mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
crypto: fix crypto.verify callback invocation with a private keyobject
fixes https://github.com/nodejs/node/issues/37794 PR-URL: https://github.com/nodejs/node/pull/37795 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
c6855eb88f
commit
5e6386ec3f
2 files changed
+4
-2
No files matched your search
@@ -847,7 +847,7 @@ bool SignTraits::DeriveBits(
|
||||
}
|
||||
break;
|
||||
case SignConfiguration::kVerify:
|
||||
CHECK_EQ(params.key->GetKeyType(), kKeyTypePublic);
|
||||
CHECK_NE(params.key->GetKeyType(), kKeyTypeSecret);
|
||||
if (!EVP_DigestVerifyInit(
|
||||
context.get(),
|
||||
&ctx,
|
||||
|
||||
@@ -52,7 +52,9 @@ function test(
|
||||
}));
|
||||
}
|
||||
|
||||
for (const key of [publicPem, publicKey, publicDer]) {
|
||||
const verifyInputs = [
|
||||
publicPem, publicKey, publicDer, privatePem, privateKey, privateDer];
|
||||
for (const key of verifyInputs) {
|
||||
crypto.verify(algorithm, data, key, expected, common.mustSucceed(
|
||||
(verified) => assert.strictEqual(verified, true)));
|
||||
|
||||
|
||||
Reference in new issue
Block a user