]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Too much reduced computed space to build handshake packets
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 2 Jul 2021 15:20:04 +0000 (17:20 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
Before this patch we reserved 16 bytes (QUIC_TLS_TAG_LEN) before building the
handshake packet to be sure to be able to add the tag which comes with the
the packet encryption, decreasing the end offset of the building buffer by 16 bytes.
But this tag length was taken into an account when calling qc_build_frms() which
computes and build crypto frames for the remaining available room thanks to <*len>
parameter which is the length of the already present bytes in the building buffer
before adding CRYPTO frames. This leaded us to waste the 16 last bytes of the buffer
which were not used.

src/xprt_quic.c

index 783772a9bb47bad50ffba97a5122276d4127f1ff..1fe3cc15130b02228119689642966b42f04ca2d0 100644 (file)
@@ -3662,8 +3662,6 @@ static ssize_t qc_do_build_hdshk_pkt(struct q_buf *wbuf,
                goto err;
        }
 
-       /* Reserve enough room at the end of the packet for the AEAD TAG. */
-       end -= QUIC_TLS_TAG_LEN;
        largest_acked_pn = qel->pktns->tx.largest_acked_pn;
        /* packet number length */
        *pn_len = quic_packet_number_length(pn, largest_acked_pn);