mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-31 12:22:36 +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 final HabboEncryption encryption;
|
||||||
|
|
||||||
private Habbo habbo;
|
private Habbo habbo;
|
||||||
|
private boolean handshakeFinished;
|
||||||
private String machineId = "";
|
private String machineId = "";
|
||||||
|
|
||||||
public final ConcurrentHashMap<Integer, Integer> incomingPacketCounter = new ConcurrentHashMap<>(25);
|
public final ConcurrentHashMap<Integer, Integer> incomingPacketCounter = new ConcurrentHashMap<>(25);
|
||||||
@ -56,6 +57,14 @@ public class GameClient {
|
|||||||
this.habbo = habbo;
|
this.habbo = habbo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isHandshakeFinished() {
|
||||||
|
return handshakeFinished;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHandshakeFinished(boolean handshakeFinished) {
|
||||||
|
this.handshakeFinished = handshakeFinished;
|
||||||
|
}
|
||||||
|
|
||||||
public String getMachineId() {
|
public String getMachineId() {
|
||||||
return this.machineId;
|
return this.machineId;
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ public class CompleteDiffieHandshakeEvent extends MessageHandler {
|
|||||||
|
|
||||||
byte[] sharedKey = this.client.getEncryption().getDiffie().getSharedKey(this.packet.readString());
|
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.sendResponse(new CompleteDiffieHandshakeComposer(this.client.getEncryption().getDiffie().getPublicKey()));
|
||||||
|
|
||||||
this.client.getChannel().attr(GameServerAttributes.CRYPTO_CLIENT).set(new HabboRC4(sharedKey));
|
this.client.getChannel().attr(GameServerAttributes.CRYPTO_CLIENT).set(new HabboRC4(sharedKey));
|
||||||
|
@ -51,6 +51,11 @@ public class SecureLoginEvent extends MessageHandler {
|
|||||||
if (!Emulator.isReady)
|
if (!Emulator.isReady)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Emulator.getCrypto().isEnabled() && !this.client.isHandshakeFinished()) {
|
||||||
|
Emulator.getGameServer().getGameClientManager().disposeClient(this.client);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String sso = this.packet.readString().replace(" ", "");
|
String sso = this.packet.readString().replace(" ", "");
|
||||||
|
|
||||||
if (Emulator.getPluginManager().fireEvent(new SSOAuthenticationEvent(sso)).isCancelled()) {
|
if (Emulator.getPluginManager().fireEvent(new SSOAuthenticationEvent(sso)).isCancelled()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user