mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 06:54:15 +00:00
use token from RelayResponse block
This commit is contained in:
parent
a68765e021
commit
83bd3b6f0b
@ -960,11 +960,9 @@ namespace transport
|
|||||||
RAND_bytes ((uint8_t *)&m_DestConnID, 8);
|
RAND_bytes ((uint8_t *)&m_DestConnID, 8);
|
||||||
RAND_bytes ((uint8_t *)&m_SourceConnID, 8);
|
RAND_bytes ((uint8_t *)&m_SourceConnID, 8);
|
||||||
m_Server.UpdateSessionConnID (oldConnID);
|
m_Server.UpdateSessionConnID (oldConnID);
|
||||||
// new token
|
|
||||||
m_Server.UpdateOutgoingToken (m_RemoteEndpoint, headerX[1], i2p::util::GetSecondsSinceEpoch () + SSU2_TOKEN_EXPIRATION_TIMEOUT);
|
|
||||||
// connect
|
// connect
|
||||||
m_State = eSSU2SessionStateUnknown;
|
m_State = eSSU2SessionStateUnknown;
|
||||||
SendSessionRequest (headerX[1]);
|
Connect ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1451,6 +1449,13 @@ namespace transport
|
|||||||
// verify nonce
|
// verify nonce
|
||||||
if (~htobe64 (((uint64_t)nonce << 32) | nonce) != m_DestConnID)
|
if (~htobe64 (((uint64_t)nonce << 32) | nonce) != m_DestConnID)
|
||||||
LogPrint (eLogWarning, "SSU2: Relay response nonce mismatch ", nonce, " connID=", m_DestConnID);
|
LogPrint (eLogWarning, "SSU2: Relay response nonce mismatch ", nonce, " connID=", m_DestConnID);
|
||||||
|
if (len >= 8)
|
||||||
|
{
|
||||||
|
// new token
|
||||||
|
uint64_t token;
|
||||||
|
memcpy (&token, buf + len - 8, 8);
|
||||||
|
m_Server.UpdateOutgoingToken (m_RemoteEndpoint, token, i2p::util::GetSecondsSinceEpoch () + SSU2_TOKEN_EXPIRATION_TIMEOUT);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto it = m_RelaySessions.find (nonce);
|
auto it = m_RelaySessions.find (nonce);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user