mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-09-28 13:12:59 -04:00
Fixed password_salt in OnlineInterfaceService
This commit is contained in:
@@ -15,7 +15,7 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import network.encryption.MD5;
|
||||
import resources.common.BCrypt;
|
||||
import resources.config.ConfigFile;
|
||||
import resources.control.Intent;
|
||||
import resources.control.Service;
|
||||
@@ -200,10 +200,9 @@ public class OnlineInterfaceService extends Service implements HttpServerCallbac
|
||||
if (set.getBoolean("banned"))
|
||||
return false;
|
||||
String psqlPass = set.getString("password");
|
||||
String psqlSalt = set.getString("password_salt");
|
||||
if (psqlPass.length() != 32 && psqlSalt.length() == 0)
|
||||
if (psqlPass.length() != 60 && !psqlPass.startsWith("$2"))
|
||||
return psqlPass.equals(password);
|
||||
password = MD5.digest(MD5.digest(psqlSalt) + MD5.digest(password));
|
||||
password = BCrypt.hashpw(BCrypt.hashpw(password, psqlPass), psqlPass);
|
||||
return psqlPass.equals(password);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user