public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jakub Jelen <jjelen@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/python-tpm2-pytss] rawhide: New upstream release 3.0.0
Date: Tue, 18 Aug 2026 10:46:09 GMT	[thread overview]
Message-ID: <178704996967.1.10848736417803838076.rpms-python-tpm2-pytss-997a16bc99e3@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/python-tpm2-pytss
Branch : rawhide
Commit : 997a16bc99e30865b7f4eabe992a57e72eacd87d
Author : Jakub Jelen <jjelen@redhat.com>
Date   : 2026-08-18T12:45:47+02:00
Stats  : +4/-747 in 11 file(s)
URL    : https://src.fedoraproject.org/rpms/python-tpm2-pytss/c/997a16bc99e30865b7f4eabe992a57e72eacd87d?branch=rawhide

Log:
New upstream release 3.0.0

---
diff --git a/.gitignore b/.gitignore
index e21deea..fb4186f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
 /tpm2-pytss-2.1.0.tar.gz
 /tpm2-pytss-2.2.1.tar.gz
 /tpm2-pytss-2.3.0.tar.gz
+/tpm2-pytss-3.0.0.tar.gz

diff --git a/3107f615.patch b/3107f615.patch
deleted file mode 100644
index dc60c8c..0000000
--- a/3107f615.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 3107f61574c27bb914549d6ce32d23d6320cd9f8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
-Date: Thu, 24 Jul 2025 00:21:32 +0200
-Subject: [PATCH] Do not require wheel for building
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
- - current version of setuptools (70.1+) does not need wheel at all
- - older versions of setuptools would fetch wheel when building wheels (but not sdists)
-
-----
-
-I was asked to include the Signed-off-by line, even thought here is no
-clear indication what it is for.
-The assumption is that it is for https://developercertificate.org/
-
-Signed-off-by: Miro Hrončok <miro@hroncok.cz>
----
- pyproject.toml | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pyproject.toml b/pyproject.toml
-index f0c3071d..918bbadf 100644
---- a/pyproject.toml
-+++ b/pyproject.toml
-@@ -1,5 +1,5 @@
- [build-system]
--requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]>=3.4.3", "pycparser", "pkgconfig"]
-+requires = ["setuptools>=44", "setuptools_scm[toml]>=3.4.3", "pycparser", "pkgconfig"]
- build-backend = "setuptools.build_meta"
- 
- [tool.setuptools_scm]

diff --git a/python-tpm2-pytss-2.3.0-secp192.patch b/python-tpm2-pytss-2.3.0-secp192.patch
deleted file mode 100644
index b6df378..0000000
--- a/python-tpm2-pytss-2.3.0-secp192.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-commit 3cd9d2e5f9b4760c4c178c6e6c23247249012611
-Author: Jakub Jelen <jjelen@redhat.com>
-Date:   Wed Jul 3 18:26:34 2024 +0200
-
-    tests: Use p384 instead of p192
-    
-    The p192 is not available on all platforms, such as Fedora.
-    
-    Signed-off-by: Jakub Jelen <jjelen@redhat.com>
-
-diff --git a/test/test_cryptography.py b/test/test_cryptography.py
-index ed3dd6f..7f1bad5 100644
---- a/test/test_cryptography.py
-+++ b/test/test_cryptography.py
-@@ -297,14 +297,14 @@ class TestCryptography(TSS2_EsapiTest):
-         )
-         privkey = tpm_ecc_private_key(self.ectx, handle)
- 
--        peer_key = ec.generate_private_key(ec.SECP192R1())
-+        peer_key = ec.generate_private_key(ec.SECP384R1())
-         peer_public_key = peer_key.public_key()
- 
-         with self.assertRaises(ValueError) as e:
-             privkey.exchange(ec.ECDH(), peer_public_key)
-         self.assertEqual(
-             str(e.exception),
--            "curve mismatch for peer key, got secp192r1, expected secp256r1",
-+            "curve mismatch for peer key, got secp384r1, expected secp256r1",
-         )
- 
-     def test_ecc_no_sign(self):
-

