Return per-certificate chain if extra chain is NULL.
[openssl.git] / ssl / s2_meth.c
index e2add16..f0e8ca5 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#ifndef NO_RSA
+#include "ssl_locl.h"
+#ifndef OPENSSL_NO_SSL2
 #include <stdio.h>
 #include <openssl/objects.h>
-#include "ssl_locl.h"
 
-static SSL_METHOD *ssl2_get_method(int ver);
-static SSL_METHOD *ssl2_get_method(int ver)
+static const SSL_METHOD *ssl2_get_method(int ver);
+static const SSL_METHOD *ssl2_get_method(int ver)
        {
        if (ver == SSL2_VERSION)
                return(SSLv2_method());
@@ -70,20 +70,15 @@ static SSL_METHOD *ssl2_get_method(int ver)
                return(NULL);
        }
 
-SSL_METHOD *SSLv2_method(void)
-       {
-       static int init=1;
-       static SSL_METHOD SSLv2_data;
+IMPLEMENT_ssl2_meth_func(SSLv2_method,
+                        ssl2_accept,
+                        ssl2_connect,
+                        ssl2_get_method)
+
+#else /* !OPENSSL_NO_SSL2 */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
 
-       if (init)
-               {
-               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;
-               init=0;
-               }
-       return(&SSLv2_data);
-       }
 #endif