Skip to content

Implement ZeroizeOnDrop for buffer_ct_variable wrappers - #919

Open
00200200 wants to merge 1 commit into
RustCrypto:masterfrom
00200200:fix/zeroize-on-drop-ct-variable-wrappers
Open

00200200 wants to merge 1 commit into
RustCrypto:masterfrom
00200200:fix/zeroize-on-drop-ct-variable-wrappers

Conversation

@00200200

Copy link
Copy Markdown

Fixes #912.

digest::buffer_ct_variable! builds the public wrappers (Blake2b512, Groestl512, Kupyna512, and the other compile-time output-size types) but does not implement ZeroizeOnDrop. buffer_fixed! already does. The inner core/buffer fields do implement it when the zeroize feature is on, so the wrappers already zeroize on drop — they just do not advertise the marker trait.

This adds the same empty marker impl used by buffer_fixed!, locally, until digest emits it from the macro (same pattern as the nearby CustomizedInit impls).

Tests

  • cargo test -p blake2 --features zeroize --lib wrappers_impl_zeroize_on_drop
  • cargo test -p groestl --features zeroize --lib wrappers_impl_zeroize_on_drop
  • cargo test -p kupyna --features zeroize --lib wrappers_impl_zeroize_on_drop
  • cargo test -p blake2 --offline
  • cargo test -p blake2 --features zeroize --offline
  • cargo test -p blake2 --all-features --offline
  • cargo test -p groestl --offline
  • cargo test -p groestl --features zeroize --offline
  • cargo test -p kupyna --offline
  • cargo test -p kupyna --features zeroize --offline

Cores and MAC types already zeroize on drop, but the compile-time
output-size wrappers (Blake2b512 and the other buffer_ct_variable
types) did not implement the marker trait.

This branch has not been deployed

No deployments
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.

blake2::Blake2b512 does not implement ZeroizeOnDrop

1 participant