#358 Ensure lowercase player name, issue cleanup
- Ensure within PasswordSecurity that the player name is lowercase - Remove check for MD5VB separate salt (we only generate hashes with the salt embedded, so either we need to change that or we don't need this check) - Remove obsolete TODO
This commit is contained in:
@@ -30,8 +30,9 @@ public class PasswordSecurity {
|
||||
}
|
||||
|
||||
public EncryptedPassword computeHash(HashAlgorithm algorithm, String password, String playerName) {
|
||||
EncryptionMethod method = initializeEncryptionMethod(algorithm, playerName);
|
||||
return method.computeHash(password, playerName);
|
||||
String playerLowerCase = playerName.toLowerCase();
|
||||
EncryptionMethod method = initializeEncryptionMethod(algorithm, playerLowerCase);
|
||||
return method.computeHash(password, playerLowerCase);
|
||||
}
|
||||
|
||||
public boolean comparePassword(String password, String playerName) {
|
||||
@@ -52,8 +53,9 @@ public class PasswordSecurity {
|
||||
return false;
|
||||
}
|
||||
|
||||
return method.comparePassword(password, encryptedPassword, playerName)
|
||||
|| supportOldAlgorithm && compareWithAllEncryptionMethods(password, encryptedPassword, playerName);
|
||||
String playerLowerCase = playerName.toLowerCase();
|
||||
return method.comparePassword(password, encryptedPassword, playerLowerCase)
|
||||
|| supportOldAlgorithm && compareWithAllEncryptionMethods(password, encryptedPassword, playerLowerCase);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user