Summary
hmac::Hmac<H> (via the Mac trait) copies key material into internal state via new_from_slice(). When the Mac value is dropped after finalize(), the key copy persists in memory because neither Key<H> nor the HMAC internal state implements Zeroize or ZeroizeOnDrop.
Impact
Applications using HMAC for authentication (e.g. JWT signing) cannot zeroize the key material held inside the Mac state after use. The key copy is typically stack-local and short-lived, but for defense-in-depth this should be zeroizable.
CWE Reference
CWE-244 (Improper Clearing of Heap Data Before Release)
Suggestion
Add Zeroize and/or ZeroizeOnDrop implementations (possibly behind a zeroize feature flag, consistent with how other RustCrypto crates handle this) to the HMAC state types.
Version
Observed on hmac 0.12.1.