SIGN IN SIGN UP

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.
F
Frederic Lecaille committed
59ad7a7c09e1aa31b782bf9f584768b4fd1cd04b
Parent: 672010e