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 <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
tniessen authored and addaleax committed Nov 30, 2019
1 parent 9e9e48b commit 55c2ac7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/crypto/pbkdf2.js
Original file line number Diff line number Diff line change
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 55c2ac7

Please sign in to comment.