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

Use zeroize to clear DICE secrets #4645

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

conradgrobler
Copy link
Collaborator

We were using .fill(0) to clear DICE-related secrets, but this could be optimised away by the compiler. The zeroize crate provides a more tobust mechanism for clearing secrets from memory, so switching to that.

Copy link
Collaborator

@tiziano88 tiziano88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@@ -215,7 +202,7 @@ impl ApplicationKeys {
static_assertions::assert_eq_size!([u8; 2048], ApplicationKeys);

/// ECDSA private keys that can be used for an application for signing or encryption.
#[derive(AsBytes, FromZeroes, FromBytes)]
#[derive(AsBytes, FromZeroes, FromBytes, Zeroize, ZeroizeOnDrop)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, it has zeroize on drop already, nice
Will use it for the private key in the crypto as well

@tiziano88
Copy link
Collaborator

Ref #4513

@conradgrobler conradgrobler merged commit bec8380 into project-oak:main Jan 12, 2024
17 checks passed
@conradgrobler conradgrobler deleted the zeroize branch January 12, 2024 19:27
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.

3 participants