]> git.kaiwu.me - haproxy.git/commit
MINOR: quic: implement the AEAD integrity limit
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 3 Sep 2026 13:10:47 +0000 (15:10 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 3 Sep 2026 17:44:36 +0000 (19:44 +0200)
commitf83f6c0d37dfa08e6db6802894ed22dad61e0ef6
treeb8a68f8c350aa88985f34d8e6065d6d66af67a1e
parent055f5a7f49eccec1987fd37c4bb813357d14f194
MINOR: quic: implement the AEAD integrity limit

RFC 9001 6.6 requires an endpoint to count the received packets which fail
authentication, and to close the connection with AEAD_LIMIT_REACHED once
their number exceeds the limit of the AEAD in use. This was not implemented.

Add quic_aead_integrity_limit() which returns that limit for each algorithm
tls_aead() may return, and count the failures in qc_pkt_decrypt(). This is the
only place where a packet is decrypted, whatever its encryption level, so the
count covers all the keys of the connection as the RFC asks. An unknown
algorithm gets a null limit, which closes the connection on the first failure:
QUIC must not use one.

With AES-GCM the limit is 2^52 failed packets, which at one million forged
packets per second on a single connection would take more than a century. With
ChaCha20-Poly1305 it is 2^36, about 19 hours at the same rate.

This is not a bug fix, nothing is affected in practice, so there is no hurry.
This may be backported to all the stable versions after some exposure in 3.5.
include/haproxy/quic_conn-t.h
include/haproxy/quic_tls.h
src/quic_conn.c
src/quic_rx.c