summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-05 11:01:55 +0900
committerkali <kali@leap.se>2012-10-06 02:36:12 +0900
commit75b5abe95137c676b4390c9f43c3d50192c2392e (patch)
tree423e298482ea4ee3367298aeda83788f7035da1c /src
parentfb7a25f8f33c7aad6da302ed8c9c14675c7cb6f1 (diff)
fix cert needed evaluation
Diffstat (limited to 'src')
-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):
"""