From 3721bca657264a928926706c75ab0d2a7593845f Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Mar 29 2023 08:45:07 +0000 Subject: 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 --- diff --git a/ipalib/x509.py b/ipalib/x509.py index 3fcd3f4..ed2e8f1 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): """