Skip to content

Commit

Permalink
crypto: remove redundant validateUint32 argument
Browse files Browse the repository at this point in the history
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 22, 2019
1 parent b8f8f05 commit 64ee64d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/crypto/pbkdf2.js
Expand Up @@ -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 };
}
Expand Down

0 comments on commit 64ee64d

Please sign in to comment.