]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Wrong endianess for version field in Retry token
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 30 Jun 2023 12:57:30 +0000 (14:57 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Fri, 30 Jun 2023 12:57:30 +0000 (14:57 +0200)
This field must be sent in network byte order.

Must be backported as far as 2.6.

src/quic_conn.c

index 6be031717da028b4fef46969b0fb03c507f95f18..074ac8cc322e3595bbf0acccd6dfc943005fa79a 100644 (file)
@@ -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);