diff --git a/_service b/_service index 7a080f4..540794c 100644 --- a/_service +++ b/_service @@ -1,7 +1,7 @@ tpm2-pytss - 2.1.0 + 2.2.0 git disable https://github.com/tpm2-software/tpm2-pytss.git diff --git a/_servicedata b/_servicedata index 9ed9d02..5dc308c 100644 --- a/_servicedata +++ b/_servicedata @@ -1,4 +1,4 @@ https://github.com/tpm2-software/tpm2-pytss.git - 9f27d0c0bdd42574b158c0372213e259fad80798 \ No newline at end of file + b9dae8373baad0f9f09a8d745a063f4960dd9369 \ No newline at end of file diff --git a/fix_pycparse_float128.patch b/fix_pycparse_float128.patch deleted file mode 100644 index c803b84..0000000 --- a/fix_pycparse_float128.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 9bcd83905e5b7e718fe3787600f3ecf957c66430 Mon Sep 17 00:00:00 2001 -From: Alberto Planas -Date: Fri, 17 Feb 2023 13:58:18 +0100 -Subject: [PATCH] setup: define __float128 for pycparse - -When compiling in 32bit stddef.h makes use of the __float128 type, that -pycparse cannot recognize. - -This patch define the type as "long double", fixing the issue in 32bits -platforms. - -Fix #497 - -Signed-off-by: Alberto Planas ---- - setup.py | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 17736597..4554db0b 100644 ---- a/setup.py -+++ b/setup.py -@@ -204,7 +204,11 @@ def get_mappings(self): - if policy_header_path: - pdata = preprocess_file( - policy_header_path, -- cpp_args=["-D__extension__=", "-D__attribute__(x)="], -+ cpp_args=[ -+ "-D__extension__=", -+ "-D__attribute__(x)=", -+ "-D__float128=long double", -+ ], - ) - parser = c_parser.CParser() - past = parser.parse(pdata, "tss2_policy.h") diff --git a/python-tpm2-pytss-RSAPrivateNumbers.patch b/python-tpm2-pytss-RSAPrivateNumbers.patch new file mode 100644 index 0000000..a1b5a2a --- /dev/null +++ b/python-tpm2-pytss-RSAPrivateNumbers.patch @@ -0,0 +1,53 @@ +Index: tpm2-pytss-2.2.0/src/tpm2_pytss/internal/crypto.py +=================================================================== +--- tpm2-pytss-2.2.0.orig/src/tpm2_pytss/internal/crypto.py ++++ tpm2-pytss-2.2.0/src/tpm2_pytss/internal/crypto.py +@@ -23,7 +23,7 @@ from cryptography.hazmat.primitives.ciph + from cryptography.hazmat.primitives.ciphers import modes, Cipher, CipherAlgorithm + from cryptography.hazmat.backends import default_backend + from cryptography.exceptions import UnsupportedAlgorithm, InvalidSignature +-from typing import Tuple, Type ++from typing import Tuple, Type, Any + import secrets + import sys + +@@ -220,7 +220,7 @@ def public_to_key(obj): + return key + + +-class _MyRSAPrivateNumbers(rsa.RSAPrivateNumbers): ++class _MyRSAPrivateNumbers: + def __init__(self, p: int, n: int, e: int, pubnums: rsa.RSAPublicNumbers): + + q = n // p +@@ -231,7 +231,12 @@ class _MyRSAPrivateNumbers(rsa.RSAPrivat + dmq1 = rsa.rsa_crt_dmq1(d, q) + iqmp = rsa.rsa_crt_iqmp(p, q) + +- super().__init__(p, q, d, dmp1, dmq1, iqmp, pubnums) ++ self._private_numbers = rsa.RSAPrivateNumbers( ++ p, q, d, dmp1, dmq1, iqmp, pubnums ++ ) ++ ++ def private_key(self, *args: Any, **kwargs: Any) -> rsa.RSAPrivateKey: ++ return self._private_numbers.private_key(*args, **kwargs) + + @staticmethod + def _xgcd(a: int, b: int) -> Tuple[int, int, int]: +@@ -251,15 +256,7 @@ class _MyRSAPrivateNumbers(rsa.RSAPrivat + # + @staticmethod + def _modinv(a, m): +- +- if sys.version_info < (3, 8): +- g, x, y = _MyRSAPrivateNumbers._xgcd(a, m) +- if g != 1: +- raise Exception("modular inverse does not exist") +- else: +- return x % m +- else: +- return pow(a, -1, m) ++ return pow(a, -1, m) + + @staticmethod + def _generate_d(p, q, e, n): diff --git a/python-tpm2-pytss.changes b/python-tpm2-pytss.changes index 59f2f6c..980554c 100644 --- a/python-tpm2-pytss.changes +++ b/python-tpm2-pytss.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Wed Feb 28 10:44:28 UTC 2024 - Pedro Monreal + +- Fix tpm2-pkcs11 build: + * internal/crypto: fix _MyRSAPrivateNumbers with cryptograpy >= 42.0.1 + * Upstream: github.com/tpm2-software/tpm2-pytss/pull/562 + * Add python-tpm2-pytss-RSAPrivateNumbers.patch + +------------------------------------------------------------------- +Tue Feb 27 18:21:56 UTC 2024 - Pedro Monreal + +- Update to version 2.2.0: + * docs: use same requirements as in setup.cfg + * policy: fix hardcoded size in description + * policy: fix hardcoded size in get_calculated_json + * readthedocs: switch to new build specification format + * test: test against python 3.12 + * test: skip tests if ECC curves aren't supported. + * init: provide a better error message for missing symbols + * scripts: remove references to TPMS_ALGORITHM_DESCRIPTION + * tctildr: use Tss2_TctiLdr_GetInfo to lookup tcti backend + * setup: fixup compilation with fortify source enabled + * setup: drop python 3.7 + * test: add check for renamed cryptography types + * constants: use relative import over absolute + * constants: support unmarshal and marshal routines + * ESAPI: fix check on ESYS_TR in policy_secret + * constants: add routine for making ESYS_TR from parts + * setup: define __float128 for pycparse + * Remove fix_pycparse_float128.patch fixed upstream + ------------------------------------------------------------------- Fri Feb 17 13:17:22 UTC 2023 - Alberto Planas Dominguez diff --git a/python-tpm2-pytss.spec b/python-tpm2-pytss.spec index d343cfb..43e938f 100644 --- a/python-tpm2-pytss.spec +++ b/python-tpm2-pytss.spec @@ -1,7 +1,7 @@ # -# spec file +# spec file for package python-tpm2-pytss # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,14 +21,14 @@ %define srcname tpm2-pytss %bcond_with test Name: python-%{srcname} -Version: 2.1.0 +Version: 2.2.0 Release: 0 Summary: Python bindings for TSS License: BSD-2-Clause -URL: https://github.com/tpm2-software/tpm2-pkcs11 +URL: https://github.com/tpm2-software/tpm2-pytss Source: %{srcname}-%{version}.tar.gz -# PATCH-FIX-UPSTREAM fix_pycparse_float128.patch gh#tpm2-software/tpm2-pytss#497 -Patch0: fix_pycparse_float128.patch +# PATCH-FIX-UPSTREAM Fix tpm2-pkcs11 build: github.com/tpm2-software/tpm2-pytss/pull/562 +Patch0: python-tpm2-pytss-RSAPrivateNumbers.patch BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module asn1crypto} BuildRequires: %{python_module cffi} diff --git a/tpm2-pytss-2.1.0.tar.gz b/tpm2-pytss-2.1.0.tar.gz deleted file mode 100644 index 78c77a9..0000000 --- a/tpm2-pytss-2.1.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98fed29ee2eb7abc8d82ba47a82aaf4eef2cb0907c7716c00b40dde01d472593 -size 208553 diff --git a/tpm2-pytss-2.2.0.tar.gz b/tpm2-pytss-2.2.0.tar.gz new file mode 100644 index 0000000..7a10ac0 --- /dev/null +++ b/tpm2-pytss-2.2.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68e1caf6fc81fc93392bc917a72a48bb149bf03acf1c3408ed3a8433095d94d2 +size 210068