update FAQ
[openssl.git] / ssl / s3_meth.c
index 1fd7a96..cdddb17 100644 (file)
@@ -60,8 +60,8 @@
 #include <openssl/objects.h>
 #include "ssl_locl.h"
 
-static SSL_METHOD *ssl3_get_method(int ver);
-static SSL_METHOD *ssl3_get_method(int ver)
+static const SSL_METHOD *ssl3_get_method(int ver);
+static const SSL_METHOD *ssl3_get_method(int ver)
        {
        if (ver == SSL3_VERSION)
                return(SSLv3_method());
@@ -69,27 +69,9 @@ static SSL_METHOD *ssl3_get_method(int ver)
                return(NULL);
        }
 
-SSL_METHOD *SSLv3_method(void)
-       {
-       static int init=1;
-       static SSL_METHOD SSLv3_data;
-
-       if (init)
-               {
-               CRYPTO_w_lock(CRYPTO_LOCK_SSL_METHOD);
-               
-               if (init)
-                       {
-                       memcpy((char *)&SSLv3_data,(char *)sslv3_base_method(),
-                               sizeof(SSL_METHOD));
-                       SSLv3_data.ssl_connect=ssl3_connect;
-                       SSLv3_data.ssl_accept=ssl3_accept;
-                       SSLv3_data.get_ssl_method=ssl3_get_method;
-                       init=0;
-                       }
+IMPLEMENT_ssl3_meth_func(SSLv3_method,
+                        ssl3_accept,
+                        ssl3_connect,
+                        ssl3_get_method)
 
-               CRYPTO_w_unlock(CRYPTO_LOCK_SSL_METHOD);
-               }
-       return(&SSLv3_data);
-       }