* 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:
Jeff Becker 2018-01-24 10:16:51 -05:00
parent 3820b51960
commit 4a77a03033
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
3 changed files with 46 additions and 8 deletions

View file

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