]> git.kaiwu.me - haproxy.git/commit
MINOR: quic: use the same HP encryption helpers for RX and TX
authorFrederic Lecaille <flecaille@haproxy.com>
Fri, 16 Oct 2026 09:41:41 +0000 (11:41 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Fri, 16 Oct 2026 14:42:55 +0000 (16:42 +0200)
commit9a00cdaa152e68b37f3ab50687643990ef002727
tree60b39d15b8c899105eec7086741477beccadbd9a
parentcfb3d8b67a82edf71c7c034fa8adbd6f6f3b921f
MINOR: quic: use the same HP encryption helpers for RX and TX

Header protection is applied by generating a mask and XORing it with
the header. Removing it requires the same mask and the same XOR, which
restores the original header.

With AES-128-CTR, AES-256-CTR and ChaCha20, encryption and decryption
produce the same mask from the same key and packet sample. This is a
property of these algorithms, not specific to OpenSSL.

Use quic_tls_enc_hp_ctx_init() and quic_tls_hp_encrypt() for RX too,
with the RX key, and remove the redundant decryption helpers.
include/haproxy/quic_tls.h
src/quic_rx.c
src/quic_ssl.c
src/quic_tls.c