@electerm/ssh2 1.16.0 → 1.16.1
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/client.js +2 -12
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -461,18 +461,8 @@ class Client extends EventEmitter {
|
|
|
461
461
|
});
|
|
462
462
|
});
|
|
463
463
|
} else if (curAuth.type === 'publickey') {
|
|
464
|
-
proto.authPK(curAuth.username, curAuth.key, (buf, cb) => {
|
|
465
|
-
|
|
466
|
-
if (curAuth.key.type === 'ssh-rsa') {
|
|
467
|
-
if (this._protocol._remoteHostKeyAlgorithms
|
|
468
|
-
.includes('rsa-sha2-512')) {
|
|
469
|
-
signatureAlgo = 'sha512';
|
|
470
|
-
} else if (this._protocol._remoteHostKeyAlgorithms
|
|
471
|
-
.includes('rsa-sha2-256')) {
|
|
472
|
-
signatureAlgo = 'sha256';
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
const signature = curAuth.key.sign(buf, signatureAlgo);
|
|
464
|
+
proto.authPK(curAuth.username, curAuth.key, keyAlgo, (buf, cb) => {
|
|
465
|
+
const signature = curAuth.key.sign(buf, hashAlgo);
|
|
476
466
|
if (signature instanceof Error) {
|
|
477
467
|
signature.message =
|
|
478
468
|
`Error signing data with key: ${signature.message}`;
|
package/package.json
CHANGED