diff options
author | jsing <> | 2014-05-24 12:44:48 +0000 |
---|---|---|
committer | jsing <> | 2014-05-24 12:44:48 +0000 |
commit | 52c89a2661760a5549aeb55a62ea9957c3379e64 (patch) | |
tree | d69c2da4faf1b7f2a4d061a5b3cf3601197a246a /src/lib/libssl/d1_clnt.c | |
parent | 423deaf23c5a306d0f9bc96d6e1e9584d85f7c16 (diff) | |
download | openbsd-52c89a2661760a5549aeb55a62ea9957c3379e64.tar.gz openbsd-52c89a2661760a5549aeb55a62ea9957c3379e64.tar.bz2 openbsd-52c89a2661760a5549aeb55a62ea9957c3379e64.zip |
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 'src/lib/libssl/d1_clnt.c')
-rw-r--r-- | src/lib/libssl/d1_clnt.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/lib/libssl/d1_clnt.c b/src/lib/libssl/d1_clnt.c index 8967879f70..8f304a75ff 100644 --- a/src/lib/libssl/d1_clnt.c +++ b/src/lib/libssl/d1_clnt.c | |||
@@ -128,6 +128,44 @@ | |||
128 | static const SSL_METHOD *dtls1_get_client_method(int ver); | 128 | static const SSL_METHOD *dtls1_get_client_method(int ver); |
129 | static int dtls1_get_hello_verify(SSL *s); | 129 | static int dtls1_get_hello_verify(SSL *s); |
130 | 130 | ||
131 | const SSL_METHOD DTLSv1_client_method_data = { | ||
132 | .version = DTLS1_VERSION, | ||
133 | .ssl_new = dtls1_new, | ||
134 | .ssl_clear = dtls1_clear, | ||
135 | .ssl_free = dtls1_free, | ||
136 | .ssl_accept = ssl_undefined_function, | ||
137 | .ssl_connect = dtls1_connect, | ||
138 | .ssl_read = ssl3_read, | ||
139 | .ssl_peek = ssl3_peek, | ||
140 | .ssl_write = ssl3_write, | ||
141 | .ssl_shutdown = dtls1_shutdown, | ||
142 | .ssl_renegotiate = ssl3_renegotiate, | ||
143 | .ssl_renegotiate_check = ssl3_renegotiate_check, | ||
144 | .ssl_get_message = dtls1_get_message, | ||
145 | .ssl_read_bytes = dtls1_read_bytes, | ||
146 | .ssl_write_bytes = dtls1_write_app_data_bytes, | ||
147 | .ssl_dispatch_alert = dtls1_dispatch_alert, | ||
148 | .ssl_ctrl = dtls1_ctrl, | ||
149 | .ssl_ctx_ctrl = ssl3_ctx_ctrl, | ||
150 | .get_cipher_by_char = ssl3_get_cipher_by_char, | ||
151 | .put_cipher_by_char = ssl3_put_cipher_by_char, | ||
152 | .ssl_pending = ssl3_pending, | ||
153 | .num_ciphers = ssl3_num_ciphers, | ||
154 | .get_cipher = dtls1_get_cipher, | ||
155 | .get_ssl_method = dtls1_get_client_method, | ||
156 | .get_timeout = dtls1_default_timeout, | ||
157 | .ssl3_enc = &DTLSv1_enc_data, | ||
158 | .ssl_version = ssl_undefined_void_function, | ||
159 | .ssl_callback_ctrl = ssl3_callback_ctrl, | ||
160 | .ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl, | ||
161 | }; | ||
162 | |||
163 | const SSL_METHOD * | ||
164 | DTLSv1_client_method(void) | ||
165 | { | ||
166 | return &DTLSv1_client_method_data; | ||
167 | } | ||
168 | |||
131 | static const SSL_METHOD * | 169 | static const SSL_METHOD * |
132 | dtls1_get_client_method(int ver) | 170 | dtls1_get_client_method(int ver) |
133 | { | 171 | { |
@@ -136,9 +174,6 @@ dtls1_get_client_method(int ver) | |||
136 | return (NULL); | 174 | return (NULL); |
137 | } | 175 | } |
138 | 176 | ||
139 | IMPLEMENT_dtls1_meth_func(DTLSv1_client_method, | ||
140 | ssl_undefined_function, dtls1_connect, dtls1_get_client_method) | ||
141 | |||
142 | int | 177 | int |
143 | dtls1_connect(SSL *s) | 178 | dtls1_connect(SSL *s) |
144 | { | 179 | { |