summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_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/evp/evp_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/evp/evp_fetch.c')
-rw-r--r--crypto/evp/evp_fetch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c
index 41dee721a4..fa85178a7e 100644
--- a/crypto/evp/evp_fetch.c
+++ b/crypto/evp/evp_fetch.c
@@ -114,9 +114,9 @@ static void *get_method_from_store(OPENSSL_CTX *libctx, void *store,
}
static int put_method_in_store(OPENSSL_CTX *libctx, void *store,
- void *method, int operation_id,
- const char *name, const char *propdef,
- void *data)
+ void *method, const OSSL_PROVIDER *prov,
+ int operation_id, const char *name,
+ const char *propdef, void *data)
{
struct method_data_st *methdata = data;
OSSL_NAMEMAP *namemap;
@@ -132,7 +132,7 @@ static int put_method_in_store(OPENSSL_CTX *libctx, void *store,
&& (store = get_default_method_store(libctx)) == NULL)
return 0;
- return ossl_method_store_add(store, methid, propdef, method,
+ return ossl_method_store_add(store, prov, methid, propdef, method,
methdata->refcnt_up_method,
methdata->destruct_method);
}