diff options
Diffstat (limited to 'source/Protocol132.h')
-rw-r--r-- | source/Protocol132.h | 23 |
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);
} ;
|