summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2015-09-11 14:47:57 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2015-09-11 14:47:57 +0000
commit9dba3eea2e349ca9591f897975888e8ae593051a (patch)
treefbbdbdf197e5610f0c01d6b4defe8fc16f19061f
parent216e57b6bf13f26a51e3b243d991a5bf672e9009 (diff)
Put the *server_method* data structures and functions in the same place.
We can also now nuke ssl23_get_server_method() since it is the same as tls1_get_server_method(). ok miod@
-rw-r--r--lib/libssl/src/ssl/s23_srvr.c59
-rw-r--r--lib/libssl/src/ssl/t1_srvr.c76
2 files changed, 61 insertions, 74 deletions
diff --git a/lib/libssl/src/ssl/s23_srvr.c b/lib/libssl/src/ssl/s23_srvr.c
index d4ca586c2d4..d0699a55d7d 100644
--- a/lib/libssl/src/ssl/s23_srvr.c
+++ b/lib/libssl/src/ssl/s23_srvr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s23_srvr.c,v 1.43 2015/08/29 17:15:52 doug Exp $ */
+/* $OpenBSD: s23_srvr.c,v 1.44 2015/09/11 14:47:56 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -117,59 +117,8 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
-static const SSL_METHOD *ssl23_get_server_method(int ver);
int ssl23_get_client_hello(SSL *s);
-const SSL_METHOD SSLv23_server_method_data = {
- .version = TLS1_2_VERSION,
- .ssl_new = tls1_new,
- .ssl_clear = tls1_clear,
- .ssl_free = tls1_free,
- .ssl_accept = ssl23_accept,
- .ssl_connect = ssl_undefined_function,
- .ssl_read = ssl23_read,
- .ssl_peek = ssl23_peek,
- .ssl_write = ssl23_write,
- .ssl_shutdown = ssl_undefined_function,
- .ssl_renegotiate = ssl_undefined_function,
- .ssl_renegotiate_check = ssl_ok,
- .ssl_get_message = ssl3_get_message,
- .ssl_read_bytes = ssl3_read_bytes,
- .ssl_write_bytes = ssl3_write_bytes,
- .ssl_dispatch_alert = ssl3_dispatch_alert,
- .ssl_ctrl = ssl3_ctrl,
- .ssl_ctx_ctrl = ssl3_ctx_ctrl,
- .get_cipher_by_char = ssl3_get_cipher_by_char,
- .put_cipher_by_char = ssl3_put_cipher_by_char,
- .ssl_pending = ssl_undefined_const_function,
- .num_ciphers = ssl3_num_ciphers,
- .get_cipher = ssl3_get_cipher,
- .get_ssl_method = ssl23_get_server_method,
- .get_timeout = ssl23_default_timeout,
- .ssl3_enc = &ssl3_undef_enc_method,
- .ssl_version = ssl_undefined_void_function,
- .ssl_callback_ctrl = ssl3_callback_ctrl,
- .ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl,
-};
-
-const SSL_METHOD *
-SSLv23_server_method(void)
-{
- return &SSLv23_server_method_data;
-}
-
-static const SSL_METHOD *
-ssl23_get_server_method(int ver)
-{
- if (ver == TLS1_VERSION)
- return (TLSv1_server_method());
- if (ver == TLS1_1_VERSION)
- return (TLSv1_1_server_method());
- if (ver == TLS1_2_VERSION)
- return (TLSv1_2_server_method());
- return (NULL);
-}
-
int
ssl23_accept(SSL *s)
{
@@ -555,9 +504,3 @@ ssl23_get_client_hello(SSL *s)
return (SSL_accept(s));
}
-
-const SSL_METHOD *
-TLS_server_method(void)
-{
- return &SSLv23_server_method_data;
-}
diff --git a/lib/libssl/src/ssl/t1_srvr.c b/lib/libssl/src/ssl/t1_srvr.c
index 3c6ac541f8c..902cd93cd7c 100644
--- a/lib/libssl/src/ssl/t1_srvr.c
+++ b/lib/libssl/src/ssl/t1_srvr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: t1_srvr.c,v 1.18 2015/02/06 08:30:23 jsing Exp $ */
+/* $OpenBSD: t1_srvr.c,v 1.19 2015/09/11 14:47:56 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -67,6 +67,38 @@
static const SSL_METHOD *tls1_get_server_method(int ver);
+const SSL_METHOD TLS_server_method_data = {
+ .version = TLS1_2_VERSION,
+ .ssl_new = tls1_new,
+ .ssl_clear = tls1_clear,
+ .ssl_free = tls1_free,
+ .ssl_accept = ssl23_accept,
+ .ssl_connect = ssl_undefined_function,
+ .ssl_read = ssl23_read,
+ .ssl_peek = ssl23_peek,
+ .ssl_write = ssl23_write,
+ .ssl_shutdown = ssl_undefined_function,
+ .ssl_renegotiate = ssl_undefined_function,
+ .ssl_renegotiate_check = ssl_ok,
+ .ssl_get_message = ssl3_get_message,
+ .ssl_read_bytes = ssl3_read_bytes,
+ .ssl_write_bytes = ssl3_write_bytes,
+ .ssl_dispatch_alert = ssl3_dispatch_alert,
+ .ssl_ctrl = ssl3_ctrl,
+ .ssl_ctx_ctrl = ssl3_ctx_ctrl,
+ .get_cipher_by_char = ssl3_get_cipher_by_char,
+ .put_cipher_by_char = ssl3_put_cipher_by_char,
+ .ssl_pending = ssl_undefined_const_function,
+ .num_ciphers = ssl3_num_ciphers,
+ .get_cipher = ssl3_get_cipher,
+ .get_ssl_method = tls1_get_server_method,
+ .get_timeout = ssl23_default_timeout,
+ .ssl3_enc = &ssl3_undef_enc_method,
+ .ssl_version = ssl_undefined_void_function,
+ .ssl_callback_ctrl = ssl3_callback_ctrl,
+ .ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl,
+};
+
const SSL_METHOD TLSv1_server_method_data = {
.version = TLS1_VERSION,
.ssl_new = tls1_new,
@@ -163,32 +195,44 @@ const SSL_METHOD TLSv1_2_server_method_data = {
.ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl,
};
+static const SSL_METHOD *
+tls1_get_server_method(int ver)
+{
+ if (ver == TLS1_2_VERSION)
+ return (TLSv1_2_server_method());
+ if (ver == TLS1_1_VERSION)
+ return (TLSv1_1_server_method());
+ if (ver == TLS1_VERSION)
+ return (TLSv1_server_method());
+ return (NULL);
+}
+
const SSL_METHOD *
-TLSv1_server_method(void)
+SSLv23_server_method(void)
{
- return &TLSv1_server_method_data;
+ return (TLS_server_method());
}
const SSL_METHOD *
-TLSv1_1_server_method(void)
+TLS_server_method(void)
{
- return &TLSv1_1_server_method_data;
+ return (&TLS_server_method_data);
}
const SSL_METHOD *
-TLSv1_2_server_method(void)
+TLSv1_server_method(void)
{
- return &TLSv1_2_server_method_data;
+ return (&TLSv1_server_method_data);
}
-static const SSL_METHOD *
-tls1_get_server_method(int ver)
+const SSL_METHOD *
+TLSv1_1_server_method(void)
{
- if (ver == TLS1_2_VERSION)
- return (TLSv1_2_server_method());
- if (ver == TLS1_1_VERSION)
- return (TLSv1_1_server_method());
- if (ver == TLS1_VERSION)
- return (TLSv1_server_method());
- return (NULL);
+ return (&TLSv1_1_server_method_data);
+}
+
+const SSL_METHOD *
+TLSv1_2_server_method(void)
+{
+ return (&TLSv1_2_server_method_data);
}