|
|
@ -1073,7 +1073,10 @@ namespace transport |
|
|
|
LogPrint (eLogDebug, "SSU: peer test from Charlie. We are Bob"); |
|
|
|
LogPrint (eLogDebug, "SSU: peer test from Charlie. We are Bob"); |
|
|
|
auto session = m_Server.GetPeerTestSession (nonce); // session with Alice from PeerTest
|
|
|
|
auto session = m_Server.GetPeerTestSession (nonce); // session with Alice from PeerTest
|
|
|
|
if (session && session->m_State == eSessionStateEstablished) |
|
|
|
if (session && session->m_State == eSessionStateEstablished) |
|
|
|
session->Send (PAYLOAD_TYPE_PEER_TEST, buf, len); // back to Alice
|
|
|
|
{ |
|
|
|
|
|
|
|
const auto& ep = session->GetRemoteEndpoint (); // Alice's endpoint as known to Bob
|
|
|
|
|
|
|
|
session->SendPeerTest (nonce, ep.address (), ep.port (), introKey, false, true); // send back to Alice
|
|
|
|
|
|
|
|
} |
|
|
|
m_Server.RemovePeerTest (nonce); // nonce has been used
|
|
|
|
m_Server.RemovePeerTest (nonce); // nonce has been used
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -1093,10 +1096,13 @@ namespace transport |
|
|
|
if (port) |
|
|
|
if (port) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint (eLogDebug, "SSU: peer test from Bob. We are Charlie"); |
|
|
|
LogPrint (eLogDebug, "SSU: peer test from Bob. We are Charlie"); |
|
|
|
m_Server.NewPeerTest (nonce, ePeerTestParticipantCharlie); |
|
|
|
|
|
|
|
Send (PAYLOAD_TYPE_PEER_TEST, buf, len); // back to Bob
|
|
|
|
Send (PAYLOAD_TYPE_PEER_TEST, buf, len); // back to Bob
|
|
|
|
|
|
|
|
if (!addr.is_unspecified () && !i2p::util::net::IsInReservedRange(addr)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
m_Server.NewPeerTest (nonce, ePeerTestParticipantCharlie); |
|
|
|
SendPeerTest (nonce, addr, port, introKey); // to Alice with her address received from Bob
|
|
|
|
SendPeerTest (nonce, addr, port, introKey); // to Alice with her address received from Bob
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint (eLogDebug, "SSU: peer test from Alice. We are Bob"); |
|
|
|
LogPrint (eLogDebug, "SSU: peer test from Alice. We are Bob"); |
|
|
|