X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=ssl%2Ft1_meth.c;h=3257636425f3e714f3956f9c4eef037f833b4634;hb=54e02a234ccc875a75b57c4dbaaaf817b9215903;hp=fcc243f782643d5cdb3c015d90390a442562208f;hpb=929f11673384d9f518b47bd4dc7f1878e80cdf28;p=openssl.git diff --git a/ssl/t1_meth.c b/ssl/t1_meth.c index fcc243f782..3257636425 100644 --- a/ssl/t1_meth.c +++ b/ssl/t1_meth.c @@ -60,37 +60,22 @@ #include #include "ssl_locl.h" -static SSL_METHOD *tls1_get_method(int ver); -static SSL_METHOD *tls1_get_method(int ver) +static const SSL_METHOD *tls1_get_method(int ver) { + if (ver == TLS1_1_VERSION) + return TLSv1_1_method(); if (ver == TLS1_VERSION) - return(TLSv1_method()); - else - return(NULL); + return TLSv1_method(); + 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; - } +IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_method, + ssl3_accept, + ssl3_connect, + tls1_get_method) - CRYPTO_w_unlock(CRYPTO_LOCK_SSL_METHOD); - } - - return(&TLSv1_data); - } +IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_method, + ssl3_accept, + ssl3_connect, + tls1_get_method)