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: https://github.com/nodejs/node/pull/22780 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
0ade10df79
commit
711445b419
@ -3887,7 +3887,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) {
|
|||||||
bool r = Cipher<operation, EVP_PKEY_cipher_init, EVP_PKEY_cipher>(
|
bool r = Cipher<operation, EVP_PKEY_cipher_init, EVP_PKEY_cipher>(
|
||||||
kbuf,
|
kbuf,
|
||||||
klen,
|
klen,
|
||||||
args.Length() >= 3 && !args[2]->IsNull() ? *passphrase : nullptr,
|
args.Length() >= 4 && !args[3]->IsNull() ? *passphrase : nullptr,
|
||||||
padding,
|
padding,
|
||||||
reinterpret_cast<const unsigned char*>(buf),
|
reinterpret_cast<const unsigned char*>(buf),
|
||||||
len,
|
len,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user