diff --git a/src/crypto/crypto_hkdf.cc b/src/crypto/crypto_hkdf.cc index b1efcbe55fa..721c400af8e 100644 --- a/src/crypto/crypto_hkdf.cc +++ b/src/crypto/crypto_hkdf.cc @@ -58,7 +58,7 @@ Maybe HKDFTraits::AdditionalConfig( Utf8Value hash(env->isolate(), args[offset]); params->digest = EVP_get_digestbyname(*hash); if (params->digest == nullptr) { - THROW_ERR_CRYPTO_INVALID_DIGEST(env); + THROW_ERR_CRYPTO_INVALID_DIGEST(env, "Invalid digest: %s", *hash); return Nothing(); } diff --git a/src/crypto/crypto_hmac.cc b/src/crypto/crypto_hmac.cc index 296ae541a3e..19a5c066645 100644 --- a/src/crypto/crypto_hmac.cc +++ b/src/crypto/crypto_hmac.cc @@ -70,7 +70,8 @@ void Hmac::HmacInit(const char* hash_type, const char* key, int key_len) { const EVP_MD* md = EVP_get_digestbyname(hash_type); if (md == nullptr) - return THROW_ERR_CRYPTO_INVALID_DIGEST(env()); + return THROW_ERR_CRYPTO_INVALID_DIGEST( + env(), "Invalid digest: %s", hash_type); if (key_len == 0) { key = ""; } @@ -187,7 +188,7 @@ Maybe HmacTraits::AdditionalConfig( Utf8Value digest(env->isolate(), args[offset + 1]); params->digest = EVP_get_digestbyname(*digest); if (params->digest == nullptr) { - THROW_ERR_CRYPTO_INVALID_DIGEST(env); + THROW_ERR_CRYPTO_INVALID_DIGEST(env, "Invalid digest: %s", *digest); return Nothing(); } diff --git a/src/crypto/crypto_rsa.cc b/src/crypto/crypto_rsa.cc index 97007527efd..c79e384feba 100644 --- a/src/crypto/crypto_rsa.cc +++ b/src/crypto/crypto_rsa.cc @@ -333,7 +333,7 @@ Maybe RSACipherTraits::AdditionalConfig( params->digest = EVP_get_digestbyname(*digest); if (params->digest == nullptr) { - THROW_ERR_CRYPTO_INVALID_DIGEST(env); + THROW_ERR_CRYPTO_INVALID_DIGEST(env, "Invalid digest: %s", *digest); return Nothing(); } diff --git a/src/crypto/crypto_sig.cc b/src/crypto/crypto_sig.cc index c4483a71744..d5214f2a533 100644 --- a/src/crypto/crypto_sig.cc +++ b/src/crypto/crypto_sig.cc @@ -648,7 +648,7 @@ Maybe SignTraits::AdditionalConfig( Utf8Value digest(env->isolate(), args[offset + 6]); params->digest = EVP_get_digestbyname(*digest); if (params->digest == nullptr) { - THROW_ERR_CRYPTO_INVALID_DIGEST(env); + THROW_ERR_CRYPTO_INVALID_DIGEST(env, "Invalid digest: %s", *digest); return Nothing(); } }