Accepting request 988380 from home:aplanas:branches:security

tpm2-pytss contains the Python bindings to call the tpm2-tss libraries (mainly FAPI and ESAPI interfaces)

OBS-URL: https://build.opensuse.org/request/show/988380
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tpm2-pytss?expand=0&rev=1
This commit is contained in:
Matej Cepl 2022-07-11 16:38:58 +00:00 committed by Git OBS Bridge
commit e58b4efb36
7 changed files with 172 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,25 @@
From b88dc903e7d304851ed651f3a9aea24656a5681c Mon Sep 17 00:00:00 2001
From: Alberto Planas <aplanas@suse.com>
Date: Mon, 11 Jul 2022 11:54:47 +0200
Subject: [PATCH 1/1] test_crypto: fix test_ecc_bad_curves assert
---
test/test_crypto.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/test_crypto.py b/test/test_crypto.py
index 1120c7b..f65b465 100644
--- a/test/test_crypto.py
+++ b/test/test_crypto.py
@@ -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)
- 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
--
2.36.1

18
_service Normal file
View File

@ -0,0 +1,18 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="filename">tpm2-pytss</param>
<param name="revision">1.2.0</param>
<param name="scm">git</param>
<param name="submodules">disable</param>
<param name="url">https://github.com/tpm2-software/tpm2-pytss.git</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">[v]?([^\+]+)(.*)</param>
<param name="versionrewrite-replacement">\1</param>
<param name="changesgenerate">enable</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

View File

@ -0,0 +1,4 @@
-------------------------------------------------------------------
Mon Jul 11 07:35:34 UTC 2022 - Alberto Planas Dominguez <aplanas@suse.com>
- Initial package for 1.2.0

98
python-tpm2-pytss.spec Normal file
View File

@ -0,0 +1,98 @@
#
# spec file for package python-tpm2-pytss
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define pythons python3
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define srcname tpm2-pytss
%bcond_with test
Name: python-%{srcname}
Version: 1.2.0
Release: 0
Summary: Python bindings for TSS
License: BSD-2-Clause
URL: https://github.com/tpm2-software/tpm2-pkcs11
Source: %{srcname}-%{version}.tar.gz
Patch0: 0001-test_crypto-fix-test_ecc_bad_curves-assert.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 pkgconfig}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: pkgconfig
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: python3-setuptools
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
TPM2 TSS Python bindings for Enhanced System API (ESYS), Feature API
(FAPI), Marshaling (MU), TCTI Loader (TCTILdr) and RC Decoding
(rcdecode) libraries. It also contains utility methods for wrapping
keys to TPM 2.0 data structures for importation into the TPM,
unwrapping keys and exporting them from the TPM, TPM-less
makecredential command and name calculations, TSS2 PEM Key format
support, importing Keys from PEM, DER and SSH formats, conversion from
tpm2-tools based command line strings and loading tpm2-tools context
files.
%prep
%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}"
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%if %{with test}
%check
%pytest_arch
%endif
%files %{python_files}
%license LICENSE
%{python_sitearch}/tpm2_pytss
%{python_sitearch}/tpm2_pytss-%{version}*-info
%changelog

3
tpm2-pytss-1.2.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:22649ac0f02500498a76a364d94efef7834035f2d7536412d078baa131e9a87e
size 183892