]> git.ipfire.org Git - thirdparty/openssl.git/commit - crypto/dh/dh_ameth.c
DH, DSA, EC_KEY: Fix exporters to allow domain parameter keys
authorRichard Levitte <levitte@openssl.org>
Thu, 19 Mar 2020 21:29:10 +0000 (22:29 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 23 Mar 2020 09:07:38 +0000 (10:07 +0100)
commit0996cff91fe9d6ed7c37830debdf585119dcc067
tree64bfae0bbb313c8f827958ec6206b84be8174c80
parent8cc86b81ac20ff3e933ea7fd107a5a6066032330
DH, DSA, EC_KEY: Fix exporters to allow domain parameter keys

The export-to-provider functions for DH, DSA and EC_KEY assumed that a
public key is always present, and would fail if not.  This blocks any
attempt to export a key structure with only domain parameters.

While fixing this, we also modify the selection declaration to
evp_keymgmt_import() to be more adaptive, the diverse selection bits
are now added when the corresponding data is added to the OSSL_PARAM
array.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11374)
crypto/dh/dh_ameth.c
crypto/dsa/dsa_ameth.c
crypto/ec/ec_ameth.c
crypto/ec/ecx_meth.c
crypto/rsa/rsa_ameth.c