X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ssl%2Ft1_srvr.c;h=a1858cf1b07f82677b5380458a0a170dd16e2d7e;hb=03da57fe14f2de5bde9d4496a2ae9a4ae8879f88;hp=996b7ca8e2ef54a6bc65288d94e9f9aa8e9810e0;hpb=a9be3af5ad4836f7e50f0546311ca90c717b861e;p=openssl.git diff --git a/ssl/t1_srvr.c b/ssl/t1_srvr.c index 996b7ca8e2..a1858cf1b0 100644 --- a/ssl/t1_srvr.c +++ b/ssl/t1_srvr.c @@ -57,35 +57,40 @@ */ #include +#include "ssl_locl.h" #include #include #include #include #include -#include "ssl_locl.h" -static SSL_METHOD *tls1_get_server_method(int ver); -static SSL_METHOD *tls1_get_server_method(int ver) +static const SSL_METHOD *tls1_get_server_method(int ver); +static const SSL_METHOD *tls1_get_server_method(int ver) { + if (ver == TLS1_2_VERSION) + return TLSv1_2_server_method(); + if (ver == TLS1_1_VERSION) + return TLSv1_1_server_method(); if (ver == TLS1_VERSION) - return(TLSv1_server_method()); - else - return(NULL); + return TLSv1_server_method(); + return NULL; } -SSL_METHOD *TLSv1_server_method(void) - { - static int init=1; - static SSL_METHOD TLSv1_server_data; +IMPLEMENT_tls_meth_func(TLS1_2_VERSION, TLSv1_2_server_method, + ssl3_accept, + ssl_undefined_function, + tls1_get_server_method, + TLSv1_2_enc_data) - if (init) - { - memcpy((char *)&TLSv1_server_data,(char *)tlsv1_base_method(), - sizeof(SSL_METHOD)); - TLSv1_server_data.ssl_accept=ssl3_accept; - TLSv1_server_data.get_ssl_method=tls1_get_server_method; - init=0; - } - return(&TLSv1_server_data); - } +IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_server_method, + ssl3_accept, + ssl_undefined_function, + tls1_get_server_method, + TLSv1_1_enc_data) + +IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_server_method, + ssl3_accept, + ssl_undefined_function, + tls1_get_server_method, + TLSv1_enc_data)