Create a duplicate of the SSL_CTX's CERT in SSL_new instead of copying
[openssl.git] / ssl / s23_meth.c
index edcbdbb..b52ca1d 100644 (file)
  */
 
 #include <stdio.h>
-#include "objects.h"
+#include <openssl/objects.h>
 #include "ssl_locl.h"
 
-#ifndef NOPROTO
 static SSL_METHOD *ssl23_get_method(int ver);
-#else
-static SSL_METHOD *ssl23_get_method();
-#endif
-
 static SSL_METHOD *ssl23_get_method(int ver)
        {
        if (ver == SSL2_VERSION)
@@ -85,12 +80,12 @@ SSL_METHOD *SSLv23_method(void)
 
        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;
+               init=0;
                }
        return(&SSLv23_data);
        }