From 660860b92d2da2a883442814fedf6767834cc15e Mon Sep 17 00:00:00 2001 From: xcps Date: Mon, 7 Nov 2016 15:50:03 -0500 Subject: [PATCH] verify LeaseSet's ident hash --- Destination.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Destination.cpp b/Destination.cpp index c8384ff9..70cfbc45 100644 --- a/Destination.cpp +++ b/Destination.cpp @@ -289,7 +289,7 @@ namespace client if (leaseSet->IsNewer (buf + offset, len - offset)) { leaseSet->Update (buf + offset, len - offset); - if (leaseSet->IsValid ()) + if (leaseSet->IsValid () && leaseSet->GetIdentHash () == i2p::data::IdentHash (buf + DATABASE_STORE_KEY_OFFSET)) LogPrint (eLogDebug, "Destination: Remote LeaseSet updated"); else { @@ -304,7 +304,7 @@ namespace client else { leaseSet = std::make_shared (buf + offset, len - offset); - if (leaseSet->IsValid ()) + if (leaseSet->IsValid () && leaseSet->GetIdentHash () == i2p::data::IdentHash (buf + DATABASE_STORE_KEY_OFFSET)) { if (leaseSet->GetIdentHash () != GetIdentHash ()) {