From 4d4375dd2d64162d3a9b47da9a1d0b7de33124ae Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Mon, 15 May 2023 15:01:10 +0300 Subject: [PATCH] Support python-cryptography 40.0 Use upstream fixes from https://pagure.io/freeipa/issue/9355 Signed-off-by: Alexander Bokovoy --- freeipa-issue-9355.patch | 36 ++++++++++++++++++++++++++++++++++++ freeipa.spec | 8 +++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 freeipa-issue-9355.patch diff --git a/freeipa-issue-9355.patch b/freeipa-issue-9355.patch new file mode 100644 index 0000000..a2c7983 --- /dev/null +++ b/freeipa-issue-9355.patch @@ -0,0 +1,36 @@ +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 + diff --git a/freeipa.spec b/freeipa.spec index abce17e..ca0d05e 100644 --- a/freeipa.spec +++ b/freeipa.spec @@ -213,7 +213,7 @@ Name: %{package_name} Version: %{IPA_VERSION} -Release: 4%{?rc_version:.%rc_version}%{?dist} +Release: 5%{?rc_version:.%rc_version}%{?dist} Summary: The Identity, Policy and Audit system License: GPL-3.0-or-later @@ -224,6 +224,9 @@ Source0: https://releases.pagure.org/freeipa/freeipa-%{version}%{?rc_vers Source1: https://releases.pagure.org/freeipa/freeipa-%{version}%{?rc_version}.tar.gz.asc %endif +# python-cryptography 40.0+ support +Patch0: freeipa-issue-9355.patch + # RHEL spec file only: START: Change branding to IPA and Identity Management # Moved branding logos and background to redhat-logos-ipa-80.4: # header-logo.png, login-screen-background.jpg, login-screen-logo.png, @@ -1741,6 +1744,9 @@ fi %endif %changelog +* Mon May 15 2023 Alexander Bokovoy - 4.10.1-5 +- Support python-cryptography 40.0 + * Thu Mar 30 2023 Jerry James - 4.10.1-4 - Change fontawesome-fonts R to match fontawesome 4.x