summaryrefslogtreecommitdiff
path: root/src/leap/eip/checks.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-12-12 09:16:53 +0900
committerkali <kali@leap.se>2012-12-12 09:16:53 +0900
commit4984f2c966d11f529a2a8b722814b748b6a524d2 (patch)
tree3f494b647c8aa0875487a8d2e6790654a73c4c8a /src/leap/eip/checks.py
parentf671412ebd4f2ce0dd9948cb8821f1d6d8ac7d9b (diff)
changed some values in new style eipconfig
Diffstat (limited to 'src/leap/eip/checks.py')
-rw-r--r--src/leap/eip/checks.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/leap/eip/checks.py b/src/leap/eip/checks.py
index 8d615b94..92964a9d 100644
--- a/src/leap/eip/checks.py
+++ b/src/leap/eip/checks.py
@@ -242,7 +242,9 @@ class ProviderCertChecker(object):
raise
try:
pemfile_content = req.content
- self.is_valid_pemfile(pemfile_content)
+ valid = self.is_valid_pemfile(pemfile_content)
+ if not valid:
+ return False
cert_path = self._get_client_cert_path()
self.write_cert(pemfile_content, to=cert_path)
except:
@@ -303,6 +305,10 @@ class ProviderCertChecker(object):
if len(certparts) > 1:
cert_s = sep + certparts[1]
ssl.PEM_cert_to_DER_cert(cert_s)
+ except ValueError:
+ # valid_pemfile raises a value error if not BEGIN_CERTIFICATE in
+ # there...
+ return False
except:
# XXX raise proper exception
raise