From: Thierry Parmentelat Date: Thu, 17 Dec 2015 10:44:02 +0000 (+0100) Subject: bugfix - m2crypto verification function returns X-Git-Tag: sfa-3.1-20~1 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=d0aed7cce376986611204f90dd2b61b4648532e1 bugfix - m2crypto verification function returns . 1 in case of success . but otherwise it may be 0 or -1 --- 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: