mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
check the return value of EVP_MD_fetch in ecdh_exch.c:285 & dh_exch.c:347
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17153)
This commit is contained in:
parent
d26b3766a0
commit
04e3ab64d5
@ -345,12 +345,13 @@ static int dh_set_ctx_params(void *vpdhctx, const OSSL_PARAM params[])
|
||||
|
||||
EVP_MD_free(pdhctx->kdf_md);
|
||||
pdhctx->kdf_md = EVP_MD_fetch(pdhctx->libctx, name, mdprops);
|
||||
if (pdhctx->kdf_md == NULL)
|
||||
return 0;
|
||||
if (!ossl_digest_is_allowed(pdhctx->libctx, pdhctx->kdf_md)) {
|
||||
EVP_MD_free(pdhctx->kdf_md);
|
||||
pdhctx->kdf_md = NULL;
|
||||
}
|
||||
if (pdhctx->kdf_md == NULL)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_OUTLEN);
|
||||
|
@ -283,12 +283,13 @@ int ecdh_set_ctx_params(void *vpecdhctx, const OSSL_PARAM params[])
|
||||
|
||||
EVP_MD_free(pectx->kdf_md);
|
||||
pectx->kdf_md = EVP_MD_fetch(pectx->libctx, name, mdprops);
|
||||
if (pectx->kdf_md == NULL)
|
||||
return 0;
|
||||
if (!ossl_digest_is_allowed(pectx->libctx, pectx->kdf_md)) {
|
||||
EVP_MD_free(pectx->kdf_md);
|
||||
pectx->kdf_md = NULL;
|
||||
}
|
||||
if (pectx->kdf_md == NULL)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_OUTLEN);
|
||||
|
Loading…
Reference in New Issue
Block a user