summaryrefslogtreecommitdiff
path: root/lib/internal/crypto/pbkdf2.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/crypto/pbkdf2.js')
-rw-r--r--lib/internal/crypto/pbkdf2.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/internal/crypto/pbkdf2.js b/lib/internal/crypto/pbkdf2.js
index 2fc211a87d..e967e0a794 100644
--- a/lib/internal/crypto/pbkdf2.js
+++ b/lib/internal/crypto/pbkdf2.js
@@ -52,7 +52,10 @@ function _pbkdf2(password, salt, iterations, keylen, digest, callback) {
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'iterations', 'number');
if (iterations < 0)
- throw new errors.RangeError('ERR_OUT_OF_RANGE', 'iterations');
+ throw new errors.RangeError('ERR_OUT_OF_RANGE',
+ 'iterations',
+ 'a non-negative number',
+ iterations);
if (typeof keylen !== 'number')
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'keylen', 'number');