Skip to content

Commit

Permalink
crypto: fix public key encryption internals
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
tniessen authored and targos committed Sep 20, 2018
1 parent 6786730 commit ff17b39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3890,7 +3890,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) {
bool r = Cipher<operation, EVP_PKEY_cipher_init, EVP_PKEY_cipher>(
kbuf,
klen,
args.Length() >= 3 && !args[2]->IsNull() ? *passphrase : nullptr,
args.Length() >= 4 && !args[3]->IsNull() ? *passphrase : nullptr,
padding,
reinterpret_cast<const unsigned char*>(buf),
len,
Expand Down

0 comments on commit ff17b39

Please sign in to comment.