Skip to content

Commit

Permalink
Merge pull request #20 from neo-project/master
Browse files Browse the repository at this point in the history
Fix change password (neo-project#1490)
  • Loading branch information
Qiao-Jin authored Mar 23, 2020
2 parents 33e0e26 + 6eba2ee commit 8988eda
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 8988eda

Please sign in to comment.