From 3ec3c329c6c3f04b7f3c3de1621a8d889b26305e Mon Sep 17 00:00:00 2001 From: BufoViridis <30531954+BufoViridis@users.noreply.github.com> Date: Tue, 30 Jan 2018 19:43:50 +0200 Subject: [PATCH] src: fix crypto.pbkdf2 callback error argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Callbacks should always return `null` instead of `undefined` if no error occurred. PR-URL: https://github.com/nodejs/node/pull/18458 Reviewed-By: Ben Noordhuis Reviewed-By: Tobias Nießen Reviewed-By: Fedor Indutny Reviewed-By: James M Snell --- 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 5e331a0b7ca506..a398f745537b54 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -5599,7 +5599,7 @@ void PBKDF2Request::Work(uv_work_t* work_req) { void PBKDF2Request::After(Local (*argv)[2]) { if (success_) { - (*argv)[0] = Undefined(env()->isolate()); + (*argv)[0] = Null(env()->isolate()); (*argv)[1] = Buffer::New(env(), key_, keylen_).ToLocalChecked(); key_ = nullptr; keylen_ = 0;