summaryrefslogtreecommitdiffstats
path: root/providers/implementations
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-05-21 11:36:21 +0100
committerMatt Caswell <matt@openssl.org>2020-06-05 11:04:11 +0100
commit7fa2b2673edd684ceb94ff19346f08121da9774f (patch)
treeccddae3a0c0d7ad01a93a4fd7d1cdfdb69e506b7 /providers/implementations
parent11391da217b5d07dd30dd4c1890b5320fa56be18 (diff)
When asked if an ECX key has parameters we should answer "true"
An ECX key doesn't have any parameters associated with it. Therefore it always has all the parameters it needs, and the "has" function should return 1 if asked about parameters. Without this EVP_PKEY_missing_parameters() fails for ECX keys. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11898)
Diffstat (limited to 'providers/implementations')
-rw-r--r--providers/implementations/keymgmt/ecx_kmgmt.c7
1 files changed, 5 insertions, 2 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;