Browse Source

verify LeaseSet's ident hash

pull/701/head
xcps 8 years ago
parent
commit
660860b92d
  1. 4
      Destination.cpp

4
Destination.cpp

@ -289,7 +289,7 @@ namespace client
if (leaseSet->IsNewer (buf + offset, len - offset)) if (leaseSet->IsNewer (buf + offset, len - offset))
{ {
leaseSet->Update (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"); LogPrint (eLogDebug, "Destination: Remote LeaseSet updated");
else else
{ {
@ -304,7 +304,7 @@ namespace client
else else
{ {
leaseSet = std::make_shared<i2p::data::LeaseSet> (buf + offset, len - offset); leaseSet = std::make_shared<i2p::data::LeaseSet> (buf + offset, len - offset);
if (leaseSet->IsValid ()) if (leaseSet->IsValid () && leaseSet->GetIdentHash () == i2p::data::IdentHash (buf + DATABASE_STORE_KEY_OFFSET))
{ {
if (leaseSet->GetIdentHash () != GetIdentHash ()) if (leaseSet->GetIdentHash () != GetIdentHash ())
{ {

Loading…
Cancel
Save