Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-tpm2-pytss for 
openSUSE:Factory checked in at 2026-11-19 16:54:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tpm2-pytss (Old)
 and      /work/SRC/openSUSE:Factory/.python-tpm2-pytss.new.1251 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-tpm2-pytss"

Thu Nov 19 16:54:59 2026 rev:8 rq:1398548 version:3.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tpm2-pytss/python-tpm2-pytss.changes      
2025-08-08 15:13:10.191422867 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-tpm2-pytss.new.1251/python-tpm2-pytss.changes
    2026-11-19 16:55:18.399270380 +0100
@@ -1,0 +2,39 @@
+Thu Nov 19 04:14:16 UTC 2026 - Steve Kowalik <[email protected]>
+
+- Update to 3.0.0:
+  * Restore environment when exiting FAPIConfig
+  * Fix ESAPI.hierarchy_control support for PLATFORM_NV hierarchy
+  * Fix FAPI callback buffer lifetimes (fixes free-threaded Python issues)
+  * Fix ECC seed length calculation in __ecc_secret_to_seed
+  * Fix memory leak in FAPI
+  * Use block size instead of key size for symmetric encryption IV
+  * Add a context manager for ESYS handles that flushes the handle at exit
+  * Add SVN, ACT, and other missing constants
+  * Add the ESAPI command certify_x509
+  * Add the ESAPI command act_set_timeout
+  * Add copy dunder for cryptography private keys
+  * Add the ESAPI command trsess_get_attributes
+  * Add signature scheme structures
+  * Add marshal/unmarshal structures for TPM2_HANDLE
+  * Add command_parser module to decode TPM 2.0 command/response streams
+  * Support passing prehashed data to TPMT_SIGNATURE.verify_signature
+  * Add marshal/unmarshal methods to union types (requiring a selector)
+  * Add equal dunder to struct types for comparing instances
+  * Add support for Python 3.14
+  * Make the symmetric argument to start_auth_session optional
+  * Accept None for the pcr_digest argument in policy_pcr
+  * Support looking up EK templates by other names (e.g. L-1 or H-2)
+  * Make the validation ticket for sign optional (defaults to NULL ticket)
+  * Reorder ESAPI.policy_signed, policy_ticket, and policy_authorize
+    arguments to make trailing parameters optional
+  * Drop asn1crypto and use cryptography's ASN.1 serializer/deserializer
+  * Remove support for the tools encoder/decoder
+  * Drop support for Python 3.9
+- Ship the README in built packages.
+- Drop service and servicedata, we're using GitHub sources.
+- Always run the testsuite.
+- Drop patch use-c99-for-preproccessing.patch, merged upstream.
+- Add patch use-after-free-nvpublic.patch:
+  * Copy a callback into CFFI-controlled memory, so we don't outlive it.
+
+-------------------------------------------------------------------

Old:
----
  _service
  _servicedata
  tpm2-pytss-2.3.0.tar.gz
  use-c99-for-preproccessing.patch

New:
----
  tpm2-pytss-3.0.0.tar.gz
  use-after-free-nvpublic.patch

----------(Old B)----------
  Old:- Always run the testsuite.
- Drop patch use-c99-for-preproccessing.patch, merged upstream.
- Add patch use-after-free-nvpublic.patch:
----------(Old E)----------

----------(New B)----------
  New:- Drop patch use-c99-for-preproccessing.patch, merged upstream.
- Add patch use-after-free-nvpublic.patch:
  * Copy a callback into CFFI-controlled memory, so we don't outlive it.
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-tpm2-pytss.spec ++++++
--- /var/tmp/diff_new_pack.MEBTej/_old  2026-11-19 16:55:19.241306073 +0100
+++ /var/tmp/diff_new_pack.MEBTej/_new  2026-11-19 16:55:19.242306115 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-tpm2-pytss
 #
-# Copyright (c) 2025 SUSE LLC and contributors
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,21 +18,18 @@
 
 %define pythons python3
 %define srcname tpm2-pytss
-%bcond_with     test
 Name:           python-%{srcname}
-Version:        2.3.0
+Version:        3.0.0
 Release:        0
 Summary:        Python bindings for TSS
 License:        BSD-2-Clause
 URL:            https://github.com/tpm2-software/tpm2-pytss
 Source:         
https://github.com/tpm2-software/%{srcname}/archive/refs/tags/%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
-#PATCH-FIX-UPSTREAM use-c99-for-preproccessing.patch from 
https://github.com/tpm2-software/tpm2-pytss/commit/61d00b4dcca131b3f03f674ceabf4260bdbd6a61
-Patch:          use-c99-for-preproccessing.patch
-BuildRequires:  %{python_module PyYAML}
-BuildRequires:  %{python_module asn1crypto}
+# PATCH-FIX-UPSTREAM gh#tpm2-software/tpm2-pytss#702
+Patch0:         use-after-free-nvpublic.patch
 BuildRequires:  %{python_module cffi}
 BuildRequires:  %{python_module cryptography}
