aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZach Brown <[email protected]>2016-03-29 23:29:14 -0500
committerZach Brown <[email protected]>2016-03-29 23:29:14 -0500
commit4c7641d1919222fdf02903bc529af1d6cbbe6146 (patch)
tree5eab539f5e21b6ef1bc1590489853f78f0b546ab
parent010c6514734b9676bcb26b36f5290e1a013873bd (diff)
downloadPaper-4c7641d1919222fdf02903bc529af1d6cbbe6146.tar.gz
Paper-4c7641d1919222fdf02903bc529af1d6cbbe6146.zip
PaperMC/Paper/GH-166
-rw-r--r--Spigot-Server-Patches/0003-mc-dev-imports.patch41
-rw-r--r--Spigot-Server-Patches/0101-PaperMC-Paper-GH-166.patch48
2 files changed, 89 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0003-mc-dev-imports.patch b/Spigot-Server-Patches/0003-mc-dev-imports.patch
index 0bae8eccb9..e9e03d6fcf 100644
--- a/Spigot-Server-Patches/0003-mc-dev-imports.patch
+++ b/Spigot-Server-Patches/0003-mc-dev-imports.patch
@@ -4074,6 +4074,47 @@ index 0000000..f75e2de
+
+ }
+}
+diff --git a/src/main/java/net/minecraft/server/PacketLoginInEncryptionBegin.java b/src/main/java/net/minecraft/server/PacketLoginInEncryptionBegin.java
+new file mode 100644
+index 0000000..1d2e855
+--- /dev/null
++++ b/src/main/java/net/minecraft/server/PacketLoginInEncryptionBegin.java
+@@ -0,0 +1,35 @@
++package net.minecraft.server;
++
++import java.io.IOException;
++import java.security.PrivateKey;
++import javax.crypto.SecretKey;
++
++public class PacketLoginInEncryptionBegin implements Packet<PacketLoginInListener> {
++
++ private byte[] a = new byte[0];
++ private byte[] b = new byte[0];
++
++ public PacketLoginInEncryptionBegin() {}
++
++ public void a(PacketDataSerializer packetdataserializer) throws IOException {
++ this.a = packetdataserializer.a();
++ this.b = packetdataserializer.a();
++ }
++
++ public void b(PacketDataSerializer packetdataserializer) throws IOException {
++ packetdataserializer.a(this.a);
++ packetdataserializer.a(this.b);
++ }
++
++ public void a(PacketLoginInListener packetlogininlistener) {
++ packetlogininlistener.a(this);
++ }
++
++ public SecretKey a(PrivateKey privatekey) {
++ return MinecraftEncryption.a(privatekey, this.a);
++ }
++
++ public byte[] b(PrivateKey privatekey) {
++ return privatekey == null ? this.b : MinecraftEncryption.b(privatekey, this.b);
++ }
++}
--
2.7.1
diff --git a/Spigot-Server-Patches/0101-PaperMC-Paper-GH-166.patch b/Spigot-Server-Patches/0101-PaperMC-Paper-GH-166.patch
new file mode 100644
index 0000000000..2a1106671b
--- /dev/null
+++ b/Spigot-Server-Patches/0101-PaperMC-Paper-GH-166.patch
@@ -0,0 +1,48 @@
+From dc74220050b2649edcd76d58e5becfe9f8280d9d Mon Sep 17 00:00:00 2001
+From: Zach Brown <[email protected]>
+Date: Tue, 29 Mar 2016 23:20:10 -0500
+Subject: [PATCH] PaperMC/Paper/GH-166
+
+
+diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
+index f426c2e..e2eb305 100644
+--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
++++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
+@@ -46,8 +46,16 @@ public class PacketDataSerializer extends ByteBuf {
+ this.writeBytes(abyte);
+ }
+
++ // Paper start
+ public byte[] a() {
+- byte[] abyte = new byte[this.e()];
++ return readByteArray(Short.MAX_VALUE);
++ }
++
++ public byte[]readByteArray(int limit) {
++ int len = this.e();
++ if (len > limit) throw new DecoderException("The received a byte array longer than allowed " + len + " > " + limit);
++ byte[] abyte = new byte[len];
++ // Paper end
+
+ this.readBytes(abyte);
+ return abyte;
+diff --git a/src/main/java/net/minecraft/server/PacketLoginInEncryptionBegin.java b/src/main/java/net/minecraft/server/PacketLoginInEncryptionBegin.java
+index 1d2e855..da9d4d8 100644
+--- a/src/main/java/net/minecraft/server/PacketLoginInEncryptionBegin.java
++++ b/src/main/java/net/minecraft/server/PacketLoginInEncryptionBegin.java
+@@ -12,8 +12,10 @@ public class PacketLoginInEncryptionBegin implements Packet<PacketLoginInListene
+ public PacketLoginInEncryptionBegin() {}
+
+ public void a(PacketDataSerializer packetdataserializer) throws IOException {
+- this.a = packetdataserializer.a();
+- this.b = packetdataserializer.a();
++ // Paper start
++ this.a = packetdataserializer.readByteArray(256);
++ this.b = packetdataserializer.readByteArray(256);
++ // Paper end
+ }
+
+ public void b(PacketDataSerializer packetdataserializer) throws IOException {
+--
+2.7.4
+