diff --git a/bukkit/pom.xml b/bukkit/pom.xml index c1f63ba1..28c585a0 100644 --- a/bukkit/pom.xml +++ b/bukkit/pom.xml @@ -161,7 +161,7 @@ io.papermc.paper paper-api - 1.18-R0.1-SNAPSHOT + 1.19-R0.1-SNAPSHOT provided @@ -211,7 +211,7 @@ com.github.ProtocolSupport ProtocolSupport - 3a80c661fe + master-66b494a8dd-1 provided @@ -265,7 +265,7 @@ me.clip placeholderapi - 2.11.1 + 2.11.2 provided true @@ -280,7 +280,7 @@ fr.xephi authme - 5.4.0 + 5.6.0-beta2 provided true diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/EncryptionUtil.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/EncryptionUtil.java index 179cc45f..53189ea8 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/EncryptionUtil.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/EncryptionUtil.java @@ -91,7 +91,6 @@ class EncryptionUtil { * @return The RSA key pair. */ public static KeyPair generateKeyPair() { - // KeyPair b() try { KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_PAIR_ALGORITHM); @@ -111,7 +110,6 @@ class EncryptionUtil { * @return an error with 4 bytes long */ public static byte[] generateVerifyToken(RandomGenerator random) { - // extracted from LoginListener byte[] token = new byte[VERIFY_TOKEN_LENGTH]; random.nextBytes(token); return token; @@ -126,7 +124,6 @@ class EncryptionUtil { * @return the server id formatted as a hexadecimal string. */ public static String getServerIdHashString(String serverId, SecretKey sharedSecret, PublicKey publicKey) { - // found in LoginListener byte[] serverHash = getServerIdHash(serverId, publicKey, sharedSecret); return (new BigInteger(serverHash)).toString(16); } @@ -142,7 +139,6 @@ class EncryptionUtil { public static SecretKey decryptSharedKey(PrivateKey privateKey, byte[] sharedKey) throws NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException { - // SecretKey a(PrivateKey var0, byte[] var1) return new SecretKeySpec(decrypt(privateKey, sharedKey), "AES"); } @@ -188,17 +184,14 @@ class EncryptionUtil { private static byte[] decrypt(PrivateKey key, byte[] data) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException { - // b(Key var0, byte[] var1) Cipher cipher = Cipher.getInstance(key.getAlgorithm()); cipher.init(Cipher.DECRYPT_MODE, key); return cipher.doFinal(data); } private static byte[] getServerIdHash(String sessionId, PublicKey publicKey, SecretKey sharedSecret) { - // byte[] a(String var0, PublicKey var1, SecretKey var2) Hasher hasher = Hashing.sha1().newHasher(); - // inlined from byte[] a(String var0, byte[]... var1) hasher.putBytes(sessionId.getBytes(StandardCharsets.ISO_8859_1)); hasher.putBytes(sharedSecret.getEncoded()); hasher.putBytes(publicKey.getEncoded()); diff --git a/bukkit/src/test/resources/client_keys/README.md b/bukkit/src/test/resources/client_keys/README.md index dd119ad5..78882233 100644 --- a/bukkit/src/test/resources/client_keys/README.md +++ b/bukkit/src/test/resources/client_keys/README.md @@ -15,10 +15,10 @@ stripped before including it.** ## Directory structure +* `valid_public_key.json`: Extracted from the actual file * `invalid_wrong_expiration.json`: Changed the expiration date * `invalid_wrong_key.json`: Modified public key while keeping the RSA structure valid * `invalid_wrong_signature.json`: Changed a character in the public key signature -* `valid_public_key.json`: Extracted from actual file ## File content diff --git a/bukkit/src/test/resources/signature/README.md b/bukkit/src/test/resources/signature/README.md index cc603bcc..401142fa 100644 --- a/bukkit/src/test/resources/signature/README.md +++ b/bukkit/src/test/resources/signature/README.md @@ -4,7 +4,7 @@ This contains test resources for the unit tests. Files in this folder include pr ## Directory structure -* `valid_signature.json`: Extracted using packet extract from actual authentication +* `valid_signature.json`: Extracted using packet extract from an actual authentication * `incorrect_nonce.json`: Different nonce token simulating that the server expected a different token than signed * `incorrect_salt.json`: Salt sent is different to the content signed by the signature (changed salt field) * `incorrect_signature.json`: Changed signature @@ -12,5 +12,5 @@ This contains test resources for the unit tests. Files in this folder include pr ## File content * `nonce`: Server generated nonce token -* `salt`: Client generated random token +* `salt`: Client generated random token that will be signed * `signature`: Nonce and salt signed using the client key from `valid_public_key.json` diff --git a/bungee/pom.xml b/bungee/pom.xml index 4de703cf..07c50764 100644 --- a/bungee/pom.xml +++ b/bungee/pom.xml @@ -192,7 +192,7 @@ de.xxschrandxx.bca BungeeCordAuthenticator - 0.0.2 + 0.0.3 provided diff --git a/core/pom.xml b/core/pom.xml index 119ea35c..8cd8469c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -52,9 +52,6 @@ codemc-repo https://repo.codemc.io/repository/maven-public/ - - false - @@ -73,7 +70,7 @@ com.zaxxer HikariCP - 4.0.3 + 5.0.1 @@ -95,7 +92,7 @@ net.md-5 bungeecord-config - 1.16-R0.4 + 1.19-R0.1-20220702.004052-16 * diff --git a/core/src/test/java/com/github/games647/fastlogin/core/TickingRateLimiterTest.java b/core/src/test/java/com/github/games647/fastlogin/core/TickingRateLimiterTest.java index 34f196aa..cedb61b5 100644 --- a/core/src/test/java/com/github/games647/fastlogin/core/TickingRateLimiterTest.java +++ b/core/src/test/java/com/github/games647/fastlogin/core/TickingRateLimiterTest.java @@ -37,8 +37,6 @@ import static org.hamcrest.MatcherAssert.assertThat; public class TickingRateLimiterTest { - private static final long THRESHOLD_MILLI = 10; - /** * Always expired */ diff --git a/velocity/pom.xml b/velocity/pom.xml index a6cd8016..4eb541c6 100644 --- a/velocity/pom.xml +++ b/velocity/pom.xml @@ -113,7 +113,7 @@ velocity - https://nexus.velocitypowered.com/repository/maven-public/ + https://repo.papermc.io/repository/maven-public/ @@ -129,7 +129,7 @@ com.velocitypowered velocity-api - 3.1.0 + 3.1.1 provided @@ -137,7 +137,7 @@ org.mariadb.jdbc mariadb-java-client - 3.0.5 + 3.0.6 diff --git a/velocity/src/main/java/com/github/games647/fastlogin/velocity/listener/ConnectListener.java b/velocity/src/main/java/com/github/games647/fastlogin/velocity/listener/ConnectListener.java index 902fb039..d0dcfd17 100644 --- a/velocity/src/main/java/com/github/games647/fastlogin/velocity/listener/ConnectListener.java +++ b/velocity/src/main/java/com/github/games647/fastlogin/velocity/listener/ConnectListener.java @@ -118,13 +118,14 @@ public class ConnectListener { } if (!plugin.getCore().getConfig().get("forwardSkin", true)) { - event.setGameProfile(event.getGameProfile().withProperties(removeSkin(event.getGameProfile().getProperties()))); + List skinFreeProp = removeSkin(event.getGameProfile().getProperties()); + event.setGameProfile(event.getGameProfile().withProperties(skinFreeProp)); } } } private List removeSkin(Collection oldProperties) { - List newProperties = new ArrayList<>(oldProperties.size() - 1); + List newProperties = new ArrayList<>(oldProperties.size()); for (GameProfile.Property property : oldProperties) { if (!"textures".equals(property.getName())) newProperties.add(property);