Open targos opened 2 years ago
Would it make sense to introduce a new error like ERR_CRYPTO_UNKNOWN_ENCODING
with a message Unknown encoding {wrong encoding name}
?
I'm afraid the last mentioned "other issue" is also present in Sign , Verify, Hash, Hmac, and the like. I also suspect hard validating may be breaking for a lot of legacy applications.
I suggest to deal with the first two in #45990 and leaving the inputEncoding validation to a separate PR and CITGM to decide whether it's worth fixing or not.
Also refs: #31766
This also affects Decipher methods.
Here's an example:
Gives an internal assertion:
final
has the same issue:Other issue:
Gives no error at all for the wrong input encoding.
@nodejs/crypto