diff options
author | Richard Levitte <levitte@openssl.org> | 2019-08-23 14:03:28 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-09-03 10:36:49 +0200 |
commit | 3ca9d210c94b9b88b89b224797aa403dfe97ccce (patch) | |
tree | 6e365bd489d75e5d4a8ae814103edbfecc715715 /crypto/evp/mac_meth.c | |
parent | 7964e3709af59675795ab1f4f69a935980379a66 (diff) | |
download | openssl-3ca9d210c94b9b88b89b224797aa403dfe97ccce.zip openssl-3ca9d210c94b9b88b89b224797aa403dfe97ccce.tar.gz openssl-3ca9d210c94b9b88b89b224797aa403dfe97ccce.tar.bz2 |
Refactor how KEYMGMT methods get associated with other methods
KEYMGMT methods were attached to other methods after those were fully
created and registered, thereby creating a potential data race, if two
threads tried to create the exact same method at the same time.
Instead of this, we change the method creating function to take an
extra data parameter, passed all the way from the public fetching
function. In the case of EVP_KEYEXCH, we pass all the necessary data
that evp_keyexch_from_dispatch() needs to be able to fetch the
appropriate KEYMGMT method on the fly.
Fixes #9592
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9678)
Diffstat (limited to 'crypto/evp/mac_meth.c')
-rw-r--r-- | crypto/evp/mac_meth.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/evp/mac_meth.c b/crypto/evp/mac_meth.c index 1c0d642..a317127 100644 --- a/crypto/evp/mac_meth.c +++ b/crypto/evp/mac_meth.c @@ -48,7 +48,7 @@ static void *evp_mac_new(void) } static void *evp_mac_from_dispatch(const char *name, const OSSL_DISPATCH *fns, - OSSL_PROVIDER *prov) + OSSL_PROVIDER *prov, void *unused) { EVP_MAC *mac = NULL; int fnmaccnt = 0, fnctxcnt = 0; @@ -154,7 +154,7 @@ EVP_MAC *EVP_MAC_fetch(OPENSSL_CTX *libctx, const char *algorithm, const char *properties) { return evp_generic_fetch(libctx, OSSL_OP_MAC, algorithm, properties, - evp_mac_from_dispatch, evp_mac_up_ref, + evp_mac_from_dispatch, NULL, evp_mac_up_ref, evp_mac_free); } @@ -205,5 +205,5 @@ void EVP_MAC_do_all_ex(OPENSSL_CTX *libctx, { evp_generic_do_all(libctx, OSSL_OP_MAC, (void (*)(void *, void *))fn, arg, - evp_mac_from_dispatch, evp_mac_free); + evp_mac_from_dispatch, NULL, evp_mac_free); } |