-BuildRequires:  %{python_module devel}
+BuildRequires:  %{python_module devel >= 3.10}
 BuildRequires:  %{python_module packaging}
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module pkgconfig}
@@ -45,19 +42,15 @@
 BuildRequires:  python-rpm-macros
 BuildRequires:  pkgconfig(tss2-esys)
 BuildRequires:  pkgconfig(tss2-fapi)
-Requires:       python3-PyYAML
-Requires:       python3-asn1crypto
 Requires:       python3-cffi
 Requires:       python3-cryptography
 Requires:       python3-packaging
 Requires:       pkgconfig(tss2-esys)
 Requires:       pkgconfig(tss2-fapi)
-%if %{with test}
 # SECTION test requirements
 BuildRequires:  %{python_module pytest}
 BuildRequires:  swtpm
 # /SECTION
-%endif
 %python_subpackages
 
 %description
@@ -75,25 +68,20 @@
 %autosetup -p1 -n %{srcname}-%{version}
 
 %build
-# Provides a PKG-INFO with "version" for setuptools_scm
-cat <<EOF > PKG-INFO
-Metadata-Version: 1.1
-Version:        %{version}
-EOF
 export CFLAGS="%{optflags}"
+export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
 %pyproject_wheel
 
 %install
 %pyproject_install
 %python_expand %fdupes %{buildroot}%{$python_sitearch}
 
-%if %{with test}
 %check
 %pytest_arch
-%endif
 
 %files %{python_files}
 %license LICENSE
+%doc README.md
 %{python_sitearch}/tpm2_pytss
 %{python_sitearch}/tpm2_pytss-%{version}.dist-info
 

++++++ tpm2-pytss-2.3.0.tar.gz -> tpm2-pytss-3.0.0.tar.gz ++++++
++++ 11317 lines of diff (skipped)

++++++ use-after-free-nvpublic.patch ++++++
>From 1263a1552c1120e157ba3944aee7628797655a73 Mon Sep 17 00:00:00 2001
From: Steve Kowalik <[email protected]>
Date: Thu, 19 Nov 2026 15:04:25 +1100
Subject: [PATCH] fix(policy): copy TPMS_NV_PUBLIC in polauthnv callback

_policy_cb_exec_polauthnv wrapped the borrowed TPMS_NV_PUBLIC pointer
from libtss2-policy directly without copying it. Once Tss2_PolicyExecute
returns, libtss2-policy frees its temporary buffer, leaving any saved
TPMS_NV_PUBLIC instance with a dangling pointer. Copy the struct into
CFFI-managed memory so the Python object can safely outlive the
callback.

Signed-off-by: Steve Kowalik <[email protected]>
---
 src/tpm2_pytss/policy.py |  2 +-
 test/test_policy.py      | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/tpm2_pytss/policy.py b/src/tpm2_pytss/policy.py
index cc6beadf..b044dc75 100644
--- a/src/tpm2_pytss/policy.py
+++ b/src/tpm2_pytss/policy.py
@@ -326,7 +326,7 @@ def _policy_cb_exec_polauthnv(nv_public, hash_alg, 
userdata):
     if not cb:
         return TSS2_RC.POLICY_RC_NULL_CALLBACK
     try:
-        nvp = TPMS_NV_PUBLIC(nv_public)
+        nvp = TPMS_NV_PUBLIC(ffi.new("TPMS_NV_PUBLIC *", nv_public[0]))
         halg = TPM2_ALG(hash_alg)
         cb(nvp, halg)
     except Exception as e:
diff --git a/test/test_policy.py b/test/test_policy.py
index d8a93a17..c7c96b1a 100644
--- a/test/test_policy.py
+++ b/test/test_policy.py
@@ -862,3 +862,23 @@ def bad_cb(*args):
             p.set_callback(policy_cb_types.EXEC_POLACTION, bad_cb)
             p.execute(self.ectx, session)
         self.assertEqual(str(e.exception), "callback exception")
+
+    def test_polauthnv_cb_copies_nv_public(self):
+        from tpm2_pytss.policy import _policy_cb_exec_polauthnv, ffi
+
+        src = ffi.new("TPMS_NV_PUBLIC *", {"nvIndex": 0x1000000})
+        captured = None
+
+        def cb(nv_public, hash_alg):
+            nonlocal captured
+            captured = nv_public
+
+        with policy('{"description": "", "policy": []}', TPM2_ALG.SHA256) as p:
+            p._callbacks[policy_cb_types.EXEC_POLAUTHNV] = cb
+            handle = ffi.new_handle(p)
+            rc = _policy_cb_exec_polauthnv(src, TPM2_ALG.SHA256, handle)
+            self.assertEqual(rc, TPM2_RC.SUCCESS)
+
+        # Simulate libtss2-policy freeing/reusing the buffer
+        src[0].nvIndex = 0xDEADBEEF
+        self.assertEqual(captured.nvIndex, 0x1000000)

Reply via email to