Kick players using an invalid public key

This commit is contained in:
games647
2022-06-28 18:34:25 +02:00
parent ce59172839
commit c118430bf5
2 changed files with 5 additions and 1 deletions
@@ -179,6 +179,7 @@ public class ProtocolLibListener extends PacketAdapter {
WrappedProfileKeyData profileKey = packet.getOptionals(BukkitConverters.getWrappedPublicKeyDataConverter())
.read(0).orElse(null);
if (profileKey != null && !verifyPublicKey(profileKey)) {
player.kickPlayer(plugin.getCore().getMessage("invalid-public-key"));
plugin.getLog().warn("Invalid public key from player {}", username);
return;
}