summaryrefslogtreecommitdiffstats
path: root/source/Protocol132.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-30 23:06:13 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-30 23:06:13 +0200
commit539364846a89987ac2679988653f50332cb91d26 (patch)
treef1695473c1f493a19c5fbdb70f7f1faccf99d7f3 /source/Protocol132.h
parentUpdated to V6 - "Stop" and "Progress report" functionality (diff)
downloadcuberite-539364846a89987ac2679988653f50332cb91d26.tar
cuberite-539364846a89987ac2679988653f50332cb91d26.tar.gz
cuberite-539364846a89987ac2679988653f50332cb91d26.tar.bz2
cuberite-539364846a89987ac2679988653f50332cb91d26.tar.lz
cuberite-539364846a89987ac2679988653f50332cb91d26.tar.xz
cuberite-539364846a89987ac2679988653f50332cb91d26.tar.zst
cuberite-539364846a89987ac2679988653f50332cb91d26.zip
Diffstat (limited to '')
-rw-r--r--source/Protocol132.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/Protocol132.h b/source/Protocol132.h
index af3e78ecc..a0e16b585 100644
--- a/source/Protocol132.h
+++ b/source/Protocol132.h
@@ -10,6 +10,8 @@
#pragma once
#include "Protocol125.h"
+#include "CryptoPP/modes.h"
+#include "CryptoPP/aes.h"
@@ -26,8 +28,29 @@ public:
/// Called when client sends some data:
virtual void DataReceived(const char * a_Data, int a_Size) override;
+ /// Handling of the additional packets:
+ virtual int ParsePacket(unsigned char a_PacketType) override;
+
// Modified packets:
virtual int ParseHandshake(void) override;
+ virtual int ParseLogin (void) override;
+
+ // New packets:
+ virtual int ParseClientStatuses (void);
+ virtual int ParseEncryptionKeyResponse(void);
+
+ virtual void SendData(const char * a_Data, int a_Size);
+
+protected:
+ bool m_IsEncrypted;
+ CryptoPP::CFB_Mode<CryptoPP::AES>::Decryption m_Decryptor; // ((byte*)sDecryptedSharedSecret.c_str(),(unsigned int)16, IV, 1);
+ CryptoPP::CFB_Mode<CryptoPP::AES>::Encryption m_Encryptor;
+
+ /// Decrypts the key and nonce, checks nonce, starts the symmetric encryption
+ void HandleEncryptionKeyResponse(const AString & a_EncKey, const AString & a_EncNonce);
+
+ /// Starts the symmetric encryption with the specified key
+ void StartEncryption(const byte * a_Key);
} ;