mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-31 13:14:13 +00:00
allow tunnel endpoint to send tunnel build reply to itself
This commit is contained in:
parent
78af34237e
commit
a1dce017f4
@ -378,7 +378,8 @@ namespace i2p
|
|||||||
LogPrint (eLogWarning, "I2NP: Failed to decrypt tunnel build record");
|
LogPrint (eLogWarning, "I2NP: Failed to decrypt tunnel build record");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!memcmp ((const uint8_t *)i2p::context.GetIdentHash (), clearText + ECIES_BUILD_REQUEST_RECORD_NEXT_IDENT_OFFSET, 32)) // if next ident is now ours
|
if (!memcmp ((const uint8_t *)i2p::context.GetIdentHash (), clearText + ECIES_BUILD_REQUEST_RECORD_NEXT_IDENT_OFFSET, 32) && // if next ident is now ours
|
||||||
|
!(clearText[ECIES_BUILD_REQUEST_RECORD_FLAG_OFFSET] & TUNNEL_BUILD_RECORD_ENDPOINT_FLAG)) // and not endpoint
|
||||||
{
|
{
|
||||||
LogPrint (eLogWarning, "I2NP: Next ident is ours in tunnel build record");
|
LogPrint (eLogWarning, "I2NP: Next ident is ours in tunnel build record");
|
||||||
return false;
|
return false;
|
||||||
@ -571,11 +572,6 @@ namespace i2p
|
|||||||
LogPrint (eLogWarning, "I2NP: Can't decrypt short request record ", i);
|
LogPrint (eLogWarning, "I2NP: Can't decrypt short request record ", i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!memcmp ((const uint8_t *)i2p::context.GetIdentHash (), clearText + SHORT_REQUEST_RECORD_NEXT_IDENT_OFFSET, 32)) // if next ident is now ours
|
|
||||||
{
|
|
||||||
LogPrint (eLogWarning, "I2NP: Next ident is ours in short request record");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (clearText[SHORT_REQUEST_RECORD_LAYER_ENCRYPTION_TYPE]) // not AES
|
if (clearText[SHORT_REQUEST_RECORD_LAYER_ENCRYPTION_TYPE]) // not AES
|
||||||
{
|
{
|
||||||
LogPrint (eLogWarning, "I2NP: Unknown layer encryption type ", clearText[SHORT_REQUEST_RECORD_LAYER_ENCRYPTION_TYPE], " in short request record");
|
LogPrint (eLogWarning, "I2NP: Unknown layer encryption type ", clearText[SHORT_REQUEST_RECORD_LAYER_ENCRYPTION_TYPE], " in short request record");
|
||||||
@ -595,7 +591,14 @@ namespace i2p
|
|||||||
memcpy (ivKey, noiseState.m_CK + 32, 32);
|
memcpy (ivKey, noiseState.m_CK + 32, 32);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (!memcmp ((const uint8_t *)i2p::context.GetIdentHash (), clearText + SHORT_REQUEST_RECORD_NEXT_IDENT_OFFSET, 32)) // if next ident is now ours
|
||||||
|
{
|
||||||
|
LogPrint (eLogWarning, "I2NP: Next ident is ours in short request record");
|
||||||
|
return;
|
||||||
|
}
|
||||||
memcpy (ivKey, noiseState.m_CK , 32);
|
memcpy (ivKey, noiseState.m_CK , 32);
|
||||||
|
}
|
||||||
|
|
||||||
// check if we accept this tunnel
|
// check if we accept this tunnel
|
||||||
std::shared_ptr<i2p::tunnel::TransitTunnel> transitTunnel;
|
std::shared_ptr<i2p::tunnel::TransitTunnel> transitTunnel;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user