diff options
author | Ruben Pollan <meskio@sindominio.net> | 2017-10-31 11:02:00 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-12-03 23:12:14 +0100 |
commit | fb7eef011cc672f1884bcfcd4c859a549d8f3e49 (patch) | |
tree | 753190cbeeae7f1934590533f467a717cfabdaab /src/leap/bitmask/keymanager/keys.py | |
parent | f6c71494f0ada864e80ee74c60ec09939a14f44b (diff) |
[feat] extend the expiration of private keys if needed
Check on every fetch of the private key if the expiration is less than
two months before it expire. And extend the expiration if needed.
- Resolves: #8217
Diffstat (limited to 'src/leap/bitmask/keymanager/keys.py')
-rw-r--r-- | src/leap/bitmask/keymanager/keys.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/leap/bitmask/keymanager/keys.py b/src/leap/bitmask/keymanager/keys.py index 0f68c06b..efc6f925 100644 --- a/src/leap/bitmask/keymanager/keys.py +++ b/src/leap/bitmask/keymanager/keys.py @@ -338,6 +338,8 @@ class OpenPGPKey(object): :return: True if the current date is within the threshold :rtype: Boolean """ + if self.expiry_date is None: + return False days_till_expiry = (self.expiry_date - datetime.now()) return days_till_expiry.days < pre_expiration_threshold |