diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-09-19 18:08:46 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-09-19 18:08:46 +1000 |
commit | 80f4fd18f72c0d3faae864da6979b83acc4f89a2 (patch) | |
tree | 0882ccf31406c4f9948674913f51e3c46efff64d /providers/implementations/keymgmt | |
parent | 28833f1465a2dd197f8df80a69095d1913e6e85e (diff) |
Add KEM (Key encapsulation mechanism) support to providers
SP800-56Br2 requires support for the RSA primitives for RSASVE generate and recover.
As these are simple KEM operations another operation type has been added that can support future extensions.
Added public functions EVP_PKEY_encapsulate_init(), EVP_PKEY_encapsulate(), EVP_PKEY_decapsulate_init() and EVP_PKEY_decapsulate()
Added EVP_KEM_* functions.
Added OSSL_FUNC_kem_* dispatch functions
Added EVP_PKEY_CTX_set_kem_op() so that different types of KEM can be added in the future. This value must currently be set to
"RSASVE" after EVP_PKEY_encapsulate_init() & EVP_PKEY_decapsulate_init() as there is no default value.
This allows the existing RSA key types, keymanagers, and encoders to be used with the encapsulation operations.
The design of the public API's resulted from contributions from @romen & @levitte.
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12750)
Diffstat (limited to 'providers/implementations/keymgmt')
-rw-r--r-- | providers/implementations/keymgmt/rsa_kmgmt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/providers/implementations/keymgmt/rsa_kmgmt.c b/providers/implementations/keymgmt/rsa_kmgmt.c index 5a8da35d60..659121c227 100644 --- a/providers/implementations/keymgmt/rsa_kmgmt.c +++ b/providers/implementations/keymgmt/rsa_kmgmt.c @@ -46,7 +46,7 @@ static OSSL_FUNC_keymgmt_import_fn rsa_import; static OSSL_FUNC_keymgmt_import_types_fn rsa_import_types; static OSSL_FUNC_keymgmt_export_fn rsa_export; static OSSL_FUNC_keymgmt_export_types_fn rsa_export_types; -static OSSL_FUNC_keymgmt_query_operation_name_fn rsapss_query_operation_name; +static OSSL_FUNC_keymgmt_query_operation_name_fn rsa_query_operation_name; #define RSA_DEFAULT_MD "SHA256" #define RSA_PSS_DEFAULT_MD OSSL_DIGEST_NAME_SHA1 @@ -609,7 +609,7 @@ void *rsa_load(const void *reference, size_t reference_sz) } /* For any RSA key, we use the "RSA" algorithms regardless of sub-type. */ -static const char *rsapss_query_operation_name(int operation_id) +static const char *rsa_query_operation_name(int operation_id) { return "RSA"; } @@ -657,6 +657,6 @@ const OSSL_DISPATCH rsapss_keymgmt_functions[] = { { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))rsa_export }, { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))rsa_export_types }, { OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME, - (void (*)(void))rsapss_query_operation_name }, + (void (*)(void))rsa_query_operation_name }, { 0, NULL } }; |