diff options
author | Tobias Nießen <tniessen@tnie.de> | 2022-05-02 20:46:04 +0300 |
---|---|---|
committer | RafaelGSS <rafael.nunu@hotmail.com> | 2022-05-10 15:13:15 +0300 |
commit | 183bcc069973dd2132fe844261ce051796bc9bea (patch) | |
tree | 8f1085a5362b4fc910508d54c5cd785d6e92903b /test | |
parent | 924670f3af1500c8723eb287365e2539190294ea (diff) |
crypto: clean up parameter validation in HKDF
PR-URL: https://github.com/nodejs/node/pull/42924
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-crypto-hkdf.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-crypto-hkdf.js b/test/parallel/test-crypto-hkdf.js index 16744201a93..2d6689a486d 100644 --- a/test/parallel/test-crypto-hkdf.js +++ b/test/parallel/test-crypto-hkdf.js @@ -15,6 +15,11 @@ const { } = require('crypto'); { + assert.throws(() => hkdf(), { + code: 'ERR_INVALID_ARG_TYPE', + message: /The "digest" argument must be of type string/ + }); + [1, {}, [], false, Infinity].forEach((i) => { assert.throws(() => hkdf(i, 'a'), { code: 'ERR_INVALID_ARG_TYPE', |