Reject objects with end of life set too far into the future

This commit is contained in:
TheKysek 2017-08-23 18:35:48 +02:00
parent 05d3b4244d
commit 9c73986e2a
No known key found for this signature in database
GPG Key ID: 50D9AF00D0B1C497
1 changed files with 3 additions and 0 deletions

View File

@ -84,6 +84,9 @@ class Object(object):
if self.is_expired():
logging.warning('Rejecting object {}, reason: is_expired'.format(base64.b16encode(self.vector).decode()))
return False
if self.expires_time > time.time() + 28 * 24 * 3600 + 3 * 3600:
logging.warning('Rejecting object {}, reason: end of life too far into the future'.format(base64.b16encode(self.vector).decode()))
return False
if len(self.object_payload) > 2**18:
logging.warning('Rejecting object {}, reason: len(payload) > 2**18'.format(base64.b16encode(self.vector).decode()))
return False