mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
* Add LeaseSetBufferValidate which checks lease validity and extracts timestamp
* check for leases with LeaseSetBufferValidate before update in floodfill code as to prevent malicous nodes removing good LS
This commit is contained in:
parent
3820b51960
commit
4a77a03033
3 changed files with 46 additions and 8 deletions
|
@ -95,6 +95,12 @@ namespace data
|
|||
size_t m_BufferLen;
|
||||
};
|
||||
|
||||
/**
|
||||
validate lease set buffer signature and extract expiration timestamp
|
||||
@returns true if the leaseset is well formed and signature is valid
|
||||
*/
|
||||
bool LeaseSetBufferValidate(const uint8_t * ptr, size_t sz, uint64_t & expires);
|
||||
|
||||
class LocalLeaseSet
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue