diff options
author | Richard Levitte <levitte@openssl.org> | 2021-05-15 07:43:06 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2021-05-20 12:57:22 +0100 |
commit | bed7437b00734ee463de3c6fd6851458fa8c6cb0 (patch) | |
tree | 3bdbff41b883abd1cdb3e5b3e641e808109629c0 /crypto/ec | |
parent | 0e5a4da4a86c6435c70d587d740c3096686a8500 (diff) |
Modify EVP_PKEY_ASN1_METHOD's export_to function to take an importer
We previously took an EVP_KEYMGMT pointer, but now found it necessary
to use a different import function in some cases. Since that's the
only thing we use from EVP_KEYMGMT, we might as well pass the import
function directly, allowing for some flexibility in how export_to is
used.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15293)
Diffstat (limited to 'crypto/ec')
-rw-r--r-- | crypto/ec/ec_ameth.c | 6 | ||||
-rw-r--r-- | crypto/ec/ecx_meth.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c index e49252449d..32fe692d8a 100644 --- a/crypto/ec/ec_ameth.c +++ b/crypto/ec/ec_ameth.c @@ -478,8 +478,8 @@ size_t ec_pkey_dirty_cnt(const EVP_PKEY *pkey) static int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata, - EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx, - const char *propq) + OSSL_FUNC_keymgmt_import_fn *importer, + OSSL_LIB_CTX *libctx, const char *propq) { const EC_KEY *eckey = NULL; const EC_GROUP *ecg = NULL; @@ -607,7 +607,7 @@ int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata, params = OSSL_PARAM_BLD_to_param(tmpl); /* We export, the provider imports */ - rv = evp_keymgmt_import(to_keymgmt, to_keydata, selection, params); + rv = importer(to_keydata, selection, params); err: OSSL_PARAM_BLD_free(tmpl); diff --git a/crypto/ec/ecx_meth.c b/crypto/ec/ecx_meth.c index 61f062a2f8..c47bd9f9dd 100644 --- a/crypto/ec/ecx_meth.c +++ b/crypto/ec/ecx_meth.c @@ -346,8 +346,8 @@ static size_t ecx_pkey_dirty_cnt(const EVP_PKEY *pkey) } static int ecx_pkey_export_to(const EVP_PKEY *from, void *to_keydata, - EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx, - const char *propq) + OSSL_FUNC_keymgmt_import_fn *importer, + OSSL_LIB_CTX *libctx, const char *propq) { const ECX_KEY *key = from->pkey.ecx; OSSL_PARAM_BLD *tmpl = OSSL_PARAM_BLD_new(); @@ -375,7 +375,7 @@ static int ecx_pkey_export_to(const EVP_PKEY *from, void *to_keydata, params = OSSL_PARAM_BLD_to_param(tmpl); /* We export, the provider imports */ - rv = evp_keymgmt_import(to_keymgmt, to_keydata, selection, params); + rv = importer(to_keydata, selection, params); err: OSSL_PARAM_BLD_free(tmpl); |