summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_locl.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-08-23 14:03:28 +0200
committerRichard Levitte <levitte@openssl.org>2019-09-03 10:36:49 +0200
commit3ca9d210c94b9b88b89b224797aa403dfe97ccce (patch)
tree6e365bd489d75e5d4a8ae814103edbfecc715715 /crypto/evp/evp_locl.h
parentFix Coverity 1453452: Control flow issues (DEADCODE) (diff)
downloadopenssl-3ca9d210c94b9b88b89b224797aa403dfe97ccce.tar.xz
openssl-3ca9d210c94b9b88b89b224797aa403dfe97ccce.zip
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/evp_locl.h')
-rw-r--r--crypto/evp/evp_locl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/evp/evp_locl.h b/crypto/evp/evp_locl.h
index 3fd73212a4..a7b36dbc0e 100644
--- a/crypto/evp/evp_locl.h
+++ b/crypto/evp/evp_locl.h
@@ -141,7 +141,9 @@ void *evp_generic_fetch(OPENSSL_CTX *ctx, int operation_id,
const char *algorithm, const char *properties,
void *(*new_method)(const char *name,
const OSSL_DISPATCH *fns,
- OSSL_PROVIDER *prov),
+ OSSL_PROVIDER *prov,
+ void *method_data),
+ void *method_data,
int (*up_ref_method)(void *),
void (*free_method)(void *));
void evp_generic_do_all(OPENSSL_CTX *libctx, int operation_id,
@@ -149,7 +151,9 @@ void evp_generic_do_all(OPENSSL_CTX *libctx, int operation_id,
void *user_arg,
void *(*new_method)(const char *name,
const OSSL_DISPATCH *fns,
- OSSL_PROVIDER *prov),
+ OSSL_PROVIDER *prov,
+ void *method_data),
+ void *method_data,
void (*free_method)(void *));
/* Helper functions to avoid duplicating code */