From d0aed7cce376986611204f90dd2b61b4648532e1 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 17 Dec 2015 11:44:02 +0100 Subject: [PATCH] bugfix - m2crypto verification function returns . 1 in case of success . but otherwise it may be 0 or -1 --- sfa/trust/certificate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sfa/trust/certificate.py b/sfa/trust/certificate.py index 6082d921..ff6534e0 100644 --- a/sfa/trust/certificate.py +++ b/sfa/trust/certificate.py @@ -680,7 +680,9 @@ class Certificate: m2x509 = X509.load_cert_string(self.save_to_string()) m2pubkey = pubkey.get_m2_pubkey() # verify it - return m2x509.verify(m2pubkey) + # verify returns -1 or 0 on failure depending on how serious the + # error conditions are + return m2x509.verify(m2pubkey) == 1 # XXX alternatively, if openssl has been patched, do the much simpler: # try: -- 2.43.0