mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
moved encryption keys from TunnelPool to StreamingDestination
This commit is contained in:
parent
9f0c0b3b35
commit
c600be59b1
6 changed files with 16 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
|||
#include <fstream>
|
||||
#include <algorithm>
|
||||
#include <cryptopp/dh.h>
|
||||
#include <cryptopp/gzip.h>
|
||||
#include "Log.h"
|
||||
#include "RouterInfo.h"
|
||||
|
@ -347,6 +348,8 @@ namespace stream
|
|||
m_IdentHash = i2p::data::CalculateIdentHash (m_Keys.pub);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -357,6 +360,8 @@ namespace stream
|
|||
s.read ((char *)&m_Keys, sizeof (m_Keys));
|
||||
else
|
||||
LogPrint ("Can't open file ", fullPath);
|
||||
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