Skip to content

Scrub header-protection key material on drop - #23

Merged
lann merged 1 commit into
mainfrom
hp-key-zeroize
Aug 6, 2026
Merged

Scrub header-protection key material on drop#23
lann merged 1 commit into
mainfrom
hp-key-zeroize

Conversation

@lann

@lann lann commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

`ChaChaHeaderProtectionKey` stored its raw 32-byte key as a plain `[u8; 32]` with no zeroization on drop; the AES header-protection key's expanded schedule (`aes::Aes128`) and the transient `chacha20` cipher states built per mask call dropped unscrubbed too. The ChaCha key now rides `zeroize::Zeroizing`, and the `aes`/`chacha20` dependencies enable their `zeroize` features — matching the webcrypto core's practice for key schedules. `zeroize` was already in the lock; the workspace gains the direct edge.

Verified locally: quinn lib tests (Appendix A vectors + the masking guard test), fmt, clippy all-features.

Fixes #22

ChaChaHeaderProtectionKey held its raw 32-byte key as a plain array
that survived its drop; the AES twin's expanded schedule and the
transient per-mask chacha20 cipher states likewise dropped unscrubbed.
The ChaCha key now rides zeroize::Zeroizing, and the aes and chacha20
dependencies enable their zeroize features, so the schedule and cipher
states scrub themselves. zeroize was already in the lock.
@lann
lann enabled auto-merge August 6, 2026 10:57
@lann
lann merged commit 760ddca into main Aug 6, 2026
3 checks passed
@lann
lann deleted the hp-key-zeroize branch August 6, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quinn: ChaCha20 header-protection key held as a plain array — scrub HP key material on drop

1 participant