Skip to content

crypto: remove ERR_CRYPTO_SCRYPT_INVALID_PARAMETER

It is confusing to have both ERR_CRYPTO_SCRYPT_INVALID_PARAMETER and ERR_CRYPTO_INVALID_SCRYPT_PARAMS. The former was the original error code, added in 371103da, but parameter validation gradually changed and now produces ERR_CRYPTO_INVALID_SCRYPT_PARAMS for all parameter validation errors coming from OpenSSL, as well as different error codes for validation errors coming from JavaScript.

The only remaining use of ERR_CRYPTO_SCRYPT_INVALID_PARAMETER is in the validation logic that ensures that no two synonymous options were passed. We already have an error code for that particular case, ERR_INCOMPATIBLE_OPTION_PAIR, so replace these last instances of ERR_CRYPTO_SCRYPT_INVALID_PARAMETER with that error code and remove ERR_CRYPTO_SCRYPT_INVALID_PARAMETER. If there ever is need again for such an error code, we can just use ERR_CRYPTO_INVALID_SCRYPT_PARAMS.

This also improves the error messages where Node.js would previously throw ERR_CRYPTO_SCRYPT_INVALID_PARAMETER.

Refs: https://github.com/nodejs/node/pull/35093 Refs: https://github.com/nodejs/node/pull/21525 Refs: https://github.com/nodejs/node/pull/20816

Merge request reports

Loading