|
|
@ -1053,6 +1053,17 @@ namespace transport |
|
|
|
LogPrint (eLogError, "SSU2: SessionConfirmed malformed RouterInfo block"); |
|
|
|
LogPrint (eLogError, "SSU2: SessionConfirmed malformed RouterInfo block"); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
auto ts = i2p::util::GetMillisecondsSinceEpoch(); |
|
|
|
|
|
|
|
if (ts > ri->GetTimestamp () + i2p::data::NETDB_MIN_EXPIRATION_TIMEOUT*1000LL) // 90 minutes
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrint (eLogError, "SSU2: RouterInfo in SessionConfirmed is too old for ", (ts - ri->GetTimestamp ())/1000LL, " seconds"); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (ts + i2p::data::NETDB_EXPIRATION_TIMEOUT_THRESHOLD*1000LL < ri->GetTimestamp ()) // 2 minutes
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrint (eLogError, "SSU2: RouterInfo in SessionConfirmed is from future for ", (ri->GetTimestamp () - ts)/1000LL, " seconds"); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
m_Address = m_RemoteEndpoint.address ().is_v6 () ? ri->GetSSU2V6Address () : ri->GetSSU2V4Address (); |
|
|
|
m_Address = m_RemoteEndpoint.address ().is_v6 () ? ri->GetSSU2V6Address () : ri->GetSSU2V4Address (); |
|
|
|
if (!m_Address || memcmp (S, m_Address->s, 32)) |
|
|
|
if (!m_Address || memcmp (S, m_Address->s, 32)) |
|
|
|
{ |
|
|
|
{ |
|
|
|