don't encrypt ShortTunnelBuild and ShortTunnelBuildReply if on the same router

This commit is contained in:
orignal 2021-07-28 15:06:24 -04:00
parent e68cff8bba
commit 9a3c22f47d
2 changed files with 23 additions and 9 deletions

View file

@ -96,7 +96,7 @@ namespace tunnel
if (m_Config->IsShort ())
{
auto ident = m_Config->GetFirstHop () ? m_Config->GetFirstHop ()->ident : nullptr;
if (ident)
if (ident && ident->GetIdentHash () != outboundTunnel->GetNextIdentHash ()) // don't encrypt if IBGW = OBEP
{
auto msg1 = i2p::garlic::WrapECIESX25519MessageForRouter (msg, ident->GetEncryptionPublicKey ());
if (msg1) msg = msg1;