]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Move QUIC encryption level structure definition
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 12 Jun 2023 16:19:17 +0000 (18:19 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 30 Jun 2023 14:20:55 +0000 (16:20 +0200)
haproxy/quic_tls-t.h is the correct place to quic_enc_level structure
definition.

Should be backported as far as 2.6 to ease any further backport to come.

include/haproxy/quic_conn-t.h
include/haproxy/quic_tls-t.h

index b3b5607450740018669c9275c7d2363baf94ab8b..a2dd9b1e9d4d5d0f874b7d2acf09f02666834f50 100644 (file)
@@ -537,32 +537,6 @@ struct quic_cstream {
        struct qc_stream_desc *desc;
 };
 
-struct quic_enc_level {
-       enum ssl_encryption_level_t level;
-       struct quic_tls_ctx tls_ctx;
-       struct {
-               /* The packets received by the listener I/O handler
-                  with header protection removed. */
-               struct eb_root pkts;
-               /* Liste of QUIC packets with protected header. */
-               struct list pqpkts;
-       } rx;
-       struct {
-               struct {
-                       struct quic_crypto_buf **bufs;
-                       /* The number of element in use in the previous array. */
-                       size_t nb_buf;
-                       /* The total size of the CRYPTO data stored in the CRYPTO buffers. */
-                       size_t sz;
-                       /* The offset of the CRYPT0 data stream. */
-                       uint64_t offset;
-               } crypto;
-       } tx;
-       /* Crypto data stream */
-       struct quic_cstream *cstream;
-       struct quic_pktns *pktns;
-};
-
 struct quic_path {
        /* Control congestion. */
        struct quic_cc cc;
index 7ea67c43f2a54c566d10b220c5ed26d8066e5bfc..55e990184b53e036185e99b8e9a9ceb7934a060b 100644 (file)
 
 #include <openssl/evp.h>
 
+#include <import/ebtree.h>
+
+#include <haproxy/openssl-compat.h>
+
 /* It seems TLS 1.3 ciphersuites macros differ between openssl and boringssl */
 
 #if defined(OPENSSL_IS_BORINGSSL)
@@ -163,6 +167,42 @@ struct quic_tls_ctx {
        unsigned char flags;
 };
 
+struct quic_enc_level {
+       /* Encryption level, as defined by the TLS stack. */
+       enum ssl_encryption_level_t level;
+       /* TLS encryption context (AEAD only) */
+       struct quic_tls_ctx tls_ctx;
+
+       /* RX part */
+       struct {
+               /* The packets received by the listener I/O handler
+                * with header protection removed.
+                */
+               struct eb_root pkts;
+               /* List of QUIC packets with protected header. */
+               struct list pqpkts;
+       } rx;
+
+       /* TX part */
+       struct {
+               struct {
+                       /* Array of CRYPTO data buffers */
+                       struct quic_crypto_buf **bufs;
+                       /* The number of element in use in the previous array. */
+                       size_t nb_buf;
+                       /* The total size of the CRYPTO data stored in the CRYPTO buffers. */
+                       size_t sz;
+                       /* The offset of the CRYPT0 data stream. */
+                       uint64_t offset;
+               } crypto;
+       } tx;
+
+       /* Crypto data stream */
+       struct quic_cstream *cstream;
+       /* Packet number space */
+       struct quic_pktns *pktns;
+};
+
 #endif /* USE_QUIC */
 #endif /* _TYPES_QUIC_TLS_H */