diff options
author | Richard Levitte <levitte@openssl.org> | 2021-09-30 09:32:57 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-10-27 12:46:15 +0200 |
commit | 203ef4d7bfa65813dfa6fd49fb84c787e22b8c0c (patch) | |
tree | 8c20c8aa8f60b01c12efbde0ab05d768f7ef4985 /crypto/evp | |
parent | c4105ed91ffc020455847ef97293eab262deddd7 (diff) |
CORE: add a provider argument to ossl_method_construct()
This makes it possible to limit the search of methods to that
particular provider. This uses already available possibilities in
ossl_algorithm_do_all().
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16725)
(cherry picked from commit cfce50f791511c8fee7dec90c57f02d9410d039f)
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/evp_fetch.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c index 5303cf8859..a0fa6590ae 100644 --- a/crypto/evp/evp_fetch.c +++ b/crypto/evp/evp_fetch.c @@ -234,7 +234,8 @@ static void destruct_evp_method(void *method, void *data) } static void * -inner_evp_generic_fetch(struct evp_method_data_st *methdata, int operation_id, +inner_evp_generic_fetch(struct evp_method_data_st *methdata, + OSSL_PROVIDER *prov, int operation_id, int name_id, const char *name, const char *properties, void *(*new_method)(int name_id, @@ -315,7 +316,7 @@ inner_evp_generic_fetch(struct evp_method_data_st *methdata, int operation_id, methdata->destruct_method = free_method; methdata->flag_construct_error_occurred = 0; if ((method = ossl_method_construct(methdata->libctx, operation_id, - 0 /* !force_cache */, + prov, 0 /* !force_cache */, &mcm, methdata)) != NULL) { /* * If construction did create a method for us, we know that @@ -366,8 +367,8 @@ void *evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id, methdata.libctx = libctx; methdata.tmp_store = NULL; - method = inner_evp_generic_fetch(&methdata, - operation_id, 0, name, properties, + method = inner_evp_generic_fetch(&methdata, NULL, operation_id, + 0, name, properties, new_method, up_ref_method, free_method); dealloc_tmp_evp_method_store(methdata.tmp_store); return method; @@ -393,8 +394,8 @@ void *evp_generic_fetch_by_number(OSSL_LIB_CTX *libctx, int operation_id, methdata.libctx = libctx; methdata.tmp_store = NULL; - method = inner_evp_generic_fetch(&methdata, - operation_id, name_id, NULL, properties, + method = inner_evp_generic_fetch(&methdata, NULL, operation_id, + name_id, NULL, properties, new_method, up_ref_method, free_method); dealloc_tmp_evp_method_store(methdata.tmp_store); return method; @@ -588,7 +589,7 @@ void evp_generic_do_all(OSSL_LIB_CTX *libctx, int operation_id, methdata.libctx = libctx; methdata.tmp_store = NULL; - (void)inner_evp_generic_fetch(&methdata, operation_id, 0, NULL, NULL, + (void)inner_evp_generic_fetch(&methdata, NULL, operation_id, 0, NULL, NULL, new_method, up_ref_method, free_method); data.operation_id = operation_id; |