Skip to content

Commit

Permalink
fixed remote pub key being set to null in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
shanet committed Feb 18, 2013
1 parent d67ae52 commit 8ae7762
Showing 1 changed file with 13 additions and 22 deletions.
35 changes: 13 additions & 22 deletions src/crypto/Crypto.cpp
Expand Up @@ -27,36 +27,27 @@ Crypto::Crypto() {


Crypto::Crypto(unsigned char *remotePubKey, size_t remotePubKeyLen) {
localKeypair = NULL;
remotePubKey = NULL;
rsaSymKey = NULL;
rsaSymKeyLen = 0;
rsaIV = NULL;
encryptLen = 0;

#ifdef PSUEDO_CLIENT
genTestClientKey(DEFAULT_RSA_KEYLEN);
#endif
localKeypair = NULL;
this->remotePubKey = NULL;
rsaSymKey = NULL;
rsaSymKeyLen = 0;
rsaIV = NULL;
encryptLen = 0;

setRemotePubKey(remotePubKey, remotePubKeyLen);
init(DEFAULT_RSA_KEYLEN, DEFAULT_AES_KEYLEN);
}


Crypto::Crypto(unsigned char *remotePubKey, size_t remotePubKeyLen, size_t rsaKeyLen, size_t aesKeyLen) {
localKeypair = NULL;
remotePubKey = NULL;
rsaSymKey = NULL;
rsaSymKeyLen = 0;
rsaIV = NULL;
encryptLen = 0;

#ifdef PSUEDO_CLIENT
genTestClientKey(DEFAULT_RSA_KEYLEN);
#else
setRemotePubKey(remotePubKey, remotePubKeyLen);
#endif
localKeypair = NULL;
this->remotePubKey = NULL;
rsaSymKey = NULL;
rsaSymKeyLen = 0;
rsaIV = NULL;
encryptLen = 0;

setRemotePubKey(remotePubKey, remotePubKeyLen);
init(rsaKeyLen, aesKeyLen);
}

Expand Down

0 comments on commit 8ae7762

Please sign in to comment.