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_srvr.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_srvr.c')
-rw-r--r-- | src/lib/libssl/d1_srvr.c | 41 |
1 files changed, 38 insertions, 3 deletions
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 @@ | |||
129 | static const SSL_METHOD *dtls1_get_server_method(int ver); | 129 | static const SSL_METHOD *dtls1_get_server_method(int ver); |
130 | static int dtls1_send_hello_verify_request(SSL *s); | 130 | static int dtls1_send_hello_verify_request(SSL *s); |
131 | 131 | ||
132 | const SSL_METHOD DTLSv1_server_method_data = { | ||
133 | .version = DTLS1_VERSION, | ||
134 | .ssl_new = dtls1_new, | ||
135 | .ssl_clear = dtls1_clear, | ||
136 | .ssl_free = dtls1_free, | ||
137 | .ssl_accept = dtls1_accept, | ||
138 | .ssl_connect = ssl_undefined_function, | ||
139 | .ssl_read = ssl3_read, | ||
140 | .ssl_peek = ssl3_peek, | ||
141 | .ssl_write = ssl3_write, | ||
142 | .ssl_shutdown = dtls1_shutdown, | ||
143 | .ssl_renegotiate = ssl3_renegotiate, | ||
144 | .ssl_renegotiate_check = ssl3_renegotiate_check, | ||
145 | .ssl_get_message = dtls1_get_message, | ||
146 | .ssl_read_bytes = dtls1_read_bytes, | ||
147 | .ssl_write_bytes = dtls1_write_app_data_bytes, | ||
148 | .ssl_dispatch_alert = dtls1_dispatch_alert, | ||
149 | .ssl_ctrl = dtls1_ctrl, | ||
150 | .ssl_ctx_ctrl = ssl3_ctx_ctrl, | ||
151 | .get_cipher_by_char = ssl3_get_cipher_by_char, | ||
152 | .put_cipher_by_char = ssl3_put_cipher_by_char, | ||
153 | .ssl_pending = ssl3_pending, | ||
154 | .num_ciphers = ssl3_num_ciphers, | ||
155 | .get_cipher = dtls1_get_cipher, | ||
156 | .get_ssl_method = dtls1_get_server_method, | ||
157 | .get_timeout = dtls1_default_timeout, | ||
158 | .ssl3_enc = &DTLSv1_enc_data, | ||
159 | .ssl_version = ssl_undefined_void_function, | ||
160 | .ssl_callback_ctrl = ssl3_callback_ctrl, | ||
161 | .ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl, | ||
162 | }; | ||
163 | |||
164 | const SSL_METHOD * | ||
165 | DTLSv1_server_method(void) | ||
166 | { | ||
167 | return &DTLSv1_server_method_data; | ||
168 | } | ||
169 | |||
132 | static const SSL_METHOD * | 170 | static const SSL_METHOD * |
133 | dtls1_get_server_method(int ver) | 171 | dtls1_get_server_method(int ver) |
134 | { | 172 | { |
@@ -137,9 +175,6 @@ dtls1_get_server_method(int ver) | |||
137 | return (NULL); | 175 | return (NULL); |
138 | } | 176 | } |
139 | 177 | ||
140 | IMPLEMENT_dtls1_meth_func(DTLSv1_server_method, | ||
141 | dtls1_accept, ssl_undefined_function, dtls1_get_server_method) | ||
142 | |||
143 | int | 178 | int |
144 | dtls1_accept(SSL *s) | 179 | dtls1_accept(SSL *s) |
145 | { | 180 | { |