diff --git a/libi2pd/RouterContext.cpp b/libi2pd/RouterContext.cpp index 4602f5eb..2f45fd91 100644 --- a/libi2pd/RouterContext.cpp +++ b/libi2pd/RouterContext.cpp @@ -118,7 +118,7 @@ namespace i2p if (ssu2) { addressCaps |= i2p::data::RouterInfo::AddressCaps::eV4; - routerInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey); + routerInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey, m_SSU2Keys->intro); } } if (ipv6) @@ -158,7 +158,7 @@ namespace i2p if (ssu2) { if (!ipv4) // no other ssu2 addresses yet - routerInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey); + routerInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey, m_SSU2Keys->intro); addressCaps |= i2p::data::RouterInfo::AddressCaps::eV6; } } @@ -351,7 +351,7 @@ namespace i2p bool ipv6; i2p::config::GetOption("ipv6", ipv6); if (ipv4) addressCaps |= i2p::data::RouterInfo::AddressCaps::eV4; if (ipv6) addressCaps |= i2p::data::RouterInfo::AddressCaps::eV6; - m_RouterInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey, addressCaps); + m_RouterInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey, m_SSU2Keys->intro, addressCaps); updated = true; } if (updated) diff --git a/libi2pd/RouterInfo.cpp b/libi2pd/RouterInfo.cpp index ceabe964..1f3fd985 100644 --- a/libi2pd/RouterInfo.cpp +++ b/libi2pd/RouterInfo.cpp @@ -631,13 +631,14 @@ namespace data m_Addresses->push_back(std::move(addr)); } - void RouterInfo::AddSSU2Address (const uint8_t * staticKey, uint8_t caps) + void RouterInfo::AddSSU2Address (const uint8_t * staticKey, const uint8_t * introKey, uint8_t caps) { auto addr = std::make_shared
(); addr->transportStyle = eTransportSSU2; addr->caps = caps; addr->date = 0; memcpy (addr->s, staticKey, 32); + memcpy (addr->i, introKey, 32); m_Addresses->push_back(std::move(addr)); } diff --git a/libi2pd/RouterInfo.h b/libi2pd/RouterInfo.h index ae846724..cf2bc4c7 100644 --- a/libi2pd/RouterInfo.h +++ b/libi2pd/RouterInfo.h @@ -190,7 +190,7 @@ namespace data void AddSSUAddress (const char * host, int port, const uint8_t * key, int mtu = 0); void AddNTCP2Address (const uint8_t * staticKey, const uint8_t * iv, const boost::asio::ip::address& host = boost::asio::ip::address(), int port = 0, uint8_t caps = 0); - void AddSSU2Address (const uint8_t * staticKey, uint8_t caps = 0); // non published + void AddSSU2Address (const uint8_t * staticKey, const uint8_t * introKey, uint8_t caps = 0); // non published bool AddIntroducer (const Introducer& introducer); bool RemoveIntroducer (const boost::asio::ip::udp::endpoint& e); void SetUnreachableAddressesTransportCaps (uint8_t transports); // bitmask of AddressCaps