From 1b6487c9c048b7ccc8afe4f7b6a070b573e19da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sun, 9 Sep 2018 21:54:55 +0200 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- src/node_crypto.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 203d6b4aacfc17..75aedabf7eac5c 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3890,7 +3890,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { bool r = Cipher( kbuf, klen, - args.Length() >= 3 && !args[2]->IsNull() ? *passphrase : nullptr, + args.Length() >= 4 && !args[3]->IsNull() ? *passphrase : nullptr, padding, reinterpret_cast(buf), len,