mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-29 04:07:49 +02:00
create DH keys for SSU session directly
This commit is contained in:
parent
614921276e
commit
acc5592f59
5 changed files with 11 additions and 23 deletions
|
@ -224,7 +224,11 @@ namespace transport
|
|||
return;
|
||||
}
|
||||
if (!m_DHKeysPair)
|
||||
m_DHKeysPair = transports.GetNextDHKeysPair ();
|
||||
{
|
||||
auto pair = std::make_shared<i2p::crypto::DHKeys> ();
|
||||
pair->GenerateKeys ();
|
||||
m_DHKeysPair = pair;
|
||||
}
|
||||
CreateAESandMacKey (buf + headerSize);
|
||||
SendSessionCreated (buf + headerSize, sendRelayTag);
|
||||
}
|
||||
|
@ -826,9 +830,9 @@ namespace transport
|
|||
{
|
||||
if (m_State == eSessionStateUnknown)
|
||||
{
|
||||
// set connect timer
|
||||
ScheduleConnectTimer ();
|
||||
m_DHKeysPair = transports.GetNextDHKeysPair ();
|
||||
ScheduleConnectTimer (); // set connect timer
|
||||
m_DHKeysPair = std::make_shared<i2p::crypto::DHKeys> ();
|
||||
m_DHKeysPair->GenerateKeys ();
|
||||
SendSessionRequest ();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue