From ed9119f39e18d32f5615e2d5a850e4a96371ed8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Fri, 2 Jul 2021 17:20:04 +0200 Subject: [PATCH] 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. --- src/xprt_quic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 783772a9b..1fe3cc151 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);