diff options
author | Ruben Pollan <meskio@sindominio.net> | 2014-11-04 11:53:56 -0600 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2014-11-06 19:43:41 -0600 |
commit | c223cca848e854d0015314ef517a6a4f928a2d0a (patch) | |
tree | 51780a96c6df649ce0245ce4c63a5fe9a530649b /src/leap/keymanager/validation.py | |
parent | 6729bd975e4fe6714c46bcc8c04e63830a2b4491 (diff) |
Use datetime for key expiration
Diffstat (limited to 'src/leap/keymanager/validation.py')
-rw-r--r-- | src/leap/keymanager/validation.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/leap/keymanager/validation.py b/src/leap/keymanager/validation.py index 7d68966e..cf5b4a83 100644 --- a/src/leap/keymanager/validation.py +++ b/src/leap/keymanager/validation.py @@ -80,11 +80,10 @@ def can_upgrade(new_key, old_key): return True # Expired key and higher validation level - if old_key.expiry_date: - old_expiry_date = datetime.fromtimestamp(int(old_key.expiry_date)) - if (old_expiry_date < datetime.now() and - new_key.validation >= old_key.validation): - return True + if (old_key.expiry_date is not None and + old_key.expiry_date < datetime.now() and + new_key.validation >= old_key.validation): + return True # No expiration date and higher validation level elif new_key.validation >= old_key.validation: |