mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
update keys for NTCP2 and SSU2 addreses
This commit is contained in:
parent
f43e860998
commit
a94ae7d77d
|
@ -338,18 +338,22 @@ namespace i2p
|
||||||
{
|
{
|
||||||
auto& addresses = m_RouterInfo.GetAddresses ();
|
auto& addresses = m_RouterInfo.GetAddresses ();
|
||||||
bool found = false, updated = false;
|
bool found = false, updated = false;
|
||||||
for (auto it = addresses.begin (); it != addresses.end (); ++it)
|
for (auto it = addresses.begin (); it != addresses.end ();)
|
||||||
{
|
{
|
||||||
if ((*it)->IsNTCP2 ())
|
if ((*it)->IsNTCP2 ())
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
if (!enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
addresses.erase (it);
|
(*it)->s = m_NTCP2Keys->staticPublicKey;
|
||||||
updated= true;
|
memcpy ((*it)->i, m_NTCP2Keys->iv, 16);
|
||||||
}
|
}
|
||||||
break;
|
else
|
||||||
|
it = addresses.erase (it);
|
||||||
|
updated = true;;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
it++;
|
||||||
}
|
}
|
||||||
if (enable && !found)
|
if (enable && !found)
|
||||||
{
|
{
|
||||||
|
@ -386,18 +390,22 @@ namespace i2p
|
||||||
{
|
{
|
||||||
auto& addresses = m_RouterInfo.GetAddresses ();
|
auto& addresses = m_RouterInfo.GetAddresses ();
|
||||||
bool found = false, updated = false;
|
bool found = false, updated = false;
|
||||||
for (auto it = addresses.begin (); it != addresses.end (); ++it)
|
for (auto it = addresses.begin (); it != addresses.end ();)
|
||||||
{
|
{
|
||||||
if ((*it)->IsSSU2 ())
|
if ((*it)->IsSSU2 ())
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
if (!enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
addresses.erase (it);
|
(*it)->s = m_SSU2Keys->staticPublicKey;
|
||||||
updated= true;
|
(*it)->i = m_SSU2Keys->intro;
|
||||||
}
|
}
|
||||||
break;
|
else
|
||||||
|
it = addresses.erase (it);
|
||||||
|
updated = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
it++;
|
||||||
}
|
}
|
||||||
if (enable && !found)
|
if (enable && !found)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue