aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-02-12 14:28:50 +0100
committerRichard Levitte <levitte@openssl.org>2020-02-22 01:19:54 +0100
commit3f7ce7f1029c01c2c4d00e14ffc9630d26f485a4 (patch)
treeb9256d3cf61c639bb444c04e52ebff524fcba07c /include
parent8e90e3d53665854d76d6d46491b38f0e2a802428 (diff)
downloadopenssl-3f7ce7f1029c01c2c4d00e14ffc9630d26f485a4.zip
openssl-3f7ce7f1029c01c2c4d00e14ffc9630d26f485a4.tar.gz
openssl-3f7ce7f1029c01c2c4d00e14ffc9630d26f485a4.tar.bz2
Refactor evp_pkey_make_provided() to do legacy to provider export
Previously, evp-keymgmt_util_export_to_provider() took care of all kinds of exports of EVP_PKEYs to provider side keys, be it from its legacy key or from another provider side key. This works most of the times, but there may be cases where the caller wants to be a bit more in control of what sort of export happens when. Also, when it's time to remove all legacy stuff, that job will be much easier if we have a better separation between legacy support and support of provided stuff, as far as we can take it. This changes moves the support of legacy key to provider side key export from evp-keymgmt_util_export_to_provider() to evp_pkey_make_provided(), and makes sure the latter is called from all EVP_PKEY functions that handle legacy stuff. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11074)
Diffstat (limited to 'include')
-rw-r--r--include/crypto/evp.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/crypto/evp.h b/include/crypto/evp.h
index 0f5e86b..1724a12 100644
--- a/include/crypto/evp.h
+++ b/include/crypto/evp.h
@@ -574,11 +574,15 @@ void openssl_add_all_ciphers_int(void);
void openssl_add_all_digests_int(void);
void evp_cleanup_int(void);
void evp_app_cleanup_int(void);
+void *evp_pkey_make_provided(EVP_PKEY *pk, OPENSSL_CTX *libctx,
+ EVP_KEYMGMT **keymgmt, const char *propquery);
/*
* KEYMGMT utility functions
*/
void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt);
+size_t evp_keymgmt_util_find_pkey_cache_index(EVP_PKEY *pk,
+ EVP_KEYMGMT *keymgmt);
void evp_keymgmt_util_clear_pkey_cache(EVP_PKEY *pk);
void evp_keymgmt_util_cache_pkey(EVP_PKEY *pk, size_t index,
EVP_KEYMGMT *keymgmt, void *keydata);