diff --git a/fix-missing-X509_CRL_set1_lastUpdate-_nextUpdate.patch b/fix-missing-X509_CRL_set1_lastUpdate-_nextUpdate.patch new file mode 100644 index 0000000..c08804e --- /dev/null +++ b/fix-missing-X509_CRL_set1_lastUpdate-_nextUpdate.patch @@ -0,0 +1,24 @@ +diff -urN a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py +--- a/src/OpenSSL/crypto.py 2023-04-29 03:22:33.000000000 +0200 ++++ b/src/OpenSSL/crypto.py 2024-08-02 10:24:47.843604182 +0200 +@@ -39,6 +39,20 @@ + ) + + ++# Define X509_CRL_set1_lastUpdate and X509_CRL_set1_nextUpdate if are missing, ++# but X509_CRL_set_lastUpdate and X509_CRL_set_nextUpdate present. ++# It's required for backward compatibility with older openssl versions. ++if ( ++ not hasattr(_lib, "X509_CRL_set1_lastUpdate") ++ and hasattr(_lib, "X509_CRL_set_lastUpdate") ++): ++ _lib.X509_CRL_set1_lastUpdate = _lib.X509_CRL_set_lastUpdate ++if ( ++ not hasattr(_lib, "X509_CRL_set1_nextUpdate") ++ and hasattr(_lib, "X509_CRL_set_nextUpdate") ++): ++ _lib.X509_CRL_set1_nextUpdate = _lib.X509_CRL_set_nextUpdate ++ + __all__ = [ + "FILETYPE_PEM", + "FILETYPE_ASN1", diff --git a/saltbundlepy-pyopenssl.changes b/saltbundlepy-pyopenssl.changes index 10713d1..a52f362 100644 --- a/saltbundlepy-pyopenssl.changes +++ b/saltbundlepy-pyopenssl.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Aug 2 08:28:18 UTC 2024 - Victor Zhestkov + +- Make the module compatible with older OpenSSL versions + not having `X509_CRL_set1_lastUpdate` and `X509_CRL_set1_nextUpdate` + defined by using `X509_CRL_set_lastUpdate` and + `X509_CRL_set_nextUpdate` instead. + +- Added: + * fix-missing-X509_CRL_set1_lastUpdate-_nextUpdate.patch + ------------------------------------------------------------------- Mon May 6 13:50:55 UTC 2024 - Victor Zhestkov diff --git a/saltbundlepy-pyopenssl.spec b/saltbundlepy-pyopenssl.spec index cba0cf9..794a620 100644 --- a/saltbundlepy-pyopenssl.spec +++ b/saltbundlepy-pyopenssl.spec @@ -38,6 +38,9 @@ Patch0: skip-networked-test.patch Patch1: revert_switch_to_new_utils_deprecation.patch # Fix missing ASN1_STRING_get0_data definition in old OpenSSL versions Patch2: fix-missing-ASN1_STRING_get0_data-in-old-openssl.patch +# Fix missing X509_CRL_set1_lastUpdate and X509_CRL_set1_nextUpdate +# in old OpenSSL versions +Patch3: fix-missing-X509_CRL_set1_lastUpdate-_nextUpdate.patch BuildRequires: %{saltbundlepy_module base >= 3.10} BuildRequires: %{saltbundlepy_module cffi} BuildRequires: %{saltbundlepy_module cryptography >= 2.3.0}