mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
copy constructor for PrivateKeys
This commit is contained in:
parent
4fef0dd1cb
commit
4f429b3e06
3 changed files with 19 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue