X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=ssl%2Ft1_clnt.c;h=578617ed84b47f4a361126553d5d99d0c26d26e0;hb=d2add2efaa2df50063c7aa6d849525dfe1c1d6da;hp=1a179221e756908f1a5eae99fdf3f9ef5508378b;hpb=9b3086fe382e7b0f53b8634d0e75f1a659ab2653;p=openssl.git diff --git a/ssl/t1_clnt.c b/ssl/t1_clnt.c index 1a179221e7..578617ed84 100644 --- a/ssl/t1_clnt.c +++ b/ssl/t1_clnt.c @@ -57,40 +57,36 @@ */ #include -#include "buffer.h" -#include "rand.h" -#include "objects.h" -#include "evp.h" #include "ssl_locl.h" +#include +#include +#include +#include -#ifndef NOPROTO -static SSL_METHOD *tls1_get_client_method(int ver); -#else -static SSL_METHOD *tls1_get_client_method(); -#endif - -static SSL_METHOD *tls1_get_client_method(ver) -int ver; +static const SSL_METHOD *tls1_get_client_method(int ver); +static const SSL_METHOD *tls1_get_client_method(int ver) { + if (ver == TLS1_2_VERSION) + return TLSv1_2_client_method(); + if (ver == TLS1_1_VERSION) + return TLSv1_1_client_method(); if (ver == TLS1_VERSION) - return(TLSv1_client_method()); - else - return(NULL); + return TLSv1_client_method(); + return NULL; } -SSL_METHOD *TLSv1_client_method() - { - static int init=1; - static SSL_METHOD TLSv1_client_data; +IMPLEMENT_tls_meth_func(TLS1_2_VERSION, TLSv1_2_client_method, + ssl_undefined_function, + ssl3_connect, + tls1_get_client_method) - if (init) - { - init=0; - memcpy((char *)&TLSv1_client_data,(char *)tlsv1_base_method(), - sizeof(SSL_METHOD)); - TLSv1_client_data.ssl_connect=ssl3_connect; - TLSv1_client_data.get_ssl_method=tls1_get_client_method; - } - return(&TLSv1_client_data); - } +IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_client_method, + ssl_undefined_function, + ssl3_connect, + tls1_get_client_method) + +IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_client_method, + ssl_undefined_function, + ssl3_connect, + tls1_get_client_method)