mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
EVP: Don't shadow EVP_PKEY_CTX_new* error records
There are places that add an ERR_R_MALLOC_FAILURE record when any of EVP_PKEY_CTX_new*() return NULL, which is 1) inaccurate, and 2) shadows the more accurate error record generated when trying to create the EVP_PKEY_CTX. Reviewed-by: Paul Yang <kaishen.yy@antfin.com> (Merged from https://github.com/openssl/openssl/pull/12785)
This commit is contained in:
parent
509144964b
commit
20d56d6d62
@ -606,10 +606,8 @@ static EVP_PKEY *new_cmac_key_int(const unsigned char *priv, size_t len,
|
||||
}
|
||||
|
||||
ctx = EVP_PKEY_CTX_new_from_name(libctx, "CMAC", propq);
|
||||
if (ctx == NULL) {
|
||||
EVPerr(0, ERR_R_MALLOC_FAILURE);
|
||||
if (ctx == NULL)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!EVP_PKEY_key_fromdata_init(ctx)) {
|
||||
EVPerr(0, EVP_R_KEY_SETUP_FAILED);
|
||||
|
Loading…
Reference in New Issue
Block a user