diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2014-05-24 12:44:49 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2014-05-24 12:44:49 +0000 |
commit | ced86759028df271cd7acc93b02b06be2a86a1da (patch) | |
tree | 6fa1974c5db25c805c4109b89ed8a31dada7b2c9 /lib/libssl/d1_clnt.c | |
parent | 4cef52233be815bb5d720e26422753a82ed38990 (diff) |
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...)
Diffstat (limited to 'lib/libssl/d1_clnt.c')
-rw-r--r-- | lib/libssl/d1_clnt.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/lib/libssl/d1_clnt.c b/lib/libssl/d1_clnt.c index 8967879f70b..8f304a75ff8 100644 --- a/lib/libssl/d1_clnt.c +++ b/lib/libssl/d1_clnt.c @@ -128,6 +128,44 @@ static const SSL_METHOD *dtls1_get_client_method(int ver); static int dtls1_get_hello_verify(SSL *s); +const SSL_METHOD DTLSv1_client_method_data = { + .version = DTLS1_VERSION, + .ssl_new = dtls1_new, + .ssl_clear = dtls1_clear, + .ssl_free = dtls1_free, + .ssl_accept = ssl_undefined_function, + .ssl_connect = dtls1_connect, + .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_client_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_client_method(void) +{ + return &DTLSv1_client_method_data; +} + static const SSL_METHOD * dtls1_get_client_method(int ver) { @@ -136,9 +174,6 @@ dtls1_get_client_method(int ver) return (NULL); } -IMPLEMENT_dtls1_meth_func(DTLSv1_client_method, - ssl_undefined_function, dtls1_connect, dtls1_get_client_method) - int dtls1_connect(SSL *s) { |