1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-11 13:27:52 +00:00

don't verify signature twice

This commit is contained in:
orignal 2018-01-25 10:32:08 -05:00
parent b1c701085b
commit 7db2e9dc4a
3 changed files with 4 additions and 4 deletions

View File

@ -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 ()

View File

@ -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

View File

@ -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;
}