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 <flo@redhat.com>
Reviewed-By: Stanislav Levin <slev@altlinux.org>
This commit is contained in:
Alexander Bokovoy 2023-03-24 09:39:03 +02:00 committed by Florence Blanc-Renaud
parent d32c640df0
commit 3721bca657

View File

@ -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):
"""