summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-system/htdocs/luci-static/resources/view
diff options
context:
space:
mode:
authorEric McDonald <ericmcdonald@protonmail.com>2022-09-21 09:04:49 -0400
committerEric McDonald <ericmcdonald@protonmail.com>2022-09-21 17:25:37 -0400
commit2b3c852aa383b0bd40041964cb74cd3823df4e45 (patch)
tree9c0b0e62a3dea85209ad6d538eb80a6b0100f307 /modules/luci-mod-system/htdocs/luci-static/resources/view
parent944b55738e7f9685865d5298248b7fbd7380749e (diff)
luci-mod-system: allow ecdsa-sk and ed25519-sk key types
Allow adding ecdsa-sk and ed25519-sk SSH keys in LuCI These key types can be generated via the -t flag in ssh-keygen and are supported in recent versions of dropbear. As ssh-keygen ignores the -b flag when generating ecdsa-sk and ed25519-sk keys, the curve field in the objects returned by the decode function is set to fixed strings for both ecdsa-sk and ed25519-sk public key strings. This is in contrast to ecdsa keys for which various curves can be provided (e.g., NIST P-256, NIST P-384, and NIST P-521). Signed-off-by: Eric McDonald <ericmcdonald@protonmail.com>
Diffstat (limited to 'modules/luci-mod-system/htdocs/luci-static/resources/view')
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js
index 8b12b2311e..df3e354e37 100644
--- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js
+++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js
@@ -22,7 +22,7 @@ var SSHPubkeyDecoder = baseclass.singleton({
decode: function(s)
{
- var parts = s.trim().match(/^((?:(?:^|,)[^ =,]+(?:=(?:[^ ",]+|"(?:[^"\\]|\\.)*"))?)+ +)?(ssh-dss|ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp[0-9]+) +([^ ]+)( +.*)?$/);
+ var parts = s.trim().match(/^((?:(?:^|,)[^ =,]+(?:=(?:[^ ",]+|"(?:[^"\\]|\\.)*"))?)+ +)?(ssh-dss|ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp[0-9]+|sk-ecdsa-sha2-nistp256@openssh\.com|sk-ssh-ed25519@openssh\.com) +([^ ]+)( +.*)?$/);
if (!parts)
return null;
@@ -99,6 +99,12 @@ var SSHPubkeyDecoder = baseclass.singleton({
case 'ecdsa-sha2':
return { type: 'ECDSA', curve: curve, comment: comment, options: options, fprint: fprint, src: s };
+
+ case 'sk-ecdsa-sha2-nistp256@openssh.com':
+ return { type: 'ECDSA-SK', curve: 'NIST P-256', comment: comment, options: options, fprint: fprint, src: s };
+
+ case 'sk-ssh-ed25519@openssh.com':
+ return { type: 'EdDSA-SK', curve: 'Curve25519', comment: comment, options: options, fprint: fprint, src: s };
default:
return null;