Add EVP_PKEY_gettable_params support for accessing EVP_PKEY key data fields
authorShane Lontis <shane.lontis@oracle.com>
Wed, 1 Apr 2020 05:51:18 +0000 (15:51 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Wed, 1 Apr 2020 05:51:18 +0000 (15:51 +1000)
commit96ebe52e897dea29664683e138877fb5eb995e4d
treeb32e8fa99b2b4eb53e214b7fa196c8ec8d465777
parentf4c88073091592b1ff92ba12c894488ff7d03ece
Add EVP_PKEY_gettable_params support for accessing EVP_PKEY key data fields

Currently only RSA, EC and ECX are supported (DH and DSA need to be added to the keygen
PR's seperately because the fields supported have changed significantly).

The API's require the keys to be provider based.

Made the keymanagement export and get_params functions share the same code by supplying
support functions that work for both a OSSL_PARAM_BLD as well as a OSSL_PARAM[].
This approach means that complex code is not required to build an
empty OSSL_PARAM[] with the correct sized fields before then doing a second
pass to populate the array.

The RSA factor arrays have been changed to use unique key names to simplify the interface
needed by the user.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11365)
22 files changed:
crypto/build.info
crypto/evp/p_lib.c
crypto/param_build_set.c [new file with mode: 0644]
crypto/rsa/build.info
crypto/rsa/rsa_ameth.c
crypto/rsa/rsa_backend.c
crypto/rsa/rsa_mp_names.c [new file with mode: 0644]
doc/man3/EVP_PKEY_fromdata.pod
doc/man3/EVP_PKEY_gettable_params.pod [new file with mode: 0644]
doc/man7/provider-keymgmt.pod
include/crypto/rsa.h
include/internal/param_build_set.h [new file with mode: 0644]
include/openssl/core_names.h
include/openssl/evp.h
providers/implementations/keymgmt/build.info
providers/implementations/keymgmt/ec_kmgmt.c
providers/implementations/keymgmt/ecx_kmgmt.c
providers/implementations/keymgmt/rsa_kmgmt.c
providers/implementations/serializers/serializer_rsa.c
test/evp_pkey_provided_test.c
test/keymgmt_internal_test.c
util/libcrypto.num