summaryrefslogtreecommitdiff
path: root/src/leap/services/eip/eipbootstrapper.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-13 11:09:38 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-13 11:09:38 -0300
commit60bcc7b27aa934a0d62033e7152b87d5af638491 (patch)
tree0e3e58d4974906dd91c67880316808d5aed0e13f /src/leap/services/eip/eipbootstrapper.py
parenta12906958e4d117daaf45bd42e7383d2344ea463 (diff)
Add valid pemfile check before saving the downloaded client cert
Diffstat (limited to 'src/leap/services/eip/eipbootstrapper.py')
-rw-r--r--src/leap/services/eip/eipbootstrapper.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/leap/services/eip/eipbootstrapper.py b/src/leap/services/eip/eipbootstrapper.py
index 3e4e2063..ec3dfe7b 100644
--- a/src/leap/services/eip/eipbootstrapper.py
+++ b/src/leap/services/eip/eipbootstrapper.py
@@ -32,6 +32,7 @@ from leap.util.check import leap_assert, leap_assert_type
from leap.util.checkerthread import CheckerThread
from leap.util.files import check_and_fix_urw_only, get_mtime, mkdir_p
from leap.util.request_helpers import get_content
+from leap.util.certs import is_valid_pemfile
logger = logging.getLogger(__name__)
@@ -183,6 +184,10 @@ class EIPBootstrapper(QtCore.QObject):
# TODO: check certificate validity
+ if not is_valid_pemfile(client_cert):
+ raise Exception(self.tr("The downloaded certificate is not a "
+ "valid PEM file"))
+
mkdir_p(os.path.dirname(client_cert_path))
with open(client_cert_path, "w") as f: