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 17005bf0..bb057204 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 @@ -10,7 +10,7 @@ public class AdvancedProtectHandler extends ProtectHandler implements SecureProt @Override public boolean allowGetAccessToken(AuthResponse.AuthContext context) { - return (context.authType == AuthResponse.ConnectTypes.CLIENT) && context.client.isSecure; + return (context.authType == AuthResponse.ConnectTypes.CLIENT) && context.client.checkSign; } @Override @@ -25,6 +25,6 @@ public GetSecureLevelInfoRequestEvent onGetSecureLevelInfo(GetSecureLevelInfoReq @Override public boolean allowGetSecureLevelInfo(Client client) { - return client.isSecure; + return client.checkSign; } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java index 380413e0..0a06e4e3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java @@ -8,7 +8,7 @@ public class StdProtectHandler extends ProtectHandler { @Override public boolean allowGetAccessToken(AuthResponse.AuthContext context) { - return (context.authType == AuthResponse.ConnectTypes.CLIENT) && (!checkSecure || context.client.isSecure); + return (context.authType == AuthResponse.ConnectTypes.CLIENT) && (!checkSecure || context.client.checkSign); } @Override diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ClientsCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ClientsCommand.java index 80ed2ef3..6d52c664 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ClientsCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ClientsCommand.java @@ -34,7 +34,7 @@ public void invoke(String... args) { LogHelper.info("Channel %s | connectUUID %s | checkSign %s", ip, frameHandler.getConnectUUID(), client.checkSign ? "true" : "false"); else { LogHelper.info("Client name %s | ip %s | connectUUID %s", client.username == null ? "null" : client.username, ip, frameHandler.getConnectUUID()); - LogHelper.subInfo("Data: checkSign %s | isSecure %s | auth_id %s", client.checkSign ? "true" : "false", client.isSecure ? "true" : "false", + LogHelper.subInfo("Data: checkSign %s | auth_id %s", client.checkSign ? "true" : "false", client.auth_id); LogHelper.subInfo("Permissions: %s (long %d)", client.permissions == null ? "null" : client.permissions.toString(), client.permissions == null ? 0 : client.permissions.toLong()); } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java index c3a2a323..205ac55c 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java @@ -15,10 +15,8 @@ public class Client { public ClientProfile profile; public boolean isAuth; public boolean checkSign; - public boolean isSecure; public ClientPermissions permissions; public String username; - public String verifyToken; public TrustLevel trustLevel; public transient LogHelper.OutputEnity logOutput; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java index 07af9fff..91d98be7 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java @@ -36,7 +36,6 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception { return; } Client newClient = new Client(0); - newClient.isSecure = client.isSecure; newClient.checkSign = client.checkSign; handler.setClient(newClient); if(client.session != 0) server.sessionManager.removeClient(client.session); @@ -56,7 +55,6 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception { if(chClient.session != client.session) return; } Client newCusClient = new Client(0); - newCusClient.isSecure = chClient.isSecure; newCusClient.checkSign = chClient.checkSign; wsHandler.setClient(newCusClient); if(chClient.session != 0) server.sessionManager.removeClient(chClient.session); @@ -76,7 +74,6 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception { Client chClient = wsHandler.getClient(); if(!chClient.isAuth || !username.equals(chClient.username)) return; Client newCusClient = new Client(0); - newCusClient.isSecure = chClient.isSecure; newCusClient.checkSign = chClient.checkSign; wsHandler.setClient(newCusClient); if(chClient.session != 0) server.sessionManager.removeClient(chClient.session); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/LauncherResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/LauncherResponse.java index 63f10afb..ef7bc7b1 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/LauncherResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/LauncherResponse.java @@ -36,9 +36,8 @@ public void execute(ChannelHandlerContext ctx, Client client) { byte[] hash = server.launcherBinary.getDigest(); if (hash == null) service.sendObjectAndClose(ctx, new LauncherRequestEvent(true, server.config.netty.launcherURL)); - if (Arrays.equals(bytes, hash)) { + if (Arrays.equals(bytes, hash) && checkSecure(secureHash, secureSalt)) { client.checkSign = true; - client.isSecure = checkSecure(secureHash, secureSalt); sendResult(new LauncherRequestEvent(false, server.config.netty.launcherURL)); } else { sendResultAndClose(new LauncherRequestEvent(true, server.config.netty.launcherURL)); @@ -47,9 +46,8 @@ public void execute(ChannelHandlerContext ctx, Client client) { { byte[] hash = server.launcherEXEBinary.getDigest(); if (hash == null) sendResultAndClose(new LauncherRequestEvent(true, server.config.netty.launcherEXEURL)); - if (Arrays.equals(bytes, hash)) { + if (Arrays.equals(bytes, hash) && checkSecure(secureHash, secureSalt)) { client.checkSign = true; - client.isSecure = checkSecure(secureHash, secureSalt); sendResult(new LauncherRequestEvent(false, server.config.netty.launcherEXEURL)); } else { sendResultAndClose(new LauncherRequestEvent(true, server.config.netty.launcherEXEURL));