Return per-certificate chain if extra chain is NULL.
[openssl.git] / ssl / s2_meth.c
index 0b8c2ac..f0e8ca5 100644 (file)
@@ -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
  * [including the GNU Public Licence.]
  */
 
-#include <stdio.h>
-#include "objects.h"
 #include "ssl_locl.h"
+#ifndef OPENSSL_NO_SSL2
+#include <stdio.h>
+#include <openssl/objects.h>
 
-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