Merged
[sync] PR-44: Rename TPM DIGEST macro #45
[sync] PR-44: Rename TPM DIGEST macro #45
Merged
openeuler-ci-botAdd on Jul 22
Total: 2 files changed+40-1
@@ -0,0 +1,35 @@
1+From b15fd085e3871ac866664b261d99634c5819b5ce Mon Sep 17 00:00:00 2001
2+From: xucee1 <xuce10@h-partners.com>
3+Date: Sat, 7 Feb 2026 08:20:13 +0800
4+Subject: [PATCH] rename TPM_MAX_DIGEST_SIZE to TPM2_MAX_DIGEST_SIZE
5+ 
6+Signed-off-by: Huaxin Lu <luhuaxin1@huawei.com>
7+---
8+ src/common/dim_tpm.c | 4 ++--
9+ 1 file changed, 2 insertions(+), 2 deletions(-)
10+ 
11+diff --git a/src/common/dim_tpm.c b/src/common/dim_tpm.c
12+index 35f3fac..6cc4851 100644
13+--- a/src/common/dim_tpm.c
14++++ b/src/common/dim_tpm.c
15+@@ -29,7 +29,7 @@ int dim_tpm_init(struct dim_tpm *tpm, int algo)
16+ if (tpm->chip->allocated_banks[i].crypto_id == algo)
17+ tpm->bank = i;
18+
19+- memset(tpm->digests[i].digest, 0xff, TPM_MAX_DIGEST_SIZE);
20++ memset(tpm->digests[i].digest, 0xff, TPM2_MAX_DIGEST_SIZE);
21+ }
22+
23+ if (tpm->bank == -1) {
24+@@ -60,7 +60,7 @@ int dim_tpm_pcr_extend(struct dim_tpm *tpm, int pcr, struct dim_digest *digest)
25+ return 0;
26+
27+ size = dim_digest_size(digest->algo);
28+- if (size == 0 || size > TPM_MAX_DIGEST_SIZE)
29++ if (size == 0 || size > TPM2_MAX_DIGEST_SIZE)
30+ return -EINVAL;
31+
32+ memcpy(tpm->digests[tpm->bank].digest, digest->data, size);
33+--
34+2.43.0
35+ 
@@ -22,7 +22,7 @@ mv $module_path/dim_monitor.ko.sig $module_path/dim_monitor.ko ||: \
22Name : dim22Name : dim
23Summary : Dynamic Integrity Measurement23Summary : Dynamic Integrity Measurement
24Version : 1.0.224Version : 1.0.2
25-Release : 1425+Release : 15
26License : GPL-2.026License : GPL-2.0
27Source0 : %{name}-v%{version}.tar.gz27Source0 : %{name}-v%{version}.tar.gz
28BuildRequires: kernel-devel kernel-headers28BuildRequires: kernel-devel kernel-headers
@@ -83,6 +83,7 @@ Patch0053: backport-Optimized-directory-suffix-matching.patch
83Patch0054: backport-Resolved-the-problem-that-the-jump_label_lock-isrepe.patch83Patch0054: backport-Resolved-the-problem-that-the-jump_label_lock-isrepe.patch
84Patch0055: backport-fix-prototype-build-error.patch84Patch0055: backport-fix-prototype-build-error.patch
85Patch0056: backport-fix-bug-of-code_cmp.patch85Patch0056: backport-fix-bug-of-code_cmp.patch
86+Patch0057: Rename-TPM_MAX_DIGEST_SIZE-to-TPM2_MAX_DIGEST_SIZE.patch
86 87 
87%description88%description
88Dynamic Integrity Measurement89Dynamic Integrity Measurement
@@ -121,6 +122,9 @@ rm -rf %{buildroot}
121%attr(0400,root,root) /lib/modules/%{kernel_version}/extra/dim/dim_monitor.ko122%attr(0400,root,root) /lib/modules/%{kernel_version}/extra/dim/dim_monitor.ko
122 123 
123%changelog124%changelog
125+* Fri Jul 10 2026 Linux_zhang <244695981@qq.com> 1.0.2-15
126+- Rename TPM DIGEST macro
127+ 
124* Wed Dec 31 2025 xuce <xuce10@h-partners.com> 1.0.2-14128* Wed Dec 31 2025 xuce <xuce10@h-partners.com> 1.0.2-14
125- revert patches about dim rot/measure only/binary log129- revert patches about dim rot/measure only/binary log
126 130