Red indication if OpenSSH key is not valid, #3093

This commit is contained in:
Ylian Saint-Hilaire 2021-09-02 18:16:02 -07:00
parent 8b93655638
commit 6f03c026c6
1 changed files with 2 additions and 1 deletions

View File

@ -9040,7 +9040,7 @@
x += '<div id=d2passauth>';
x += addHtmlValue("Password", '<input type=password id=dp2pass style=width:230px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />');
x += '</div><div id=d2keyauth style=display:none>';
x += addHtmlValue("Key File", '<input type=file id=dp2key style=width:230px maxlength=64 autocomplete=off onchange=sshAuthUpdate(event) />' + '<div style=font-size:x-small>' + "Key file must be in OpenSSH format." + '</div>');
x += addHtmlValue("Key File", '<input type=file id=dp2key style=width:230px maxlength=64 autocomplete=off onchange=sshAuthUpdate(event) />' + '<div id=d2badkey style=font-size:x-small>' + "Key file must be in OpenSSH format." + '</div>');
x += addHtmlValue("Key Password", '<input type=password id=dp2keypass style=width:230px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />');
x += '</div>';
x += addHtmlValue('', '<label><input id=dp2keep type=checkbox>' + "Remember credentials" + '</label>');
@ -9074,6 +9074,7 @@
reader.onload = function (e) {
var validkey = ((e.target.result.indexOf('-----BEGIN OPENSSH PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END OPENSSH PRIVATE KEY-----') >= 0));
QE('idx_dlgOkButton', validkey);
QS('d2badkey')['color'] = validkey?'#000':'#F00';
}
reader.readAsText(Q('dp2key').files[0]);
}