From b48ca0a140dc727c0c9d3d2ffb204a201745d2d5 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 6b5958b35e7049..580d6a4f4d55bc 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -5421,7 +5421,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;