summaryrefslogtreecommitdiffstats
path: root/apps/pkeyutl.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-02-10 11:45:27 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-02-14 07:28:46 +1000
commit075b1f2f42c9ab1f5c80078cad70de0216748b6d (patch)
tree25fe5cb77edaee8f576fd459eb47642853ea21b5 /apps/pkeyutl.c
parent51994e505dbb1cd0dd76869ec962e2948b77b585 (diff)
Fix coverity issues
CID : 1458169 RESOURCE LEAK ffc_params_generate.c - False positive, but addressed another Leak in adjacent code CID : 1458171 UNCHECKED RET apps/pkeyutl.c CID : 1458173 DEAD CODE ffc_params_generate.c CID : 1458174 RESOURCE LEAK ssl_lib.c Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/11048)
Diffstat (limited to 'apps/pkeyutl.c')
-rw-r--r--apps/pkeyutl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c
index a8cd2a0e3e..5bc436576d 100644
--- a/apps/pkeyutl.c
+++ b/apps/pkeyutl.c
@@ -556,8 +556,9 @@ static EVP_PKEY_CTX *init_ctx(const char *kdfalg, int *pkeysize,
|| (group = EC_KEY_get0_group(eckey)) == NULL
|| (nid = EC_GROUP_get_curve_name(group)) == 0)
goto end;
- if (nid == NID_sm2)
- EVP_PKEY_set_alias_type(pkey, EVP_PKEY_SM2);
+ if (nid == NID_sm2
+ && !EVP_PKEY_set_alias_type(pkey, EVP_PKEY_SM2))
+ goto end;
}
#endif
*pkeysize = EVP_PKEY_size(pkey);