From 1a3d2312529a81bea836825b4cfa4eb15e8230f8 Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 21 Oct 2019 22:38:07 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BD=D0=B5?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BE=D1=81=D0=BF=D0=BE=D1=81?= =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20Mojang=20=D0=B0?= =?UTF-8?q?=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?(=D0=BF=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gravit/launchserver/auth/handler/CachedAuthHandler.java | 2 +- .../gravit/launchserver/response/auth/JoinServerResponse.java | 2 +- .../main/java/ru/gravit/launcher/client/ClientLauncher.java | 4 ++-- .../ru/gravit/launcher/request/auth/JoinServerRequest.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/CachedAuthHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/CachedAuthHandler.java index 82b598fd..6653c06b 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/CachedAuthHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/CachedAuthHandler.java @@ -24,7 +24,7 @@ public static final class Entry { public Entry(UUID uuid, String username, String accessToken, String serverID) { this.uuid = Objects.requireNonNull(uuid, "uuid"); this.username = Objects.requireNonNull(username, "username"); - this.accessToken = accessToken == null ? null : SecurityHelper.verifyToken(accessToken); + this.accessToken = accessToken == null ? null : accessToken; this.serverID = serverID == null ? null : VerifyHelper.verifyServerID(serverID); } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/response/auth/JoinServerResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/response/auth/JoinServerResponse.java index 521a908e..afc2a2e1 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/response/auth/JoinServerResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/response/auth/JoinServerResponse.java @@ -22,7 +22,7 @@ public JoinServerResponse(LaunchServer server, long session, HInput input, HOutp @Override public void reply() throws IOException { String username = VerifyHelper.verifyUsername(input.readString(SerializeLimits.MAX_LOGIN)); - String accessToken = SecurityHelper.verifyToken(input.readASCII(-SecurityHelper.TOKEN_STRING_LENGTH)); + String accessToken = input.readASCII(-SecurityHelper.TOKEN_STRING_LENGTH); String serverID = VerifyHelper.verifyServerID(input.readASCII(SerializeLimits.MAX_SERVERID)); // With minus sign if (!clientData.isAuth || clientData.type != Client.Type.USER) { requestError("Access denied"); diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java index f684ec33..9ee932eb 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -90,7 +90,7 @@ public Params(byte[] launcherDigest, Path assetDir, Path clientDir, PlayerProfil this.clientDir = clientDir; // Client params this.pp = pp; - this.accessToken = SecurityHelper.verifyToken(accessToken); + this.accessToken = accessToken; this.autoEnter = autoEnter; this.fullScreen = fullScreen; this.ram = ram; @@ -110,7 +110,7 @@ public Params(HInput input) throws Exception { pp = new PlayerProfile(input); byte[] encryptedAccessToken = input.readByteArray(SecurityHelper.CRYPTO_MAX_LENGTH); String accessTokenD = new String(SecurityHelper.decrypt(Launcher.getConfig().secretKeyClient.getBytes(), encryptedAccessToken)); - accessToken = SecurityHelper.verifyToken(accessTokenD); + accessToken = accessTokenD; autoEnter = input.readBoolean(); fullScreen = input.readBoolean(); ram = input.readVarInt(); diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/JoinServerRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/JoinServerRequest.java index 0ff36115..e621331f 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/JoinServerRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/JoinServerRequest.java @@ -24,7 +24,7 @@ public final class JoinServerRequest extends Request { public JoinServerRequest(LauncherConfig config, String username, String accessToken, String serverID) { super(config); this.username = VerifyHelper.verifyUsername(username); - this.accessToken = SecurityHelper.verifyToken(accessToken); + this.accessToken = accessToken; this.serverID = VerifyHelper.verifyServerID(serverID); }