]> git.kaiwu.me - haproxy.git/commit
MINOR: quic: protect the ChaCha20 header protection context from being freed
authorFrederic Lecaille <flecaille@haproxy.com>
Tue, 1 Sep 2026 07:52:01 +0000 (09:52 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Wed, 2 Sep 2026 13:32:32 +0000 (15:32 +0200)
commit59ad7a7c09e1aa31b782bf9f584768b4fd1cd04b
treec90fd51f93a126fc7cd3383454bb154d28898bde
parent672010ec2fcb643efcc9d0445190fdabb6e98e04
MINOR: quic: protect the ChaCha20 header protection context from being freed

quic_tls_secrets_keys_free() calls EVP_CIPHER_CTX_free() on <hp_ctx> without
checking it against EVP_CIPHER_CTX_CHACHA20. With AWS-LC this member may hold
this value, which points to a static object and not to an allocated context.
quic_tls_ctx_secs_free() already guards against it.

This cannot happen today, as the only caller runs before the contexts are
created. Add the same guard, and reset <hp_ctx> and <ctx> so that calling this
function twice is harmless.

Should be backported as far as 2.6 to ease any future bug fix backport.
include/haproxy/quic_tls.h