#358 Remove old methods on PasswordSecurity, unify hash + salt
- For encryption methods with a separate salt, the hash is useless without the salt, so hash and salt should always be persisted and retrieved together
This commit is contained in:
@@ -34,7 +34,7 @@ public class ChangePasswordTask implements Runnable {
|
||||
|
||||
final String name = player.getName().toLowerCase();
|
||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
|
||||
if (passwordSecurity.comparePassword(oldPassword, auth.getHash(), player.getName())) {
|
||||
if (passwordSecurity.comparePassword(oldPassword, auth.getHash(), auth.getSalt(), player.getName())) {
|
||||
HashResult hashResult = passwordSecurity.computeHash(newPassword, name);
|
||||
auth.setHash(hashResult.getHash());
|
||||
auth.setSalt(hashResult.getSalt());
|
||||
|
||||
Reference in New Issue
Block a user