summaryrefslogtreecommitdiff
path: root/ssl/t1_meth.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssl/t1_meth.c')
-rw-r--r--ssl/t1_meth.c41
1 files changed, 13 insertions, 28 deletions
diff --git a/ssl/t1_meth.c b/ssl/t1_meth.c
index fcc243f782..3257636425 100644
--- a/ssl/t1_meth.c
+++ b/ssl/t1_meth.c
@@ -60,37 +60,22 @@
#include <openssl/objects.h>
#include "ssl_locl.h"
-static SSL_METHOD *tls1_get_method(int ver);
-static SSL_METHOD *tls1_get_method(int ver)
+static const SSL_METHOD *tls1_get_method(int ver)
{
+ if (ver == TLS1_1_VERSION)
+ return TLSv1_1_method();
if (ver == TLS1_VERSION)
- return(TLSv1_method());
- else
- return(NULL);
+ return TLSv1_method();
+ return NULL;
}
-SSL_METHOD *TLSv1_method(void)
- {
- static int init=1;
- static SSL_METHOD TLSv1_data;
-
- if (init)
- {
- CRYPTO_w_lock(CRYPTO_LOCK_SSL_METHOD);
-
- if (init)
- {
- memcpy((char *)&TLSv1_data,(char *)tlsv1_base_method(),
- sizeof(SSL_METHOD));
- TLSv1_data.ssl_connect=ssl3_connect;
- TLSv1_data.ssl_accept=ssl3_accept;
- TLSv1_data.get_ssl_method=tls1_get_method;
- init=0;
- }
+IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_method,
+ ssl3_accept,
+ ssl3_connect,
+ tls1_get_method)
- CRYPTO_w_unlock(CRYPTO_LOCK_SSL_METHOD);
- }
-
- return(&TLSv1_data);
- }
+IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_method,
+ ssl3_accept,
+ ssl3_connect,
+ tls1_get_method)