diff --git a/python-tpm2-pytss-bsd.patch b/python-tpm2-pytss-bsd.patch
deleted file mode 100644
index e163d6f..0000000
--- a/python-tpm2-pytss-bsd.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 55d28b259f1a68f60c937ea8be7815685d32757f Mon Sep 17 00:00:00 2001
-From: ethan-thompson <ethan.thompson@networkradius.com>
-Date: Wed, 24 Jul 2024 14:54:25 -0400
-Subject: [PATCH] fix: Check if system is running BSD. If so, update declared
- types accordingly.
-
-Signed-off-by: ethan-thompson <ethan.thompson@networkradius.com>
----
- setup.py | 48 ++++++++++++++++++++++++++++++++++++------------
- 1 file changed, 36 insertions(+), 12 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index 1b5f5135..a757b1a8 100644
---- a/setup.py
-+++ b/setup.py
-@@ -1,6 +1,7 @@
- import site
- import sys
- import os
-+import platform
- from setuptools import setup
- from setuptools.command.build_ext import build_ext
- from pkgconfig import pkgconfig
-@@ -183,9 +184,20 @@ def get_mappings(self):
-             raise RuntimeError(
-                 f"unable to find tss2_tpm2_types.h in {pk['include_dirs']}"
-             )
--        pdata = preprocess_file(
--            header_path, cpp_args=["-D__extension__=", "-D__attribute__(x)="]
--        )
-+
-+        if platform.system() == "FreeBSD":
-+            pdata = preprocess_file(
-+                header_path,
-+                cpp_args=[
-+                    "-D__builtin_va_list=char*",
-+                    "-D__extension__=",
-+                    "-D__attribute__(x)=",
-+                ],
-+            )
-+        else:
-+            pdata = preprocess_file(
-+                header_path, cpp_args=["-D__extension__=", "-D__attribute__(x)="]
-+            )
-         parser = c_parser.CParser()
-         ast = parser.parse(pdata, "tss2_tpm2_types.h")
-         tm = self.get_types(ast)
-@@ -202,15 +214,27 @@ def get_mappings(self):
-                     policy_header_path = hp
-                     break
-             if policy_header_path:
--                pdata = preprocess_file(
--                    policy_header_path,
--                    cpp_args=[
--                        "-D__extension__=",
--                        "-D__attribute__(x)=",
--                        "-D__float128=long double",
--                        "-D_FORTIFY_SOURCE=0",
--                    ],
--                )
-+                if platform.system() == "FreeBSD":
-+                    pdata = preprocess_file(
-+                        policy_header_path,
-+                        cpp_args=[
-+                            "-D__builtin_va_list=char*",
-+                            "-D__extension__=",
-+                            "-D__attribute__(x)=",
-+                            "-D__float128=long double",
-+                            "-D_FORTIFY_SOURCE=0",
-+                        ],
-+                    )
-+                else:
-+                    pdata = preprocess_file(
-+                        policy_header_path,
-+                        cpp_args=[
-+                            "-D__extension__=",
-+                            "-D__attribute__(x)=",
-+                            "-D__float128=long double",
-+                            "-D_FORTIFY_SOURCE=0",
-+                        ],
-+                    )
-                 parser = c_parser.CParser()
-                 past = parser.parse(pdata, "tss2_policy.h")
-                 ptm = self.get_types(past)
-

