BUG/MINOR: quic: adjust restriction for stateless reset emission

Review RFC 9000 and ensure restriction on Stateless reset are properly
enforced. After careful examination, several changes are introduced.

First, redefine minimal Stateless Reset emitted packet length to 21
bytes (5 random bytes + a token). This is the new default length used in
every case, unless received packet which triggered it is 43 bytes or
smaller.

Ensure every Stateless Reset packets emitted are at 1 byte shorter than
the received packet which triggered it. No Stateless reset will be
emitted if this falls under the above limit of 21 bytes. Thus this
should prevent looping issues.

This should be backported up to 2.6.

(cherry picked from commit 5764bc50b5453628b02a951d7ad5f3463b95d709)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
(cherry picked from commit efda35bd987bbada2c854d02bc9b8a357435e8ce)
 [ad: code moved from quic_rx.c/quic_tx.c to quic_conn.c]
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
2 files changed