mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
copy constructor for PrivateKeys
This commit is contained in:
@@ -334,6 +334,7 @@ namespace stream
|
||||
StreamingDestination::StreamingDestination (): m_LeaseSet (nullptr)
|
||||
{
|
||||
m_Keys = i2p::data::CreateRandomKeys ();
|
||||
|
||||
m_IdentHash = m_Keys.pub.Hash ();
|
||||
m_SigningPrivateKey.Initialize (i2p::crypto::dsap, i2p::crypto::dsaq, i2p::crypto::dsag,
|
||||
CryptoPP::Integer (m_Keys.signingPrivateKey, 20));
|
||||
@@ -349,6 +350,10 @@ namespace stream
|
||||
s.read ((char *)&m_Keys, sizeof (m_Keys));
|
||||
else
|
||||
LogPrint ("Can't open file ", fullPath);
|
||||
|
||||
m_IdentHash = m_Keys.pub.Hash ();
|
||||
m_SigningPrivateKey.Initialize (i2p::crypto::dsap, i2p::crypto::dsaq, i2p::crypto::dsag,
|
||||
CryptoPP::Integer (m_Keys.signingPrivateKey, 20));
|
||||
CryptoPP::DH dh (i2p::crypto::elgp, i2p::crypto::elgg);
|
||||
dh.GenerateKeyPair(i2p::context.GetRandomNumberGenerator (), m_EncryptionPrivateKey, m_EncryptionPublicKey);
|
||||
m_Pool = i2p::tunnel::tunnels.CreateTunnelPool (*this);
|
||||
|
||||
Reference in New Issue
Block a user