Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: move _scrypt call out of handleError funct #28318

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! crypto: move _scrypt call out of handleError funct
  • Loading branch information
danbev committed Jun 20, 2019
commit ec549532192779a830a7ff95b39dd5a8055430b0
8 changes: 4 additions & 4 deletions lib/internal/crypto/scrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ function scryptSync(password, salt, keylen, options = defaults) {
return keybuf.toString(encoding);
}

function handleError(error) {
if (error === undefined)
function handleError(ex) {
if (ex === undefined)
return;

if (error === null)
if (ex === null)
throw new ERR_CRYPTO_SCRYPT_INVALID_PARAMETER(); // Bad N, r, p, or maxmem.

throw error; // Scrypt operation failed, exception object contains details.
throw ex; // Scrypt operation failed, exception object contains details.
}

function check(password, salt, keylen, options) {
Expand Down