diff --git a/python-tpm2-pytss-1.2.0-openssl.patch b/python-tpm2-pytss-1.2.0-openssl.patch index 522a5fb1bad8cc9e34a427fa17d8805beb7c4dd3..881206e82c1054e6777a2d1938bb9efc56f73fb6 100644 --- a/python-tpm2-pytss-1.2.0-openssl.patch +++ b/python-tpm2-pytss-1.2.0-openssl.patch @@ -4,9 +4,81 @@ diff -up tpm2-pytss-1.2.0/test/test_crypto.py.old tpm2-pytss-1.2.0/test/test_cry @@ -581,7 +581,7 @@ class CryptoTest(TSS2_EsapiTest): def test_ecc_bad_curves(self): with self.assertRaises(ValueError) as e: - pub = TPMT_PUBLIC.from_pem(ecc_bad_curve) + TPMT_PUBLIC.from_pem(ecc_bad_curve) - self.assertEqual(str(e.exception), "unsupported curve: sect163r2") + self.assertEqual(str(e.exception), "Unsupported key format") pub = TPMT_PUBLIC.from_pem(ecc_public_key) pub.parameters.eccDetail.curveID = TPM2_ECC.NONE + +diff -up tpm2-pytss-2.1.0/test/test_policy.py.old tpm2-pytss-2.1.0/test/test_policy.py +--- tpm2-pytss-2.1.0/test/test_policy.py.old 2023-08-07 18:42:18.825991709 +0200 ++++ tpm2-pytss-2.1.0/test/test_policy.py 2023-08-07 18:42:38.690410796 +0200 +@@ -2,6 +2,7 @@ + # SPDX-License-Identifier: BSD-2 + + import unittest ++import pytest + import textwrap + import json + from tpm2_pytss import * +@@ -521,6 +522,7 @@ class TestPolicy(TSS2_EsapiTest): + p.execute(self.ectx, session) + self.assertEqual(str(e.exception), "callback exception") + ++ @pytest.mark.skip(reason="Fedora does not support P192v1 curve") + def test_exec_sign_callback(self): + private_key = textwrap.dedent( + """ +@@ -593,6 +595,7 @@ class TestPolicy(TSS2_EsapiTest): + p.execute(self.ectx, session) + self.assertEqual(str(e.exception), "callback exception") + ++ @pytest.mark.skip(reason="Fedora does not support P192v1 curve") + def test_exec_polauth_callback(self): + private_key = textwrap.dedent( + """ + +From e4006e6066c015d9ed55befa9b98247fbdcafd7d Mon Sep 17 00:00:00 2001 +From: Erik Larsson +Date: Mon, 26 Jun 2023 12:15:41 +0200 +Subject: [PATCH] test: add check for renamed cryptography types + +Some types have changed their names in newer cryptography release, so add them to the tests + +Signed-off-by: Erik Larsson +--- + test/test_crypto.py | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/test/test_crypto.py b/test/test_crypto.py +index 92cda009..7d7466e2 100644 +--- a/test/test_crypto.py ++++ b/test/test_crypto.py +@@ -596,11 +596,23 @@ def test_unsupported_key(self): + + with self.assertRaises(ValueError) as e: + TPMT_SENSITIVE.from_pem(der) +- self.assertEqual(str(e.exception), "unsupported key type: _DSAPrivateKey") ++ self.assertIn( ++ str(e.exception), ++ ( ++ "unsupported key type: _DSAPrivateKey", ++ "unsupported key type: DSAPrivateKey", ++ ), ++ ) + + with self.assertRaises(ValueError) as e: + TPMT_PUBLIC.from_pem(dsa_public_key) +- self.assertEqual(str(e.exception), "unsupported key type: _DSAPublicKey") ++ self.assertIn( ++ str(e.exception), ++ ( ++ "unsupported key type: _DSAPublicKey", ++ "unsupported key type: DSAPublicKey", ++ ), ++ ) + + def test_from_pem_with_symmetric(self): + sym = TPMT_SYM_DEF_OBJECT(algorithm=TPM2_ALG.AES) + diff --git a/python-tpm2-pytss.spec b/python-tpm2-pytss.spec index bd81b478a0f5594a87404d768ec9b7a1a3907d3b..dba05950c6c6de3d560155498508cabe6ed64cb7 100644 --- a/python-tpm2-pytss.spec +++ b/python-tpm2-pytss.spec @@ -5,8 +5,8 @@ Summary: TPM 2.0 TSS Bindings for Python Name: python-%{srcname} -Version: 1.2.0 -Release: 7%{?dist} +Version: 2.1.0 +Release: 1%{?dist} License: BSD-2-Clause URL: https://github.com/tpm2-software/tpm2-pytss Source: %{pypi_source %{srcname}} @@ -62,6 +62,9 @@ based command line strings and loading tpm2-tools context files. %doc README.md %changelog +* Mon Sep 25 2023 Shuo Wang - 2.1.0-1 +- update to 2.1.0 + * Wed Sep 20 2023 Wang Guodong - 1.2.0-7 - Rebuilt for python-pytest-forked diff --git a/sources b/sources index d32335ebb13d0faa3da8c012b0d01d06fe5eccd0..5f6f3578df4362a31ce5861b9aae4a2e6587733e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (tpm2-pytss-1.2.0.tar.gz) = 688223d05a2ed5f3a5aeec47c77a02c10d40d4f23a97622e76acbf8f86b14ac2a92482869c5e04de395edb96b1e1b142c5ff53c7dbc97673ead531e4d6138184 +SHA512 (tpm2-pytss-2.1.0.tar.gz) = b4d8b3a0124e67278f08ff72d3635221e84ae26b6a5489ee159e641931aa9045b4b5111ed02d5ff86d69bd89b8460b2592a3fdb94742562351e41783c78184ba