From 7bfa4ebdabd238b924ed32ce984e12a62c00cab6 Mon Sep 17 00:00:00 2001 From: Gravita Date: Wed, 30 Mar 2022 16:39:48 +0700 Subject: [PATCH] [FIX] Bad login (MySQL + HWID) --- .../launchserver/auth/protect/AdvancedProtectHandler.java | 4 ++-- .../events/request/VerifySecureLevelKeyRequestEvent.java | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java index 86410ced..e65e25cd 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java @@ -93,17 +93,17 @@ public VerifySecureLevelKeyRequestEvent onSuccessVerify(Client client) { } client.trustLevel.hardwareInfo = hardware.getHardwareInfo(); authSupportHardware.connectUserAndHardware(client.sessionObject, hardware); + return new VerifySecureLevelKeyRequestEvent(false, false, createPublicKeyToken(client.username, client.trustLevel.publicKey), createHardwareToken(client.username, client.trustLevel.hardwareInfo)); } else { logger.warn("AuthCoreProvider not supported hardware. HardwareInfo not checked!"); } - return new VerifySecureLevelKeyRequestEvent(false, false, createPublicKeyToken(client.username, client.trustLevel.publicKey)); } return new VerifySecureLevelKeyRequestEvent(false, false, createPublicKeyToken(client.username, client.trustLevel.publicKey)); } @Override public boolean onJoinServer(String serverID, String username, Client client) { - return !enableHardwareFeature || (client.trustLevel != null && client.trustLevel.publicKey != null); + return !enableHardwareFeature || (client.trustLevel != null && client.trustLevel.hardwareInfo != null); } @Override diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java index ff7085e5..0c40dccd 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java @@ -6,6 +6,7 @@ public class VerifySecureLevelKeyRequestEvent extends RequestEvent { public boolean needHardwareInfo; public boolean onlyStatisticInfo; public String extendedToken; + public String hardwareExtendedToken; public VerifySecureLevelKeyRequestEvent() { } @@ -20,6 +21,13 @@ public VerifySecureLevelKeyRequestEvent(boolean needHardwareInfo, boolean onlySt this.extendedToken = extendedToken; } + public VerifySecureLevelKeyRequestEvent(boolean needHardwareInfo, boolean onlyStatisticInfo, String extendedToken, String hardwareExtendedToken) { + this.needHardwareInfo = needHardwareInfo; + this.onlyStatisticInfo = onlyStatisticInfo; + this.extendedToken = extendedToken; + this.hardwareExtendedToken = hardwareExtendedToken; + } + @Override public String getType() { return "verifySecureLevelKey";