diff options
author | Bodo Möller <bodo@openssl.org> | 1999-04-22 13:37:46 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 1999-04-22 13:37:46 +0000 |
commit | 5cc146f344bd2225e7afa66052a8401468b94ef4 (patch) | |
tree | fed6103a36e32b130cb0ec6ba4ae6c4c9540f848 /ssl/s2_lib.c | |
parent | 4cd401e401c4526768f0ca9257129e749431b384 (diff) | |
download | openssl-new-5cc146f344bd2225e7afa66052a8401468b94ef4.tar.gz |
Fixed some race conditions.
Submitted by:
Reviewed by:
PR:
Diffstat (limited to 'ssl/s2_lib.c')
-rw-r--r-- | ssl/s2_lib.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ssl/s2_lib.c b/ssl/s2_lib.c index 43c7cab3ed..4c734c9acf 100644 --- a/ssl/s2_lib.c +++ b/ssl/s2_lib.c @@ -316,7 +316,7 @@ SSL_CIPHER *ssl2_get_cipher_by_char(const unsigned char *p) if (init) { - init=0; + CRYPTO_w_lock(CRYPTO_LOCK_SSL); for (i=0; i<SSL2_NUM_CIPHERS; i++) sorted[i]= &(ssl2_ciphers[i]); @@ -324,6 +324,9 @@ SSL_CIPHER *ssl2_get_cipher_by_char(const unsigned char *p) qsort( (char *)sorted, SSL2_NUM_CIPHERS,sizeof(SSL_CIPHER *), FP_ICC ssl_cipher_ptr_id_cmp); + + CRYPTO_w_unlock(CRYPTO_LOCK_SSL); + init=0; } id=0x02000000L|((unsigned long)p[0]<<16L)| |