Skip to content

Commit

Permalink
fix: updates for SafePassword API change (#4927)
Browse files Browse the repository at this point in the history
Description
---
Minor updates for a corresponding [change](tari-project/tari_utilities#52) to the `SafePassword` API.

Motivation and Context
---
A pending change in `tari_utilities` to the handling of sensitive data includes a new implementation of `SafePassword`. One change removes derived traits for equality testing in favor of equality testing on references to the underlying passphrase data. This work makes the minor but necessary changes to address this API change.

How Has This Been Tested?
---
Tests pass after applying the linked `tari_utilities` PR. Note that tests will pass using the current `SafePassword` API as well, as the dependency change PR restricts the API.
  • Loading branch information
AaronFeickert committed Nov 16, 2022
1 parent 26aacc7 commit 92d73e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions applications/tari_console_wallet/src/init/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub async fn change_password(
let passphrase = prompt_password("New wallet password: ")?;
let confirmed = prompt_password("Confirm new password: ")?;

if passphrase != confirmed {
if passphrase.reveal() != confirmed.reveal() {
return Err(ExitError::new(ExitCode::InputError, "Passwords don't match!"));
}

Expand Down Expand Up @@ -376,7 +376,7 @@ pub async fn init_wallet(
let password = prompt_password("Create wallet password: ")?;
let confirmed = prompt_password("Confirm wallet password: ")?;

if password != confirmed {
if password.reveal() != confirmed.reveal() {
return Err(ExitError::new(ExitCode::InputError, "Passwords don't match!"));
}

Expand Down

0 comments on commit 92d73e4

Please sign in to comment.