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/s23_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/s23_srvr.c')
-rw-r--r-- | src/lib/libssl/s23_srvr.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/src/lib/libssl/s23_srvr.c b/src/lib/libssl/s23_srvr.c index 1f17c19c06..94e669ae14 100644 --- a/src/lib/libssl/s23_srvr.c +++ b/src/lib/libssl/s23_srvr.c | |||
@@ -118,6 +118,45 @@ | |||
118 | 118 | ||
119 | static const SSL_METHOD *ssl23_get_server_method(int ver); | 119 | static const SSL_METHOD *ssl23_get_server_method(int ver); |
120 | int ssl23_get_client_hello(SSL *s); | 120 | int ssl23_get_client_hello(SSL *s); |
121 | |||
122 | const SSL_METHOD SSLv23_server_method_data = { | ||
123 | .version = TLS1_2_VERSION, | ||
124 | .ssl_new = tls1_new, | ||
125 | .ssl_clear = tls1_clear, | ||
126 | .ssl_free = tls1_free, | ||
127 | .ssl_accept = ssl23_accept, | ||
128 | .ssl_connect = ssl_undefined_function, | ||
129 | .ssl_read = ssl23_read, | ||
130 | .ssl_peek = ssl23_peek, | ||
131 | .ssl_write = ssl23_write, | ||
132 | .ssl_shutdown = ssl_undefined_function, | ||
133 | .ssl_renegotiate = ssl_undefined_function, | ||
134 | .ssl_renegotiate_check = ssl_ok, | ||
135 | .ssl_get_message = ssl3_get_message, | ||
136 | .ssl_read_bytes = ssl3_read_bytes, | ||
137 | .ssl_write_bytes = ssl3_write_bytes, | ||
138 | .ssl_dispatch_alert = ssl3_dispatch_alert, | ||
139 | .ssl_ctrl = ssl3_ctrl, | ||
140 | .ssl_ctx_ctrl = ssl3_ctx_ctrl, | ||
141 | .get_cipher_by_char = ssl23_get_cipher_by_char, | ||
142 | .put_cipher_by_char = ssl23_put_cipher_by_char, | ||
143 | .ssl_pending = ssl_undefined_const_function, | ||
144 | .num_ciphers = ssl23_num_ciphers, | ||
145 | .get_cipher = ssl23_get_cipher, | ||
146 | .get_ssl_method = ssl23_get_server_method, | ||
147 | .get_timeout = ssl23_default_timeout, | ||
148 | .ssl3_enc = &ssl3_undef_enc_method, | ||
149 | .ssl_version = ssl_undefined_void_function, | ||
150 | .ssl_callback_ctrl = ssl3_callback_ctrl, | ||
151 | .ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl, | ||
152 | }; | ||
153 | |||
154 | const SSL_METHOD * | ||
155 | SSLv23_server_method(void) | ||
156 | { | ||
157 | return &SSLv23_server_method_data; | ||
158 | } | ||
159 | |||
121 | static const SSL_METHOD * | 160 | static const SSL_METHOD * |
122 | ssl23_get_server_method(int ver) | 161 | ssl23_get_server_method(int ver) |
123 | { | 162 | { |
@@ -132,9 +171,6 @@ ssl23_get_server_method(int ver) | |||
132 | return (NULL); | 171 | return (NULL); |
133 | } | 172 | } |
134 | 173 | ||
135 | IMPLEMENT_ssl23_meth_func(SSLv23_server_method, | ||
136 | ssl23_accept, ssl_undefined_function, ssl23_get_server_method) | ||
137 | |||
138 | int | 174 | int |
139 | ssl23_accept(SSL *s) | 175 | ssl23_accept(SSL *s) |
140 | { | 176 | { |