diff options
author | Tobias Nießen <tniessen@tnie.de> | 2019-02-21 12:46:49 +0100 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2019-02-23 13:48:41 +0100 |
commit | 10c3db3da682b85e7b44b2671f227449713cd4d8 (patch) | |
tree | 91766dc62725e0dcec0d6e0b61be08a9502e1226 /src/node_crypto.cc | |
parent | 8ebd339031cf9826629ad780dd35fee130e95985 (diff) | |
download | node-new-10c3db3da682b85e7b44b2671f227449713cd4d8.tar.gz |
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: https://github.com/nodejs/node/pull/26238
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_crypto.cc')
-rw-r--r-- | src/node_crypto.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc index fcc35ce63f..8b6587b6ea 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -4675,6 +4675,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]); |