summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_fetch.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-03-16 14:14:43 +0100
committerRichard Levitte <levitte@openssl.org>2021-04-02 08:52:37 +0200
commit309a78aa305ee14878e453c78ccf9a7dc91264cf (patch)
tree82b3791b395f3e6557084d08cdf3058a30eb38e2 /crypto/evp/evp_fetch.c
parent650c66873793bed505802f316b15772a0f887743 (diff)
CORE: Add an algorithm_description field to OSSL_ALGORITHM
This corresponds to the |info| field in EVP_PKEY_ASN1_METHOD, as well as the generic use of OBJ_nid2ln() as a one line description. We also add the base functionality to make use of this field. Fixes #14514 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14656)
Diffstat (limited to 'crypto/evp/evp_fetch.c')
-rw-r--r--crypto/evp/evp_fetch.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c
index 701abfaaf5..4b81204046 100644
--- a/crypto/evp/evp_fetch.c
+++ b/crypto/evp/evp_fetch.c
@@ -50,8 +50,8 @@ struct evp_method_data_st {
unsigned int flag_construct_error_occurred : 1;
- void *(*method_from_dispatch)(int name_id, const OSSL_DISPATCH *,
- OSSL_PROVIDER *);
+ void *(*method_from_algorithm)(int name_id, const OSSL_ALGORITHM *,
+ OSSL_PROVIDER *);
int (*refcnt_up_method)(void *method);
void (*destruct_method)(void *method);
};
@@ -194,8 +194,7 @@ static void *construct_evp_method(const OSSL_ALGORITHM *algodef,
if (name_id == 0)
return NULL;
- method = methdata->method_from_dispatch(name_id, algodef->implementation,
- prov);
+ method = methdata->method_from_algorithm(name_id, algodef, prov);
/*
* Flag to indicate that there was actual construction errors. This
@@ -220,7 +219,7 @@ inner_evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id,
int name_id, const char *name,
const char *properties,
void *(*new_method)(int name_id,
- const OSSL_DISPATCH *fns,
+ const OSSL_ALGORITHM *algodef,
OSSL_PROVIDER *prov),
int (*up_ref_method)(void *),
void (*free_method)(void *))
@@ -296,7 +295,7 @@ inner_evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id,
mcmdata.name_id = name_id;
mcmdata.names = name;
mcmdata.propquery = properties;
- mcmdata.method_from_dispatch = new_method;
+ mcmdata.method_from_algorithm = new_method;
mcmdata.refcnt_up_method = up_ref_method;
mcmdata.destruct_method = free_method;
mcmdata.flag_construct_error_occurred = 0;
@@ -341,7 +340,7 @@ inner_evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id,
void *evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id,
const char *name, const char *properties,
void *(*new_method)(int name_id,
- const OSSL_DISPATCH *fns,
+ const OSSL_ALGORITHM *algodef,
OSSL_PROVIDER *prov),
int (*up_ref_method)(void *),
void (*free_method)(void *))
@@ -361,7 +360,7 @@ void *evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id,
void *evp_generic_fetch_by_number(OSSL_LIB_CTX *libctx, int operation_id,
int name_id, const char *properties,
void *(*new_method)(int name_id,
- const OSSL_DISPATCH *fns,
+ const OSSL_ALGORITHM *algodef,
OSSL_PROVIDER *prov),
int (*up_ref_method)(void *),
void (*free_method)(void *))
@@ -461,7 +460,7 @@ int EVP_default_properties_enable_fips(OSSL_LIB_CTX *libctx, int enable)
struct do_all_data_st {
void (*user_fn)(void *method, void *arg);
void *user_arg;
- void *(*new_method)(const int name_id, const OSSL_DISPATCH *fns,
+ void *(*new_method)(const int name_id, const OSSL_ALGORITHM *algodef,
OSSL_PROVIDER *prov);
void (*free_method)(void *);
};
@@ -477,7 +476,7 @@ static void do_one(OSSL_PROVIDER *provider, const OSSL_ALGORITHM *algo,
void *method = NULL;
if (name_id != 0)
- method = data->new_method(name_id, algo->implementation, provider);
+ method = data->new_method(name_id, algo, provider);
if (method != NULL) {
data->user_fn(method, data->user_arg);
@@ -489,7 +488,7 @@ void evp_generic_do_all(OSSL_LIB_CTX *libctx, int operation_id,
void (*user_fn)(void *method, void *arg),
void *user_arg,
void *(*new_method)(int name_id,
- const OSSL_DISPATCH *fns,
+ const OSSL_ALGORITHM *algodef,
OSSL_PROVIDER *prov),
void (*free_method)(void *))
{