diff options
author | Matt Caswell <matt@openssl.org> | 2020-04-24 16:32:34 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-05-04 10:30:55 +0200 |
commit | 969024b4580172b1cd836550e227d64515c628bc (patch) | |
tree | b9a123f73674628424168b0362ba16a3a1e0275f /providers | |
parent | Ensure OSSL_PARAM_BLD_free() can accept a NULL (diff) | |
download | openssl-969024b4580172b1cd836550e227d64515c628bc.tar.xz openssl-969024b4580172b1cd836550e227d64515c628bc.zip |
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.c | 5 |
1 files changed, 2 insertions, 3 deletions
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; } |