From 969024b4580172b1cd836550e227d64515c628bc Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 24 Apr 2020 15:32:34 +0100 Subject: 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 (Merged from https://github.com/openssl/openssl/pull/11635) --- providers/implementations/keymgmt/ecx_kmgmt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'providers') diff --git a/providers/implementations/keymgmt/ecx_kmgmt.c b/providers/implementations/keymgmt/ecx_kmgmt.c index 2ba8f53e5a..5cc11406f6 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; } -- cgit v1.2.3