Fix decoding of unsigned messages on 1.19.1 (#814)

This commit is contained in:
JNNGL
2022-08-04 02:20:25 +11:00
committed by GitHub
parent 8344082b1a
commit 62bd58d356

View File

@@ -99,7 +99,8 @@ public class PlayerChat implements MinecraftPacket {
salt = Longs.toByteArray(saltLong); salt = Longs.toByteArray(saltLong);
signature = signatureBytes; signature = signatureBytes;
expiry = Instant.ofEpochMilli(expiresAt); expiry = Instant.ofEpochMilli(expiresAt);
} else if (saltLong == 0L && signatureBytes.length == 0) { } else if ((protocolVersion.compareTo(ProtocolVersion.MINECRAFT_1_19_1) >= 0
|| saltLong == 0L) && signatureBytes.length == 0) {
unsigned = true; unsigned = true;
} else { } else {
throw EncryptionUtils.INVALID_SIGNATURE; throw EncryptionUtils.INVALID_SIGNATURE;