Skip to content
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

feat: require secret keys to be zeroized on drop #171

Merged
merged 1 commit into from Mar 16, 2023

Conversation

AaronFeickert
Copy link
Contributor

Adds a trait bound requiring that a SecretKey zeroize on drop. Derives this trait bound for RistrettoSecretKey.

Currently, we use a macro from zeroize to zeroize a RistrettoSecretKey on drop. This works fine, but doesn't let us require this behavior as a SecretKey trait bound. Now that we have a custom curve library fork that supports an updated version of zeroize, we can take advantage of a new ZeroizeOnDrop derive macro that adds a corresponding marker trait. This PR adds the marker trait as a trait bound to SecretKey and uses the derive macro for RistrettoSecretKey. This adds an additional layer of safety to secret keys.

Closes issue #147.

@AaronFeickert
Copy link
Contributor Author

This should be tested on the main tari repository to ensure it doesn't introduce any dependency issues.

@stringhandler stringhandler merged commit a8b9479 into tari-project:main Mar 16, 2023
@AaronFeickert AaronFeickert deleted the zeroize-on-drop branch March 16, 2023 15:05
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.

Enforce zeroizing on generic secret keys
2 participants