From 52c89a2661760a5549aeb55a62ea9957c3379e64 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 24 May 2014 12:44:48 +0000 Subject: DeIMPLEMENT libssl. Expand the IMPLEMENT_* macros since it is far more readable and one less layer of abstraction. Use C99 initialisers for clarity, grepability and to protect from future field reordering/removal. ok miod@ (tedu@ also thought it was a wonderful idea, beck@ also agreed, but ran away squealing since it reminded him of the VOP layer...) --- src/lib/libssl/d1_srvr.c | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'src/lib/libssl/d1_srvr.c') diff --git a/src/lib/libssl/d1_srvr.c b/src/lib/libssl/d1_srvr.c index 6183815a6d..2c22a25bce 100644 --- a/src/lib/libssl/d1_srvr.c +++ b/src/lib/libssl/d1_srvr.c @@ -129,6 +129,44 @@ static const SSL_METHOD *dtls1_get_server_method(int ver); static int dtls1_send_hello_verify_request(SSL *s); +const SSL_METHOD DTLSv1_server_method_data = { + .version = DTLS1_VERSION, + .ssl_new = dtls1_new, + .ssl_clear = dtls1_clear, + .ssl_free = dtls1_free, + .ssl_accept = dtls1_accept, + .ssl_connect = ssl_undefined_function, + .ssl_read = ssl3_read, + .ssl_peek = ssl3_peek, + .ssl_write = ssl3_write, + .ssl_shutdown = dtls1_shutdown, + .ssl_renegotiate = ssl3_renegotiate, + .ssl_renegotiate_check = ssl3_renegotiate_check, + .ssl_get_message = dtls1_get_message, + .ssl_read_bytes = dtls1_read_bytes, + .ssl_write_bytes = dtls1_write_app_data_bytes, + .ssl_dispatch_alert = dtls1_dispatch_alert, + .ssl_ctrl = dtls1_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 = ssl3_pending, + .num_ciphers = ssl3_num_ciphers, + .get_cipher = dtls1_get_cipher, + .get_ssl_method = dtls1_get_server_method, + .get_timeout = dtls1_default_timeout, + .ssl3_enc = &DTLSv1_enc_data, + .ssl_version = ssl_undefined_void_function, + .ssl_callback_ctrl = ssl3_callback_ctrl, + .ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl, +}; + +const SSL_METHOD * +DTLSv1_server_method(void) +{ + return &DTLSv1_server_method_data; +} + static const SSL_METHOD * dtls1_get_server_method(int ver) { @@ -137,9 +175,6 @@ dtls1_get_server_method(int ver) return (NULL); } -IMPLEMENT_dtls1_meth_func(DTLSv1_server_method, - dtls1_accept, ssl_undefined_function, dtls1_get_server_method) - int dtls1_accept(SSL *s) { -- cgit v1.2.3-55-g6feb