diff options
author | tangyiqun <tangyiqun@uniontech.com> | 2022-04-12 16:07:17 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-04-13 12:14:41 +0200 |
commit | 7ebd227b87c6ae451cc6efaac8603c21cb418097 (patch) | |
tree | 12a5fee81860885131dadf0e2941770e687fe634 | |
parent | 6b42c74b0677560017df08c452342355adfd1ecc (diff) |
Check the return of EVP_KDF_fetch()
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18096)
(cherry picked from commit 02119faee397565525151eb2ce39c424d129d287)
-rw-r--r-- | crypto/dh/dh_kdf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/dh/dh_kdf.c b/crypto/dh/dh_kdf.c index 419e7711d3..97933cb520 100644 --- a/crypto/dh/dh_kdf.c +++ b/crypto/dh/dh_kdf.c @@ -39,6 +39,8 @@ int ossl_dh_kdf_X9_42_asn1(unsigned char *out, size_t outlen, const char *mdname = EVP_MD_get0_name(md); kdf = EVP_KDF_fetch(libctx, OSSL_KDF_NAME_X942KDF_ASN1, propq); + if (kdf == NULL) + return 0; kctx = EVP_KDF_CTX_new(kdf); if (kctx == NULL) goto err; |