commit c329fb2e29f3a929c82a0cbc17ba9858b17f8de9 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:18:39 2019 -0400 Package init diff --git a/Revert-objectattrs-clear-before-or-ing-in-values.patch b/Revert-objectattrs-clear-before-or-ing-in-values.patch new file mode 100644 index 0000000..de2f41f --- /dev/null +++ b/Revert-objectattrs-clear-before-or-ing-in-values.patch @@ -0,0 +1,43 @@ +From 1f3451ee7b046a590b6dfc20b6af010166670ff7 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Thu, 12 Jul 2018 19:50:26 +0200 +Subject: [PATCH 1/1] Revert "objectattrs: clear before or'ing in values" + +This reverts commit e103bbf5117b0b62b358fd15f18f848854fcb0ee. + +The tpm2-tools 3.1.0 release contains a backward incompatible change that +was introduced by commit e103bbf5117 ("objectattrs: clear before or'ing +in values"), that changed the way that object attributes were specified. + +Before there were a set of default attributes and the user could specify +additional attributes to be used, but after the mentioned commit the user +must specify all attributes. + +This is a user visible change that changes the tools semantics, so is not +a suitable change for a MINOR version number increment, according to the +Semantic Versioning document (https://semver.org) since it breaks rule 2: + +2.MINOR version when you add functionality in a backwards-compatible manner + +Fixes: #1097 + +Signed-off-by: Javier Martinez Canillas +--- + lib/tpm2_attr_util.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/lib/tpm2_attr_util.c b/lib/tpm2_attr_util.c +index d461a744c0d..e43d03f9e0a 100644 +--- a/lib/tpm2_attr_util.c ++++ b/lib/tpm2_attr_util.c +@@ -501,7 +501,6 @@ bool tpm2_attr_util_nv_strtoattr(char *attribute_list, TPMA_NV *nvattrs) { + + bool tpm2_attr_util_obj_strtoattr(char *attribute_list, TPMA_OBJECT *objattrs) { + +- memset(objattrs, 0, sizeof(*objattrs)); + return common_strtoattr(attribute_list, objattrs, obj_attr_table, ARRAY_LEN(obj_attr_table)); + } + +-- +2.17.1 + diff --git a/tpm2-tools-3.1.1.tar.gz b/tpm2-tools-3.1.1.tar.gz new file mode 100644 index 0000000..593814f Binary files /dev/null and b/tpm2-tools-3.1.1.tar.gz differ diff --git a/tpm2-tools.spec b/tpm2-tools.spec new file mode 100644 index 0000000..d95b611 --- /dev/null +++ b/tpm2-tools.spec @@ -0,0 +1,64 @@ +Name: tpm2-tools +Version: 3.1.1 +Release: 5 +Summary: A TPM2.0 testing tool based on TPM2.0-TSS +License: BSD +URL: https://github.com/tpm2-software/tpm2-tools +Source0: https://github.com/tpm2-software/tpm2-tools/releases/download/%{version}/%{name}-%{version}.tar.gz + +Patch1: Revert-objectattrs-clear-before-or-ing-in-values.patch + +BuildRequires: gcc-c++ libtool autoconf-archive pkgconfig(cmocka) pkgconfig(libcurl) pkgconfig(openssl) +BuildRequires: pkgconfig(tss2-mu) pkgconfig(tss2-sys) pkgconfig(tss2-esys) git +Requires: tpm2-tss >= 2.0.0-2 +Obsoletes: tpm2-tools <= 2.1.1-2 + +%description +The package contains the code for the TPM (Trusted Platform Module) 2.0 +tools based on tpm2-tss. + +The tpm2-tools projects aims to deliver both low-level and aggregate +command line tools that provide access to a tpm2.0 compatible device. + +%package_help + +%prep +%autosetup -n %{name}-%{version} -p1 -Sgit + +%build +%configure --prefix=/usr --disable-static --disable-silent-rules +make %{?_smp_mflags} V=1 + +%install +rm -rf %{buildroot} +%make_install + +%check +make check + +%pre + +%preun + +%post + +%postun + +%files +%defattr(-,root,root) +%license LICENSE +%{_bindir}/* + +%files help +%doc README.md CHANGELOG.md +%{_mandir}/*/* + +%changelog +* Tue Sep 24 2019 openEuler Buildteam - 3.1.1-5 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: revise spec file with new rules + +* Wed Aug 14 2019 openEuler Buildteam - 3.1.1-4 +- Package init