common LocalEncryptionKey to pass to loacl LeaseSet
Some checks are pending
Build Debian packages / bookworm (push) Waiting to run
Build Debian packages / bullseye (push) Waiting to run
Build Debian packages / buster (push) Waiting to run
Build on FreeBSD / with UPnP (push) Waiting to run
Build on OSX / With USE_UPNP=no (push) Waiting to run
Build on OSX / With USE_UPNP=yes (push) Waiting to run
Build on Windows / clang-x86_64 (push) Waiting to run
Build on Windows / i686 (push) Waiting to run
Build on Windows / ucrt-x86_64 (push) Waiting to run
Build on Windows / x86_64 (push) Waiting to run
Build on Windows / CMake clang-x86_64 (push) Waiting to run
Build on Windows / CMake i686 (push) Waiting to run
Build on Windows / CMake ucrt-x86_64 (push) Waiting to run
Build on Windows / CMake x86_64 (push) Waiting to run
Build on Windows / XP (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=no (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=yes (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=OFF (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=ON (push) Waiting to run
Build containers / Pushing merged manifest (push) Blocked by required conditions
Build containers / Building container for linux/amd64 (push) Waiting to run
Build containers / Building container for linux/arm64 (push) Waiting to run
Build containers / Building container for linux/arm/v7 (push) Waiting to run
Build containers / Building container for linux/386 (push) Waiting to run

This commit is contained in:
orignal 2025-04-16 15:40:09 -04:00
parent 9c46ff2449
commit f6c93f7345
6 changed files with 43 additions and 34 deletions

View file

@ -1047,7 +1047,7 @@ namespace client
for (auto& it: encryptionKeyTypes)
{
auto encryptionKey = std::make_shared<EncryptionKey> (it);
auto encryptionKey = std::make_shared<i2p::crypto::LocalEncryptionKey> (it);
if (IsPublic ())
PersistTemporaryKeys (encryptionKey);
else
@ -1405,7 +1405,7 @@ namespace client
return ret;
}
void ClientDestination::PersistTemporaryKeys (std::shared_ptr<EncryptionKey> keys)
void ClientDestination::PersistTemporaryKeys (std::shared_ptr<i2p::crypto::LocalEncryptionKey> keys)
{
if (!keys) return;
std::string ident = GetIdentHash().ToBase32();
@ -1475,9 +1475,9 @@ namespace client
else
{
// standard LS2 (type 3) first
i2p::data::LocalLeaseSet2::KeySections keySections;
i2p::data::LocalLeaseSet2::EncryptionKeys keySections;
for (const auto& it: m_EncryptionKeys)
keySections.push_back ({it.first, (uint16_t)it.second->pub.size (), it.second->pub.data ()} );
keySections.push_back (it.second);
auto publishedTimestamp = i2p::util::GetSecondsSinceEpoch ();
if (publishedTimestamp <= m_LastPublishedTimestamp)
@ -1503,7 +1503,7 @@ namespace client
bool ClientDestination::Decrypt (const uint8_t * encrypted, uint8_t * data, i2p::data::CryptoKeyType preferredCrypto) const
{
std::shared_ptr<EncryptionKey> encryptionKey;
std::shared_ptr<i2p::crypto::LocalEncryptionKey> encryptionKey;
if (!m_EncryptionKeys.empty ())
{
if (m_EncryptionKeys.rbegin ()->first == preferredCrypto)