diff options
Diffstat (limited to 'crypto/openssl/ssl/s23_meth.c')
-rw-r--r-- | crypto/openssl/ssl/s23_meth.c | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/crypto/openssl/ssl/s23_meth.c b/crypto/openssl/ssl/s23_meth.c index f207140..950d9aa 100644 --- a/crypto/openssl/ssl/s23_meth.c +++ b/crypto/openssl/ssl/s23_meth.c @@ -63,37 +63,26 @@ static SSL_METHOD *ssl23_get_method(int ver); static SSL_METHOD *ssl23_get_method(int ver) { +#ifndef OPENSSL_NO_SSL2 if (ver == SSL2_VERSION) return(SSLv2_method()); - else if (ver == SSL3_VERSION) + else +#endif +#ifndef OPENSSL_NO_SSL3 + if (ver == SSL3_VERSION) return(SSLv3_method()); - else if (ver == TLS1_VERSION) + else +#endif +#ifndef OPENSSL_NO_TLS1 + if (ver == TLS1_VERSION) return(TLSv1_method()); else +#endif return(NULL); } -SSL_METHOD *SSLv23_method(void) - { - static int init=1; - static SSL_METHOD SSLv23_data; - - if (init) - { - CRYPTO_w_lock(CRYPTO_LOCK_SSL_METHOD); - - if (init) - { - memcpy((char *)&SSLv23_data,(char *)sslv23_base_method(), - sizeof(SSL_METHOD)); - SSLv23_data.ssl_connect=ssl23_connect; - SSLv23_data.ssl_accept=ssl23_accept; - SSLv23_data.get_ssl_method=ssl23_get_method; - init=0; - } - - CRYPTO_w_unlock(CRYPTO_LOCK_SSL_METHOD); - } - return(&SSLv23_data); - } +IMPLEMENT_ssl23_meth_func(SSLv23_method, + ssl23_accept, + ssl23_connect, + ssl23_get_method) |