From: Frédéric Lécaille Date: Fri, 2 Jul 2021 15:20:04 +0000 (+0200) Subject: BUG/MINOR: quic: Too much reduced computed space to build handshake packets X-Git-Tag: v2.5-dev8~110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed9119f39e18d32f5615e2d5a850e4a96371ed8a;p=thirdparty%2Fhaproxy.git BUG/MINOR: quic: Too much reduced computed space to build handshake packets 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. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 783772a9bb..1fe3cc1513 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -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);