Skip to content
Permalink
Browse files

crypto: remove redundant validateUint32 argument

The third parameter should be a boolean indicating whether the number
must be positive. Passing zero works, but is unnecessary, misleading
and inconsistent with other uses of the same function.

PR-URL: #30579
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
tniessen committed Nov 21, 2019
1 parent b8f8f05 commit 64ee64d3afc837350ee39058cef9179e92f3554c
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/internal/crypto/pbkdf2.js
@@ -66,8 +66,8 @@ function check(password, salt, iterations, keylen, digest) {

password = getArrayBufferView(password, 'password');
salt = getArrayBufferView(salt, 'salt');
validateUint32(iterations, 'iterations', 0);
validateUint32(keylen, 'keylen', 0);
validateUint32(iterations, 'iterations');
validateUint32(keylen, 'keylen');

return { password, salt, iterations, keylen, digest };
}

0 comments on commit 64ee64d

Please sign in to comment.
You can’t perform that action at this time.