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 {
class Cipher {
public:
Cipher() {};
Cipher(const KeyExchange& key);
void Parse(std::string* data);

View file

@ -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();
}

View file

@ -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<MasterClient> {
@ -29,6 +34,9 @@ public:
void Close();
private:
IntraClient client;
cgc::KeyExchange key;
cgc::Cipher cipher;
};
class MasterIntraPool : public Pool<MasterIntra> {