mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-16 20:31:47 +02:00
separate ratchet session for ECIES router
This commit is contained in:
parent
def9873a70
commit
065cfe3b9d
4 changed files with 64 additions and 36 deletions
libi2pd
|
@ -48,6 +48,7 @@ namespace i2p
|
|||
auto initState = new i2p::crypto::NoiseSymmetricState ();
|
||||
i2p::crypto::InitNoiseNState (*initState, GetIdentity ()->GetEncryptionPublicKey ());
|
||||
m_InitialNoiseState.reset (initState);
|
||||
m_ECIESSession = std::make_shared<i2p::garlic::RouterIncomingRatchetSession>(*initState);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -739,8 +740,10 @@ namespace i2p
|
|||
return;
|
||||
}
|
||||
buf += 4;
|
||||
auto session = std::make_shared<i2p::garlic::ECIESX25519AEADRatchetSession>(this, false);
|
||||
session->HandleNextMessageForRouter (buf, len);
|
||||
if (m_ECIESSession)
|
||||
m_ECIESSession->HandleNextMessage (buf, len);
|
||||
else
|
||||
LogPrint (eLogError, "Router: Session is not set for ECIES router");
|
||||
}
|
||||
else
|
||||
i2p::garlic::GarlicDestination::ProcessGarlicMessage (msg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue