Fix CrazyCrypt1 need player real case

This commit is contained in:
Xephi 2014-06-14 02:59:44 +02:00
parent 8db9c69ed0
commit 4de55d9efa
4 changed files with 4 additions and 4 deletions

View File

@ -126,7 +126,7 @@ public class API {
String player = playerName.toLowerCase();
PlayerAuth auth = database.getAuth(player);
try {
return PasswordSecurity.comparePasswordWithHash(passwordToCheck, auth.getHash(), player);
return PasswordSecurity.comparePasswordWithHash(passwordToCheck, auth.getHash(), playerName);
} catch (NoSuchAlgorithmException e) {
return false;
}

View File

@ -56,7 +56,7 @@ public class ChangePasswordCommand implements CommandExecutor {
try {
String hashnew = PasswordSecurity.getHash(Settings.getPasswordHash, args[1], name);
if (PasswordSecurity.comparePasswordWithHash(args[0], PlayerCache.getInstance().getAuth(name).getHash(), name)) {
if (PasswordSecurity.comparePasswordWithHash(args[0], PlayerCache.getInstance().getAuth(name).getHash(), player.getName())) {
PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
auth.setHash(hashnew);
if (PasswordSecurity.userSalt.containsKey(name) && PasswordSecurity.userSalt.get(name) != null)

View File

@ -64,7 +64,7 @@ public class UnregisterCommand implements CommandExecutor {
return true;
}
try {
if (PasswordSecurity.comparePasswordWithHash(args[0], PlayerCache.getInstance().getAuth(name).getHash(), name)) {
if (PasswordSecurity.comparePasswordWithHash(args[0], PlayerCache.getInstance().getAuth(name).getHash(), player.getName())) {
if (!database.removeAuth(name)) {
player.sendMessage("error");
return true;

View File

@ -122,7 +122,7 @@ public class AsyncronousLogin {
boolean passwordVerified = true;
if (!forceLogin)
try {
passwordVerified = PasswordSecurity.comparePasswordWithHash(password, hash, name);
passwordVerified = PasswordSecurity.comparePasswordWithHash(password, hash, realName);
} catch (Exception ex) {
ConsoleLogger.showError(ex.getMessage());
m._(player, "error");