X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=ssl%2Ft1_meth.c;h=51626783588fa026bce7d3ebee2a831f2cc32a0a;hb=b9ef52b07897f249a9fa44943dba33fba8fb2721;hp=512c2078e763740c939fa46ee9ea5f2988e3054c;hpb=78414a6a897db42c9bcf06aa21c705811ab33921;p=openssl.git diff --git a/ssl/t1_meth.c b/ssl/t1_meth.c index 512c2078e7..5162678358 100644 --- a/ssl/t1_meth.c +++ b/ssl/t1_meth.c @@ -57,32 +57,35 @@ */ #include -#include "objects.h" +#include #include "ssl_locl.h" -static SSL_METHOD *tls1_get_method(ver) -int ver; +static const SSL_METHOD *tls1_get_method(int ver) { + if (ver == TLS1_2_VERSION) + return TLSv1_2_method(); + 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() - { - static int init=1; - static SSL_METHOD TLSv1_data; +IMPLEMENT_tls_meth_func(TLS1_2_VERSION, TLSv1_2_method, + ssl3_accept, + ssl3_connect, + tls1_get_method, + TLSv1_2_enc_data) - if (init) - { - init=0; - 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; - } - return(&TLSv1_data); - } +IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_method, + ssl3_accept, + ssl3_connect, + tls1_get_method, + TLSv1_1_enc_data) + +IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_method, + ssl3_accept, + ssl3_connect, + tls1_get_method, + TLSv1_enc_data)