summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_fetch.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-05-08 14:00:31 +0200
committerRichard Levitte <levitte@openssl.org>2019-05-12 13:43:38 -0700
commit0211740fcc47a954be19cceb65fb57a6f7deb797 (patch)
tree6eaa2197081d55c35f53d97d2ebe1fdd3cc4e34e /crypto/evp/evp_fetch.c
parent1f79ddf5049ff53ad8a7cbab76e62d02d9ac099f (diff)
EVP_FETCH: remove the need to transport the legacy NID through construction
Now that the legacy NID isn't used as a main index for fetched algorithms, the legacy NID was just transported around unnecessarily. This is removed, and the legacy NID is simply set by EVP_{API}_fetch() after the construction process is done. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8878)
Diffstat (limited to 'crypto/evp/evp_fetch.c')
-rw-r--r--crypto/evp/evp_fetch.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c
index dc66a694a2..fdd6209bc2 100644
--- a/crypto/evp/evp_fetch.c
+++ b/crypto/evp/evp_fetch.c
@@ -39,13 +39,11 @@ static const OPENSSL_CTX_METHOD default_method_store_method = {
struct method_data_st {
OPENSSL_CTX *libctx;
const char *name;
- int nid;
+ int id;
OSSL_METHOD_CONSTRUCT_METHOD *mcm;
- void *(*method_from_dispatch)(int nid, const OSSL_DISPATCH *,
- OSSL_PROVIDER *);
+ void *(*method_from_dispatch)(const OSSL_DISPATCH *, OSSL_PROVIDER *);
int (*refcnt_up_method)(void *method);
void (*destruct_method)(void *method);
- int (*nid_method)(void *method);
};
/*
@@ -121,10 +119,8 @@ static void *construct_method(const char *name, const OSSL_DISPATCH *fns,
OSSL_PROVIDER *prov, void *data)
{
struct method_data_st *methdata = data;
- /* TODO(3.0) get rid of the need for legacy NIDs */
- int legacy_nid = OBJ_sn2nid(name);
- return methdata->method_from_dispatch(legacy_nid, fns, prov);
+ return methdata->method_from_dispatch(fns, prov);
}
static void destruct_method(void *method, void *data)
@@ -136,11 +132,10 @@ static void destruct_method(void *method, void *data)
void *evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id,
const char *name, const char *properties,
- void *(*new_method)(int nid, const OSSL_DISPATCH *fns,
+ void *(*new_method)(const OSSL_DISPATCH *fns,
OSSL_PROVIDER *prov),
int (*upref_method)(void *),
- void (*free_method)(void *),
- int (*nid_method)(void *))
+ void (*free_method)(void *))
{
OSSL_METHOD_STORE *store = get_default_method_store(libctx);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
@@ -168,7 +163,6 @@ void *evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id,
mcmdata.destruct_method = free_method;
mcmdata.refcnt_up_method = upref_method;
mcmdata.destruct_method = free_method;
- mcmdata.nid_method = nid_method;
method = ossl_method_construct(libctx, operation_id, name,
properties, 0 /* !force_cache */,
&mcm, &mcmdata);