Unverified Commit 18dc03d6 authored by Ben Bucksch's avatar Ben Bucksch Committed by Shelley Vohr
Browse files

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: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarUjjwal Sharma <ryzokuken@disroot.org>
parent 7ea6b07b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment