diff options
author | Pauli <pauli@openssl.org> | 2021-05-17 09:42:42 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-05-18 13:24:41 +1000 |
commit | 84c5ad23e13a95d962fe52a5aeb23c0c525f0166 (patch) | |
tree | 4808f88f2550440ee3f2ec94a3d0e9d5c24f8cca /providers/implementations | |
parent | 3c18459235331e0562cfd2a9de5ab87040bf55f2 (diff) |
keymgmt: fix coverity 1484886 unchecked return value
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15300)
Diffstat (limited to 'providers/implementations')
-rw-r--r-- | providers/implementations/keymgmt/ec_kmgmt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c index 2673619ef4..e901275ce2 100644 --- a/providers/implementations/keymgmt/ec_kmgmt.c +++ b/providers/implementations/keymgmt/ec_kmgmt.c @@ -255,9 +255,10 @@ int otherparams_to_params(const EC_KEY *ec, OSSL_PARAM_BLD *tmpl, name)) return 0; - if ((EC_KEY_get_enc_flags(ec) & EC_PKEY_NO_PUBKEY) != 0) - ossl_param_build_set_int(tmpl, params, - OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0); + if ((EC_KEY_get_enc_flags(ec) & EC_PKEY_NO_PUBKEY) != 0 + && !ossl_param_build_set_int(tmpl, params, + OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0)) + return 0; ecdh_cofactor_mode = (EC_KEY_get_flags(ec) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0; |