diff --git a/0001-tpm2_getcap-fix-misspelling-of-TPM2_PT_HR_-constants.patch b/0001-tpm2_getcap-fix-misspelling-of-TPM2_PT_HR_-constants.patch deleted file mode 100644 index ea87be26819249d8b5382875d7887c423ec4986b..0000000000000000000000000000000000000000 --- a/0001-tpm2_getcap-fix-misspelling-of-TPM2_PT_HR_-constants.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 7e9bb6c3a91a5da2792010f42df88ab9f80e8093 Mon Sep 17 00:00:00 2001 -From: Matthew Dempsky -Date: Tue, 27 Aug 2019 18:11:27 -0700 -Subject: [PATCH] tpm2_getcap: fix misspelling of TPM2_PT_HR_ constants - -tpm2-tss mispelled some of these constants as TPM2_PT_TPM2_HR_* -instead of just TPM2_PT_HR_*, and tpm2_getcap blindly followed suit. - -This commit switches tpm2_getcap to use the proper names, and to -define them locally if they're missing. Once tpm2-tools can assume a -fixed tpm2-tss, this workaround can be removed. - -Updates tpm2-software/tpm2-tss#1500. - -Signed-off-by: Matthew Dempsky ---- - tools/tpm2_getcap.c | 37 +++++++++++++++++++++++++------------ - 1 file changed, 25 insertions(+), 12 deletions(-) - -diff --git a/tools/tpm2_getcap.c b/tools/tpm2_getcap.c -index 9b15e3b..8b753dd 100644 ---- a/tools/tpm2_getcap.c -+++ b/tools/tpm2_getcap.c -@@ -38,6 +38,19 @@ - #include "tpm2_tool.h" - #include "tpm2_util.h" - -+/* -+ * Older versions of tpm2-tss misspelled these constants' names. -+ * See https://github.com/tpm2-software/tpm2-tss/issues/1500. -+ */ -+#ifndef TPM2_PT_HR_TRANSIENT_MIN -+#define TPM2_PT_HR_TRANSIENT_MIN ((TPM2_PT) (TPM2_PT_FIXED + 14)) -+#define TPM2_PT_HR_PERSISTENT_MIN ((TPM2_PT) (TPM2_PT_FIXED + 15)) -+#define TPM2_PT_HR_NV_INDEX ((TPM2_PT) (TPM2_PT_VAR + 2)) -+#define TPM2_PT_HR_TRANSIENT_AVAIL ((TPM2_PT) (TPM2_PT_VAR + 7)) -+#define TPM2_PT_HR_PERSISTENT ((TPM2_PT) (TPM2_PT_VAR + 8)) -+#define TPM2_PT_HR_PERSISTENT_AVAIL ((TPM2_PT) (TPM2_PT_VAR + 9)) -+#endif -+ - /* convenience macro to convert flags into "set" / "clear" strings */ - #define prop_str(val) val ? "set" : "clear" - /* number of eleents in the capability_map array */ -@@ -313,11 +313,11 @@ dump_tpm_properties_fixed (TPMS_TAGGED_PROPERTY properties[], - case TPM2_PT_INPUT_BUFFER: - tpm2_tool_output ("TPM2_PT_INPUT_BUFFER: 0x%08x\n", value); - break; -- case TPM2_PT_TPM2_HR_TRANSIENT_MIN: -- tpm2_tool_output ("TPM2_PT_TPM2_HR_TRANSIENT_MIN: 0x%08x\n", value); -+ case TPM2_PT_HR_TRANSIENT_MIN: -+ tpm2_tool_output ("TPM2_PT_HR_TRANSIENT_MIN: 0x%08x\n", value); - break; -- case TPM2_PT_TPM2_HR_PERSISTENT_MIN: -- tpm2_tool_output ("TPM2_PT_TPM2_HR_PERSISTENT_MIN: 0x%08x\n", value); -+ case TPM2_PT_HR_PERSISTENT_MIN: -+ tpm2_tool_output ("TPM2_PT_HR_PERSISTENT_MIN: 0x%08x\n", value); - break; - case TPM2_PT_HR_LOADED_MIN: - tpm2_tool_output ("TPM2_PT_HR_LOADED_MIN: 0x%08x\n", value); -@@ -428,8 +428,8 @@ dump_tpm_properties_var (TPMS_TAGGED_PROPERTY properties[], - case TPM2_PT_STARTUP_CLEAR: - dump_startup_clear_attrs ((TPMA_STARTUP_CLEAR)value); - break; -- case TPM2_PT_TPM2_HR_NV_INDEX: -- tpm2_tool_output ("TPM2_PT_TPM2_HR_NV_INDEX: 0x%08x\n", value); -+ case TPM2_PT_HR_NV_INDEX: -+ tpm2_tool_output ("TPM2_PT_HR_NV_INDEX: 0x%08x\n", value); - break; - case TPM2_PT_HR_LOADED: - tpm2_tool_output ("TPM2_PT_HR_LOADED: 0x%08x\n", value); -@@ -443,14 +443,14 @@ dump_tpm_properties_var (TPMS_TAGGED_PROPERTY properties[], - case TPM2_PT_HR_ACTIVE_AVAIL: - tpm2_tool_output ("TPM2_PT_HR_ACTIVE_AVAIL: 0x%08x\n", value); - break; -- case TPM2_PT_TPM2_HR_TRANSIENT_AVAIL: -- tpm2_tool_output ("TPM2_PT_TPM2_HR_TRANSIENT_AVAIL: 0x%08x\n", value); -+ case TPM2_PT_HR_TRANSIENT_AVAIL: -+ tpm2_tool_output ("TPM2_PT_HR_TRANSIENT_AVAIL: 0x%08x\n", value); - break; -- case TPM2_PT_TPM2_HR_PERSISTENT: -- tpm2_tool_output ("TPM2_PT_TPM2_HR_PERSISTENT: 0x%08x\n", value); -+ case TPM2_PT_HR_PERSISTENT: -+ tpm2_tool_output ("TPM2_PT_HR_PERSISTENT: 0x%08x\n", value); - break; -- case TPM2_PT_TPM2_HR_PERSISTENT_AVAIL: -- tpm2_tool_output ("TPM2_PT_TPM2_HR_PERSISTENT_AVAIL: 0x%08x\n", value); -+ case TPM2_PT_HR_PERSISTENT_AVAIL: -+ tpm2_tool_output ("TPM2_PT_HR_PERSISTENT_AVAIL: 0x%08x\n", value); - break; - case TPM2_PT_NV_COUNTERS: - tpm2_tool_output ("TPM2_PT_NV_COUNTERS: 0x%08x\n", value); -diff --git a/tools/tpm2_listpersistent.c b/tools/tpm2_listpersistent.c -index 45da1a4..d693e6c 100644 ---- a/tools/tpm2_listpersistent.c -+++ b/tools/tpm2_listpersistent.c -@@ -152,7 +152,7 @@ int tpm2_tool_onrun(TSS2_SYS_CONTEXT *sapi_context, tpm2_option_flags flags) { - - UINT32 property = tpm2_util_endian_swap_32(TPM2_HT_PERSISTENT); - rval = TSS2_RETRY_EXP(Tss2_Sys_GetCapability(sapi_context, 0, TPM2_CAP_HANDLES, -- property, TPM2_PT_TPM2_HR_PERSISTENT, &moreData, -+ property, TPM2_PT_HR_PERSISTENT, &moreData, - &capabilityData, 0)); - if(rval != TPM2_RC_SUCCESS) - { diff --git a/Revert-objectattrs-clear-before-or-ing-in-values.patch b/Revert-objectattrs-clear-before-or-ing-in-values.patch deleted file mode 100644 index de2f41ff1a2b6e32e0b0a546f35bff43cf6d40d0..0000000000000000000000000000000000000000 --- a/Revert-objectattrs-clear-before-or-ing-in-values.patch +++ /dev/null @@ -1,43 +0,0 @@ -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 deleted file mode 100644 index 593814f2f1c971eac5adbf545df3ad89aed055a5..0000000000000000000000000000000000000000 Binary files a/tpm2-tools-3.1.1.tar.gz and /dev/null differ diff --git a/tpm2-tools-5.0.tar.gz b/tpm2-tools-5.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..80adb10cbab5557ea4e152a7efacfa1a1ec061fa Binary files /dev/null and b/tpm2-tools-5.0.tar.gz differ diff --git a/tpm2-tools.spec b/tpm2-tools.spec index 499c53dc8235a7b62ca65d7cfb4284d68efec18c..703648d5fdcc8be621b46c6544fe023d7ff7e71f 100644 --- a/tpm2-tools.spec +++ b/tpm2-tools.spec @@ -1,18 +1,15 @@ Name: tpm2-tools -Version: 3.1.1 -Release: 9 +Version: 5.0 +Release: 1 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 -Patch2: 0001-tpm2_getcap-fix-misspelling-of-TPM2_PT_HR_-constants.patch - BuildRequires: gcc-c++ libtool autoconf-archive pkgconfig(cmocka) pkgconfig(libcurl) pkgconfig(openssl) -BuildRequires: pkgconfig(tss2-mu) pkgconfig(tss2-sys) pkgconfig(tss2-esys) git libgcrypt +BuildRequires: pkgconfig(tss2-mu) pkgconfig(tss2-sys) pkgconfig(tss2-esys) pkgconfig(uuid) git libgcrypt BuildRequires: libgcrypt-devel gdb -Requires: tpm2-tss >= 2.0.0-2 +Requires: tpm2-tss >= 2.3.1 Obsoletes: tpm2-tools <= 2.1.1-2 %description @@ -48,14 +45,19 @@ make check %files %defattr(-,root,root) -%license LICENSE +%license doc/LICENSE %{_bindir}/* +%{_datadir}/bash-completion/completions/tpm2* +%{_datadir}/bash-completion/completions/tss2* %files help -%doc README.md CHANGELOG.md +%doc README.md doc/CHANGELOG.md %{_mandir}/*/* %changelog +* Thu Apr 8 2021 Hugel - 5.0-1 +- update to 5.0 + * Sat Mar 20 2021 lirui - 3.1.1-9 - downgarde to 3.1.1