From e6b1b105d08a0dddb0b78a99ce893c918683b9c7 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 2 Dec 2020 19:05:20 +0000 Subject: [PATCH] Brrrrr --- ...0052-Speed-up-some-common-exceptions.patch | 32 +++++++++++++++++-- .../0058-Add-auth-url-option.patch | 10 +++--- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/BungeeCord-Patches/0052-Speed-up-some-common-exceptions.patch b/BungeeCord-Patches/0052-Speed-up-some-common-exceptions.patch index 75000cf..ca34537 100644 --- a/BungeeCord-Patches/0052-Speed-up-some-common-exceptions.patch +++ b/BungeeCord-Patches/0052-Speed-up-some-common-exceptions.patch @@ -1,4 +1,4 @@ -From 0512eeec0c47f8619716ff7aa0cf89684ddafb4a Mon Sep 17 00:00:00 2001 +From eebd97973aff4d2912fd7ee9ca362c1658ae8a6d Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 25 Nov 2019 19:54:06 +0000 Subject: [PATCH] Speed up some common exceptions @@ -145,6 +145,34 @@ index a2c72c9b..1a647f2b 100644 } finally { if ( slice != null ) +diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +index 3d3b2352..4b22b232 100644 +--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java ++++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +@@ -12,6 +12,8 @@ import java.util.List; + import java.util.UUID; + import java.util.logging.Level; + import javax.crypto.SecretKey; ++import javax.crypto.spec.SecretKeySpec; ++ + import lombok.Getter; + import lombok.RequiredArgsConstructor; + import net.md_5.bungee.BungeeCord; +@@ -424,6 +426,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection + Preconditions.checkState( thisState == State.ENCRYPT, "Not expecting ENCRYPT" ); + + SecretKey sharedKey = EncryptionUtil.getSecret( encryptResponse, request ); ++ // Waterfall start ++ if (sharedKey instanceof SecretKeySpec) { ++ if (sharedKey.getEncoded().length != 16) { ++ this.ch.close(); ++ return; ++ } ++ } ++ // Waterfall end + BungeeCipher decrypt = EncryptionUtil.getCipher( false, sharedKey ); + ch.addBefore( PipelineUtils.FRAME_DECODER, PipelineUtils.DECRYPT_HANDLER, new CipherDecoder( decrypt ) ); + BungeeCipher encrypt = EncryptionUtil.getCipher( true, sharedKey ); diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java index ac99d02c..0c1ecfb8 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -167,5 +195,5 @@ index ac99d02c..0c1ecfb8 100644 // Waterfall start -- -2.24.0 +2.29.2 diff --git a/BungeeCord-Patches/0058-Add-auth-url-option.patch b/BungeeCord-Patches/0058-Add-auth-url-option.patch index f1f5a91..0f0987f 100644 --- a/BungeeCord-Patches/0058-Add-auth-url-option.patch +++ b/BungeeCord-Patches/0058-Add-auth-url-option.patch @@ -1,14 +1,14 @@ -From 80b2f3785af009bef64f05e3832e833298d6cafd Mon Sep 17 00:00:00 2001 +From 277da892c1e5b98479332162adfa981d0bcb3eb2 Mon Sep 17 00:00:00 2001 From: theminecoder Date: Sun, 19 Jul 2020 10:18:23 +1000 Subject: [PATCH] Add auth url option diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java -index 3d3b2352..7e6027aa 100644 +index 4b22b232..b7ecd828 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java -@@ -70,6 +70,8 @@ import net.md_5.bungee.util.QuietException; +@@ -72,6 +72,8 @@ import net.md_5.bungee.util.QuietException; public class InitialHandler extends PacketHandler implements PendingConnection { @@ -17,7 +17,7 @@ index 3d3b2352..7e6027aa 100644 private final BungeeCord bungee; private ChannelWrapper ch; @Getter -@@ -442,7 +444,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -452,7 +454,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection String encodedHash = URLEncoder.encode( new BigInteger( sha.digest() ).toString( 16 ), "UTF-8" ); String preventProxy = ( BungeeCord.getInstance().config.isPreventProxyConnections() && getSocketAddress() instanceof InetSocketAddress ) ? "&ip=" + URLEncoder.encode( getAddress().getAddress().getHostAddress(), "UTF-8" ) : ""; @@ -27,5 +27,5 @@ index 3d3b2352..7e6027aa 100644 Callback handler = new Callback() { -- -2.28.0 +2.29.2