From 315b5fbf546712f22a7b03ca750257bc92263a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Wed, 5 Apr 2023 09:56:02 -0400 Subject: [PATCH] opendht: bump to 2.5.3 Change-Id: I11e6e6ffc73c90736c65264ec4581e97bb88c9e7 --- contrib/src/opendht/SHA512SUMS | 2 +- contrib/src/opendht/package.json | 4 +++- contrib/src/opendht/rules.mak | 2 +- src/connectivity/connectionmanager.cpp | 2 +- src/jamidht/account_manager.cpp | 10 +++++----- src/jamidht/archive_account_manager.cpp | 4 ++-- src/jamidht/jamiaccount.cpp | 2 +- src/jamidht/server_account_manager.cpp | 3 +-- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/contrib/src/opendht/SHA512SUMS b/contrib/src/opendht/SHA512SUMS index aedeff41c1..35e6af87e1 100644 --- a/contrib/src/opendht/SHA512SUMS +++ b/contrib/src/opendht/SHA512SUMS @@ -1 +1 @@ -c302749bf769d08caf8a82bab0409ed35edf465aa55217400a07af6a4120be008065ea426cafbfd883a151592b38d73885bfc58245a868b839c238310b4c88f5 opendht-2.4.11.tar.gz +7fe15fa4cff0213565baedabbf1e7ab4858635d727bb6a1c0ca16a4fdf66f809ef540fd5cb29cf204409ce4d66aad9df000e30f134ed5a3765faf5f95c1bd039 opendht-2.5.3.tar.gz diff --git a/contrib/src/opendht/package.json b/contrib/src/opendht/package.json index acf4d46b44..b0546eef8c 100644 --- a/contrib/src/opendht/package.json +++ b/contrib/src/opendht/package.json @@ -1,6 +1,6 @@ { "name": "opendht", - "version": "2.4.11", + "version": "2.5.3", "url": "https://github.com/savoirfairelinux/opendht/archive/v__VERSION__.tar.gz", "deps": [ "argon2", @@ -12,6 +12,8 @@ ], "use_cmake" : true, "defines": [ + "BUILD_SHARED_LIBS=0", + "BUILD_TESTING=0", "OPENDHT_SHARED=0", "OPENDHT_PROXY_CLIENT=1", "OPENDHT_PROXY_SERVER=1", diff --git a/contrib/src/opendht/rules.mak b/contrib/src/opendht/rules.mak index 8ad6c09fb4..b668e26de9 100644 --- a/contrib/src/opendht/rules.mak +++ b/contrib/src/opendht/rules.mak @@ -1,5 +1,5 @@ # OPENDHT -OPENDHT_VERSION := 2.4.11 +OPENDHT_VERSION := 2.5.3 OPENDHT_URL := https://github.com/savoirfairelinux/opendht/archive/v$(OPENDHT_VERSION).tar.gz PKGS += opendht diff --git a/src/connectivity/connectionmanager.cpp b/src/connectivity/connectionmanager.cpp index 97a00b61af..9457e404ca 100644 --- a/src/connectivity/connectionmanager.cpp +++ b/src/connectivity/connectionmanager.cpp @@ -488,7 +488,7 @@ ConnectionManager::Impl::connectDevice(const std::shared_ptr<dht::crypto::Certif noNewSocket, forceNewSocket, connType] { - auto devicePk = std::make_shared<dht::crypto::PublicKey>(cert->getPublicKey()); + auto devicePk = cert->getSharedPublicKey(); auto deviceId = devicePk->getLongId(); auto sthis = w.lock(); if (!sthis || sthis->isDestroying_) { diff --git a/src/jamidht/account_manager.cpp b/src/jamidht/account_manager.cpp index 5a5d60ca92..3d6fea1b8f 100644 --- a/src/jamidht/account_manager.cpp +++ b/src/jamidht/account_manager.cpp @@ -139,9 +139,9 @@ AccountManager::useIdentity(const dht::crypto::Identity& identity, return nullptr; } - auto pk = accountCertificate->getPublicKey(); - JAMI_DBG("[Auth] checking device receipt for %s", pk.getId().toString().c_str()); - if (!pk.checkSignature({receipt.begin(), receipt.end()}, receiptSignature)) { + auto pk = accountCertificate->getSharedPublicKey(); + JAMI_DBG("[Auth] checking device receipt for %s", pk->getId().toString().c_str()); + if (!pk->checkSignature({receipt.begin(), receipt.end()}, receiptSignature)) { JAMI_ERR("[Auth] device receipt signature check failed"); return nullptr; } @@ -160,7 +160,7 @@ AccountManager::useIdentity(const dht::crypto::Identity& identity, return nullptr; } auto id = root["id"].asString(); - if (id != pk.getId().toString()) { + if (id != pk->getId().toString()) { JAMI_ERR("[Auth] account ID mismatch between receipt and certificate"); return nullptr; } @@ -692,7 +692,7 @@ AccountManager::forEachDevice( return true; state->remaining++; findCertificate(dev.dev, [state](const std::shared_ptr<dht::crypto::Certificate>& cert) { - state->found(cert ? std::make_shared<dht::crypto::PublicKey>(cert->getPublicKey()) + state->found(cert ? cert->getSharedPublicKey() : std::shared_ptr<dht::crypto::PublicKey> {}); }); return true; diff --git a/src/jamidht/archive_account_manager.cpp b/src/jamidht/archive_account_manager.cpp index b9366fc272..4bcf35ea0a 100644 --- a/src/jamidht/archive_account_manager.cpp +++ b/src/jamidht/archive_account_manager.cpp @@ -480,7 +480,7 @@ ArchiveAccountManager::makeReceipt(const dht::crypto::Identity& id, auto devId = device.getId(); DeviceAnnouncement announcement; announcement.dev = devId; - announcement.pk = std::make_shared<dht::crypto::PublicKey>(device.getPublicKey()); + announcement.pk = device.getSharedPublicKey(); dht::Value ann_val {announcement}; ann_val.sign(*id.first); @@ -529,7 +529,7 @@ ArchiveAccountManager::syncDevices() // don't send sync data to ourself if (dev.first.toString() == info_->deviceId) continue; - auto pk = std::make_shared<dht::crypto::PublicKey>(dev.second.certificate->getPublicKey()); + auto pk = dev.second.certificate->getSharedPublicKey(); JAMI_DBG("sending device sync to %s %s", dev.second.name.c_str(), dev.first.toString().c_str()); diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index 58c75d5518..fa5eea9400 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -1669,7 +1669,7 @@ JamiAccount::trackPresence(const dht::InfoHash& h, BuddyInfo& buddy) sthis->findCertificate( dev.dev, [sthis, h](const std::shared_ptr<dht::crypto::Certificate>& cert) { if (cert) { - auto pk = std::make_shared<dht::crypto::PublicKey>(cert->getPublicKey()); + auto pk = cert->getSharedPublicKey(); if (sthis->convModule()->needsSyncingWith(h.toString(), pk->getLongId().toString())) sthis->requestSIPConnection( diff --git a/src/jamidht/server_account_manager.cpp b/src/jamidht/server_account_manager.cpp index b68cc9def4..5b48f1f85c 100644 --- a/src/jamidht/server_account_manager.cpp +++ b/src/jamidht/server_account_manager.cpp @@ -146,8 +146,7 @@ ServerAccountManager::initAuthentication(PrivateKey key, auto info = std::make_unique<AccountInfo>(); info->identity.first = ctx->key.get(); info->identity.second = cert; - info->devicePk = std::make_shared<dht::crypto::PublicKey>( - cert->getPublicKey()); + info->devicePk = cert->getSharedPublicKey(); info->deviceId = info->devicePk->getLongId().toString(); info->accountId = accountCert->getId().toString(); info->contacts = std::make_unique<ContactList>(accountCert, -- GitLab