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/s3_lib.c | |
parent | 4cd401e401c4526768f0ca9257129e749431b384 (diff) |
Fixed some race conditions.
Submitted by:
Reviewed by:
PR:
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r-- | ssl/s3_lib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 4e58bcd632..12f7ec60b6 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -797,7 +797,7 @@ SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p) if (init) { - init=0; + CRYPTO_w_lock(CRYPTO_LOCK_SSL); for (i=0; i<SSL3_NUM_CIPHERS; i++) sorted[i]= &(ssl3_ciphers[i]); @@ -805,6 +805,10 @@ SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p) qsort( (char *)sorted, SSL3_NUM_CIPHERS,sizeof(SSL_CIPHER *), FP_ICC ssl_cipher_ptr_id_cmp); + + CRYPTO_w_unlock(CRYPTO_LOCK_SSL); + + init=0; } id=0x03000000L|((unsigned long)p[0]<<8L)|(unsigned long)p[1]; |