Skip to content

Commit

Permalink
recognize PeerTest back from Bob to Alice
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Apr 10, 2014
1 parent 747383a commit 9c7039c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion SSU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,13 @@ namespace ssu
if (m_PeerTestNonces.count (nonce) > 0)
{
// existing test
if (port)
if (m_PeerTest)
{
LogPrint ("SSU peer test from Bob. We are Alice");
m_PeerTestNonces.erase (nonce);
m_PeerTest = false;
}
else if (port)
{
LogPrint ("SSU peer test from Charlie. We are Bob");
// TODO: back to Alice
Expand Down Expand Up @@ -807,6 +813,7 @@ namespace ssu
CryptoPP::RandomNumberGenerator& rnd = i2p::context.GetRandomNumberGenerator ();
uint32_t nonce = 0;
rnd.GenerateWord32 (nonce);
m_PeerTestNonces.insert (nonce);
*(uint32_t *)payload = htobe32 (nonce);
payload += 4; // nonce
*payload = 4;
Expand Down

0 comments on commit 9c7039c

Please sign in to comment.