summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Lécaille <flecaille@haproxy.com>2021-11-18 13:54:43 +0100
committerFrédéric Lécaille <flecaille@haproxy.com>2021-11-19 14:37:35 +0100
commitea78ee1adbedc1e13ce2433c3fcb04b877c3e281 (patch)
treeeaef113fe185e24ec73335750ecdca49f0cec8e1
parentf366cb7bf654d0d7972cb0541d5c50d92abd4764 (diff)
downloadhaproxy-ea78ee1adbedc1e13ce2433c3fcb04b877c3e281.tar.gz
MINOR: quic: Wrong value for version negotiation packet 'Unused' field
The seven less significant bits of the first byte must be arbitrary. Without this fix, QUIC tracker "version_negotiation" test could not pass.
-rw-r--r--src/xprt_quic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 86c7ff84e..6b4563051 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -3551,8 +3551,10 @@ static int qc_send_version_negotiation(int fd, struct sockaddr_storage *addr,
* header form
* long header, fixed bit to 0 for Version Negotiation
*/
- buf[i++] = '\x80';
+ if (RAND_bytes((unsigned char *)buf, 1) != 1)
+ return 1;
+ buf[i++] |= '\x80';
/* null version for Version Negotiation */
buf[i++] = '\x00';
buf[i++] = '\x00';