diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-11-29 12:22:24 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-12-05 11:34:42 +0100 |
commit | 0510f79265bf18fea5f13c1391a12397339db8b7 (patch) | |
tree | 4f9988846f3a9a2e579813ba239d6bbb9ddf2bf7 /crypto/hpke | |
parent | d861bc03ee2ea9945f2a52f04548398ea0b92f94 (diff) | |
download | openssl-new-0510f79265bf18fea5f13c1391a12397339db8b7.tar.gz |
ossl_kdf_ctx_create(): Check for NULL KDF being fetched
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/19784)
Diffstat (limited to 'crypto/hpke')
-rw-r--r-- | crypto/hpke/hpke_util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/hpke/hpke_util.c b/crypto/hpke/hpke_util.c index e2d28bbb58..0db5f9ce2f 100644 --- a/crypto/hpke/hpke_util.c +++ b/crypto/hpke/hpke_util.c @@ -393,6 +393,10 @@ EVP_KDF_CTX *ossl_kdf_ctx_create(const char *kdfname, const char *mdname, EVP_KDF_CTX *kctx = NULL; kdf = EVP_KDF_fetch(libctx, kdfname, propq); + if (kdf == NULL) { + ERR_raise(ERR_LIB_CRYPTO, ERR_R_FETCH_FAILED); + return NULL; + } kctx = EVP_KDF_CTX_new(kdf); EVP_KDF_free(kdf); if (kctx != NULL && mdname != NULL) { |