diff --git a/0001-Fixes-output-value-changes-between-older-and-newer-p.patch b/0001-Fixes-output-value-changes-between-older-and-newer-p.patch new file mode 100644 index 0000000..9ecc8da --- /dev/null +++ b/0001-Fixes-output-value-changes-between-older-and-newer-p.patch @@ -0,0 +1,30 @@ +From: =?utf-8?q?Pierre-Elliott_B=C3=A9cue?= +Date: Tue, 20 Feb 2018 11:58:06 +0100 +Subject: Fixes output value changes between older and newer pyasn versions + +--- + src/keyczar/util.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/keyczar/util.py b/src/keyczar/util.py +index 9e6f217..006eadb 100644 +--- a/src/keyczar/util.py ++++ b/src/keyczar/util.py +@@ -172,8 +172,7 @@ def ParseX509(x509): + if len(seq) != 2: # need two fields in SubjectPublicKeyInfo + raise errors.KeyczarError("Illegal X.509 String.") + [oid, alg_params] = ParseASN1Sequence(seq[0]) +- pubkey = decoder.decode(univ.OctetString(BinToBytes(seq[1]. +- prettyPrint()[2:-3])))[0] ++ pubkey = decoder.decode(univ.OctetString(BinToBytes(seq[1])))[0] + # Component 1 should be a BIT STRING, get raw bits by discarding extra chars, + # then convert to OCTET STRING which can be ASN.1 decoded + params = {} +@@ -251,6 +250,7 @@ def MakeEmsaMessage(msg, modulus_size): + + def BinToBytes(bits): + """Convert bit string to byte string.""" ++ bits = str(bits) + bits = _PadByte(bits) + octets = [bits[8 * i:8 * (i + 1)] for i in range(len(bits) / 8)] + return "".join([chr(int(x, 2)) for x in octets]) diff --git a/python-keyczar.changes b/python-keyczar.changes index bf996e9..44faea5 100644 --- a/python-keyczar.changes +++ b/python-keyczar.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Sep 16 09:40:33 UTC 2019 - Tomáš Chvátal + +- Add patch to fix the pyasn version conflict: + * 0001-Fixes-output-value-changes-between-older-and-newer-p.patch + ------------------------------------------------------------------- Tue Dec 4 12:49:47 UTC 2018 - Matej Cepl diff --git a/python-keyczar.spec b/python-keyczar.spec index 8f24f00..7dcd6fa 100644 --- a/python-keyczar.spec +++ b/python-keyczar.spec @@ -1,7 +1,7 @@ # # spec file for package python-keyczar # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,28 +19,26 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %{!?license: %global license %doc} %define pkgname keyczar -%bcond_without test Name: python-keyczar Version: 0.716 Release: 0 Summary: Python toolkit for cryptography License: Apache-2.0 Group: Development/Languages/Python -Url: http://www.keyczar.org -Source0: https://github.com/google/%pkgname/archive/Python_release_%{version}.tar.gz +URL: http://www.keyczar.org +Source0: https://github.com/google/%{pkgname}/archive/Python_release_%{version}.tar.gz Source1: keyczart.1 -BuildRequires: %{python_module setuptools} -BuildRequires: python-rpm-macros -%if %{with test} +Patch0: 0001-Fixes-output-value-changes-between-older-and-newer-p.patch BuildRequires: %{python_module pyasn1} BuildRequires: %{python_module pycrypto >= 2.0} -%endif +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros Requires: python-pyasn1 Requires: python-pycrypto >= 2.0 -Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch - %python_subpackages %description @@ -54,12 +52,14 @@ asymmetric keys. Some features of Keyczar include: %prep %setup -q -n %{pkgname}-Python_release_%{version}/python +%patch0 -p1 %build -%{python_build} +%python_build %install -%{python_install} +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} install -Dm644 %{SOURCE1} %{buildroot}%{_mandir}/man1/keyczart.1 %python_clone -a %{buildroot}%{_bindir}/keyczart %python_clone -a %{buildroot}%{_mandir}/man1/keyczart.1 @@ -74,13 +74,11 @@ install -Dm644 %{SOURCE1} %{buildroot}%{_mandir}/man1/keyczart.1 %check export PYTHONPATH=$(pwd)/build/lib pushd tests/keyczar_tests -# Upstream bugreport on the failing test case: https://github.com/google/keyczar/issues/209 -%{python_exec alltests.py || :} +%python_exec alltests.py popd %endif %files %{python_files} -%defattr(-,root,root) %doc README PKG-INFO doc/ %license LICENSE %python_alternative %{_mandir}/man1/keyczart.1%{ext_man}