mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-07-09 19:53:54 +02:00
prevent the 'static initialization order fiasco' for crypto constants
This commit is contained in:
parent
170da1c903
commit
fbaf09ff2b
10 changed files with 58 additions and 35 deletions
|
@ -19,7 +19,7 @@ namespace i2p
|
|||
void RouterContext::CreateNewRouter ()
|
||||
{
|
||||
m_Keys = i2p::data::CreateRandomKeys ();
|
||||
m_SigningPrivateKey.Initialize (i2p::crypto::dsap, i2p::crypto::dsaq, i2p::crypto::dsag,
|
||||
m_SigningPrivateKey.Initialize (i2p::crypto::dsap(), i2p::crypto::dsaq(), i2p::crypto::dsag(),
|
||||
CryptoPP::Integer (m_Keys.signingPrivateKey, 20));
|
||||
UpdateRouterInfo ();
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ namespace i2p
|
|||
if (!fk.is_open ()) return false;
|
||||
|
||||
fk.read ((char *)&m_Keys, sizeof (m_Keys));
|
||||
m_SigningPrivateKey.Initialize (i2p::crypto::dsap, i2p::crypto::dsaq, i2p::crypto::dsag,
|
||||
m_SigningPrivateKey.Initialize (i2p::crypto::dsap(), i2p::crypto::dsaq(), i2p::crypto::dsag(),
|
||||
CryptoPP::Integer (m_Keys.signingPrivateKey, 20));
|
||||
|
||||
m_RouterInfo = i2p::data::RouterInfo (i2p::util::filesystem::GetFullPath (ROUTER_INFO).c_str ()); // TODO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue