From 4de55d9efa3393073a53c54b0ab7339b990217f0 Mon Sep 17 00:00:00 2001 From: Xephi Date: Sat, 14 Jun 2014 02:59:44 +0200 Subject: [PATCH] Fix CrazyCrypt1 need player real case --- src/main/java/fr/xephi/authme/api/API.java | 2 +- .../java/fr/xephi/authme/commands/ChangePasswordCommand.java | 2 +- src/main/java/fr/xephi/authme/commands/UnregisterCommand.java | 2 +- .../java/fr/xephi/authme/process/login/AsyncronousLogin.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/xephi/authme/api/API.java b/src/main/java/fr/xephi/authme/api/API.java index f37b4d90e..ee3d88e11 100644 --- a/src/main/java/fr/xephi/authme/api/API.java +++ b/src/main/java/fr/xephi/authme/api/API.java @@ -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; } diff --git a/src/main/java/fr/xephi/authme/commands/ChangePasswordCommand.java b/src/main/java/fr/xephi/authme/commands/ChangePasswordCommand.java index d5f380c33..28dee6fcc 100644 --- a/src/main/java/fr/xephi/authme/commands/ChangePasswordCommand.java +++ b/src/main/java/fr/xephi/authme/commands/ChangePasswordCommand.java @@ -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) diff --git a/src/main/java/fr/xephi/authme/commands/UnregisterCommand.java b/src/main/java/fr/xephi/authme/commands/UnregisterCommand.java index bf8e831f5..39dc9e2b0 100644 --- a/src/main/java/fr/xephi/authme/commands/UnregisterCommand.java +++ b/src/main/java/fr/xephi/authme/commands/UnregisterCommand.java @@ -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; diff --git a/src/main/java/fr/xephi/authme/process/login/AsyncronousLogin.java b/src/main/java/fr/xephi/authme/process/login/AsyncronousLogin.java index 278cee3f3..d3b9f6915 100644 --- a/src/main/java/fr/xephi/authme/process/login/AsyncronousLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/AsyncronousLogin.java @@ -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");