Skip to content
Snippets Groups Projects
Commit bd0064cf authored by Adrien Béraud's avatar Adrien Béraud
Browse files

securedht: compare public key content instead of pointer

parent f42d94da
Branches
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment