mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Force encryption to be used when it is enabled.
Not doing this check would make it possible to skip encryption when it is enabled.
This commit is contained in:
parent
208be6210c
commit
57f66a1514
@ -24,6 +24,7 @@ public class GameClient {
|
||||
private final HabboEncryption encryption;
|
||||
|
||||
private Habbo habbo;
|
||||
private boolean handshakeFinished;
|
||||
private String machineId = "";
|
||||
|
||||
public final ConcurrentHashMap<Integer, Integer> incomingPacketCounter = new ConcurrentHashMap<>(25);
|
||||
@ -56,6 +57,14 @@ public class GameClient {
|
||||
this.habbo = habbo;
|
||||
}
|
||||
|
||||
public boolean isHandshakeFinished() {
|
||||
return handshakeFinished;
|
||||
}
|
||||
|
||||
public void setHandshakeFinished(boolean handshakeFinished) {
|
||||
this.handshakeFinished = handshakeFinished;
|
||||
}
|
||||
|
||||
public String getMachineId() {
|
||||
return this.machineId;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ public class CompleteDiffieHandshakeEvent extends MessageHandler {
|
||||
|
||||
byte[] sharedKey = this.client.getEncryption().getDiffie().getSharedKey(this.packet.readString());
|
||||
|
||||
this.client.setHandshakeFinished(true);
|
||||
this.client.sendResponse(new CompleteDiffieHandshakeComposer(this.client.getEncryption().getDiffie().getPublicKey()));
|
||||
|
||||
this.client.getChannel().attr(GameServerAttributes.CRYPTO_CLIENT).set(new HabboRC4(sharedKey));
|
||||
|
@ -51,6 +51,11 @@ public class SecureLoginEvent extends MessageHandler {
|
||||
if (!Emulator.isReady)
|
||||
return;
|
||||
|
||||
if (Emulator.getCrypto().isEnabled() && !this.client.isHandshakeFinished()) {
|
||||
Emulator.getGameServer().getGameClientManager().disposeClient(this.client);
|
||||
return;
|
||||
}
|
||||
|
||||
String sso = this.packet.readString().replace(" ", "");
|
||||
|
||||
if (Emulator.getPluginManager().fireEvent(new SSOAuthenticationEvent(sso)).isCancelled()) {
|
||||
|
Loading…
Reference in New Issue
Block a user