add new session to the list after reply received

This commit is contained in:
orignal 2020-01-22 11:27:47 -05:00
parent 76f95644b7
commit 7c212bef63
2 changed files with 7 additions and 10 deletions

View file

@ -668,7 +668,6 @@ namespace garlic
{
session = std::make_shared<ECIESX25519AEADRatchetSession> (this);
session->SetRemoteStaticKey (staticKey);
m_ECIESx25519Sessions.emplace (staticKey, session);
}
return session;
}
@ -870,7 +869,9 @@ namespace garlic
{
// TODO
auto session = it->second;
if (!session->NewOutgoingSessionReply (buf, len, handleClove))
if (session->NewOutgoingSessionReply (buf, len, handleClove))
m_ECIESx25519Sessions.emplace (session->GetRemoteStaticKey (), session);
else
{
LogPrint (eLogError, "Garlic: can't decrypt ECIES-X25519-AEAD-Ratchet new session reply");
m_ECIESx25519Tags.erase (tag);