summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-09-03 12:42:43 +0200
committerRichard Levitte <levitte@openssl.org>2020-09-08 06:26:19 +0200
commit20d56d6d62d98c3b2649afd2d20e0c2cc39afce1 (patch)
tree598ebd2de51c49109cc1e7bcff41a8abf0e204ff /crypto/evp
parent509144964ba69b69a90269da52a2dc3acb3149e6 (diff)
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)
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/p_lib.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index e22e900d94..fec4e2d43b 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -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);