]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Prepare Application level packet asap.
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 23 Aug 2021 06:54:28 +0000 (08:54 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
It is possible the TLS stack stack provides us with 1-RTT TX secrets
at the same time as Handshake secrets are provided. Thanks to this
simple patch we can build Application level packets during the handshake.

src/xprt_quic.c

index 634c553f83494345c2c7ce2f4416f11597222754..af0381acb3e85334d0fdc565811f878343b2a407 100644 (file)
@@ -2116,6 +2116,9 @@ static int qc_prep_hdshk_pkts(struct qring *qr, struct ssl_sock_ctx *ctx)
                        if ((tel == QUIC_TLS_ENC_LEVEL_INITIAL || tel == QUIC_TLS_ENC_LEVEL_HANDSHAKE) &&
                            (MT_LIST_ISEMPTY(&qel->pktns->tx.frms) ||
                             (next_tel != QUIC_TLS_ENC_LEVEL_NONE && qc->els[next_tel].pktns->tx.in_flight))) {
+                               /* If QUIC_TLS_ENC_LEVEL_HANDSHAKE was already reached let's try QUIC_TLS_ENC_LEVEL_APP */
+                               if (tel == QUIC_TLS_ENC_LEVEL_HANDSHAKE && next_tel == tel)
+                                       next_tel = QUIC_TLS_ENC_LEVEL_APP;
                                tel = next_tel;
                                qel = &qc->els[tel];
                                if (!MT_LIST_ISEMPTY(&qel->pktns->tx.frms)) {