Uh oh!
There was an error while loading. Please reload this page.
crypto: fix crypto.verify callback invocation with a private keyobject - #37795
Closed
panva wants to merge 1 commit into
Closed
crypto: fix crypto.verify callback invocation with a private keyobject#37795panva wants to merge 1 commit into
panva wants to merge 1 commit into
Conversation
MemberAuthor
Before constcrypto=require('crypto');constassert=require('assert');constdata=Buffer.from('hello');const{ privateKey }=crypto.generateKeyPairSync('ed25519');constsignature=crypto.sign(null,data,privateKey);assert(crypto.verify(null,data,privateKey,signature));// OKcrypto.verify(null,data,privateKey,signature,(err,verified)=>{// 💥assert(!err);assert(verified);});// node[49326]: ../src/crypto/crypto_sig.cc:850:static bool node::crypto::SignTraits::DeriveBits(node::Environment *, const node::crypto::SignConfiguration &, node::crypto::ByteSource *): Assertion `(params.key->GetKeyType()) == (kKeyTypePublic)' failed.After constcrypto=require('crypto');constassert=require('assert');constdata=Buffer.from('hello');const{ privateKey }=crypto.generateKeyPairSync('ed25519');constsignature=crypto.sign(null,data,privateKey);assert(crypto.verify(null,data,privateKey,signature));// OKcrypto.verify(null,data,privateKey,signature,(err,verified)=>{assert(!err);assert(verified);// OK}); |
nodejs-github-bot
commented
Mar 18, 2021
Collaborator
panva
commented
Mar 18, 2021
MemberAuthor
cc @nodejs/crypto |
jasnell
approved these changes
Mar 18, 2021
panva
commented
Mar 18, 2021
MemberAuthor
@jasnell should we fast-track and do v15.12.1? |
jasnell
commented
Mar 18, 2021
Member
Yeah i think so |
panva
commented
Mar 18, 2021
MemberAuthor
👍 to fast-track |
cjihrig
approved these changes
Mar 18, 2021
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Mar 18, 2021
Collaborator
panva
commented
Mar 18, 2021
MemberAuthor
Landed in 5e6386e |
MemberAuthor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes#37794