Repository navigation
zeroize: replace derived Debug with opaque impl for Zeroizing - #1497
Merged
Merged
Conversation
tarcieri
approved these changes
Jun 13, 2026
Merged
tarcieri
added a commit
that referenced
this pull request
Oct 6, 2026
## Changed - Replace `Zeroizing`'s derived `Debug` with opaque impl (#1497) ## Removed - Internal use of `optimization_barrier` (#1535) ## Fixed - Avoid double-zeroizing `Vec`'s initialized elements (#1525) - False positive failures in proxy allocator test (#1538) - Potential uninitialized memory read in fallback code used by `optimization_barrier` (#1551)
Slurp9187
added a commit
to Slurp9187/secure-gate
that referenced
this pull request
Oct 29, 2026
zeroize 1.9.1 replaced Zeroizing's derived Debug with an opaque
`Zeroizing { .. }` (RustCrypto/utils#1497); 1.9.0 and earlier printed the
wrapped value. The test that pinned the old printing behavior
(encoded_secret_into_zeroizing_carries_the_content) failed on the 1.9.1
lockfile, which is what it was there to catch.
With the requirement at "1.9.1" (>= 1.9.1, < 2) a dependent cannot
resolve a printing version, so the docs can state the opaque form without
a version caveat. EncodedSecret::into_zeroizing, the crate docs and
SECURITY.md now say: the wipe and an opaque Debug carry over, and what is
lost is the rest of EncodedSecret, since Zeroizing<String> derefs to
String. The test now pins the opaque Debug, with a positive control that
the deref still reaches the bytes.
The dev-dependency and the fuzz crate move with it. 1.9.1 declares
rust-version 1.85, inside this release's 1.87 floor. guarded-block's own
requirement moved to 1.9 separately in 98851f8.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SL2CGpoMkfiH32imMDifH8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #825
Zeroizing<Z>derivesDebugright now, which just prints the inner value. Saw this while working on a secret vault project and it was a bit surprising — the whole point of the wrapper is to protect the data.Going with @tarcieri's suggestion from the issue:
Now prints
Zeroizing { .. }. Also relaxes the bound fromZ: DebugtoZ: Zeroize + ?Sizedso it works for all wrappable types.Reference project if curious: MeissnerSeal