summaryrefslogtreecommitdiff
path: root/lib/libssl/s3_srvr.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2014-05-24 12:44:49 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2014-05-24 12:44:49 +0000
commitced86759028df271cd7acc93b02b06be2a86a1da (patch)
tree6fa1974c5db25c805c4109b89ed8a31dada7b2c9 /lib/libssl/s3_srvr.c
parent4cef52233be815bb5d720e26422753a82ed38990 (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/s3_srvr.c')
-rw-r--r--lib/libssl/s3_srvr.c42
1 files changed, 38 insertions, 4 deletions
diff --git a/lib/libssl/s3_srvr.c b/lib/libssl/s3_srvr.c
index ff86ec3f1a5..6f788cd0807 100644
--- a/lib/libssl/s3_srvr.c
+++ b/lib/libssl/s3_srvr.c
@@ -167,6 +167,44 @@
static const SSL_METHOD *ssl3_get_server_method(int ver);
+const SSL_METHOD SSLv3_server_method_data = {
+ .version = SSL3_VERSION,
+ .ssl_new = ssl3_new,
+ .ssl_clear = ssl3_clear,
+ .ssl_free = ssl3_free,
+ .ssl_accept = ssl3_accept,
+ .ssl_connect = ssl_undefined_function,
+ .ssl_read = ssl3_read,
+ .ssl_peek = ssl3_peek,
+ .ssl_write = ssl3_write,
+ .ssl_shutdown = ssl3_shutdown,
+ .ssl_renegotiate = ssl3_renegotiate,
+ .ssl_renegotiate_check = ssl3_renegotiate_check,
+ .ssl_get_message = ssl3_get_message,
+ .ssl_read_bytes = ssl3_read_bytes,
+ .ssl_write_bytes = ssl3_write_bytes,
+ .ssl_dispatch_alert = ssl3_dispatch_alert,
+ .ssl_ctrl = ssl3_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 = ssl3_get_cipher,
+ .get_ssl_method = ssl3_get_server_method,
+ .get_timeout = ssl3_default_timeout,
+ .ssl3_enc = &SSLv3_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 *
+SSLv3_server_method(void)
+{
+ return &SSLv3_server_method_data;
+}
+
static const SSL_METHOD *
ssl3_get_server_method(int ver)
{
@@ -175,10 +213,6 @@ ssl3_get_server_method(int ver)
return (NULL);
}
-
-IMPLEMENT_ssl3_meth_func(SSLv3_server_method,
- ssl3_accept, ssl_undefined_function, ssl3_get_server_method)
-
int
ssl3_accept(SSL *s)
{