Skip to content

Commit 4866601

Browse files
authored
🤖 Merge PR DefinitelyTyped#71393 [ssh2]Export hashAlgo in PublicKeyAuthContext by @yamiYori
1 parent 8e01bef commit 4866601

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎types/ssh2/index.d.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,8 @@ export interface PublicKeyAuthContext extends AuthContextBase {
12761276
signature?: Buffer;
12771277
/** The data used to verify the key, or `undefined` if the client is only checking the validity of the key. */
12781278
blob?: Buffer;
1279+
/** The explicit hash algorithm to be used during verification (passed to key.verify()). */
1280+
hashAlgo?: string;
12791281
}
12801282

12811283
export interface PublicKey {

‎types/ssh2/ssh2-tests.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ new ssh2.Server({
376376
&& ctx.key.algo === pubKey.type
377377
&& buffersEqual(ctx.key.data, pubKeySSH)
378378
) {
379-
if (ctx.signature && ctx.blob) {
380-
if (pubKey.verify(ctx.blob, ctx.signature)) {
379+
if (ctx.signature && ctx.blob && ctx.hashAlgo) {
380+
if (pubKey.verify(ctx.blob, ctx.signature, ctx.hashAlgo)) {
381381
ctx.accept();
382382
} else {
383383
ctx.reject();

0 commit comments

Comments
 (0)