Bump dependencies

This commit is contained in:
games647
2022-07-02 12:38:14 +02:00
parent 339156be18
commit 7c8de84a34
9 changed files with 16 additions and 27 deletions

View File

@ -161,7 +161,7 @@
<dependency> <dependency>
<groupId>io.papermc.paper</groupId> <groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId> <artifactId>paper-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version> <version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
<!-- Use our own newer api version --> <!-- Use our own newer api version -->
<exclusions> <exclusions>
@ -211,7 +211,7 @@
<groupId>com.github.ProtocolSupport</groupId> <groupId>com.github.ProtocolSupport</groupId>
<artifactId>ProtocolSupport</artifactId> <artifactId>ProtocolSupport</artifactId>
<!--4.29.dev after commit about API improvements--> <!--4.29.dev after commit about API improvements-->
<version>3a80c661fe</version> <version>master-66b494a8dd-1</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
@ -265,7 +265,7 @@
<dependency> <dependency>
<groupId>me.clip</groupId> <groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId> <artifactId>placeholderapi</artifactId>
<version>2.11.1</version> <version>2.11.2</version>
<scope>provided</scope> <scope>provided</scope>
<optional>true</optional> <optional>true</optional>
<exclusions> <exclusions>
@ -280,7 +280,7 @@
<dependency> <dependency>
<groupId>fr.xephi</groupId> <groupId>fr.xephi</groupId>
<artifactId>authme</artifactId> <artifactId>authme</artifactId>
<version>5.4.0</version> <version>5.6.0-beta2</version>
<scope>provided</scope> <scope>provided</scope>
<optional>true</optional> <optional>true</optional>
<exclusions> <exclusions>

View File

