summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-05 11:01:55 +0900
committerkali <kali@leap.se>2012-10-05 11:01:55 +0900
commit3ad57cfe2851038a6e7231a428f70ea8985f7b1e (patch)
tree83b9e5952cebce3d04d58216a9f31d11e21b34df
parent02f051488a358b6f0dd056f8bad4337808281457 (diff)
fix cert needed evaluation
-rw-r--r--src/leap/eip/checks.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/leap/eip/checks.py b/src/leap/eip/checks.py
index 898af2fe..f79d47f5 100644
--- a/src/leap/eip/checks.py
+++ b/src/leap/eip/checks.py
@@ -257,7 +257,7 @@ class ProviderCertChecker(object):
valid = exists() and valid_pemfile() and not_expired()
if not valid:
if do_raise:
- raise Exception('missing cert')
+ raise Exception('missing valid cert')
else:
return False
return True
@@ -273,7 +273,9 @@ class ProviderCertChecker(object):
with open(certfile) as cf:
cert_s = cf.read()
cert = crypto.X509Certificate(cert_s)
- return cert.activation_time < now() < cert.expiration_time
+ from_ = time.gmtime(cert.activation_time)
+ to_ = time.gmtime(cert.expiration_time)
+ return from_ < now() < to_
def is_valid_pemfile(self, cert_s=None):
"""