mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
Change encryption to use CTR instead of GCM
despite MCPE claiming to use GCM, it omits the auth tag, which defeats the whole point of using GCM. CTR can be used instead, with the final 4 bytes of the IV being 0002.
This commit is contained in:
@@ -670,7 +670,7 @@ class NetworkSession{
|
||||
}
|
||||
$this->sendDataPacket(ServerToClientHandshakePacket::create($handshakeJwt), true); //make sure this gets sent before encryption is enabled
|
||||
|
||||
$this->cipher = new EncryptionContext($encryptionKey, EncryptionContext::ENCRYPTION_SCHEME);
|
||||
$this->cipher = EncryptionContext::fakeGCM($encryptionKey);
|
||||
|
||||
$this->setHandler(new HandshakePacketHandler(function() : void{
|
||||
$this->onServerLoginSuccess();
|
||||
|
Reference in New Issue
Block a user