diff --git a/server/src/crypto/cipher.hpp b/server/src/crypto/cipher.hpp index 99d1a81..5fedff9 100644 --- a/server/src/crypto/cipher.hpp +++ b/server/src/crypto/cipher.hpp @@ -8,6 +8,7 @@ namespace sosc { namespace cgc { class Cipher { public: + Cipher() {}; Cipher(const KeyExchange& key); void Parse(std::string* data); diff --git a/server/src/crypto/keyex.cpp b/server/src/crypto/keyex.cpp index 533d8b8..a21c442 100644 --- a/server/src/crypto/keyex.cpp +++ b/server/src/crypto/keyex.cpp @@ -3,8 +3,8 @@ sosc::BigUInt sosc::cgc::KeyExchange::secret; sosc::cgc::KeyExchange::KeyExchange() { - if(KeyExchange::secret.IsZero()) - KeyExchange::secret = FastRandomPrime(); + if(this->secret.IsZero()) + this->secret = FastRandomPrime(); this->modulus = FastRandomPrime(); } diff --git a/server/src/hosts/master.hpp b/server/src/hosts/master.hpp index 73bef52..3c15cec 100644 --- a/server/src/hosts/master.hpp +++ b/server/src/hosts/master.hpp @@ -4,6 +4,8 @@ #include "../sock/intrasock.hpp" #include "../sock/scapesock.hpp" #include "../sock/pool.hpp" +#include "../crypto/keyex.hpp" +#include "../crypto/cipher.hpp" namespace sosc { /** MASTER -> CLIENT **/ @@ -13,6 +15,9 @@ public: private: ScapeConnection client; + + cgc::KeyExchange key; + cgc::Cipher cipher; }; class MasterClientPool : public Pool { @@ -29,6 +34,9 @@ public: void Close(); private: IntraClient client; + + cgc::KeyExchange key; + cgc::Cipher cipher; }; class MasterIntraPool : public Pool {