From fe9551636edc2127f288b5e3851dbab7319501f3 Mon Sep 17 00:00:00 2001 From: Gravit Date: Wed, 2 Jan 2019 18:54:17 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D1=83=D1=8F=D0=B7?= =?UTF-8?q?=D0=B2=D0=B8=D0=BC=D0=BE=D1=81=D1=82=D0=B8,=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B7=D0=B2=D0=BE=D0=BB=D1=8F=D1=8E=D1=89=D0=B5=D0=B9=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=BE=D0=B6=D0=B8=D1=82=D1=8C=20=D0=BB=D0=B0=D1=83?= =?UTF-8?q?=D0=BD=D1=87=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=81=D0=B0=D0=BC=D0=B8=20=D1=81=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=B2=D0=B0=D0=BB=D0=B8=D0=B4=D0=BD=D0=BE=D0=B9=20=D0=B4?= =?UTF-8?q?=D0=BB=D0=B8=D0=BD=D0=BD=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gravit/launchserver/response/update/LauncherResponse.java | 3 ++- .../java/ru/gravit/launcher/serialize/SerializeLimits.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/response/update/LauncherResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/response/update/LauncherResponse.java index 4edaadd5..e48c91ed 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/response/update/LauncherResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/response/update/LauncherResponse.java @@ -5,6 +5,7 @@ import ru.gravit.launcher.serialize.HInput; import ru.gravit.launcher.serialize.HOutput; +import ru.gravit.launcher.serialize.SerializeLimits; import ru.gravit.launcher.serialize.signed.DigestBytesHolder; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.response.Response; @@ -25,7 +26,7 @@ public void reply() throws IOException { return; } Client client = server.sessionManager.getOrNewClient(session); - byte[] digest = input.readByteArray(0); + byte[] digest = input.readByteArray(SerializeLimits.MAX_DIGEST); if (!Arrays.equals(bytes.getDigest(), digest)) { writeNoError(output); output.writeBoolean(true); diff --git a/libLauncher/src/main/java/ru/gravit/launcher/serialize/SerializeLimits.java b/libLauncher/src/main/java/ru/gravit/launcher/serialize/SerializeLimits.java index 6732670d..77c05fa1 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/serialize/SerializeLimits.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/serialize/SerializeLimits.java @@ -15,4 +15,6 @@ public class SerializeLimits { public static final int MAX_BATCH_SIZE = 128; @LauncherAPI public static final byte EXPECTED_BYTE = 0b01010101; + @LauncherAPI + public static final int MAX_DIGEST = 512; }