Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLivia Medeiros <74449973+LiviaMedeiros@users.noreply.github.com>2022-05-04 22:31:23 +0300
committerGitHub <noreply@github.com>2022-05-04 22:31:23 +0300
commita5b87305255f4757545b1d9f60a5e6f94cb742c8 (patch)
tree0597847be26f5c78ebf5ae3b1ac6fdeac031ab0f /lib
parent2454aa0f1fdd41486268f711a6ad53756350f608 (diff)
crypto: adjust minimum length in generateKey('hmac', ...)
Also affects generateKeySync('hmac', ...) PR-URL: https://github.com/nodejs/node/pull/42944 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/crypto/keygen.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/crypto/keygen.js b/lib/internal/crypto/keygen.js
index c6909b227d0..a2dad1154f0 100644
--- a/lib/internal/crypto/keygen.js
+++ b/lib/internal/crypto/keygen.js
@@ -349,7 +349,7 @@ function generateKeyJob(mode, keyType, options) {
const { length } = options;
switch (keyType) {
case 'hmac':
- validateInteger(length, 'options.length', 1, 2 ** 31 - 1);
+ validateInteger(length, 'options.length', 8, 2 ** 31 - 1);
break;
case 'aes':
validateOneOf(length, 'options.length', kAesKeyLengths);