mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Null check for when encryption is disabled.
This commit is contained in:
parent
90061e8d7d
commit
208be6210c
@ -1,5 +1,6 @@
|
||||
package com.eu.habbo.messages.incoming.handshake;
|
||||
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.crypto.HabboRC4;
|
||||
import com.eu.habbo.messages.NoAuthMessage;
|
||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||
@ -13,6 +14,11 @@ public class CompleteDiffieHandshakeEvent extends MessageHandler {
|
||||
|
||||
@Override
|
||||
public void handle() throws Exception {
|
||||
if (this.client.getEncryption() == null) {
|
||||
Emulator.getGameServer().getGameClientManager().disposeClient(this.client);
|
||||
return;
|
||||
}
|
||||
|
||||
byte[] sharedKey = this.client.getEncryption().getDiffie().getSharedKey(this.packet.readString());
|
||||
|
||||
this.client.sendResponse(new CompleteDiffieHandshakeComposer(this.client.getEncryption().getDiffie().getPublicKey()));
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.eu.habbo.messages.incoming.handshake;
|
||||
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.messages.NoAuthMessage;
|
||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||
import com.eu.habbo.messages.outgoing.handshake.InitDiffieHandshakeComposer;
|
||||
@ -9,6 +10,11 @@ public class InitDiffieHandshakeEvent extends MessageHandler {
|
||||
|
||||
@Override
|
||||
public void handle() throws Exception {
|
||||
if (this.client.getEncryption() == null) {
|
||||
Emulator.getGameServer().getGameClientManager().disposeClient(this.client);
|
||||
return;
|
||||
}
|
||||
|
||||
this.client.sendResponse(new InitDiffieHandshakeComposer(
|
||||
this.client.getEncryption().getDiffie().getSignedPrime(),
|
||||
this.client.getEncryption().getDiffie().getSignedGenerator()));
|
||||
|
Loading…
Reference in New Issue
Block a user