Fix empty password
MODIFY
WalletWasabi.Tests/UnitTests/PasswordTests.cs
WalletWasabi.Tests/UnitTests/PasswordTests.cs
@@ -101,5 +101,21 @@ namespace WalletWasabi.Tests.UnitTests
Assert.True(PasswordHelper.TryPassword(keyManager, original, out string compatiblePassword));
Assert.Equal(buggy, compatiblePassword);
}
+
+ [Fact]
+ public void EmptyNullTest()
+ {
+ string emptyPw = "";
+ string nullPw = null;
+
+ var emptyPws = PasswordHelper.GetPossiblePasswords(emptyPw);
+ var nullPws = PasswordHelper.GetPossiblePasswords(nullPw);
+
+ var emptyPwRes = Assert.Single(emptyPws);
+ var nullPwRes = Assert.Single(nullPws);
+
+ Assert.Equal("", emptyPwRes);
+ Assert.Equal("", nullPwRes);
+ }
}
}

MODIFY
WalletWasabi/Helpers/PasswordHelper.cs
WalletWasabi/Helpers/PasswordHelper.cs
@@ -20,6 +20,11 @@ namespace WalletWasabi.Helpers
public static string[] GetPossiblePasswords(string originalPassword)
{
+ if (string.IsNullOrEmpty(originalPassword))
+ {
+ return new[] { "" };
+ }
+
var buggyClipboard = StringCutIssue(originalPassword);
List<string> possiblePasswords = new List<string>()

Fix empty password