From 17eaee31c3a30153bee5785f2224d389c4159db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Fri, 30 Jun 2023 14:57:30 +0200 Subject: [PATCH] BUG/MINOR: quic: Wrong endianess for version field in Retry token This field must be sent in network byte order. Must be backported as far as 2.6. --- src/quic_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quic_conn.c b/src/quic_conn.c index 6be031717..074ac8cc3 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -6424,7 +6424,7 @@ static int quic_generate_retry_token_aad(unsigned char *aad, unsigned char *p; p = aad; - memcpy(p, &version, sizeof version); + *(uint32_t *)p = htonl(version); p += sizeof version; p += quic_saddr_cpy(p, addr); memcpy(p, cid->data, cid->len);