Skip to content

Commit

Permalink
crypto: fix error condition in Verify::VerifyFinal
Browse files Browse the repository at this point in the history
Fail early if key parsing failed, don't try to construct a context out
of it.

PR-URL: #26238
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
tniessen authored and rvagg committed Feb 28, 2019
1 parent a9a2c58 commit 70e463c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4648,6 +4648,8 @@ void Verify::VerifyFinal(const FunctionCallbackInfo<Value>& args) {

unsigned int offset = 0;
ManagedEVPPKey pkey = GetPublicOrPrivateKeyFromJs(args, &offset, true);
if (!pkey)
return;

char* hbuf = Buffer::Data(args[offset]);
ssize_t hlen = Buffer::Length(args[offset]);
Expand Down

0 comments on commit 70e463c

Please sign in to comment.