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: https://github.com/nodejs/node/pull/30579
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Tobias Nießen
2019-11-21 11:46:31 -04:00
parent b8f8f05002
commit 64ee64d3af

View File

@@ -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 };
}