Protect loading routines with a lock.
authorRichard Levitte <levitte@openssl.org>
Mon, 16 Dec 2002 06:06:06 +0000 (06:06 +0000)
committerRichard Levitte <levitte@openssl.org>
Mon, 16 Dec 2002 06:06:06 +0000 (06:06 +0000)
PR: 373

ssl/ssl_ciph.c

index 37f58886a612d8945c2784ca2001ca15390cb9ad..c72be89e9ae3a03662a968afaebc20c3204519fa 100644 (file)
@@ -751,7 +751,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