aboutsummaryrefslogtreecommitdiff
path: root/providers
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-04-24 15:32:34 +0100
committerMatt Caswell <matt@openssl.org>2020-05-04 09:30:55 +0100
commit969024b4580172b1cd836550e227d64515c628bc (patch)
treeb9a123f73674628424168b0362ba16a3a1e0275f /providers
parenta6f8a834ba6f877baa427e3d25694d49beb29306 (diff)
downloadopenssl-969024b4580172b1cd836550e227d64515c628bc.zip
openssl-969024b4580172b1cd836550e227d64515c628bc.tar.gz
openssl-969024b4580172b1cd836550e227d64515c628bc.tar.bz2
Add the ability to ECX to import keys with only the private key
ECX keys can very easily crete the public key from the private key. Therefore when we import ecx keys it is sufficent to just have the private key. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11635)
Diffstat (limited to 'providers')
-rw-r--r--providers/implementations/keymgmt/ecx_kmgmt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/providers/implementations/keymgmt/ecx_kmgmt.c b/providers/implementations/keymgmt/ecx_kmgmt.c
index 2ba8f53..5cc1140 100644
--- a/providers/implementations/keymgmt/ecx_kmgmt.c
+++ b/providers/implementations/keymgmt/ecx_kmgmt.c
@@ -113,12 +113,11 @@ static int ecx_import(void *keydata, int selection, const OSSL_PARAM params[])
if (key == NULL)
return 0;
- if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0)
+ if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
return 0;
include_private = ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0);
- if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
- ok = ok && ecx_key_fromdata(key, params, include_private);
+ ok = ok && ecx_key_fromdata(key, params, include_private);
return ok;
}