mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
incoming ECIESX25519AEADRatchet messages hanler
This commit is contained in:
parent
a1dbec0fcb
commit
48fa10b080
3 changed files with 32 additions and 18 deletions
|
@ -864,21 +864,18 @@ namespace garlic
|
|||
this, std::placeholders::_1, std::placeholders::_2);
|
||||
uint64_t tag;
|
||||
memcpy (&tag, buf, 8);
|
||||
ECIESX25519AEADRatchetSessionPtr session;
|
||||
auto it = m_ECIESx25519Tags.find (tag);
|
||||
if (it != m_ECIESx25519Tags.end ())
|
||||
{
|
||||
// TODO
|
||||
auto session = it->second;
|
||||
if (!session->NewOutgoingSessionReply (buf, len, handleClove))
|
||||
LogPrint (eLogError, "Garlic: can't decrypt ECIES-X25519-AEAD-Ratchet new session reply");
|
||||
m_ECIESx25519Tags.erase (tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto session = std::make_shared<ECIESX25519AEADRatchetSession> (this);
|
||||
if (!session->NewIncomingSession (buf, len, handleClove))
|
||||
LogPrint (eLogError, "Garlic: can't decrypt ECIES-X25519-AEAD-Ratchet new session");
|
||||
}
|
||||
{
|
||||
session = it->second;
|
||||
m_ECIESx25519Tags.erase (tag);
|
||||
}
|
||||
else
|
||||
session = std::make_shared<ECIESX25519AEADRatchetSession> (this); // incoming
|
||||
|
||||
if (!session->HandleNextMessage (buf, len, handleClove))
|
||||
LogPrint (eLogError, "Garlic: can't handle ECIES-X25519-AEAD-Ratchet message");
|
||||
}
|
||||
|
||||
void GarlicDestination::HandleECIESx25519GarlicClove (const uint8_t * buf, size_t len)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue