mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-11 17:37:53 +00:00
don't verify signature twice
This commit is contained in:
parent
b1c701085b
commit
7db2e9dc4a
@ -21,7 +21,7 @@ namespace data
|
|||||||
ReadFromBuffer ();
|
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)
|
if (len > m_BufferLen)
|
||||||
{
|
{
|
||||||
@ -31,7 +31,7 @@ namespace data
|
|||||||
}
|
}
|
||||||
memcpy (m_Buffer, buf, len);
|
memcpy (m_Buffer, buf, len);
|
||||||
m_BufferLen = len;
|
m_BufferLen = len;
|
||||||
ReadFromBuffer (false, false); // we assume signature is verified already
|
ReadFromBuffer (false, verifySignature);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LeaseSet::PopulateLeases ()
|
void LeaseSet::PopulateLeases ()
|
||||||
|
@ -57,7 +57,7 @@ namespace data
|
|||||||
|
|
||||||
LeaseSet (const uint8_t * buf, size_t len, bool storeLeases = true);
|
LeaseSet (const uint8_t * buf, size_t len, bool storeLeases = true);
|
||||||
~LeaseSet () { delete[] m_Buffer; };
|
~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;
|
bool IsNewer (const uint8_t * buf, size_t len) const;
|
||||||
void PopulateLeases (); // from buffer
|
void PopulateLeases (); // from buffer
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ namespace data
|
|||||||
{
|
{
|
||||||
if(it->second->GetExpirationTime() < expires)
|
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());
|
LogPrint (eLogInfo, "NetDb: LeaseSet updated: ", ident.ToBase32());
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user