diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2005-08-05 23:52:08 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2005-08-05 23:52:08 +0000 |
commit | 222f2246640d8bd00f509f47c436e8e48d4d67a9 (patch) | |
tree | dd8f7251ec1c20e5fd4fe14df1c35563889ce087 /ssl/t1_meth.c | |
parent | 62b6cd007f5aee952acf52e087d535594b6eae15 (diff) |
Initialize SSL_METHOD structures at compile time. This removes the need
for locking code. The CRYPTO_LOCK_SSL_METHOD lock is now no longer used.
Diffstat (limited to 'ssl/t1_meth.c')
-rw-r--r-- | ssl/t1_meth.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/ssl/t1_meth.c b/ssl/t1_meth.c index fcc243f782..f5d8df634e 100644 --- a/ssl/t1_meth.c +++ b/ssl/t1_meth.c @@ -69,28 +69,8 @@ static SSL_METHOD *tls1_get_method(int ver) return(NULL); } -SSL_METHOD *TLSv1_method(void) - { - static int init=1; - static SSL_METHOD TLSv1_data; - - if (init) - { - CRYPTO_w_lock(CRYPTO_LOCK_SSL_METHOD); - - if (init) - { - memcpy((char *)&TLSv1_data,(char *)tlsv1_base_method(), - sizeof(SSL_METHOD)); - TLSv1_data.ssl_connect=ssl3_connect; - TLSv1_data.ssl_accept=ssl3_accept; - TLSv1_data.get_ssl_method=tls1_get_method; - init=0; - } - - CRYPTO_w_unlock(CRYPTO_LOCK_SSL_METHOD); - } - - return(&TLSv1_data); - } +IMPLEMENT_tls1_meth_func(TLSv1_method, + ssl3_accept, + ssl3_connect, + tls1_get_method) |