From c1cb639e846199b3b233289672d5c8e1b634d37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 21 Nov 2019 11:46:31 -0400 Subject: [PATCH] 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 Reviewed-By: Michael Dawson Reviewed-By: Luigi Pinca --- lib/internal/crypto/pbkdf2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/crypto/pbkdf2.js b/lib/internal/crypto/pbkdf2.js index 1c2288b65f1a25..20f6f682254036 100644 --- a/lib/internal/crypto/pbkdf2.js +++ b/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 }; }