#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:
ljacqu
2015-12-20 23:43:54 +01:00
parent f809d91c45
commit 1f11537b85
42 changed files with 291 additions and 83 deletions
@@ -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,