#364 Add more tests for encryption algorithms
- Rename getHash() to computeHash(): get.. suggests it's just retrieving some field but it's really doing a computation, which is quite complex depending on the hash algorithm
This commit is contained in:
@@ -90,7 +90,7 @@ public class PasswordSecurity {
|
||||
userSalt.put(playerName, salt);
|
||||
break;
|
||||
case SMF:
|
||||
return method.getHash(password, null, playerName);
|
||||
return method.computeHash(password, null, playerName);
|
||||
case PHPBB:
|
||||
salt = createSalt(16);
|
||||
userSalt.put(playerName, salt);
|
||||
@@ -123,7 +123,7 @@ public class PasswordSecurity {
|
||||
method = event.getMethod();
|
||||
if (method == null)
|
||||
throw new NoSuchAlgorithmException("Unknown hash algorithm");
|
||||
return method.getHash(password, salt, playerName);
|
||||
return method.computeHash(password, salt, playerName);
|
||||
}
|
||||
|
||||
public static boolean comparePasswordWithHash(String password, String hash,
|
||||
|
||||
Reference in New Issue
Block a user