summaryrefslogtreecommitdiff
path: root/src/leap/keymanager/validation.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/keymanager/validation.py')
-rw-r--r--src/leap/keymanager/validation.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/leap/keymanager/validation.py b/src/leap/keymanager/validation.py
index 7d68966..cf5b4a8 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: