Fix #440 Hash algo's sometimes skipped for old algorithm support
- Fix check that discards potentially trying all encryption methods if password didn't match - Wrap call to encryption method properly to avoid calling methods with hasSeparateSalt() = true and a null salt
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package fr.xephi.authme.security.crypts;
|
||||
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.security.crypts.description.Recommendation;
|
||||
import fr.xephi.authme.security.crypts.description.Usage;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
|
||||
@Recommendation(Usage.DOES_NOT_WORK)
|
||||
public class WBB4 extends HexSaltedMethod {
|
||||
@@ -13,7 +15,12 @@ public class WBB4 extends HexSaltedMethod {
|
||||
|
||||
@Override
|
||||
public boolean comparePassword(String password, HashedPassword hashedPassword, String playerName) {
|
||||
return BCRYPT.checkpw(password, hashedPassword.getHash(), 2);
|
||||
try {
|
||||
return BCRYPT.checkpw(password, hashedPassword.getHash(), 2);
|
||||
} catch (IllegalArgumentException e) {
|
||||
ConsoleLogger.showError("WBB4 compare password returned: " + StringUtils.formatException(e));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user