X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Ft1_clnt.c;h=578617ed84b47f4a361126553d5d99d0c26d26e0;hp=9745630a008cf8e1a17e077846afd3650cac109e;hb=c46ecc3a55bcbbe4ff31da3864d015e343b0189f;hpb=a9be3af5ad4836f7e50f0546311ca90c717b861e diff --git a/ssl/t1_clnt.c b/ssl/t1_clnt.c index 9745630a00..578617ed84 100644 --- a/ssl/t1_clnt.c +++ b/ssl/t1_clnt.c @@ -57,34 +57,36 @@ */ #include +#include "ssl_locl.h" #include #include #include #include -#include "ssl_locl.h" -static SSL_METHOD *tls1_get_client_method(int ver); -static SSL_METHOD *tls1_get_client_method(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(void) - { - 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) - { - 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; - init=0; - } - 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)