diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-03-13 10:38:25 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-03-13 10:38:25 -0300 |
commit | a12906958e4d117daaf45bd42e7383d2344ea463 (patch) | |
tree | 7e9029c7bf4cc71c0d76d0a242c073f56663c660 /src/leap/services | |
parent | 5e3c49e57cd87ba6cdd11cb9ef59333fbfe4d49b (diff) |
Add util.certs and abstract digest there
Diffstat (limited to 'src/leap/services')
-rw-r--r-- | src/leap/services/eip/providerbootstrapper.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/leap/services/eip/providerbootstrapper.py b/src/leap/services/eip/providerbootstrapper.py index df56110e..dc87a1bd 100644 --- a/src/leap/services/eip/providerbootstrapper.py +++ b/src/leap/services/eip/providerbootstrapper.py @@ -23,9 +23,7 @@ import requests import logging import socket import os -import errno -from OpenSSL import crypto from PySide import QtGui, QtCore from leap.config.providerconfig import ProviderConfig @@ -33,6 +31,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 get_digest logger = logging.getLogger(__name__) @@ -324,8 +323,7 @@ class ProviderBootstrapper(QtCore.QObject): leap_assert(len(cert_data) > 0, "Could not read certificate data") - x509 = crypto.load_certificate(crypto.FILETYPE_PEM, cert_data) - digest = x509.digest(method).replace(":", "").lower() + digest = get_digest(cert_data, method) leap_assert(digest == fingerprint, "Downloaded certificate has a different fingerprint!") |