don't verify signature twice

pull/1082/head
orignal 6 years ago
parent b1c701085b
commit 7db2e9dc4a

@ -21,7 +21,7 @@ namespace data
ReadFromBuffer ();
}
void LeaseSet::Update (const uint8_t * buf, size_t len)
void LeaseSet::Update (const uint8_t * buf, size_t len, bool verifySignature)
{
if (len > m_BufferLen)
{
@ -31,7 +31,7 @@ namespace data
}
memcpy (m_Buffer, buf, len);
m_BufferLen = len;
ReadFromBuffer (false, false); // we assume signature is verified already
ReadFromBuffer (false, verifySignature);
}
void LeaseSet::PopulateLeases ()

@ -57,7 +57,7 @@ namespace data
LeaseSet (const uint8_t * buf, size_t len, bool storeLeases = true);
~LeaseSet () { delete[] m_Buffer; };
void Update (const uint8_t * buf, size_t len);
void Update (const uint8_t * buf, size_t len, bool verifySignature = true);
bool IsNewer (const uint8_t * buf, size_t len) const;
void PopulateLeases (); // from buffer

@ -242,7 +242,7 @@ namespace data
{
if(it->second->GetExpirationTime() < expires)
{
it->second->Update (buf, len);
it->second->Update (buf, len, false); // signature is verified already
LogPrint (eLogInfo, "NetDb: LeaseSet updated: ", ident.ToBase32());
updated = true;
}

Loading…
Cancel
Save