mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-27 14:43:14 -05:00
Added SSH RSA PEM key support, #4002
This commit is contained in:
parent
c1d253f299
commit
4e9daa4286
@ -4834,7 +4834,9 @@
|
|||||||
if (ok == true) {
|
if (ok == true) {
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onload = function (e) {
|
reader.onload = function (e) {
|
||||||
var validkey = ((e.target.result.indexOf('-----BEGIN OPENSSH PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END OPENSSH PRIVATE KEY-----') >= 0));
|
var validkey =
|
||||||
|
((e.target.result.indexOf('-----BEGIN OPENSSH PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END OPENSSH PRIVATE KEY-----') >= 0)) ||
|
||||||
|
((e.target.result.indexOf('-----BEGIN RSA PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END RSA PRIVATE KEY-----') >= 0));
|
||||||
QE('idx_dlgOkButton', validkey);
|
QE('idx_dlgOkButton', validkey);
|
||||||
}
|
}
|
||||||
reader.readAsText(Q('dp2key').files[0]);
|
reader.readAsText(Q('dp2key').files[0]);
|
||||||
@ -4872,7 +4874,9 @@
|
|||||||
if (ok == true) {
|
if (ok == true) {
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onload = function (e) {
|
reader.onload = function (e) {
|
||||||
var validkey = ((e.target.result.indexOf('-----BEGIN OPENSSH PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END OPENSSH PRIVATE KEY-----') >= 0));
|
var validkey =
|
||||||
|
((e.target.result.indexOf('-----BEGIN OPENSSH PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END OPENSSH PRIVATE KEY-----') >= 0)) ||
|
||||||
|
((e.target.result.indexOf('-----BEGIN RSA PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END RSA PRIVATE KEY-----') >= 0));
|
||||||
QE('idx_dlgOkButton', validkey);
|
QE('idx_dlgOkButton', validkey);
|
||||||
QS('d2badkey')['color'] = validkey ? '#000' : '#F00';
|
QS('d2badkey')['color'] = validkey ? '#000' : '#F00';
|
||||||
}
|
}
|
||||||
|
@ -9805,7 +9805,9 @@
|
|||||||
if (ok == true) {
|
if (ok == true) {
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onload = function (e) {
|
reader.onload = function (e) {
|
||||||
var validkey = ((e.target.result.indexOf('-----BEGIN OPENSSH PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END OPENSSH PRIVATE KEY-----') >= 0));
|
var validkey =
|
||||||
|
((e.target.result.indexOf('-----BEGIN OPENSSH PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END OPENSSH PRIVATE KEY-----') >= 0)) ||
|
||||||
|
((e.target.result.indexOf('-----BEGIN RSA PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END RSA PRIVATE KEY-----') >= 0));
|
||||||
QE('idx_dlgOkButton', validkey);
|
QE('idx_dlgOkButton', validkey);
|
||||||
QS('d2badkey')['color'] = validkey?'#000':'#F00';
|
QS('d2badkey')['color'] = validkey?'#000':'#F00';
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,9 @@
|
|||||||
if (ok == true) {
|
if (ok == true) {
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onload = function (e) {
|
reader.onload = function (e) {
|
||||||
var validkey = ((e.target.result.indexOf('-----BEGIN OPENSSH PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END OPENSSH PRIVATE KEY-----') >= 0));
|
var validkey =
|
||||||
|
((e.target.result.indexOf('-----BEGIN OPENSSH PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END OPENSSH PRIVATE KEY-----') >= 0)) ||
|
||||||
|
((e.target.result.indexOf('-----BEGIN RSA PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END RSA PRIVATE KEY-----') >= 0));
|
||||||
QE('idx_dlgOkButton', validkey);
|
QE('idx_dlgOkButton', validkey);
|
||||||
QS('d2badkey')['color'] = validkey ? '#000' : '#F00';
|
QS('d2badkey')['color'] = validkey ? '#000' : '#F00';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user