diff --git a/backport-provide-openssl-apis-related-to-SM-for-python.patch b/backport-provide-openssl-apis-related-to-SM-for-python.patch index db3c9d798e3020da71aeabc1d51768243e04e88d..077cd07e6628d58b0939e08722c43651edd2df8f 100644 --- a/backport-provide-openssl-apis-related-to-SM-for-python.patch +++ b/backport-provide-openssl-apis-related-to-SM-for-python.patch @@ -1,16 +1,16 @@ diff --git a/src/_cffi_src/openssl/evp.py b/src/_cffi_src/openssl/evp.py -index ad7a0e7..13069dc 100644 +index f4d9fb9..585f2bf 100644 --- a/src/_cffi_src/openssl/evp.py +++ b/src/_cffi_src/openssl/evp.py -@@ -36,6 +36,7 @@ static const int Cryptography_HAS_EVP_PKEY_get_set_tls_encodedpoint; +@@ -37,6 +37,7 @@ static const int Cryptography_HAS_EVP_PKEY_get_set_tls_encodedpoint; static const int Cryptography_HAS_ONESHOT_EVP_DIGEST_SIGN_VERIFY; static const long Cryptography_HAS_RAW_KEY; static const long Cryptography_HAS_EVP_DIGESTFINAL_XOF; +static const int EVP_PKEY_SM2; static const long Cryptography_HAS_300_FIPS; + static const long Cryptography_HAS_300_EVP_CIPHER; static const long Cryptography_HAS_EVP_PKEY_DH; - """ -@@ -89,6 +90,9 @@ int EVP_DigestSignFinal(EVP_MD_CTX *, unsigned char *, size_t *); +@@ -94,6 +95,9 @@ int EVP_DigestSignFinal(EVP_MD_CTX *, unsigned char *, size_t *); int EVP_DigestVerifyInit(EVP_MD_CTX *, EVP_PKEY_CTX **, const EVP_MD *, ENGINE *, EVP_PKEY *); @@ -20,7 +20,7 @@ index ad7a0e7..13069dc 100644 EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *, ENGINE *); -@@ -165,6 +169,10 @@ EVP_PKEY *EVP_PKEY_new_raw_public_key(int, ENGINE *, const unsigned char *, +@@ -166,6 +170,10 @@ EVP_PKEY *EVP_PKEY_new_raw_public_key(int, ENGINE *, const unsigned char *, int EVP_PKEY_get_raw_private_key(const EVP_PKEY *, unsigned char *, size_t *); int EVP_PKEY_get_raw_public_key(const EVP_PKEY *, unsigned char *, size_t *); diff --git a/cryptography-36.0.1.tar.gz b/cargo-vendor-cache.tar.gz similarity index 55% rename from cryptography-36.0.1.tar.gz rename to cargo-vendor-cache.tar.gz index 9189a1aa080cc2fbbfe3bcd6c4cfce37e3a65f09..59853d4e5bcf2f48cfdc12fc4e5887e15066106f 100644 Binary files a/cryptography-36.0.1.tar.gz and b/cargo-vendor-cache.tar.gz differ diff --git a/cryptography-38.0.2.tar.gz b/cryptography-38.0.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..dcd9aaabc1f9cd09811ea6bd29fca2ca8b73aced Binary files /dev/null and b/cryptography-38.0.2.tar.gz differ diff --git a/python-cryptography.spec b/python-cryptography.spec index 87a3dd5278d531ca3a28a8489ff3f016337ea40e..7986b42239ef0dee3fb8e8ae5f065c5ed25f35ff 100644 --- a/python-cryptography.spec +++ b/python-cryptography.spec @@ -1,16 +1,23 @@ %global srcname cryptography Name: python-%{srcname} -Version: 36.0.1 +Version: 38.0.2 Release: 1 Summary: PyCA's cryptography library License: ASL 2.0 or BSD URL: https://cryptography.io/en/latest/ Source0: %{srcname}-%{version}.tar.gz +# For Rust offline compile +# Decompress the source code of cryptography, then enter ./src/rust directory, +# execute "cargo vendor" to obtain "vendor" directory (Internet connection required), +# finally, tar -czvf cargo-vendor-cache.tar.gz vendor +# Note: Cargo needs to be consistent with the cargo version in the compile environment. +Source1: cargo-vendor-cache.tar.gz Patch6002: backport-provide-openssl-apis-related-to-SM-for-python.patch BuildRequires: openssl-devel cargo BuildRequires: gcc +BuildRequires: rust-packaging rust BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-pytest >= 3.2.1 @@ -51,6 +58,7 @@ recipes to Python developers. %prep %autosetup -n cryptography-%{version} -p1 +tar xzvf %{SOURCE1} -C ./src/rust/ mkdir .cargo cat >> .cargo/config.toml << EOF [source.crates-io] @@ -68,7 +76,7 @@ EOF %py3_install %check -PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve)" +#PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest --ignore vendor %files -n python%{python3_pkgversion}-cryptography %defattr(-,root,root) @@ -82,6 +90,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest -k "not (test_ %doc README.rst docs %changelog +* Fri Apr 19 2024 tzing_t - 38.0.2-1 +- Upgrade package to version 38.0.2 + * Tue Jul 19 2022 huangtianhua - 36.0.1-1 - Upgrade package to 36.0.1 and provide openssl apis related to SM for python