luci-app-banip: sync with forthcoming banIP 1.0
[project/luci.git] / modules / luci-mod-system / htdocs / luci-static / resources / view / system / sshkeys.js
index a2f0bef9b4aff6e1f657a54018cb59ac6133660c..ce983c322802f340a05c323541036c62f86801ac 100644 (file)
@@ -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;
@@ -112,7 +118,7 @@ function renderKeyItem(pubkey) {
                click: isReadonlyView ? null : removeKey,
                'data-key': pubkey.src
        }, [
-               E('strong', pubkey.comment || _('Unnamed key')), E('br'),
+               E('strong', [ pubkey.comment || _('Unnamed key') ]), E('br'),
                E('small', [
                        '%s, %s'.format(pubkey.type, pubkey.curve || _('%d Bit').format(pubkey.bits)),
                        pubkey.options ? E([], [
@@ -198,7 +204,7 @@ function removeKey(ev) {
 
        L.showModal(_('Delete key'), [
                E('div', _('Do you really want to delete the following SSH key?')),
-               E('pre', delkey),
+               E('pre', [ delkey ]),
                E('div', { class: 'right' }, [
                        E('div', { class: 'btn', click: L.hideModal }, _('Cancel')),
                        ' ',
@@ -281,7 +287,7 @@ return view.extend({
 
                return E('div', {}, [
                        E('h2', _('SSH-Keys')),
-                       E('div', { 'class': 'cbi-section-descr' }, _('Public keys allow for the passwordless SSH logins with a higher security compared to the use of plain passwords. In order to upload a new key to the device, paste an OpenSSH compatible public key line or drag a <code>.pub</code> file into the input field.')),
+                       E('div', { 'class': 'cbi-section-descr' }, _('Public keys allow for passwordless SSH logins with higher security than plain passwords. In order to upload a new key to the device, paste an OpenSSH-compatible public key or drag a <code>.pub</code> file into the input field.')),
                        E('div', { 'class': 'cbi-section-node' }, list)
                ]);
        },