From 539364846a89987ac2679988653f50332cb91d26 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 30 Aug 2012 21:06:13 +0000 Subject: Implemented 1.3.2 protocol encryption using CryptoPP, up to Client Status packet (http://wiki.vg/Protocol_FAQ step 14) git-svn-id: http://mc-server.googlecode.com/svn/trunk@808 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cServer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/cServer.h') diff --git a/source/cServer.h b/source/cServer.h index a97bcbd7a..7baaa0d6a 100644 --- a/source/cServer.h +++ b/source/cServer.h @@ -12,6 +12,8 @@ #define CSERVER_H_INCLUDED #include "cSocketThreads.h" +#include "CryptoPP/rsa.h" +#include "CryptoPP/osrng.h" @@ -66,6 +68,9 @@ public: //tolua_export void RemoveClient(const cSocket * a_Socket); // Removes the socket from m_SocketThreads + CryptoPP::RSA::PrivateKey & GetPrivateKey(void) { return m_PrivateKey; } + CryptoPP::RSA::PublicKey & GetPublicKey (void) { return m_PublicKey; } + private: friend class cRoot; // so cRoot can create and destroy cServer @@ -114,10 +119,15 @@ private: int m_iServerPort; bool m_bRestarting; + + CryptoPP::RSA::PrivateKey m_PrivateKey; + CryptoPP::RSA::PublicKey m_PublicKey; cServer(); ~cServer(); + /// Loads, or generates, if missing, RSA keys for protocol encryption + void PrepareKeys(void); }; //tolua_export -- cgit v1.2.3