From 828ac404eb0d23c4827ddaf7aa03510f829ad6bc Mon Sep 17 00:00:00 2001 From: EinMByte Date: Sun, 30 Aug 2015 11:30:28 +0200 Subject: [PATCH] Do not include Signature.h in Identity.h. --- core/Identity.cpp | 7 +++++++ core/Identity.h | 16 ++++++++++------ core/Reseed.cpp | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/core/Identity.cpp b/core/Identity.cpp index 226e41fb..dbf959b8 100644 --- a/core/Identity.cpp +++ b/core/Identity.cpp @@ -5,6 +5,7 @@ #include #include "util/base64.h" #include "crypto/CryptoConst.h" +#include "crypto/Signature.h" #include "crypto/ElGamal.h" #include "RouterContext.h" #include "Identity.h" @@ -370,6 +371,7 @@ namespace data delete verifier; } + PrivateKeys& PrivateKeys::operator=(const Keys& keys) { m_Public = Identity (keys); @@ -391,6 +393,11 @@ namespace data CreateSigner (); return *this; } + + PrivateKeys::~PrivateKeys() + { + delete m_Signer; + } size_t PrivateKeys::FromBuffer (const uint8_t * buf, size_t len) { diff --git a/core/Identity.h b/core/Identity.h index 3388b150..d8240232 100644 --- a/core/Identity.h +++ b/core/Identity.h @@ -7,12 +7,16 @@ #include #include "util/base64.h" #include "crypto/ElGamal.h" -#include "crypto/Signature.h" -namespace i2p -{ -namespace data -{ +namespace i2p { + +// Forward declaration to avoid include +namespace crypto { + class Signer; + class Verifier; +} + +namespace data { template class Tag { @@ -183,7 +187,7 @@ namespace data PrivateKeys (const Keys& keys): m_Signer (nullptr) { *this = keys; }; PrivateKeys& operator=(const Keys& keys); PrivateKeys& operator=(const PrivateKeys& other); - ~PrivateKeys () { delete m_Signer; }; + ~PrivateKeys (); const IdentityEx& GetPublic () const { return m_Public; }; const uint8_t * GetPrivateKey () const { return m_PrivateKey; }; diff --git a/core/Reseed.cpp b/core/Reseed.cpp index 37867b30..a43f8ae1 100644 --- a/core/Reseed.cpp +++ b/core/Reseed.cpp @@ -16,6 +16,7 @@ #include "util/Log.h" #include "Identity.h" #include "crypto/CryptoConst.h" +#include "crypto/Signature.h" #include "NetworkDatabase.h" #include "util/util.h"