From: tangyiqun Date: Tue, 12 Apr 2022 08:07:17 +0000 (+0800) Subject: Check the return of EVP_KDF_fetch() X-Git-Tag: openssl-3.2.0-alpha1~2764 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02119faee397565525151eb2ce39c424d129d287;p=thirdparty%2Fopenssl.git Check the return of EVP_KDF_fetch() Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18096) --- diff --git a/crypto/dh/dh_kdf.c b/crypto/dh/dh_kdf.c index eda3d3998ad..045936b7304 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;