From 0d2b8753e4416642fc3ae7d5871b1e4bcc856d35 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 11 Sep 2015 14:52:17 +0000 Subject: Put the *method* data structures and functions in the same place. We can also now nuke ssl23_get_method() since it is the same as tls1_get_method(). And the empty file can bite the dust. ok bcook@ miod@ --- src/lib/libssl/t1_meth.c | 76 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 16 deletions(-) (limited to 'src/lib/libssl/t1_meth.c') diff --git a/src/lib/libssl/t1_meth.c b/src/lib/libssl/t1_meth.c index 48341525d8..aea4c04547 100644 --- a/src/lib/libssl/t1_meth.c +++ b/src/lib/libssl/t1_meth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_meth.c,v 1.16 2015/02/06 08:30:23 jsing Exp $ */ +/* $OpenBSD: t1_meth.c,v 1.17 2015/09/11 14:52:17 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -64,6 +64,38 @@ static const SSL_METHOD *tls1_get_method(int ver); +const SSL_METHOD TLS_method_data = { + .version = TLS1_2_VERSION, + .ssl_new = tls1_new, + .ssl_clear = tls1_clear, + .ssl_free = tls1_free, + .ssl_accept = ssl23_accept, + .ssl_connect = ssl23_connect, + .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_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_method_data = { .version = TLS1_VERSION, .ssl_new = tls1_new, @@ -160,32 +192,44 @@ const SSL_METHOD TLSv1_2_method_data = { .ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl, }; +static const SSL_METHOD * +tls1_get_method(int ver) +{ + if (ver == TLS1_2_VERSION) + return (TLSv1_2_method()); + if (ver == TLS1_1_VERSION) + return (TLSv1_1_method()); + if (ver == TLS1_VERSION) + return (TLSv1_method()); + return (NULL); +} + const SSL_METHOD * -TLSv1_method(void) +SSLv23_method(void) { - return &TLSv1_method_data; + return (TLS_method()); } const SSL_METHOD * -TLSv1_1_method(void) +TLS_method(void) { - return &TLSv1_1_method_data; + return &TLS_method_data; } const SSL_METHOD * -TLSv1_2_method(void) +TLSv1_method(void) { - return &TLSv1_2_method_data; + return (&TLSv1_method_data); } -static const SSL_METHOD * -tls1_get_method(int ver) +const SSL_METHOD * +TLSv1_1_method(void) { - if (ver == TLS1_2_VERSION) - return (TLSv1_2_method()); - if (ver == TLS1_1_VERSION) - return (TLSv1_1_method()); - if (ver == TLS1_VERSION) - return (TLSv1_method()); - return (NULL); + return (&TLSv1_1_method_data); +} + +const SSL_METHOD * +TLSv1_2_method(void) +{ + return (&TLSv1_2_method_data); } -- cgit v1.2.3-55-g6feb