Add loaded dynamic ENGINEs to list.
[openssl.git] / ssl / s23_meth.c
index dbe282bfd0ab73c689c52df9c951634bbae795b9..40eae0f0be624868f85f7cfb471aa80a32f5e368 100644 (file)
@@ -1,5 +1,5 @@
 /* ssl/s23_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
  */
 
 #include <stdio.h>
-#include "objects.h"
+#include <openssl/objects.h>
 #include "ssl_locl.h"
 
-static SSL_METHOD *ssl23_get_method(ver)
-int ver;
+static const SSL_METHOD *ssl23_get_method(int ver);
+static const SSL_METHOD *ssl23_get_method(int ver)
        {
-       if (ver == 2)
-               return(SSLv23_method());
-       else if (ver == 3)
+#ifndef OPENSSL_NO_SSL2
+       if (ver == SSL2_VERSION)
+               return(SSLv2_method());
+       else
+#endif
+#ifndef OPENSSL_NO_SSL3
+       if (ver == SSL3_VERSION)
                return(SSLv3_method());
        else
+#endif
+#ifndef OPENSSL_NO_TLS1
+       if (ver == TLS1_VERSION)
+               return(TLSv1_method());
+       else if (ver == TLS1_1_VERSION)
+               return(TLSv1_1_method());
+       else if (ver == TLS1_2_VERSION)
+               return(TLSv1_2_method());
+       else
+#endif
                return(NULL);
        }
 
-SSL_METHOD *SSLv23_method()
-       {
-       static int init=1;
-       static SSL_METHOD SSLv23_data;
-
-       if (init)
-               {
-               init=0;
-               memcpy((char *)&SSLv23_data,(char *)sslv23_base_method(),
-                       sizeof(SSL_METHOD));
-               SSLv23_data.ssl_connect=ssl23_connect;
-               SSLv23_data.ssl_accept=ssl23_accept;
-               SSLv23_data.get_ssl_method=ssl23_get_method;
-               }
-       return(&SSLv23_data);
-       }
+IMPLEMENT_ssl23_meth_func(SSLv23_method,
+                       ssl23_accept,
+                       ssl23_connect,
+                       ssl23_get_method)