-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making sure SecretKey is zeroized on drop #671
Comments
I'm guessing this is a bug in the My guess would be it's making a copy first, then zeroizing that. I'll take a look soon. It would also be good to add a test for zeroization like you have in the description. |
So, it seems that if you instrument the
If one does not call Edit: It seems that despite only implementing A drop without a copy can be triggered in a test as
Somewhat unexpectedly, it prints
So there's some kind of a flag byte in front of the actual |
I was trying to make my newtype of
SecretKey
zeroize properly, and realized I can't even trigger zeroization forSecretKey
itself. Consider the code:k256
haszeroize
feature enabled inCargo.toml
. This still gives a non-zero output afterSecretKey
was dropped, despite there being aDrop
implementation insecret_key.rs
that callszeroize()
. Am I misunderstanding something?The text was updated successfully, but these errors were encountered: