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; }