aboutsummaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-12-16 06:06:03 +0000
committerRichard Levitte <levitte@openssl.org>2002-12-16 06:06:03 +0000
commitf70ddce761ea237c27c933303ad7935c102c5eb3 (patch)
treed77b5974909cd880845cc8499869ef93d247790d /ssl
parente29246cb179fb341dc8b66b085cc70120e214585 (diff)
downloadopenssl-f70ddce761ea237c27c933303ad7935c102c5eb3.tar.gz
Protect loading routines with a lock.
PR: 373
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_ciph.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 43abea1a7d..d4f86f6ed9 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -197,6 +197,10 @@ static int sk_comp_cmp(const SSL_COMP * const *a,
static void load_builtin_compressions(void)
{
+ if (ssl_comp_methods != NULL)
+ return;
+
+ CRYPTO_w_lock(CRYPTO_LOCK_SSL);
if (ssl_comp_methods == NULL)
{
SSL_COMP *comp = NULL;
@@ -222,6 +226,7 @@ static void load_builtin_compressions(void)
}
MemCheck_on();
}
+ CRYPTO_w_unlock(CRYPTO_LOCK_SSL);
}
int ssl_cipher_get_evp(SSL_SESSION *s, const EVP_CIPHER **enc,
@@ -793,7 +798,12 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
*/
if (rule_str == NULL) return(NULL);
- if (init_ciphers) load_ciphers();
+ if (init_ciphers)
+ {
+ CRYPTO_w_lock(CRYPTO_LOCK_SSL);
+ if (init_ciphers) load_ciphers();
+ CRYPTO_w_unlock(CRYPTO_LOCK_SSL);
+ }
/*
* To reduce the work to do we only want to process the compiled