From 2ac24d6883214018e97838da8846ebf3a1223058 Mon Sep 17 00:00:00 2001 From: Mathieu Pasquet Date: Tue, 28 Jan 2014 18:54:46 +0100 Subject: Provide a more standardized fingerprint representation (also includes silent modification of the hash already in the config) --- src/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core.py b/src/core.py index a2e59aa4..d481ae6a 100644 --- a/src/core.py +++ b/src/core.py @@ -3750,8 +3750,14 @@ class Core(object): if config.get('ignore_certificate', 'false').lower() == 'true': return cert = config.get('certificate', '') + # update the cert representation when it uses the old one + if cert and not ':' in cert: + cert = ':'.join(i + j for i, j in zip(cert[::2], cert[1::2])).upper() + config.set_and_save('certificate', cert) + der = ssl.PEM_cert_to_DER_cert(pem) - found_cert = sha1(der).hexdigest() + digest = sha1(der).hexdigest().upper() + found_cert = ':'.join(i + j for i, j in zip(digest[::2], digest[1::2])) if cert: if found_cert == cert: log.debug('Cert %s OK', found_cert) -- cgit v1.2.3