summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-06-06 10:32:49 +0100
committerMatt Caswell <matt@openssl.org>2022-06-08 15:52:01 +0100
commit187963b945a1e9db1d47de8da0f5b0066592f835 (patch)
treee618387300704fc973b47f47a440b7561654c20c
parentc8103f68ab60d8f47ce40f1e0cd3de05878424a2 (diff)
Don't report success from ec_export if OSSL_PARAM_BLD_to_param failed
If the call to OSSL_PARAM_BLD_to_param() failed then ec_export was reporting success, even though it has never called the param_cb. Found due to: https://github.com/openssl/openssl/pull/18355#issuecomment-1145993650 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18483) (cherry picked from commit 7d6aad832b4cebb181c53ab80a3f61dc8549be08)
-rw-r--r--providers/implementations/keymgmt/ec_kmgmt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c
index 44cb7c7140..bfaae4f234 100644
--- a/providers/implementations/keymgmt/ec_kmgmt.c
+++ b/providers/implementations/keymgmt/ec_kmgmt.c
@@ -498,6 +498,8 @@ int ec_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
if (ok && (params = OSSL_PARAM_BLD_to_param(tmpl)) != NULL)
ok = param_cb(params, cbarg);
+ else
+ ok = 0;
end:
OSSL_PARAM_free(params);
OSSL_PARAM_BLD_free(tmpl);