diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-11-12 16:31:35 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-11-15 09:25:42 +0100 |
commit | bef9b48e5071cdd2b41a4f486d1bcb5e14b2a5c3 (patch) | |
tree | 1c519ac26b87291506e32ecd6719f32685b230e6 /crypto/evp | |
parent | 293e251e6f0367a9aa0d3d46037b19d1a6c91b20 (diff) |
Add null digest implementation to the default provider
This is necessary to keep compatibility with 1.1.1.
Fixes #16660
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17016)
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/digest.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c index ebee9d8d76..0a133c5c15 100644 --- a/crypto/evp/digest.c +++ b/crypto/evp/digest.c @@ -229,7 +229,10 @@ static int evp_md_init_internal(EVP_MD_CTX *ctx, const EVP_MD *type, ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR); return 0; #else - EVP_MD *provmd = EVP_MD_fetch(NULL, OBJ_nid2sn(type->type), ""); + /* The NULL digest is a special case */ + EVP_MD *provmd = EVP_MD_fetch(NULL, + type->type != NID_undef ? OBJ_nid2sn(type->type) + : "NULL", ""); if (provmd == NULL) { ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR); |