mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-23 17:36:37 +02:00
fixed incorrect iv for published NTCP2 addresses
This commit is contained in:
parent
9884a4336f
commit
ee700ac861
1 changed files with 7 additions and 5 deletions
|
@ -84,11 +84,6 @@ namespace i2p
|
||||||
routerInfo.AddSSUAddress (host.c_str(), port, routerInfo.GetIdentHash ());
|
routerInfo.AddSSUAddress (host.c_str(), port, routerInfo.GetIdentHash ());
|
||||||
routerInfo.AddNTCPAddress (host.c_str(), port);
|
routerInfo.AddNTCPAddress (host.c_str(), port);
|
||||||
}
|
}
|
||||||
if (ntcp2)
|
|
||||||
{
|
|
||||||
if (!m_NTCP2Keys) NewNTCP2Keys ();
|
|
||||||
routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv);
|
|
||||||
}
|
|
||||||
|
|
||||||
routerInfo.SetCaps (i2p::data::RouterInfo::eReachable |
|
routerInfo.SetCaps (i2p::data::RouterInfo::eReachable |
|
||||||
i2p::data::RouterInfo::eSSUTesting | i2p::data::RouterInfo::eSSUIntroducer); // LR, BC
|
i2p::data::RouterInfo::eSSUTesting | i2p::data::RouterInfo::eSSUIntroducer); // LR, BC
|
||||||
|
@ -97,6 +92,13 @@ namespace i2p
|
||||||
routerInfo.CreateBuffer (m_Keys);
|
routerInfo.CreateBuffer (m_Keys);
|
||||||
m_RouterInfo.SetRouterIdentity (GetIdentity ());
|
m_RouterInfo.SetRouterIdentity (GetIdentity ());
|
||||||
m_RouterInfo.Update (routerInfo.GetBuffer (), routerInfo.GetBufferLen ());
|
m_RouterInfo.Update (routerInfo.GetBuffer (), routerInfo.GetBufferLen ());
|
||||||
|
|
||||||
|
if (ntcp2) // we don't store iv in the address if non published so we must update it from keys
|
||||||
|
{
|
||||||
|
if (!m_NTCP2Keys) NewNTCP2Keys ();
|
||||||
|
UpdateNTCP2Address (true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RouterContext::UpdateRouterInfo ()
|
void RouterContext::UpdateRouterInfo ()
|
||||||
|
|
Loading…
Add table
Reference in a new issue