summaryrefslogtreecommitdiffstats
path: root/crypto/core_fetch.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-08-21 10:08:44 +0200
committerRichard Levitte <levitte@openssl.org>2019-08-22 01:50:30 +0200
commitc1d56231ef6385b557ec72eec508e55ea26ca8b0 (patch)
treec813f45c7adc28816afbd199b5df4d972fc54019 /crypto/core_fetch.c
parentb1d40ddfe23fd9551b89cdcfa52d1c23fc667f8a (diff)
Modify ossl_method_store_add() to accept an OSSL_PROVIDER and check for it
If ossl_method_store_add() gets called with a method that already exists (i.e. the store has one with matching provider, nid and properties), that method should not be stored. We do this check inside ossl_method_store_add() because it has all the locking required to do so safely. Fixes #9561 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9650)
Diffstat (limited to 'crypto/core_fetch.c')
-rw-r--r--crypto/core_fetch.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/core_fetch.c b/crypto/core_fetch.c
index c1c81588bb..6e4414d831 100644
--- a/crypto/core_fetch.c
+++ b/crypto/core_fetch.c
@@ -52,14 +52,14 @@ static void ossl_method_construct_this(OSSL_PROVIDER *provider,
* If we haven't been told not to store,
* add to the global store
*/
- data->mcm->put(data->libctx, NULL, method, data->operation_id,
- algo->algorithm_name,
+ data->mcm->put(data->libctx, NULL, method, provider,
+ data->operation_id, algo->algorithm_name,
algo->property_definition, data->mcm_data);
}
- data->mcm->put(data->libctx, data->store, method, data->operation_id,
- algo->algorithm_name, algo->property_definition,
- data->mcm_data);
+ data->mcm->put(data->libctx, data->store, method, provider,
+ data->operation_id, algo->algorithm_name,
+ algo->property_definition, data->mcm_data);
/* refcnt-- because we're dropping the reference */
data->mcm->destruct(method, data->mcm_data);