|
|
00e791 |
From 58df8d745c6516818ba6ebfa8fe826702c1621a0 Mon Sep 17 00:00:00 2001
|
|
|
00e791 |
From: Chris Coulson <chris.coulson@canonical.com>
|
|
|
00e791 |
Date: Thu, 26 Sep 2019 20:01:01 +0100
|
|
|
00e791 |
Subject: [PATCH 41/62] tpm: Don't log duplicate identical events
|
|
|
00e791 |
|
|
|
00e791 |
According to the comment in tpm_measure_variable ("Don't measure something that we've already measured"), shim
|
|
|
00e791 |
shouldn't measure duplicate events if they are identical, which also aligns with section 2.3.4.8 of the TCG PC
|
|
|
00e791 |
Client Platform Firmware Profile Specification ("If it has been measured previously, it MUST NOT be measured
|
|
|
00e791 |
again"). This is currently broken because tpm_data_measured() uses the return value of CompareGuid() incorrectly.
|
|
|
00e791 |
|
|
|
00e791 |
Upstream-commit-id: 103adc89ce5
|
|
|
00e791 |
---
|
|
|
00e791 |
tpm.c | 2 +-
|
|
|
00e791 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
00e791 |
|
|
|
00e791 |
diff --git a/tpm.c b/tpm.c
|
|
|
00e791 |
index c0617bb479e..196b93c30f6 100644
|
|
|
00e791 |
--- a/tpm.c
|
|
|
00e791 |
+++ b/tpm.c
|
|
|
00e791 |
@@ -241,7 +241,7 @@ static BOOLEAN tpm_data_measured(CHAR16 *VarName, EFI_GUID VendorGuid, UINTN Var
|
|
|
00e791 |
|
|
|
00e791 |
for (i=0; i
|
|
|
00e791 |
if ((StrCmp (VarName, measureddata[i].VariableName) == 0) &&
|
|
|
00e791 |
- (CompareGuid (&VendorGuid, measureddata[i].VendorGuid)) &&
|
|
|
00e791 |
+ (CompareGuid (&VendorGuid, measureddata[i].VendorGuid) == 0) &&
|
|
|
00e791 |
(VarSize == measureddata[i].Size) &&
|
|
|
00e791 |
(CompareMem (VarData, measureddata[i].Data, VarSize) == 0)) {
|
|
|
00e791 |
return TRUE;
|
|
|
00e791 |
--
|
|
|
00e791 |
2.26.2
|
|
|
00e791 |
|