diff --git a/python-tpm2-pytss-copy-dunder.patch b/python-tpm2-pytss-copy-dunder.patch
deleted file mode 100644
index 46acf30..0000000
--- a/python-tpm2-pytss-copy-dunder.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 6ab4c74e6fb3da7cd38e97c1f8e92532312f8439 Mon Sep 17 00:00:00 2001
-From: Erik Larsson <who+github@cnackers.org>
-Date: Sun, 18 May 2025 14:01:20 +0200
-Subject: [PATCH] cryptograpy: add copy dunder for private keys
-
-cryptography >= 45.0.0 requires the copy dunder for private key implementations.
-
-Signed-off-by: Erik Larsson <who+github@cnackers.org>
----
- src/tpm2_pytss/cryptography.py | 12 ++++++++++++
- test/test_cryptography.py      | 19 +++++++++++++++++++
- 2 files changed, 31 insertions(+)
-
-diff --git a/src/tpm2_pytss/cryptography.py b/src/tpm2_pytss/cryptography.py
-index dd75623a..5b8432cc 100644
---- a/src/tpm2_pytss/cryptography.py
-+++ b/src/tpm2_pytss/cryptography.py
-@@ -257,6 +257,12 @@ def private_bytes(
-         """Always raises a NotImplementedError."""
-         raise NotImplementedError()
- 
-+    def __copy__(self) -> "tpm_rsa_private_key":
-+        """Returns a shallow copy of the private key."""
-+        return tpm_rsa_private_key(
-+            ectx=self._ectx, handle=self._handle, session=self._session
-+        )
-+
- 
- class tpm_ecc_private_key(ec.EllipticCurvePrivateKey):
-     """Interface to a TPM ECC key for use with the cryptography module.
-@@ -428,3 +434,9 @@ def private_bytes(
-     ) -> None:
-         """Always raises a NotImplementedError."""
-         raise NotImplementedError()
-+
-+    def __copy__(self) -> "tpm_ecc_private_key":
-+        """Returns a shallow copy of the private key."""
-+        return tpm_ecc_private_key(
-+            ectx=self._ectx, handle=self._handle, session=self._session
-+        )
-diff --git a/test/test_cryptography.py b/test/test_cryptography.py
-index 3f81f6a6..3e4f30d4 100644
---- a/test/test_cryptography.py
-+++ b/test/test_cryptography.py
-@@ -11,6 +11,7 @@
- from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
- from cryptography import x509
- import datetime
-+import copy
- 
- 
- rsa_template = TPM2B_PUBLIC.parse(
-@@ -502,3 +503,21 @@ def test_csr_builder_ecc(self):
-         halg = privkey.get_digest_algorithm()
-         csr = builder.sign(privkey, algorithm=halg())
-         self.assertEqual(csr.is_signature_valid, True)
-+
-+    def test_rsa_copy(self):
-+        handle, _, _, _, _ = self.ectx.create_primary(
-+            in_sensitive=None, in_public=rsa_template
-+        )
-+        privkey = tpm_rsa_private_key(self.ectx, handle)
-+        privkey_copy = copy.copy(privkey)
-+
-+        self.assertEqual(privkey.key_size, privkey_copy.key_size)
-+
-+    def test_ecc_copy(self):
-+        handle, _, _, _, _ = self.ectx.create_primary(
-+            in_sensitive=None, in_public=ecc_template
-+        )
-+        privkey = tpm_ecc_private_key(self.ectx, handle)
-+        privkey_copy = copy.copy(privkey)
-+
-+        self.assertEqual(type(privkey.curve), type(privkey_copy.curve))

diff --git a/python-tpm2-pytss-cryptography-decrepit.patch b/python-tpm2-pytss-cryptography-decrepit.patch
deleted file mode 100644
index 80ee11c..0000000
--- a/python-tpm2-pytss-cryptography-decrepit.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Backport of "crypto: fix deprection warnings"
-
-https://github.com/tpm2-software/tpm2-pytss/commit/f792d122ffe00e6264b0cc16458e1ba72d632cd9
-
-diff --git a/src/tpm2_pytss/internal/crypto.py b/src/tpm2_pytss/internal/crypto.py
-index c1b731e..952f118 100644
---- a/src/tpm2_pytss/internal/crypto.py
-+++ b/src/tpm2_pytss/internal/crypto.py
-@@ -19,8 +19,10 @@ from cryptography.hazmat.primitives.serialization import (
- from cryptography.x509 import load_pem_x509_certificate, load_der_x509_certificate
- from cryptography.hazmat.primitives.kdf.kbkdf import CounterLocation, KBKDFHMAC, Mode
- from cryptography.hazmat.primitives.kdf.concatkdf import ConcatKDFHash
--from cryptography.hazmat.primitives.ciphers.algorithms import AES, Camellia
-+from cryptography.hazmat.primitives.ciphers.algorithms import AES
-+from cryptography.hazmat.decrepit.ciphers.algorithms import Camellia
- from cryptography.hazmat.primitives.ciphers import modes, Cipher, CipherAlgorithm
-+import cryptography.hazmat.decrepit.ciphers.modes as decrepit_modes
- from cryptography.hazmat.backends import default_backend
- from cryptography.exceptions import UnsupportedAlgorithm, InvalidSignature
- from typing import Tuple, Type, Any
-@@ -52,7 +54,7 @@ if hasattr(hashes, "SM3"):
- _algtable = (
-     (TPM2_ALG.AES, AES),
-     (TPM2_ALG.CAMELLIA, Camellia),
--    (TPM2_ALG.CFB, modes.CFB),
-+    (TPM2_ALG.CFB, decrepit_modes.CFB),
- )
- 
- try:
-diff --git a/test/test_crypto.py b/test/test_crypto.py
-index 7abbecb..05e5f4f 100644
---- a/test/test_crypto.py
-+++ b/test/test_crypto.py
-@@ -537,7 +537,7 @@ class CryptoTest(TSS2_EsapiTest):
- 
-         (alg, mode, bits) = crypto._symdef_to_crypt(symdef)
-         self.assertEqual(alg, crypto.AES)
--        self.assertEqual(mode, crypto.modes.CFB)
-+        self.assertEqual(mode, crypto.decrepit_modes.CFB)
-         self.assertEqual(bits, 128)
- 
-         symdef.mode.sym = TPM2_ALG.LAST + 1

diff --git a/python-tpm2-pytss-cryptography47.patch b/python-tpm2-pytss-cryptography47.patch
deleted file mode 100644
index 92491ed..0000000
--- a/python-tpm2-pytss-cryptography47.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 5d15cad4bde28902a4becb8e2a8e915aba8abbd0 Mon Sep 17 00:00:00 2001
-From: Erik Larsson <who+github@cnackers.org>
-Date: Sun, 26 Apr 2026 11:50:55 +0200
-Subject: [PATCH] cryptography: fix support for cryptography 47.
-
-The abstract classes now require deepcopy support, so add that.
-
-Signed-off-by: Erik Larsson <who+github@cnackers.org>
----
- src/tpm2_pytss/cryptography.py | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
-
-diff --git a/src/tpm2_pytss/cryptography.py b/src/tpm2_pytss/cryptography.py
-index 5b8432cc..20dc34b2 100644
---- a/src/tpm2_pytss/cryptography.py
-+++ b/src/tpm2_pytss/cryptography.py
-@@ -263,6 +263,14 @@ def __copy__(self) -> "tpm_rsa_private_key":
-             ectx=self._ectx, handle=self._handle, session=self._session
-         )
- 
-+    def __deepcopy__(self, memo: dict) -> "tpm_rsa_private_key":
-+        """Retuns a copy of the private key.
-+
-+        Notes:
-+            This behaves as a shallow copy as we don't copy the ESAPI context.
-+        """
-+        return self.__copy__()
-+
- 
- class tpm_ecc_private_key(ec.EllipticCurvePrivateKey):
-     """Interface to a TPM ECC key for use with the cryptography module.
-@@ -440,3 +448,11 @@ def __copy__(self) -> "tpm_ecc_private_key":
-         return tpm_ecc_private_key(
-             ectx=self._ectx, handle=self._handle, session=self._session
-         )
-+
-+    def __deepcopy__(self, memo: dict) -> "tpm_ecc_private_key":
-+        """Retuns a copy of the private key.
-+
-+        Notes:
-+            This behaves as a shallow copy as we don't copy the ESAPI context.
-+        """
-+        return self.__copy__()

diff --git a/python-tpm2-pytss-gcc15.patch b/python-tpm2-pytss-gcc15.patch
deleted file mode 100644
index ff693dc..0000000
--- a/python-tpm2-pytss-gcc15.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 61d00b4dcca131b3f03f674ceabf4260bdbd6a61 Mon Sep 17 00:00:00 2001
-From: Christopher Byrne <salah.coronya@gmail.com>
-Date: Sun, 15 Dec 2024 17:06:13 -0600
-Subject: [PATCH] setup.py: Explicilty use C99 for preprocessing
-
-GCC 15 uses -std=c23 by default, which causes pycparser to error out
-with "pycparser.plyparser.ParseError:
-/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/stddef.h:450:31:
-before: nullptr_t". As pcyparser only supports completely C99,
-this shouldn't be an issue.
-
-Signed-off-by: Christopher Byrne <salah.coronya@gmail.com>
----
- setup.py | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/setup.py b/setup.py
-index 3613cd5f..2d77fd56 100644
---- a/setup.py
-+++ b/setup.py
-@@ -189,6 +189,7 @@ def get_mappings(self):
-             pdata = preprocess_file(
-                 header_path,
-                 cpp_args=[
-+                    "-std=c99",
-                     "-D__builtin_va_list=char*",
-                     "-D__extension__=",
-                     "-D__attribute__(x)=",
-@@ -196,7 +197,8 @@ def get_mappings(self):
-             )
-         else:
-             pdata = preprocess_file(
--                header_path, cpp_args=["-D__extension__=", "-D__attribute__(x)="]
-+                header_path,
-+                cpp_args=["-std=c99", "-D__extension__=", "-D__attribute__(x)="],
-             )
-         parser = c_parser.CParser()
-         ast = parser.parse(pdata, "tss2_tpm2_types.h")
-@@ -218,6 +220,7 @@ def get_mappings(self):
-                     pdata = preprocess_file(
-                         policy_header_path,
-                         cpp_args=[
-+                            "-std=c99",
-                             "-D__builtin_va_list=char*",
-                             "-D__extension__=",
-                             "-D__attribute__(x)=",
-@@ -229,6 +232,7 @@ def get_mappings(self):
-                     pdata = preprocess_file(
-                         policy_header_path,
-                         cpp_args=[
-+                            "-std=c99",
-                             "-D__extension__=",
-                             "-D__attribute__(x)=",
-                             "-D__float128=long double",
-

diff --git a/python-tpm2-pytss-raw-regex.patch b/python-tpm2-pytss-raw-regex.patch
deleted file mode 100644
index da25c81..0000000
--- a/python-tpm2-pytss-raw-regex.patch
+++ /dev/null
@@ -1,358 +0,0 @@
-From cd433019cf109986d523ab4dc644af723f6f0d59 Mon Sep 17 00:00:00 2001
-From: Erik Larsson <who+github@cnackers.org>
-Date: Sun, 14 Jul 2024 00:01:17 +0200
-Subject: [PATCH] scripts: fix regex for header preparation
-
-There are more upstream header file changes, so make sure we handle them correctly.
-
-Signed-off-by: Erik Larsson <who+github@cnackers.org>
----
- scripts/prepare_headers.py | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/scripts/prepare_headers.py b/scripts/prepare_headers.py
-index a7529b36..be34fee5 100644
---- a/scripts/prepare_headers.py
-+++ b/scripts/prepare_headers.py
-@@ -37,6 +37,7 @@ def remove_common_guards(s):
-     s = re.sub(
-         "(#define [A-Za-z0-9_]+) .*\n.*?.*\)\)", "\g<1>...", s, flags=re.MULTILINE
-     )
-+    s = re.sub("(#define +[A-Za-z0-9_]+) +\((-?\d+)\)", "\g<1> \g<2>", s)
-     s = re.sub("(#define [A-Za-z0-9_]+) .*", "\g<1>...", s)
- 
-     # Restructure structs and untions with ...
-
-From dba34b3a0af39122381d613a7beb3a0d46b7ae21 Mon Sep 17 00:00:00 2001
-From: Erik Larsson <who+github@cnackers.org>
-Date: Mon, 3 Feb 2025 09:56:17 +0100
-Subject: [PATCH] scripts: fix regexp for poll stuff
-
-Support for zephyr in tpm2-tss broke the removal of poll conditionals.
-So make the matching more flexible.
-
-Signed-off-by: Erik Larsson <who+github@cnackers.org>
----
- scripts/prepare_headers.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/scripts/prepare_headers.py b/scripts/prepare_headers.py
-index be34fee5..ecbe22fd 100644
---- a/scripts/prepare_headers.py
-+++ b/scripts/prepare_headers.py
-@@ -48,7 +48,7 @@ def remove_common_guards(s):
- 
- def remove_poll_stuff(s, poll_handle_type):
- 
--    r = r"#if defined\(__linux__\) \|\| defined\(__unix__\) \|\| defined\(__APPLE__\) \|\| defined \(__QNXNTO__\) \|\| defined \(__VXWORKS__\)(\n.*)+#endif\n#endif"
-+    r = r"#if defined\(__linux__\).*(\n.*)+#endif\n#endif"
- 
-     s = re.sub(r, f"typedef struct pollfd {poll_handle_type};", s)
-     return s
-
-
-
-From 6e02235e03eaab003d0bb94fd70ea16c684e6ff4 Mon Sep 17 00:00:00 2001
-From: Erik Larsson <who+github@cnackers.org>
-Date: Sun, 9 Feb 2025 16:27:29 +0100
-Subject: [PATCH] scripts: use raw strings for regular expressions
-
-Use raw strings for all regular expressions.
-This fixes the related syntax warnings during the build process.
-
-Signed-off-by: Erik Larsson <who+github@cnackers.org>
----
- scripts/prepare_headers.py | 80 ++++++++++++++++++++------------------
- 1 file changed, 43 insertions(+), 37 deletions(-)
-
-diff --git a/scripts/prepare_headers.py b/scripts/prepare_headers.py
-index ecbe22fd..792c8bb8 100644
---- a/scripts/prepare_headers.py
-+++ b/scripts/prepare_headers.py
-@@ -12,36 +12,36 @@
- def remove_common_guards(s):
- 
-     # Remove includes and guards
--    s = re.sub("#ifndef.*", "", s)
--    s = re.sub("#if .*", "", s)
--    s = re.sub("#define .*_H_*?\n", "", s)
--    s = re.sub("#endif.*", "", s)
--    s = re.sub("#error.*", "", s)
--    s = re.sub('#ifdef __cplusplus\nextern "C" {', "", s, flags=re.MULTILINE)
--    s = re.sub("#ifdef __cplusplus\n}", "", s, flags=re.MULTILINE)
--    s = re.sub("#include.*", "", s)
-+    s = re.sub(r"#ifndef.*", r"", s)
-+    s = re.sub(r"#if .*", r"", s)
-+    s = re.sub(r"#define .*_H_*?\n", r"", s)
-+    s = re.sub(r"#endif.*", r"", s)
-+    s = re.sub(r"#error.*", r"", s)
-+    s = re.sub(r'#ifdef __cplusplus\nextern "C" {', r"", s, flags=re.MULTILINE)
-+    s = re.sub(r"#ifdef __cplusplus\n}", r"", s, flags=re.MULTILINE)
-+    s = re.sub(r"#include.*", "", s)
- 
-     # Remove certain macros
--    s = re.sub("#define TSS2_API_VERSION.*", "", s)
--    s = re.sub("#define TSS2_ABI_VERSION.*", "", s)
--    s = re.sub("#define TSS2_RC_LAYER\(level\).*", "", s)
--    s = re.sub("(#define.*)TSS2_RC_LAYER\(0xff\)", "\g<1>0xff0000", s)
-+    s = re.sub(r"#define TSS2_API_VERSION.*", r"", s)
-+    s = re.sub(r"#define TSS2_ABI_VERSION.*", r"", s)
-+    s = re.sub(r"#define TSS2_RC_LAYER\(level\).*", r"", s)
-+    s = re.sub(r"(#define.*)TSS2_RC_LAYER\(0xff\)", r"\g<1>0xff0000", s)
- 
-     # Remove comments
--    s = re.sub("/\*.*?\*/", "", s, flags=re.MULTILINE)
-+    s = re.sub(r"/\*.*?\*/", "", s, flags=re.MULTILINE)
- 
-     # Restructure #defines with ...
--    s = re.sub("(#define [A-Za-z0-9_]+) +\(\(.*?\) \(.*?\)\)", "\g<1>...", s)
--    s = re.sub("(#define [A-Za-z0-9_]+) +\(\(\(.*?\) .*\)", "\g<1>...", s)
--    s = re.sub("(#define [A-Za-z0-9_]+) +\(\(.*?\).*?\) ", "\g<1>...", s)
-+    s = re.sub(r"(#define [A-Za-z0-9_]+) +\(\(.*?\) \(.*?\)\)", r"\g<1>...", s)
-+    s = re.sub(r"(#define [A-Za-z0-9_]+) +\(\(\(.*?\) .*\)", r"\g<1>...", s)
-+    s = re.sub(r"(#define [A-Za-z0-9_]+) +\(\(.*?\).*?\) ", r"\g<1>...", s)
-     s = re.sub(
--        "(#define [A-Za-z0-9_]+) .*\n.*?.*\)\)", "\g<1>...", s, flags=re.MULTILINE
-+        r"(#define [A-Za-z0-9_]+) .*\n.*?.*\)\)", r"\g<1>...", s, flags=re.MULTILINE
-     )
--    s = re.sub("(#define +[A-Za-z0-9_]+) +\((-?\d+)\)", "\g<1> \g<2>", s)
--    s = re.sub("(#define [A-Za-z0-9_]+) .*", "\g<1>...", s)
-+    s = re.sub(r"(#define +[A-Za-z0-9_]+) +\((-?\d+)\)", r"\g<1> \g<2>", s)
-+    s = re.sub(r"(#define [A-Za-z0-9_]+) .*", r"\g<1>...", s)
- 
-     # Restructure structs and untions with ...
--    s = re.sub("\[.+?\]", "[...]", s)
-+    s = re.sub(r"\[.+?\]", r"[...]", s)
- 
-     return s
- 
-@@ -50,7 +50,7 @@ def remove_poll_stuff(s, poll_handle_type):
- 
-     r = r"#if defined\(__linux__\).*(\n.*)+#endif\n#endif"
- 
--    s = re.sub(r, f"typedef struct pollfd {poll_handle_type};", s)
-+    s = re.sub(r, rf"typedef struct pollfd {poll_handle_type};", s)
-     return s
- 
- 
-@@ -58,9 +58,9 @@ def remove_INTERNALBUILD(s):
- 
-     r = r"#if\s+defined\(INTERNALBUILD\)(?:(?!endif).)*#endif"
-     s = re.sub(r, "", s, flags=re.MULTILINE | re.DOTALL)
--    s = re.sub(r"DEPRECATED", "", s)
-+    s = re.sub(r"DEPRECATED", r"", s)
- 
--    return re.sub(r"__attribute__\(\(deprecated\)\)", "", s)
-+    return re.sub(r"__attribute__\(\(deprecated\)\)", r"", s)
- 
- 
- def prepare_common(dirpath):
-@@ -76,8 +76,8 @@ def prepare_types(dirpath):
- 
-     # Remove false define (workaround)
-     s = re.sub(
--        "#define TPM2_MAX_TAGGED_POLICIES.*\n.*TPMS_TAGGED_POLICY\)\)",
--        "",
-+        r"#define TPM2_MAX_TAGGED_POLICIES.*\n.*TPMS_TAGGED_POLICY\)\)",
-+        r"",
-         s,
-         flags=re.MULTILINE,
-     )
-@@ -85,11 +85,13 @@ def prepare_types(dirpath):
-     s = remove_INTERNALBUILD(s)
- 
-     s = re.sub(
--        "typedef struct TPMS_ALGORITHM_DESCRIPTION TPMS_ALGORITHM_DESCRIPTION ;", "", s
-+        r"typedef struct TPMS_ALGORITHM_DESCRIPTION TPMS_ALGORITHM_DESCRIPTION ;",
-+        r"",
-+        s,
-     )
- 
-     s = re.sub(
--        r"struct TPMS_ALGORITHM_DESCRIPTION {\n.*\n.*\n} ;", "", s, flags=re.MULTILINE
-+        r"struct TPMS_ALGORITHM_DESCRIPTION {\n.*\n.*\n} ;", r"", s, flags=re.MULTILINE
-     )
- 
-     return remove_common_guards(s)
-@@ -99,12 +101,12 @@ def prepare_tcti(dirpath):
- 
-     s = pathlib.Path(dirpath, "tss2_tcti.h").read_text(encoding="utf-8")
- 
--    s = re.sub("#ifndef TSS2_API_VERSION.*\n.*\n#endif", "", s, flags=re.MULTILINE)
-+    s = re.sub(r"#ifndef TSS2_API_VERSION.*\n.*\n#endif", r"", s, flags=re.MULTILINE)
- 
-     s = remove_poll_stuff(s, "TSS2_TCTI_POLL_HANDLE")
- 
--    s = re.sub(r"#define TSS2_TCTI_.*\n.*", "", s, flags=re.MULTILINE)
--    s = re.sub(r"^\s*#define Tss2_Tcti_(?:.*\\\r?\n)*.*$", "", s, flags=re.MULTILINE)
-+    s = re.sub(r"#define TSS2_TCTI_.*\n.*", r"", s, flags=re.MULTILINE)
-+    s = re.sub(r"^\s*#define Tss2_Tcti_(?:.*\\\r?\n)*.*$", r"", s, flags=re.MULTILINE)
- 
-     s += """
-     struct pollfd {
-@@ -269,20 +271,24 @@ def prepare_mu(dirpath):
-     # At least tpm2-tss 3.0.3 have duplicated BYTE (un)marshal functions which break cffi
-     # So removing them is needed until 3.1.x has reached most distributions
-     n = re.findall(
--        "TSS2_RC\s+Tss2_MU_BYTE_Marshal\(.+?\);", s, re.DOTALL | re.MULTILINE
-+        r"TSS2_RC\s+Tss2_MU_BYTE_Marshal\(.+?\);", s, re.DOTALL | re.MULTILINE
-     )
-     if len(n) > 1:
-         s = re.sub(
--            "TSS2_RC\s+Tss2_MU_BYTE_Marshal\(.+?\);", "", s, 1, re.DOTALL | re.MULTILINE
-+            r"TSS2_RC\s+Tss2_MU_BYTE_Marshal\(.+?\);",
-+            r"",
-+            s,
-+            1,
-+            re.DOTALL | re.MULTILINE,
-         )
- 
-     n = re.findall(
--        "TSS2_RC\s+Tss2_MU_BYTE_Unmarshal\(.+?\);", s, re.DOTALL | re.MULTILINE
-+        r"TSS2_RC\s+Tss2_MU_BYTE_Unmarshal\(.+?\);", s, re.DOTALL | re.MULTILINE
-     )
-     if len(n) > 1:
-         s = re.sub(
--            "TSS2_RC\s+Tss2_MU_BYTE_Unmarshal\(.+?\);",
--            "",
-+            r"TSS2_RC\s+Tss2_MU_BYTE_Unmarshal\(.+?\);",
-+            r"",
-             s,
-             1,
-             re.DOTALL | re.MULTILINE,
-@@ -290,7 +296,7 @@ def prepare_mu(dirpath):
- 
-     s = re.sub(
-         r"TSS2_RC\s+Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Marshal\(.+?\)\s+;",
--        "",
-+        r"",
-         s,
-         1,
-         re.DOTALL | re.MULTILINE,
-@@ -312,7 +318,7 @@ def prepare_policy(dirpath):
-     s = remove_common_guards(s)
-     # cparser complains if a typedef of an enum is before the definition of the enum
-     s = re.sub(
--        "typedef enum TSS2_POLICY_PCR_SELECTOR TSS2_POLICY_PCR_SELECTOR;", "", s, 1
-+        r"typedef enum TSS2_POLICY_PCR_SELECTOR TSS2_POLICY_PCR_SELECTOR;", r"", s, 1
-     )
-     s = re.sub(
-         r"(enum TSS2_POLICY_PCR_SELECTOR.*?\};)",
-
-
-From 9cc11edbe174dc71cf77c841b5a99717a85b7471 Mon Sep 17 00:00:00 2001
-From: Erik Larsson <who+github@cnackers.org>
-Date: Wed, 12 Nov 2025 14:50:40 +0100
-Subject: [PATCH] scripts: update regex for current head of tpm2-tss
-
-There have some more changes to the tpm2-tss headers, so we need to update the regular expressions.
-Also cleaned up the code a bit and added comments.
-
-Signed-off-by: Erik Larsson <who+github@cnackers.org>
----
- scripts/prepare_headers.py | 42 +++++++++++++++++++++-----------------
- 1 file changed, 23 insertions(+), 19 deletions(-)
-
-diff --git a/scripts/prepare_headers.py b/scripts/prepare_headers.py
-index 792c8bb8..2488ef03 100644
---- a/scripts/prepare_headers.py
-+++ b/scripts/prepare_headers.py
-@@ -10,6 +10,8 @@
- 
- 
- def remove_common_guards(s):
-+    # merge split lines
-+    s = s.replace("\\\n", "")
- 
-     # Remove includes and guards
-     s = re.sub(r"#ifndef.*", r"", s)
-@@ -28,18 +30,17 @@ def remove_common_guards(s):
-     s = re.sub(r"(#define.*)TSS2_RC_LAYER\(0xff\)", r"\g<1>0xff0000", s)
- 
-     # Remove comments
--    s = re.sub(r"/\*.*?\*/", "", s, flags=re.MULTILINE)
-+    s = re.sub(r"/\*.*\n*\*/", "", s, flags=re.MULTILINE)
- 
-     # Restructure #defines with ...
--    s = re.sub(r"(#define [A-Za-z0-9_]+) +\(\(.*?\) \(.*?\)\)", r"\g<1>...", s)
--    s = re.sub(r"(#define [A-Za-z0-9_]+) +\(\(\(.*?\) .*\)", r"\g<1>...", s)
--    s = re.sub(r"(#define [A-Za-z0-9_]+) +\(\(.*?\).*?\) ", r"\g<1>...", s)
-+    # handles ((TYPE)NUMBER)
-     s = re.sub(
--        r"(#define [A-Za-z0-9_]+) .*\n.*?.*\)\)", r"\g<1>...", s, flags=re.MULTILINE
-+        r"(#define +[A-Za-z0-9_]+)\s+\(\(\w+\)([0-9A-Fa-fxX]+)\)\)*", r"\g<1> \g<2>", s
-     )
--    s = re.sub(r"(#define +[A-Za-z0-9_]+) +\((-?\d+)\)", r"\g<1> \g<2>", s)
--    s = re.sub(r"(#define [A-Za-z0-9_]+) .*", r"\g<1>...", s)
--
-+    # handles other defines
-+    s = re.sub(r"(#define +[A-Za-z0-9_]+)\s+[^0-9\s].*", r"\g<1>...", s)
-+    # remove macros
-+    s = re.sub(r"(#define +[A-Za-z0-9_]+)\s*\(.*?\).*", r"", s)
-     # Restructure structs and untions with ...
-     s = re.sub(r"\[.+?\]", r"[...]", s)
- 
-@@ -278,8 +279,8 @@ def prepare_mu(dirpath):
-             r"TSS2_RC\s+Tss2_MU_BYTE_Marshal\(.+?\);",
-             r"",
-             s,
--            1,
--            re.DOTALL | re.MULTILINE,
-+            count=1,
-+            flags=re.DOTALL | re.MULTILINE,
-         )
- 
-     n = re.findall(
-@@ -290,24 +291,24 @@ def prepare_mu(dirpath):
-             r"TSS2_RC\s+Tss2_MU_BYTE_Unmarshal\(.+?\);",
-             r"",
-             s,
--            1,
--            re.DOTALL | re.MULTILINE,
-+            count=1,
-+            flags=re.DOTALL | re.MULTILINE,
-         )
- 
-     s = re.sub(
-         r"TSS2_RC\s+Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Marshal\(.+?\)\s+;",
-         r"",
-         s,
--        1,
--        re.DOTALL | re.MULTILINE,
-+        count=1,
-+        flags=re.DOTALL | re.MULTILINE,
-     )
- 
-     s = re.sub(
-         r"TSS2_RC\s+Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Unmarshal\(.+?\)\s+;",
-         "",
-         s,
--        1,
--        re.DOTALL | re.MULTILINE,
-+        count=1,
-+        flags=re.DOTALL | re.MULTILINE,
-     )
- 
-     return s
-@@ -318,14 +319,17 @@ def prepare_policy(dirpath):
-     s = remove_common_guards(s)
-     # cparser complains if a typedef of an enum is before the definition of the enum
-     s = re.sub(
--        r"typedef enum TSS2_POLICY_PCR_SELECTOR TSS2_POLICY_PCR_SELECTOR;", r"", s, 1
-+        r"typedef enum TSS2_POLICY_PCR_SELECTOR TSS2_POLICY_PCR_SELECTOR;",
-+        r"",
-+        s,
-+        count=1,
-     )
-     s = re.sub(
-         r"(enum TSS2_POLICY_PCR_SELECTOR.*?\};)",
-         r"\1" + "\ntypedef enum TSS2_POLICY_PCR_SELECTOR TSS2_POLICY_PCR_SELECTOR;",
-         s,
--        1,
--        re.DOTALL | re.MULTILINE,
-+        count=1,
-+        flags=re.DOTALL | re.MULTILINE,
-     )
-     s += """
-     extern "Python" TSS2_RC _policy_cb_calc_pcr(
-

diff --git a/python-tpm2-pytss.spec b/python-tpm2-pytss.spec
index 47fa39d..c105bc7 100644
--- a/python-tpm2-pytss.spec
+++ b/python-tpm2-pytss.spec
@@ -2,35 +2,13 @@
 %global _name tpm2_pytss
 
 Name:           python-%{pypi_name}
-Version:        2.3.0
+Version:        3.0.0
 Release:        %autorelease
 Summary:        TPM 2.0 TSS Bindings for Python
 
 License:        BSD-2-Clause
 URL:            https://github.com/tpm2-software/tpm2-pytss
 Source:         %{pypi_source %{pypi_name}}
-# https://github.com/tpm2-software/tpm2-pytss/pull/585
-Patch1:         %{name}-2.3.0-secp192.patch
-# https://github.com/tpm2-software/tpm2-pytss/pull/589
-Patch2:         %{name}-bsd.patch
-# https://github.com/tpm2-software/tpm2-pytss/pull/615
-Patch3:         %{name}-gcc15.patch
-# cryptograpy: add copy dunder for private keys
-# cryptography >= 45.0.0 requires the copy dunder for private key implementations.
-# https://github.com/tpm2-software/tpm2-pytss/commit/6ab4c74e6fb3da7cd38e97c1f8e92532312f8439
-Patch4:         %{name}-copy-dunder.patch
-# cryptography: fix support for cryptography 47.
-Patch5:         %{name}-cryptography47.patch
-# crypto: fix deprection warnings (backport)
-Patch6:         %{name}-cryptography-decrepit.patch
-# Drop redundant BuildRequires for python3-wheel
-# https://github.com/fedora-eln/eln/issues/284
-Patch7:         https://github.com/tpm2-software/tpm2-pytss/commit/3107f615.patch
-# cd433019cf109986d523ab4dc644af723f6f0d59
-# dba34b3a0af39122381d613a7beb3a0d46b7ae21
-# 6e02235e03eaab003d0bb94fd70ea16c684e6ff4
-# 9cc11edbe174dc71cf77c841b5a99717a85b7471
-Patch8:         python-tpm2-pytss-raw-regex.patch
 
 BuildRequires:  python3-devel
 BuildRequires:  python3-pytest
@@ -61,7 +39,7 @@ Summary:        %{summary}
 %description -n python3-%{pypi_name} %{_description}
 
 %prep
-%autosetup -p1 -n %{pypi_name}-%{version}
+%autosetup -p1 -n %{_name}-%{version}
 
 %generate_buildrequires
 %pyproject_buildrequires

diff --git a/sources b/sources
index 0ca2639..c620331 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (tpm2-pytss-2.3.0.tar.gz) = d0f76aec77afa773ec0ed7878a0ca4ef3b3475aa64f219d7a5afd89cbca795457536b0a9b5ffa14704200dcb35a89df36f9fc799694f7cc3cfbf98ea551628b1
+SHA512 (tpm2-pytss-3.0.0.tar.gz) = c69245c6bdc5a92884c8267c3de79570880bfc2498f31bddfdb03ad21aac7932327d4d28d93bc5de6d47c99397d411a8b4c11566311a166fe4648d47cab5bad4

                 reply	other threads:[~2026-08-18 10:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178704996967.1.10848736417803838076.rpms-python-tpm2-pytss-997a16bc99e3@fedoraproject.org \
    --to=jjelen@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox