X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fs2_meth.c;h=f0e8ca593d408c9a8f5ba82e4bd2d8ed65229f39;hp=0b8c2acb48333003453a5f8215ffb858c2417515;hb=e91fb53b38a75953a693fadbc09177245bc7a05d;hpb=d02b48c63a58ea4367a0e905979f140b7d090f86 diff --git a/ssl/s2_meth.c b/ssl/s2_meth.c index 0b8c2acb48..f0e8ca593d 100644 --- a/ssl/s2_meth.c +++ b/ssl/s2_meth.c @@ -1,5 +1,5 @@ /* ssl/s2_meth.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -56,33 +56,29 @@ * [including the GNU Public Licence.] */ -#include -#include "objects.h" #include "ssl_locl.h" +#ifndef OPENSSL_NO_SSL2 +#include +#include -static SSL_METHOD *ssl2_get_method(ver) -int ver; +static const SSL_METHOD *ssl2_get_method(int ver); +static const SSL_METHOD *ssl2_get_method(int ver) { - if (ver == 2) + if (ver == SSL2_VERSION) return(SSLv2_method()); else return(NULL); } -SSL_METHOD *SSLv2_method() - { - static int init=1; - static SSL_METHOD SSLv2_data; +IMPLEMENT_ssl2_meth_func(SSLv2_method, + ssl2_accept, + ssl2_connect, + ssl2_get_method) - if (init) - { - init=0; - memcpy((char *)&SSLv2_data,(char *)sslv2_base_method(), - sizeof(SSL_METHOD)); - SSLv2_data.ssl_connect=ssl2_connect; - SSLv2_data.ssl_accept=ssl2_accept; - SSLv2_data.get_ssl_method=ssl2_get_method; - } - return(&SSLv2_data); - } +#else /* !OPENSSL_NO_SSL2 */ + +# if PEDANTIC +static void *dummy=&dummy; +# endif +#endif