]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: ssl: move ssl_sock_ctx and fix cross-dependencies issues
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 14 May 2020 22:20:53 +0000 (00:20 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 15 May 2020 12:11:54 +0000 (14:11 +0200)
In order to move all SSL sample fetches in another file, moving the
ssl_sock_ctx definition in a .h file is required.

Unfortunately it became a cross dependencies hell to solve, because of
the struct wait_event field, so <types/connection.h> is needed which
created other problems.

include/proto/ssl_sock.h
include/types/listener.h
include/types/ssl_sock.h
src/ssl_sock.c

index a01e29ef619828a27981c6a4ccec96239277f906..32b7a335ae0a06dc03321429a68015c33667ae62 100644 (file)
@@ -28,6 +28,7 @@
 #include <types/connection.h>
 #include <types/listener.h>
 #include <types/proxy.h>
+#include <types/ssl_sock.h>
 #include <types/stream_interface.h>
 
 #include <proto/connection.h>
index 4b71ddbcb0298bfd3eb178f05007f146fb12cda5..997a597206d5a91cc2ec0ab6d5b5fef8b40682c0 100644 (file)
@@ -27,7 +27,6 @@
 
 #ifdef USE_OPENSSL
 #include <common/openssl-compat.h>
-#include <types/ssl_sock.h>
 #endif
 
 #include <common/config.h>
@@ -112,6 +111,12 @@ enum li_state {
 #define BC_SSL_O_PREF_CLIE_CIPH 0x0200  /* prefer client ciphers */
 #endif
 
+struct tls_version_filter {
+       uint16_t flags;     /* ssl options */
+       uint8_t  min;      /* min TLS version */
+       uint8_t  max;      /* max TLS version */
+};
+
 /* ssl "bind" settings */
 struct ssl_bind_conf {
 #ifdef USE_OPENSSL
index e6b092e663981896d04ef689c05b9731ed7e4668..99c964d6edd4105a986097d4d99c8a54cc38a616 100644 (file)
@@ -27,6 +27,7 @@
 #include <ebmbtree.h>
 #include <eb64tree.h>
 
+#include <types/connection.h> /* struct wait_event */
 #include <types/ssl_ckch.h>
 #include <types/ssl_crtlist.h>
 
@@ -131,12 +132,6 @@ struct sni_ctx {
        struct ebmb_node name;    /* node holding the servername value */
 };
 
-struct tls_version_filter {
-       uint16_t flags;     /* ssl options */
-       uint8_t  min;      /* min TLS version */
-       uint8_t  max;      /* max TLS version */
-};
-
 extern struct list tlskeys_reference;
 
 struct tls_sess_key_128 {
@@ -233,6 +228,20 @@ struct ssl_capture {
        char ciphersuite[0];
 };
 
+struct ssl_sock_ctx {
+       struct connection *conn;
+       SSL *ssl;
+       BIO *bio;
+       const struct xprt_ops *xprt;
+       void *xprt_ctx;
+       struct wait_event wait_event;
+       struct wait_event *subs;
+       int xprt_st;                  /* transport layer state, initialized to zero */
+       struct buffer early_buf;      /* buffer to store the early data received */
+       int sent_early_data;          /* Amount of early data we sent so far */
+
+};
+
 struct global_ssl {
        char *crt_base;             /* base directory path for certificates */
        char *ca_base;              /* base directory path for CAs and CRLs */
index e0326c03730127efad651dca15c1d424885c38be..684a419a9e0a123a464d8728c939558bd5c3eb93 100644 (file)
@@ -143,20 +143,6 @@ struct global_ssl global_ssl = {
 
 static BIO_METHOD *ha_meth;
 
-struct ssl_sock_ctx {
-       struct connection *conn;
-       SSL *ssl;
-       BIO *bio;
-       const struct xprt_ops *xprt;
-       void *xprt_ctx;
-       struct wait_event wait_event;
-       struct wait_event *subs;
-       int xprt_st;                  /* transport layer state, initialized to zero */
-       struct buffer early_buf;      /* buffer to store the early data received */
-       int sent_early_data;          /* Amount of early data we sent so far */
-
-};
-
 DECLARE_STATIC_POOL(ssl_sock_ctx_pool, "ssl_sock_ctx_pool", sizeof(struct ssl_sock_ctx));
 
 static struct task *ssl_sock_io_cb(struct task *, void *, unsigned short);