Re-ignore case for name, Security issues T.T

This commit is contained in:
Xephi
2015-04-21 16:21:26 +02:00
parent 605a6d88c1
commit 84cf1a6627
37 changed files with 144 additions and 169 deletions
@@ -25,6 +25,7 @@ public class AsyncronousLogin {
protected Player player;
protected String name;
protected String realName;
protected String password;
protected boolean forceLogin;
private AuthMe plugin;
@@ -36,7 +37,8 @@ public class AsyncronousLogin {
AuthMe plugin, DataSource data) {
this.player = player;
this.password = password;
name = player.getName();
name = player.getName().toLowerCase();
realName = player.getName();
this.forceLogin = forceLogin;
this.plugin = plugin;
this.database = data;
@@ -124,7 +126,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");
@@ -40,7 +40,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
this.database = data;
this.pm = plugin.getServer().getPluginManager();
this.player = player;
this.name = player.getName();
this.name = player.getName().toLowerCase();
this.limbo = LimboCache.getInstance().getLimboPlayer(name);
this.auth = database.getAuth(name);
this.playerCache = new FileCache(plugin);
@@ -29,7 +29,7 @@ public class AsyncronousRegister {
AuthMe plugin, DataSource data) {
this.player = player;
this.password = password;
name = player.getName();
name = player.getName().toLowerCase();
this.email = email;
this.plugin = plugin;
this.database = data;
@@ -57,10 +57,10 @@ public class AsyncronousRegister {
allowRegister = false;
}
if (database.isAuthAvailable(player.getName())) {
if (database.isAuthAvailable(name)) {
m._(player, "user_regged");
if (plugin.pllog.getStringList("players").contains(player.getName())) {
plugin.pllog.getStringList("players").remove(player.getName());
if (plugin.pllog.getStringList("players").contains(name)) {
plugin.pllog.getStringList("players").remove(name);
}
allowRegister = false;
}
@@ -22,7 +22,7 @@ public class ProcessSyncronousEmailRegister implements Runnable {
public ProcessSyncronousEmailRegister(Player player, AuthMe plugin) {
this.player = player;
this.name = player.getName();
this.name = player.getName().toLowerCase();
this.plugin = plugin;
}
@@ -31,7 +31,7 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
public ProcessSyncronousPasswordRegister(Player player, AuthMe plugin) {
this.player = player;
this.name = player.getName();
this.name = player.getName().toLowerCase();
this.plugin = plugin;
}