|
|
@ -679,12 +679,16 @@ namespace transport |
|
|
|
htobe32buf (payload + 3, (ts + 500)/1000); |
|
|
|
htobe32buf (payload + 3, (ts + 500)/1000); |
|
|
|
size_t payloadSize = 7; |
|
|
|
size_t payloadSize = 7; |
|
|
|
if (GetRouterStatus () == eRouterStatusFirewalled && m_Address->IsIntroducer ()) |
|
|
|
if (GetRouterStatus () == eRouterStatusFirewalled && m_Address->IsIntroducer ()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (!m_Server.IsMaxNumIntroducers (m_RemoteEndpoint.address ().is_v4 ()) || |
|
|
|
|
|
|
|
m_Server.GetRng ()() & 0x01) // request tag with probability 1/2 if we have enough introducers
|
|
|
|
{ |
|
|
|
{ |
|
|
|
// relay tag request
|
|
|
|
// relay tag request
|
|
|
|
payload[payloadSize] = eSSU2BlkRelayTagRequest; |
|
|
|
payload[payloadSize] = eSSU2BlkRelayTagRequest; |
|
|
|
memset (payload + payloadSize + 1, 0, 2); // size = 0
|
|
|
|
memset (payload + payloadSize + 1, 0, 2); // size = 0
|
|
|
|
payloadSize += 3; |
|
|
|
payloadSize += 3; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
payloadSize += CreatePaddingBlock (payload + payloadSize, 40 - payloadSize, 1); |
|
|
|
payloadSize += CreatePaddingBlock (payload + payloadSize, 40 - payloadSize, 1); |
|
|
|
// KDF for session request
|
|
|
|
// KDF for session request
|
|
|
|
m_NoiseState->MixHash ({ {header.buf, 16}, {headerX, 16} }); // h = SHA256(h || header)
|
|
|
|
m_NoiseState->MixHash ({ {header.buf, 16}, {headerX, 16} }); // h = SHA256(h || header)
|
|
|
|