summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--providers/implementations/keymgmt/ecx_kmgmt.c7
-rw-r--r--test/evp_pkey_provided_test.c3
2 files changed, 7 insertions, 3 deletions
diff --git a/providers/implementations/keymgmt/ecx_kmgmt.c b/providers/implementations/keymgmt/ecx_kmgmt.c
index c7a90543f9..e5c7e8bf3a 100644
--- a/providers/implementations/keymgmt/ecx_kmgmt.c
+++ b/providers/implementations/keymgmt/ecx_kmgmt.c
@@ -101,8 +101,11 @@ static int ecx_has(void *keydata, int selection)
int ok = 0;
if (key != NULL) {
- if ((selection & ECX_POSSIBLE_SELECTIONS) != 0)
- ok = 1;
+ /*
+ * ECX keys always have all the parameters they need (i.e. none).
+ * Therefore we always return with 1, if asked about parameters.
+ */
+ ok = 1;
if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
ok = ok && key->haspubkey;
diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c
index 4c68f6bc6c..ffb56cb3ee 100644
--- a/test/evp_pkey_provided_test.c
+++ b/test/evp_pkey_provided_test.c
@@ -855,7 +855,8 @@ static int test_fromdata_ecx(int tst)
goto err;
if (!TEST_ptr(copy_pk = EVP_PKEY_new())
- || !TEST_false(EVP_PKEY_copy_parameters(copy_pk, pk)))
+ /* This should succeed because there are no parameters to copy */
+ || !TEST_true(EVP_PKEY_copy_parameters(copy_pk, pk)))
goto err;
if (!TEST_true(EVP_PKEY_get_octet_string_param(