testing/jami-daemon: rebuild against opendht

This commit is contained in:
psykose 2023-04-02 15:57:03 +00:00
parent d1c576682c
commit 0d235233b8
2 changed files with 117 additions and 1 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=jami-daemon
pkgver=0_git20221129
pkgrel=4
pkgrel=5
pkgdesc="Free and universal communication platform which preserves the users privacy and freedoms (daemon component)"
url="https://jami.net"
arch="all !ppc64le !s390x !riscv64" # no webrtc-audio-processing
@ -36,6 +36,7 @@ _commit=6f64b069a1c95a15b744d4044ad3d8032147439f
_pjprojectver=4af5d666d18837abaac94c8ec6bfc84984dcf1e2
source="$pkgname-$pkgver.tar.gz::https://git.jami.net/savoirfairelinux/jami-daemon/-/archive/$_commit/jami-daemon-$_commit.tar.gz
pjproject-$_pjprojectver.tar.gz::https://github.com/savoirfairelinux/pjproject/archive/$_pjprojectver/pjproject-$_pjprojectver.tar.gz
opendht-2.5.patch
ffmpeg6.patch
"
builddir="$srcdir/$pkgname-$_commit"
@ -77,5 +78,6 @@ package() {
sha512sums="
63b6cd0384cd58b18d2898086415d0ee8a352654a326255d570813d0da08ff8e485db46a0f82ec6ffae2108ae6218979e9c2190b2c9c95e41d1d8730fa165f35 jami-daemon-0_git20221129.tar.gz
3113daca372c84beda1f9f9a1b73f02ba7d565bb1d40662cc30bf741ec0ffda4e7d69034521073ce12f80498c071166a67959531e39abb865ea8d1e48564677f pjproject-4af5d666d18837abaac94c8ec6bfc84984dcf1e2.tar.gz
c1eff35b177ab563b95f22e9ba8c0b4938aa098e68ea4342a36f6f9cdafba0c243b3ab54e675d79681f421207ab3626ef6aeb81199698309f3565b216d431f44 opendht-2.5.patch
f7acc572d6e3270ca0f4c5d79383f15dadc8bb6913a4d56b68ed640678941c88c261420b39b08ad08ae0802b3e9a94c2e4ee0deadbbe9a2bba1450d2199e2b02 ffmpeg6.patch
"

View File

@ -0,0 +1,114 @@
diff --git a/src/jamidht/account_manager.cpp b/src/jamidht/account_manager.cpp
index 94ed89f..67125ea 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,13 +160,13 @@ 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;
}
auto devicePk = identity.first->getSharedPublicKey();
- if (!devicePk) {
+ if (!devicePk.get()) {
JAMI_ERR("[Auth] No device pk found");
return nullptr;
}
@@ -684,7 +684,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 f372bb8..2060241 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/connectionmanager.cpp b/src/jamidht/connectionmanager.cpp
index 06c7679..b07d7fa 100644
--- a/src/jamidht/connectionmanager.cpp
+++ b/src/jamidht/connectionmanager.cpp
@@ -447,7 +447,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/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp
index f00fc99..285153c 100644
--- a/src/jamidht/jamiaccount.cpp
+++ b/src/jamidht/jamiaccount.cpp
@@ -1852,7 +1852,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(
@@ -2302,8 +2302,7 @@ JamiAccount::doRegister_()
}
std::map<std::string, std::string> payloads = {
{datatype, utf8_make_valid(v.msg)}};
- auto pk = std::make_shared<dht::crypto::PublicKey>(
- cert->getPublicKey());
+ auto pk = cert->getSharedPublicKey();
onTextMessage(msgId,
peer_account.toString(),
pk->getLongId().toString(),
diff --git a/src/jamidht/server_account_manager.cpp b/src/jamidht/server_account_manager.cpp
index 39bb348..978957d 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,