From e07ead943abf070107a9669fc4564c9dc7518832 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Fri, 24 Mar 2023 09:39:03 +0200 Subject: [PATCH] ipalib/x509: Implement abstract method Certificate.verify_directly_issued_by Added in Python Cryptography 40.0 Thanks to @tiran for the code Fixes: https://pagure.io/freeipa/issue/9355 Signed-off-by: Florence Blanc-Renaud Reviewed-By: Stanislav Levin --- ipalib/x509.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ipalib/x509.py b/ipalib/x509.py index 3fcd3f424..ed2e8f1d8 100644 --- a/ipalib/x509.py +++ b/ipalib/x509.py @@ -405,6 +405,11 @@ class IPACertificate(crypto_x509.Certificate): def tbs_precertificate_bytes(self): return self._cert.tbs_precertificate_bytes + if hasattr(crypto_x509.Certificate, "verify_directly_issued_by"): + # added in python-cryptography 40.0 + def verify_directly_issued_by(self, issuer): + return self._cert.verify_directly_issued_by(issuer) + def load_pem_x509_certificate(data): """ -- 2.40.0