From 9744c756c62d22618f577621fbf526373e3f42cb Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 24 Jan 2022 10:35:14 +0000 Subject: [PATCH] Fix more issues with gating tests --- ...-Specify-the-out-length-for-poly1305.patch | 22 +++++++++++++++++++ python-cryptography.spec | 8 ++++++- tests/tests.yml | 7 +++++- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 0006-Specify-the-out-length-for-poly1305.patch diff --git a/0006-Specify-the-out-length-for-poly1305.patch b/0006-Specify-the-out-length-for-poly1305.patch new file mode 100644 index 0000000..1df278f --- /dev/null +++ b/0006-Specify-the-out-length-for-poly1305.patch @@ -0,0 +1,22 @@ +From 076560a9507bbe26180f499adf750bc3851b97e8 Mon Sep 17 00:00:00 2001 +From: Alex Gaynor +Date: Mon, 11 Oct 2021 09:43:28 -0400 +Subject: [PATCH] Specify the out length when obtaining the tag for poly1305 + +--- + src/cryptography/hazmat/backends/openssl/poly1305.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cryptography/hazmat/backends/openssl/poly1305.py b/src/cryptography/hazmat/backends/openssl/poly1305.py +index 35f6819ce8..2ddae9847a 100644 +--- a/src/cryptography/hazmat/backends/openssl/poly1305.py ++++ b/src/cryptography/hazmat/backends/openssl/poly1305.py +@@ -51,7 +51,7 @@ def update(self, data): + + def finalize(self): + buf = self._backend._ffi.new("unsigned char[]", _POLY1305_TAG_SIZE) +- outlen = self._backend._ffi.new("size_t *") ++ outlen = self._backend._ffi.new("size_t *", _POLY1305_TAG_SIZE) + res = self._backend._lib.EVP_DigestSignFinal(self._ctx, buf, outlen) + self._backend.openssl_assert(res != 0) + self._backend.openssl_assert(outlen[0] == _POLY1305_TAG_SIZE) diff --git a/python-cryptography.spec b/python-cryptography.spec index 3c873d0..ce128a8 100644 --- a/python-cryptography.spec +++ b/python-cryptography.spec @@ -7,7 +7,7 @@ Name: python-%{srcname} Version: 3.4.7 -Release: 5%{?dist} +Release: 6%{?dist} Summary: PyCA's cryptography library License: ASL 2.0 or BSD @@ -23,6 +23,8 @@ Patch2: 0002-WIP-3.0.0-support-5250.patch Patch3: 0003-switch-to-using-EVP_PKEY_derive-instead-of-DH_comput.patch Patch4: 0004-3.0.0-deprecated-func-and-it-isn-t-useful-to-us-in-g.patch Patch5: 0005-remove-unneeded-binding-6150.patch +# OpenSSL 3.0.1 patches +Patch6: 0006-Specify-the-out-length-for-poly1305.patch ExclusiveArch: %{rust_arches} @@ -122,6 +124,10 @@ PYTHONPATH=${PWD}/vectors:%{buildroot}%{python3_sitearch} \ %{python3_sitearch}/%{srcname}-%{version}-py*.egg-info %changelog +* Tue Jan 18 2022 Christian Heimes - 3.4.7-6 +- Fix gating issues, resolves: rhbz#2039768 +- Fix poly1305 test, resolves: rhbz#2043582 + * Tue Aug 10 2021 Mohan Boddu - 3.4.7-5 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688 diff --git a/tests/tests.yml b/tests/tests.yml index 4a090be..8cd9b36 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -13,7 +13,9 @@ required_packages: - python3-cryptography - python3-pytest - - python3-pretend + - python3-pytest-subtests + environment: + PYTHONPATH: "{{ srcdir }}/vectors" tests: - remove_hypothesis: # remove tests that depend on python3-hypothesis package @@ -27,6 +29,9 @@ # scrypt tests require more memory than available dir: "source" run: rm -f tests/hazmat/primitives/test_scrypt.py + - patch_conftest: + dir: "source" + run: "cat ../conftest-skipper.py >> tests/conftest.py" # tests take some time, split up to avoid CI timeouts. - unittests-basic: dir: "source"