X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=ssl%2Ft1_meth.c;h=6ce7c0bbf5856f6bcf0fd56a9c2dbeafded4f0cc;hb=67c8e7f41486934b6809673b6d836d38eaf2383b;hp=fcc243f782643d5cdb3c015d90390a442562208f;hpb=929f11673384d9f518b47bd4dc7f1878e80cdf28;p=oweals%2Fopenssl.git diff --git a/ssl/t1_meth.c b/ssl/t1_meth.c index fcc243f782..6ce7c0bbf5 100644 --- a/ssl/t1_meth.c +++ b/ssl/t1_meth.c @@ -60,8 +60,8 @@ #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); +static const SSL_METHOD *tls1_get_method(int ver) { if (ver == TLS1_VERSION) return(TLSv1_method()); @@ -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)