From 33d73d5d5505bbbd4d5747e67a0f27bcafb7e987 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Thu, 26 Jan 2023 23:06:07 -0500
Subject: [PATCH] securedht: compare public key content instead of pointer

---
 src/securedht.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/securedht.cpp b/src/securedht.cpp
index e6ebe0c3..55a7bd8a 100644
--- a/src/securedht.cpp
+++ b/src/securedht.cpp
@@ -79,13 +79,16 @@ SecureDht::secureType(ValueType&& type)
     type.editPolicy = [this,type](InfoHash id, const Sp<Value>& o, Sp<Value>& n, const InfoHash& nid, const SockAddr& a) {
         if (not o->isSigned())
             return type.editPolicy(id, o, n, nid, a);
-        if (o->owner != n->owner or not n->isSigned()) {
+        if (*o->owner != *n->owner or not n->isSigned()) {
             if (logger_)
-                logger_->w("Edition forbidden: signature verification failed.");
+                logger_->w("Edition forbidden: not signed or wrong owner.");
             return false;
         }
-        if (not n->checkSignature())
+        if (not n->checkSignature()) {
+            if (logger_)
+                logger_->w("Edition forbidden: signature verification failed.");
             return false;
+        }
         if (o->seq == n->seq) {
             // If the data is exactly the same,
             // it can be reannounced, possibly by someone else.
-- 
GitLab