Skip to content

Commit 711445b

Browse files
committed
crypto: fix public key encryption internals
Coincidentally, the old version works as well since the padding parameter is never null, but it is semantically incorrect. PR-URL: #22780 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 0ade10d commit 711445b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_crypto.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3887,7 +3887,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) {
38873887
bool r = Cipher<operation, EVP_PKEY_cipher_init, EVP_PKEY_cipher>(
38883888
kbuf,
38893889
klen,
3890-
args.Length() >= 3 && !args[2]->IsNull() ? *passphrase : nullptr,
3890+
args.Length() >= 4 && !args[3]->IsNull() ? *passphrase : nullptr,
38913891
padding,
38923892
reinterpret_cast<const unsigned char*>(buf),
38933893
len,

0 commit comments

Comments
 (0)