From 53b2be06d396fbeb6669d5919a0968e602338fa1 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Mon, 19 Dec 2022 17:01:37 +0100 Subject: [PATCH] DtlsMsgPoolSend: Use correct sendSz pool->sz is the size without the record header. The handshake header is present already. Reproducible with ./udp_proxy -p 12345 -s 127.0.0.1:11111 -x 1:3 -S server or ./udp_proxy -p 12345 -s 127.0.0.1:11111 -x 1:3 -S server and ./examples/server/server -l ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305 -u -i ./examples/client/client -l ECDHE-RSA-AES256-GCM-SHA384 -u -R -p 12345 -i --- src/internal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/internal.c b/src/internal.c index c58ae3a1e..8d6fd0909 100644 --- a/src/internal.c +++ b/src/internal.c @@ -8857,9 +8857,8 @@ int DtlsMsgPoolSend(WOLFSSL* ssl, int sendOnlyFirstPacket) #endif - /* add back in header space from saved pool size */ - sendSz += DTLS_HANDSHAKE_EXTRA; - sendSz += DTLS_RECORD_EXTRA; + /* add back in record header space from saved pool size */ + sendSz += DTLS_RECORD_HEADER_SZ; if ((ret = CheckAvailableSize(ssl, sendSz)) != 0) { WOLFSSL_ERROR(ret);