Browse Source

Do not include Signature.h in Identity.h.

pull/263/head
EinMByte 9 years ago
parent
commit
828ac404eb
  1. 7
      core/Identity.cpp
  2. 16
      core/Identity.h
  3. 1
      core/Reseed.cpp

7
core/Identity.cpp

@ -5,6 +5,7 @@
#include <cryptopp/dsa.h> #include <cryptopp/dsa.h>
#include "util/base64.h" #include "util/base64.h"
#include "crypto/CryptoConst.h" #include "crypto/CryptoConst.h"
#include "crypto/Signature.h"
#include "crypto/ElGamal.h" #include "crypto/ElGamal.h"
#include "RouterContext.h" #include "RouterContext.h"
#include "Identity.h" #include "Identity.h"
@ -370,6 +371,7 @@ namespace data
delete verifier; delete verifier;
} }
PrivateKeys& PrivateKeys::operator=(const Keys& keys) PrivateKeys& PrivateKeys::operator=(const Keys& keys)
{ {
m_Public = Identity (keys); m_Public = Identity (keys);
@ -392,6 +394,11 @@ namespace data
return *this; return *this;
} }
PrivateKeys::~PrivateKeys()
{
delete m_Signer;
}
size_t PrivateKeys::FromBuffer (const uint8_t * buf, size_t len) size_t PrivateKeys::FromBuffer (const uint8_t * buf, size_t len)
{ {
size_t ret = m_Public.FromBuffer (buf, len); size_t ret = m_Public.FromBuffer (buf, len);

16
core/Identity.h

@ -7,12 +7,16 @@
#include <memory> #include <memory>
#include "util/base64.h" #include "util/base64.h"
#include "crypto/ElGamal.h" #include "crypto/ElGamal.h"
#include "crypto/Signature.h"
namespace i2p namespace i2p {
{
namespace data // Forward declaration to avoid include
{ namespace crypto {
class Signer;
class Verifier;
}
namespace data {
template<int sz> template<int sz>
class Tag class Tag
{ {
@ -183,7 +187,7 @@ namespace data
PrivateKeys (const Keys& keys): m_Signer (nullptr) { *this = keys; }; PrivateKeys (const Keys& keys): m_Signer (nullptr) { *this = keys; };
PrivateKeys& operator=(const Keys& keys); PrivateKeys& operator=(const Keys& keys);
PrivateKeys& operator=(const PrivateKeys& other); PrivateKeys& operator=(const PrivateKeys& other);
~PrivateKeys () { delete m_Signer; }; ~PrivateKeys ();
const IdentityEx& GetPublic () const { return m_Public; }; const IdentityEx& GetPublic () const { return m_Public; };
const uint8_t * GetPrivateKey () const { return m_PrivateKey; }; const uint8_t * GetPrivateKey () const { return m_PrivateKey; };

1
core/Reseed.cpp

@ -16,6 +16,7 @@
#include "util/Log.h" #include "util/Log.h"
#include "Identity.h" #include "Identity.h"
#include "crypto/CryptoConst.h" #include "crypto/CryptoConst.h"
#include "crypto/Signature.h"
#include "NetworkDatabase.h" #include "NetworkDatabase.h"
#include "util/util.h" #include "util/util.h"

Loading…
Cancel
Save