disappointment boob

This commit is contained in:
malloc 2018-04-19 15:30:26 -05:00
parent b62ea3ab0e
commit f1db07c234
3 changed files with 11 additions and 2 deletions

View file

@ -8,6 +8,7 @@ namespace sosc {
namespace cgc { namespace cgc {
class Cipher { class Cipher {
public: public:
Cipher() {};
Cipher(const KeyExchange& key); Cipher(const KeyExchange& key);
void Parse(std::string* data); void Parse(std::string* data);

View file

@ -3,8 +3,8 @@
sosc::BigUInt sosc::cgc::KeyExchange::secret; sosc::BigUInt sosc::cgc::KeyExchange::secret;
sosc::cgc::KeyExchange::KeyExchange() { sosc::cgc::KeyExchange::KeyExchange() {
if(KeyExchange::secret.IsZero()) if(this->secret.IsZero())
KeyExchange::secret = FastRandomPrime(); this->secret = FastRandomPrime();
this->modulus = FastRandomPrime(); this->modulus = FastRandomPrime();
} }

View file

@ -4,6 +4,8 @@
#include "../sock/intrasock.hpp" #include "../sock/intrasock.hpp"
#include "../sock/scapesock.hpp" #include "../sock/scapesock.hpp"
#include "../sock/pool.hpp" #include "../sock/pool.hpp"
#include "../crypto/keyex.hpp"
#include "../crypto/cipher.hpp"
namespace sosc { namespace sosc {
/** MASTER -> CLIENT **/ /** MASTER -> CLIENT **/
@ -13,6 +15,9 @@ public:
private: private:
ScapeConnection client; ScapeConnection client;
cgc::KeyExchange key;
cgc::Cipher cipher;
}; };
class MasterClientPool : public Pool<MasterClient> { class MasterClientPool : public Pool<MasterClient> {
@ -29,6 +34,9 @@ public:
void Close(); void Close();
private: private:
IntraClient client; IntraClient client;
cgc::KeyExchange key;
cgc::Cipher cipher;
}; };
class MasterIntraPool : public Pool<MasterIntra> { class MasterIntraPool : public Pool<MasterIntra> {