@electerm/ssh2 1.11.1 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/protocol/Protocol.js +9 -1
- package/lib/protocol/kex.js +1 -1
- package/package.json +1 -1
package/lib/protocol/Protocol.js
CHANGED
|
@@ -616,7 +616,15 @@ class Protocol {
|
|
|
616
616
|
if (pubKey instanceof Error)
|
|
617
617
|
throw new Error('Invalid key');
|
|
618
618
|
|
|
619
|
-
|
|
619
|
+
let keyType = pubKey.type;
|
|
620
|
+
if (keyType === 'ssh-rsa') {
|
|
621
|
+
for (const algo of ['rsa-sha2-512', 'rsa-sha2-256']) {
|
|
622
|
+
if (this._remoteHostKeyAlgorithms.includes(algo)) {
|
|
623
|
+
keyType = algo;
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
620
628
|
pubKey = pubKey.getPublicSSH();
|
|
621
629
|
|
|
622
630
|
const userLen = Buffer.byteLength(username);
|
package/lib/protocol/kex.js
CHANGED
|
@@ -196,7 +196,7 @@ function handleKexInit(self, payload) {
|
|
|
196
196
|
|
|
197
197
|
const local = self._offer;
|
|
198
198
|
const remote = init;
|
|
199
|
-
|
|
199
|
+
self._remoteHostKeyAlgorithms = remote.serverHostKey;
|
|
200
200
|
let localKex = local.lists.kex.array;
|
|
201
201
|
if (self._compatFlags & COMPAT.BAD_DHGEX) {
|
|
202
202
|
let found = false;
|
package/package.json
CHANGED