Skip to content

Commit

Permalink
Fix change password (neo-project#1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiao-Jin committed Mar 23, 2020
1 parent d71a470 commit 6eba2ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/neo/Wallets/SQLite/UserWallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public bool ChangePassword(string password_old, string password_new)
byte[] passwordKey = password_new.ToAesKey();
try
{
SaveStoredData("PasswordHash", passwordKey.Sha256());
SaveStoredData("PasswordHash", passwordKey.Concat(salt).ToArray().Sha256());
SaveStoredData("MasterKey", masterKey.AesEncrypt(passwordKey, iv));
return true;
}
Expand Down
1 change: 1 addition & 0 deletions tests/neo.UnitTests/Wallets/SQLite/UT_UserWallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public void TestChangePassword()
{
wallet.ChangePassword("123455", "654321").Should().BeFalse();
wallet.ChangePassword("123456", "654321").Should().BeTrue();
wallet.ChangePassword("654321", "123456").Should().BeTrue();
}

[TestMethod]
Expand Down

0 comments on commit 6eba2ee

Please sign in to comment.