diff options
author | Richard Levitte <levitte@openssl.org> | 2019-11-08 15:24:42 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-11-14 10:53:14 +0100 |
commit | 1640d48c5b4ee0a3ff5a2a5015ee17ac163d9cd4 (patch) | |
tree | 24fb95a9c51ec8fac457e00b924b853ad098bffc /include/crypto/evp.h | |
parent | 726ad13c4e720daeda5f56326aebcd27b4615d6c (diff) |
CORE & PROV: make export of key data leaner through callback
Exporting data from a provider owned domainparams or key is quite an
ordeal, with having to figure out what parameter keys an
implementation supports, call the export function a first time to find
out how large each parameter buffer must be, allocate the necessary
space for it, and call the export function again.
So how about letting the export function build up the key data params
and call back with that? This change implements exactly such a
mechanism.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10414)
Diffstat (limited to 'include/crypto/evp.h')
-rw-r--r-- | include/crypto/evp.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/crypto/evp.h b/include/crypto/evp.h index 7f5e405486..592cbdd536 100644 --- a/include/crypto/evp.h +++ b/include/crypto/evp.h @@ -602,7 +602,8 @@ void *evp_keymgmt_gendomparams(const EVP_KEYMGMT *keymgmt, void evp_keymgmt_freedomparams(const EVP_KEYMGMT *keymgmt, void *provdomparams); int evp_keymgmt_exportdomparams(const EVP_KEYMGMT *keymgmt, - void *provdomparams, OSSL_PARAM params[]); + void *provdomparams, + OSSL_CALLBACK *param_cb, void *cbarg); const OSSL_PARAM * evp_keymgmt_importdomparam_types(const EVP_KEYMGMT *keymgmt); const OSSL_PARAM * @@ -615,8 +616,8 @@ void *evp_keymgmt_genkey(const EVP_KEYMGMT *keymgmt, void *domparams, void *evp_keymgmt_loadkey(const EVP_KEYMGMT *keymgmt, void *id, size_t idlen); void evp_keymgmt_freekey(const EVP_KEYMGMT *keymgmt, void *provkey); -int evp_keymgmt_exportkey(const EVP_KEYMGMT *keymgmt, - void *provkey, OSSL_PARAM params[]); +int evp_keymgmt_exportkey(const EVP_KEYMGMT *keymgmt, void *provkey, + OSSL_CALLBACK *param_cb, void *cbarg); const OSSL_PARAM *evp_keymgmt_importkey_types(const EVP_KEYMGMT *keymgmt); const OSSL_PARAM *evp_keymgmt_exportkey_types(const EVP_KEYMGMT *keymgmt); |