0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
nodejs/lib/internal/crypto
Ben Bucksch 2f00ca42bf crypto: fix wrong error message
When calling `crypto.sign()`, if the `key` parameter object is
missing the `key` property, the error message is wrong.

Before the fix:
TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of
type string or an instance of Buffer, TypedArray, DataView, or
KeyObject. Received an instance of Object

Expected:
TypeError [ERR_INVALID_ARG_TYPE]: The "key.key property" argument
must be of type string or an instance of Buffer, TypedArray,
DataView, or KeyObject. Received undefined

This seems like a copy&paste bug. Somebody copied from the end of
the function, where this is correct, to here, where it's wrong.

PR-URL: https://github.com/nodejs/node/pull/33482
Fixes: https://github.com/nodejs/node/issues/33480
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
2020-05-25 19:15:05 +02:00
..
certificate.js
cipher.js crypto: make update(buf, enc) ignore encoding 2020-03-05 15:24:17 -04:00
diffiehellman.js crypto: generator must be int32 in DiffieHellman() 2020-04-28 19:22:05 +02:00
hash.js crypto: make update(buf, enc) ignore encoding 2020-03-05 15:24:17 -04:00
keygen.js crypto: add DH support to generateKeyPair 2020-01-21 10:49:14 -04:00
keys.js crypto: fix wrong error message 2020-05-25 19:15:05 +02:00
pbkdf2.js crypto: move pbkdf2 without digest to EOL 2020-02-05 17:41:19 -08:00
random.js crypto: improve randomBytes() performance 2020-01-28 06:56:16 -08:00
scrypt.js
sig.js tools: enable no-else-return lint rule 2020-05-16 06:42:16 +02:00
util.js