forked from pool/python-tpm2-pytss
Compare commits
5 Commits
Author | SHA256 | Date | |
---|---|---|---|
c8aaabd165 | |||
20daf5d53c | |||
388d98a209 | |||
e2edcafc86 | |||
3c36aff150 |
8
_service
8
_service
@@ -1,7 +1,7 @@
|
||||
<services>
|
||||
<service name="tar_scm" mode="disabled">
|
||||
<service name="tar_scm" mode="manual">
|
||||
<param name="filename">tpm2-pytss</param>
|
||||
<param name="revision">2.2.0</param>
|
||||
<param name="revision">2.3.0</param>
|
||||
<param name="scm">git</param>
|
||||
<param name="submodules">disable</param>
|
||||
<param name="url">https://github.com/tpm2-software/tpm2-pytss.git</param>
|
||||
@@ -10,9 +10,9 @@
|
||||
<param name="versionrewrite-replacement">\1</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
</service>
|
||||
<service name="recompress" mode="disabled">
|
||||
<service name="recompress" mode="manual">
|
||||
<param name="file">*.tar</param>
|
||||
<param name="compression">gz</param>
|
||||
</service>
|
||||
<service name="set_version" mode="disabled"/>
|
||||
<service name="set_version" mode="manual"/>
|
||||
</services>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<servicedata>
|
||||
<service name="tar_scm">
|
||||
<param name="url">https://github.com/tpm2-software/tpm2-pytss.git</param>
|
||||
<param name="changesrevision">b9dae8373baad0f9f09a8d745a063f4960dd9369</param></service></servicedata>
|
||||
<param name="changesrevision">930cee2c45b84ac533c320b883b226edaeda9a38</param></service></servicedata>
|
@@ -1,53 +0,0 @@
|
||||
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):
|
@@ -1,3 +1,31 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 7 15:57:42 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Refresh the source tarball.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 4 13:52:43 UTC 2025 - Felix Stegmeier <felix.stegmeier@suse.com>
|
||||
|
||||
- add patch use-c99-for-preproccessing.patch to fix build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 9 04:00:45 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to version 2.3.0:
|
||||
* FAPI: support exists_ok for create_nv
|
||||
* Compatibility with python-cryptography 42
|
||||
* scripts: update regex for #defines
|
||||
* cryptography: fixes for newer version of cryptography
|
||||
* docs/maintainers: add gpg key details
|
||||
* docs: fix whitespace error
|
||||
* docs: fix error on SECURITY.md not being used
|
||||
* cryptography: add module for using TPM keys with the cryptography module
|
||||
* encoding: add deprecation warning to tools_encdec
|
||||
* internal/crypto: fix _MyRSAPrivateNumbers with cryptograpy >= 42.0.1
|
||||
* test: disable pcr_set_auth_value and pcr_set_auth_policy tests for swtpm
|
||||
- Drop patch python-tpm2-pytss-RSAPrivateNumbers.patch, included upstream.
|
||||
- Switch to pyproject macros.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 28 10:44:28 UTC 2024 - Pedro Monreal <pmonreal@suse.com>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-tpm2-pytss
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 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
|
||||
@@ -17,28 +17,29 @@
|
||||
|
||||
|
||||
%define pythons python3
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%define srcname tpm2-pytss
|
||||
%bcond_with test
|
||||
Name: python-%{srcname}
|
||||
Version: 2.2.0
|
||||
Version: 2.3.0
|
||||
Release: 0
|
||||
Summary: Python bindings for TSS
|
||||
License: BSD-2-Clause
|
||||
URL: https://github.com/tpm2-software/tpm2-pytss
|
||||
Source: %{srcname}-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM Fix tpm2-pkcs11 build: github.com/tpm2-software/tpm2-pytss/pull/562
|
||||
Patch0: python-tpm2-pytss-RSAPrivateNumbers.patch
|
||||
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}
|
||||
BuildRequires: %{python_module cffi}
|
||||
BuildRequires: %{python_module cryptography}
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module packaging}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pkgconfig}
|
||||
BuildRequires: %{python_module pycparser}
|
||||
BuildRequires: %{python_module setuptools_scm}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: python-rpm-macros
|
||||
@@ -49,7 +50,6 @@ Requires: python3-asn1crypto
|
||||
Requires: python3-cffi
|
||||
Requires: python3-cryptography
|
||||
Requires: python3-packaging
|
||||
Requires: python3-setuptools
|
||||
Requires: pkgconfig(tss2-esys)
|
||||
Requires: pkgconfig(tss2-fapi)
|
||||
%if %{with test}
|
||||
@@ -81,10 +81,10 @@ Metadata-Version: 1.1
|
||||
Version: %{version}
|
||||
EOF
|
||||
export CFLAGS="%{optflags}"
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
|
||||
%if %{with test}
|
||||
@@ -95,6 +95,6 @@ export CFLAGS="%{optflags}"
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%{python_sitearch}/tpm2_pytss
|
||||
%{python_sitearch}/tpm2_pytss-%{version}*-info
|
||||
%{python_sitearch}/tpm2_pytss-%{version}.dist-info
|
||||
|
||||
%changelog
|
||||
|
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:68e1caf6fc81fc93392bc917a72a48bb149bf03acf1c3408ed3a8433095d94d2
|
||||
size 210068
|
3
tpm2-pytss-2.3.0.tar.gz
Normal file
3
tpm2-pytss-2.3.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d101e7c4c9b4c27ccc572e8a16a68d725fdc3fd30fd3e338f21dbf8db83d8bbc
|
||||
size 210816
|
37
use-c99-for-preproccessing.patch
Normal file
37
use-c99-for-preproccessing.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
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(-)
|
||||
|
||||
Index: tpm2-pytss-2.3.0/setup.py
|
||||
===================================================================
|
||||
--- tpm2-pytss-2.3.0.orig/setup.py
|
||||
+++ tpm2-pytss-2.3.0/setup.py
|
||||
@@ -184,7 +184,7 @@ class type_generator(build_ext):
|
||||
f"unable to find tss2_tpm2_types.h in {pk['include_dirs']}"
|
||||
)
|
||||
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")
|
||||
@@ -205,6 +205,7 @@ class type_generator(build_ext):
|
||||
pdata = preprocess_file(
|
||||
policy_header_path,
|
||||
cpp_args=[
|
||||
+ "-std=c99",
|
||||
"-D__extension__=",
|
||||
"-D__attribute__(x)=",
|
||||
"-D__float128=long double",
|
Reference in New Issue
Block a user