Skip to content

Commit

Permalink
LeaseSet keys
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Dec 13, 2013
1 parent e832734 commit 7f08f78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions RouterContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ namespace i2p
if (!Load ())
CreateNewRouter ();
Save ();

// we generate LeaseSet at every start-up
CryptoPP::DH dh (i2p::crypto::elgp, i2p::crypto::elgg);
dh.GenerateKeyPair(m_Rnd, m_LeaseSetPrivateKey, m_LeaseSetPublicKey);
}

const uint8_t * RouterContext::GetSigningPrivateKey () const
Expand Down
5 changes: 4 additions & 1 deletion RouterContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace i2p
i2p::data::RouterInfo& GetRouterInfo () { return m_RouterInfo; };
const uint8_t * GetPrivateKey () const { return m_PrivateKey; };
const uint8_t * GetSigningPrivateKey () const;
const uint8_t * GetLeaseSetPrivateKey () const { return m_LeaseSetPrivateKey; };
const uint8_t * GetLeaseSetPublicKey () const { return m_LeaseSetPublicKey; };
const i2p::data::RouterIdentity& GetRouterIdentity () const { return m_RouterInfo.GetRouterIdentity (); };
CryptoPP::RandomNumberGenerator& GetRandomNumberGenerator () { return m_Rnd; };

Expand All @@ -37,7 +39,8 @@ namespace i2p

i2p::data::RouterInfo m_RouterInfo;
CryptoPP::DSA::PrivateKey m_SigningPrivateKey;
uint8_t m_PrivateKey[256], m_SigningPrivateKeyStr[20];
uint8_t m_PrivateKey[256], m_SigningPrivateKeyStr[20],
m_LeaseSetPublicKey[256], m_LeaseSetPrivateKey[256];
CryptoPP::AutoSeededRandomPool m_Rnd;
};

Expand Down

0 comments on commit 7f08f78

Please sign in to comment.