summaryrefslogtreecommitdiff
path: root/crypto/core_fetch.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-05-05 08:42:21 +0200
committerRichard Levitte <levitte@openssl.org>2019-05-12 13:43:38 -0700
commit2e49c05472ab76cee4e30c2eaa4fa576b9ae92c6 (patch)
tree951fe7806aa785611359885afeae27b8229df247 /crypto/core_fetch.c
parentbaff732dc654f8aab37953f6036399989c765604 (diff)
downloadopenssl-new-2e49c05472ab76cee4e30c2eaa4fa576b9ae92c6.tar.gz
EVP_FETCH: deal with names without pre-defined NIDs
We didn't deal very well with names that didn't have pre-defined NIDs, as the NID zero travelled through the full process and resulted in an inaccessible method. By consequence, we need to refactor the method construction callbacks to rely more on algorithm names. We must, however, still store the legacy NID with the method, for the sake of other code that depend on it (for example, CMS). Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8878)
Diffstat (limited to 'crypto/core_fetch.c')
-rw-r--r--crypto/core_fetch.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/crypto/core_fetch.c b/crypto/core_fetch.c
index 6c4ed6a30a..227f920713 100644
--- a/crypto/core_fetch.c
+++ b/crypto/core_fetch.c
@@ -56,14 +56,14 @@ static int ossl_method_construct_this(OSSL_PROVIDER *provider, void *cbdata)
* If we haven't been told not to store,
* add to the global store
*/
- data->mcm->put(data->libctx, NULL,
- thismap->property_definition,
- method, data->mcm_data);
+ data->mcm->put(data->libctx, NULL, method,
+ thismap->algorithm_name,
+ thismap->property_definition, data->mcm_data);
}
- data->mcm->put(data->libctx, data->store,
- thismap->property_definition,
- method, data->mcm_data);
+ data->mcm->put(data->libctx, data->store, method,
+ thismap->algorithm_name, thismap->property_definition,
+ data->mcm_data);
/* refcnt-- because we're dropping the reference */
data->mcm->destruct(method, data->mcm_data);
@@ -79,7 +79,8 @@ void *ossl_method_construct(OPENSSL_CTX *libctx, int operation_id,
{
void *method = NULL;
- if ((method = mcm->get(libctx, NULL, propquery, mcm_data)) == NULL) {
+ if ((method =
+ mcm->get(libctx, NULL, name, propquery, mcm_data)) == NULL) {
struct construct_data_st cbdata;
/*
@@ -97,7 +98,7 @@ void *ossl_method_construct(OPENSSL_CTX *libctx, int operation_id,
ossl_provider_forall_loaded(libctx, ossl_method_construct_this,
&cbdata);
- method = mcm->get(libctx, cbdata.store, propquery, mcm_data);
+ method = mcm->get(libctx, cbdata.store, name, propquery, mcm_data);
mcm->dealloc_tmp_store(cbdata.store);
}