Always use Guard.Correct before verifying pw.
MODIFY
WalletWasabi.Gui/CommandLine/Daemon.cs
WalletWasabi.Gui/CommandLine/Daemon.cs
@@ -58,7 +58,7 @@ namespace WalletWasabi.Gui.CommandLine
}
if (PasswordHelper.IsTrimable(password, out password))
{
- Console.WriteLine(PasswordHelper.TrimmedMessage);
+ Console.WriteLine(PasswordHelper.TrimWarnMessage);
}
}
while (!PasswordHelper.TryPassword(keyManager, password, out compatibilityPassword));

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -221,7 +221,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
try
{
SetWarningMessage("");
- Password = Guard.Correct(Password);
if (!selectedCoins.Any())
{
@@ -229,6 +228,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
return;
}
+ if (PasswordHelper.TryPassword(KeyManager, Password, out string compatiblityPassword))
+ {
+ Password = compatiblityPassword;
+ SetWarningMessage(PasswordHelper.CompatibilityPasswordWarnMessage);
+ }
+
try
{
await Global.ChaumianClient.QueueCoinsToMixAsync(Password, selectedCoins.Select(c => c.Model).ToArray());

MODIFY
WalletWasabi/Helpers/PasswordHelper.cs
WalletWasabi/Helpers/PasswordHelper.cs
@@ -15,10 +15,10 @@ namespace WalletWasabi.Helpers
public const int MaxPasswordLength = 150;
public const string CompatibilityPasswordWarnMessage = "Compatibility password was used! Please consider generating a new wallet to ensure recoverability!";
public static readonly string PasswordTooLongMessage = $"Password is too long (Max {MaxPasswordLength} characters).";
- public const string TrimmedMessage = "Leading and trailing white spaces were removed!";
public const string TrimWarnMessage = "Leading and trailing white spaces will be removed!";
public static string[] GetPossiblePasswords(string originalPassword)
+
{
List<string> possiblePasswords = new List<string>()
{
@@ -109,6 +109,8 @@ namespace WalletWasabi.Helpers
public static ExtKey GetMasterExtKey(KeyManager keyManager, string password, out string compatiblityPassword)
{
+ password = Helpers.Guard.Correct(password); // Correct the password to ensure compatiblity. User will be notified about this through TogglePasswordBox.
+
Guard(password);
compatiblityPassword = null;

Always use Guard.Correct before verifying pw.