Skip to content

Commit 10c3db3

Browse files
committed
crypto: fix error condition in Verify::VerifyFinal
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]>
1 parent 8ebd339 commit 10c3db3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/node_crypto.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4675,6 +4675,8 @@ void Verify::VerifyFinal(const FunctionCallbackInfo<Value>& args) {
46754675

46764676
unsigned int offset = 0;
46774677
ManagedEVPPKey pkey = GetPublicOrPrivateKeyFromJs(args, &offset, true);
4678+
if (!pkey)
4679+
return;
46784680

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

0 commit comments

Comments
 (0)