@ -91,7 +91,6 @@ class EncryptionUtil {
* @return The RSA key pair. * @return The RSA key pair.
*/ */
public static KeyPair generateKeyPair() { public static KeyPair generateKeyPair() {
// KeyPair b()
try { try {
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_PAIR_ALGORITHM); KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_PAIR_ALGORITHM);
@ -111,7 +110,6 @@ class EncryptionUtil {
* @return an error with 4 bytes long * @return an error with 4 bytes long
*/ */
public static byte[] generateVerifyToken(RandomGenerator random) { public static byte[] generateVerifyToken(RandomGenerator random) {
// extracted from LoginListener
byte[] token = new byte[VERIFY_TOKEN_LENGTH]; byte[] token = new byte[VERIFY_TOKEN_LENGTH];
random.nextBytes(token); random.nextBytes(token);
return token; return token;
@ -126,7 +124,6 @@ class EncryptionUtil {
* @return the server id formatted as a hexadecimal string. * @return the server id formatted as a hexadecimal string.
*/ */
public static String getServerIdHashString(String serverId, SecretKey sharedSecret, PublicKey publicKey) { public static String getServerIdHashString(String serverId, SecretKey sharedSecret, PublicKey publicKey) {
// found in LoginListener
byte[] serverHash = getServerIdHash(serverId, publicKey, sharedSecret); byte[] serverHash = getServerIdHash(serverId, publicKey, sharedSecret);
return (new BigInteger(serverHash)).toString(16); return (new BigInteger(serverHash)).toString(16);
} }
@ -142,7 +139,6 @@ class EncryptionUtil {
public static SecretKey decryptSharedKey(PrivateKey privateKey, byte[] sharedKey) public static SecretKey decryptSharedKey(PrivateKey privateKey, byte[] sharedKey)
throws NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, throws NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException,
BadPaddingException, InvalidKeyException { BadPaddingException, InvalidKeyException {
// SecretKey a(PrivateKey var0, byte[] var1)
return new SecretKeySpec(decrypt(privateKey, sharedKey), "AES"); return new SecretKeySpec(decrypt(privateKey, sharedKey), "AES");
} }
@ -188,17 +184,14 @@ class EncryptionUtil {
private static byte[] decrypt(PrivateKey key, byte[] data) private static byte[] decrypt(PrivateKey key, byte[] data)
throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException,
IllegalBlockSizeException, BadPaddingException { IllegalBlockSizeException, BadPaddingException {
// b(Key var0, byte[] var1)
Cipher cipher = Cipher.getInstance(key.getAlgorithm()); Cipher cipher = Cipher.getInstance(key.getAlgorithm());
cipher.init(Cipher.DECRYPT_MODE, key); cipher.init(Cipher.DECRYPT_MODE, key);
return cipher.doFinal(data); return cipher.doFinal(data);
} }
private static byte[] getServerIdHash(String sessionId, PublicKey publicKey, SecretKey sharedSecret) { private static byte[] getServerIdHash(String sessionId, PublicKey publicKey, SecretKey sharedSecret) {
// byte[] a(String var0, PublicKey var1, SecretKey var2)
Hasher hasher = Hashing.sha1().newHasher(); Hasher hasher = Hashing.sha1().newHasher();
// inlined from byte[] a(String var0, byte[]... var1)
hasher.putBytes(sessionId.getBytes(StandardCharsets.ISO_8859_1)); hasher.putBytes(sessionId.getBytes(StandardCharsets.ISO_8859_1));
hasher.putBytes(sharedSecret.getEncoded()); hasher.putBytes(sharedSecret.getEncoded());
hasher.putBytes(publicKey.getEncoded()); hasher.putBytes(publicKey.getEncoded());

View File

@ -15,10 +15,10 @@ stripped before including it.**
## Directory structure ## Directory structure
* `valid_public_key.json`: Extracted from the actual file
* `invalid_wrong_expiration.json`: Changed the expiration date * `invalid_wrong_expiration.json`: Changed the expiration date
* `invalid_wrong_key.json`: Modified public key while keeping the RSA structure valid * `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 * `invalid_wrong_signature.json`: Changed a character in the public key signature
* `valid_public_key.json`: Extracted from actual file
## File content ## File content

View File

@ -4,7 +4,7 @@ This contains test resources for the unit tests. Files in this folder include pr
## Directory structure ## 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_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_salt.json`: Salt sent is different to the content signed by the signature (changed salt field)
* `incorrect_signature.json`: Changed signature * `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 ## File content
* `nonce`: Server generated nonce token * `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` * `signature`: Nonce and salt signed using the client key from `valid_public_key.json`

View File

@ -192,7 +192,7 @@
<dependency> <dependency>
<groupId>de.xxschrandxx.bca</groupId> <groupId>de.xxschrandxx.bca</groupId>
<artifactId>BungeeCordAuthenticator</artifactId> <artifactId>BungeeCordAuthenticator</artifactId>
<version>0.0.2</version> <version>0.0.3</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>

View File

@ -52,9 +52,6 @@
<repository> <repository>
<id>codemc-repo</id> <id>codemc-repo</id>
<url>https://repo.codemc.io/repository/maven-public/</url> <url>https://repo.codemc.io/repository/maven-public/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository> </repository>
<!-- Floodgate --> <!-- Floodgate -->
<repository> <repository>
@ -73,7 +70,7 @@
<dependency> <dependency>
<groupId>com.zaxxer</groupId> <groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId> <artifactId>HikariCP</artifactId>
<version>4.0.3</version> <version>5.0.1</version>
<exclusions> <exclusions>
<!-- HikariCP uses an old version of this API that has a typo in the service interface --> <!-- HikariCP uses an old version of this API that has a typo in the service interface -->
<!-- We will use the api provided by the jdk14 dependency --> <!-- We will use the api provided by the jdk14 dependency -->
@ -95,7 +92,7 @@
<dependency> <dependency>
<groupId>net.md-5</groupId> <groupId>net.md-5</groupId>
<artifactId>bungeecord-config</artifactId> <artifactId>bungeecord-config</artifactId>
<version>1.16-R0.4</version> <version>1.19-R0.1-20220702.004052-16</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>*</groupId> <groupId>*</groupId>

View File

@ -37,8 +37,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
public class TickingRateLimiterTest { public class TickingRateLimiterTest {
private static final long THRESHOLD_MILLI = 10;
/** /**
* Always expired * Always expired
*/ */

View File

@ -113,7 +113,7 @@
<repositories> <repositories>
<repository> <repository>
<id>velocity</id> <id>velocity</id>
<url>https://nexus.velocitypowered.com/repository/maven-public/</url> <url>https://repo.papermc.io/repository/maven-public/</url>
</repository> </repository>
</repositories> </repositories>
@ -129,7 +129,7 @@
<dependency> <dependency>
<groupId>com.velocitypowered</groupId> <groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId> <artifactId>velocity-api</artifactId>
<version>3.1.0</version> <version>3.1.1</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -137,7 +137,7 @@
<dependency> <dependency>
<groupId>org.mariadb.jdbc</groupId> <groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId> <artifactId>mariadb-java-client</artifactId>
<version>3.0.5</version> <version>3.0.6</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -118,13 +118,14 @@ public class ConnectListener {
} }
if (!plugin.getCore().getConfig().get("forwardSkin", true)) { if (!plugin.getCore().getConfig().get("forwardSkin", true)) {
event.setGameProfile(event.getGameProfile().withProperties(removeSkin(event.getGameProfile().getProperties()))); List<Property> skinFreeProp = removeSkin(event.getGameProfile().getProperties());
event.setGameProfile(event.getGameProfile().withProperties(skinFreeProp));
} }
} }
} }
private List<GameProfile.Property> removeSkin(Collection<Property> oldProperties) { private List<GameProfile.Property> removeSkin(Collection<Property> oldProperties) {
List<GameProfile.Property> newProperties = new ArrayList<>(oldProperties.size() - 1); List<GameProfile.Property> newProperties = new ArrayList<>(oldProperties.size());
for (GameProfile.Property property : oldProperties) { for (GameProfile.Property property : oldProperties) {
if (!"textures".equals(property.getName())) if (!"textures".equals(property.getName()))
newProperties.add(property); newProperties.add(property);