From ce599741739627ba0cd46a910d448286a016d81b Mon Sep 17 00:00:00 2001 From: wenyuzifang Date: Mon, 29 Sep 2025 12:17:48 +0800 Subject: [PATCH] Update code from upstream --- trousers-0.3.14-fix-indent-obj_policy.patch | 12 ++++++++++++ trousers-0.3.14-fix-indent-tspi_key.patch | 18 ++++++++++++++++++ trousers.spec | 12 ++++++++---- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 trousers-0.3.14-fix-indent-obj_policy.patch create mode 100644 trousers-0.3.14-fix-indent-tspi_key.patch diff --git a/trousers-0.3.14-fix-indent-obj_policy.patch b/trousers-0.3.14-fix-indent-obj_policy.patch new file mode 100644 index 0000000..af53ee4 --- /dev/null +++ b/trousers-0.3.14-fix-indent-obj_policy.patch @@ -0,0 +1,12 @@ +diff -ur trousers-0.3.14/src/tspi/obj_policy.c trousers-0.3.14-new/src/tspi/obj_policy.c +--- trousers-0.3.14/src/tspi/obj_policy.c 2014-07-23 12:42:44.000000000 -0700 ++++ trousers-0.3.14-new/src/tspi/obj_policy.c 2019-05-27 13:29:56.720899059 -0700 +@@ -984,7 +984,7 @@ + policy->popupString, + policy->Secret))) + goto done; +- policy->SecretSet = TRUE; ++ policy->SecretSet = TRUE; + } + memcpy(secret, policy->Secret, TPM_SHA1_160_HASH_LEN); + *mode = policy->SecretMode; diff --git a/trousers-0.3.14-fix-indent-tspi_key.patch b/trousers-0.3.14-fix-indent-tspi_key.patch new file mode 100644 index 0000000..9278fc8 --- /dev/null +++ b/trousers-0.3.14-fix-indent-tspi_key.patch @@ -0,0 +1,18 @@ +diff -ur trousers-0.3.14/src/tspi/tspi_key.c trousers-0.3.14-new/src/tspi/tspi_key.c +--- trousers-0.3.14/src/tspi/tspi_key.c 2014-07-23 12:42:45.000000000 -0700 ++++ trousers-0.3.14-new/src/tspi/tspi_key.c 2019-05-27 13:44:42.366735438 -0700 +@@ -370,10 +370,10 @@ + /* get the key to be wrapped's private key */ + if ((result = obj_rsakey_get_priv_blob(hKey, &keyPrivBlobLen, &keyPrivBlob))) + goto done; +- /* verify if its under the maximum size, according to the +- * TPM_STORE_ASYMKEY specification */ +- if (keyPrivBlobLen > TPM_STORE_PRIVKEY_LEN) +- return TSPERR(TSS_E_ENC_INVALID_LENGTH); ++ /* verify if its under the maximum size, according to the ++ * TPM_STORE_ASYMKEY specification */ ++ if (keyPrivBlobLen > TPM_STORE_PRIVKEY_LEN) ++ return TSPERR(TSS_E_ENC_INVALID_LENGTH); + + /* get the key to be wrapped's blob */ + if ((result = obj_rsakey_get_blob(hKey, &keyBlobLen, &keyBlob))) diff --git a/trousers.spec b/trousers.spec index 5d91c0c..7aff916 100644 --- a/trousers.spec +++ b/trousers.spec @@ -1,16 +1,18 @@ -%define anolis_release 3 +%define anolis_release 4 Name: trousers -Version: 0.3.15 +Version: 0.3.15 Release: %{anolis_release}%{?dist} Summary: The open-source TCG Software Stack License: BSD Url: http://trousers.sourceforge.net -Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -Source1: tcsd.service +Source0: http://downloads.sourceforge.net/trousers/trousers-0.3.15.tar.gz +Source1: tcsd.service Patch1: trousers-0.3.14-noinline.patch Patch2: trousers-0.3.14-unlock-in-err-path.patch +Patch3: trousers-0.3.14-fix-indent-tspi_key.patch +Patch4: trousers-0.3.14-fix-indent-obj_policy.patch BuildRequires: autoconf automake make BuildRequires: libtool openssl-devel gettext-devel systemd @@ -127,6 +129,8 @@ exit 0 %doc README ChangeLog %changelog +* Mon Sep 29 2025 wenyuzifang - 0.3.15-4 +- Fix indentation to ensure code clarity and prevent maintenance errors. * Wed Apr 12 2023 Shawn Wang - 0.3.15-3 - Optimize the spec file -- Gitee