From 0c90e94e85a521afd56ac83eb47b111675c827d2 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 26 Jan 2021 19:50:43 -0500 Subject: [PATCH] fix --- .../proxy/connection/client/LoginSessionHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java index 2874ba137..f342cc15e 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java @@ -36,6 +36,7 @@ import io.netty.buffer.ByteBuf; import java.net.InetSocketAddress; import java.security.GeneralSecurityException; import java.security.KeyPair; +import java.security.MessageDigest; import java.util.Arrays; import java.util.Optional; import java.util.UUID; @@ -90,7 +91,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler { try { KeyPair serverKeyPair = server.getServerKeyPair(); byte[] decryptedVerifyToken = decryptRsa(serverKeyPair, packet.getVerifyToken()); - if (!Arrays.equals(verify, decryptedVerifyToken)) { + if (!MessageDigest.isEqual(verify, decryptedVerifyToken)) { throw new IllegalStateException("Unable to successfully decrypt the verification token."); }