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: add SafePassword struct #46

Merged
merged 4 commits into from
Jul 26, 2022

Conversation

therustmonk
Copy link
Contributor

@therustmonk therustmonk commented Jul 18, 2022

The PR introduces a special wrapper for passphrases that guarantees the data will be erased when value dropped.

Notes:

src/password.rs Outdated
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(transparent)]
pub struct SafePassword {
password: Hidden<String>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this not be a slice so that reallocations can't happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point 👍 Done

@therustmonk therustmonk marked this pull request as ready for review July 19, 2022 06:56
stringhandler
stringhandler previously approved these changes Jul 21, 2022
@stringhandler stringhandler merged commit ae01aeb into tari-project:main Jul 26, 2022
stringhandler pushed a commit to tari-project/tari that referenced this pull request Aug 3, 2022
Description
---
This update replaces `String` types with `SafePassword` wrapper to be sure app the passwords:
- zeroized
- never printed

Related: tari-project/tari_utilities#46

Motivation and Context
---
To guarantee all the passphrases erased.

How Has This Been Tested?
---
CI
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.

2 participants