mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-09-19 06:24:16 +02:00
28 lines
1.2 KiB
Java
28 lines
1.2 KiB
Java
|
package com.eu.habbo.messages.incoming.handshake;
|
||
|
|
||
|
import com.eu.habbo.crypto.HabboRC4;
|
||
|
import com.eu.habbo.messages.NoAuthMessage;
|
||
|
import com.eu.habbo.messages.incoming.MessageHandler;
|
||
|
import com.eu.habbo.messages.outgoing.handshake.CompleteDiffieHandshakeComposer;
|
||
|
import com.eu.habbo.networking.gameserver.GameByteDecryption;
|
||
|
import com.eu.habbo.networking.gameserver.GameByteEncryption;
|
||
|
import com.eu.habbo.networking.gameserver.GameServerAttributes;
|
||
|
|
||
|
@NoAuthMessage
|
||
|
public class CompleteDiffieHandshakeEvent extends MessageHandler {
|
||
|
|
||
|
@Override
|
||
|
public void handle() throws Exception {
|
||
|
byte[] sharedKey = this.client.getEncryption().getDiffie().getSharedKey(this.packet.readString());
|
||
|
|
||
|
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_SERVER).set(new HabboRC4(sharedKey));
|
||
|
|
||
|
this.client.getChannel().pipeline().addFirst(new GameByteDecryption());
|
||
|
this.client.getChannel().pipeline().addFirst(new GameByteEncryption());
|
||
|
}
|
||
|
|
||
|
}
|