Skip to content

Commit ff17b39

Browse files
tniessentargos
authored andcommitted
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 6786730 commit ff17b39

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
@@ -3890,7 +3890,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) {
38903890
bool r = Cipher<operation, EVP_PKEY_cipher_init, EVP_PKEY_cipher>(
38913891
kbuf,
38923892
klen,
3893-
args.Length() >= 3 && !args[2]->IsNull() ? *passphrase : nullptr,
3893+
args.Length() >= 4 && !args[3]->IsNull() ? *passphrase : nullptr,
38943894
padding,
38953895
reinterpret_cast<const unsigned char*>(buf),
38963896
len,

0 commit comments

Comments
 (0)