summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Coulson <chris.coulson@canonical.com>2019-09-26 20:01:01 +0100
committerPeter Jones <pjones@redhat.com>2020-07-23 20:53:24 -0400
commit58df8d745c6516818ba6ebfa8fe826702c1621a0 (patch)
treeef3cbac40b73e2f0277f20235569598ae4d92b5b
parentd57e53f3bddc4bc7299b3d5efd5ba8c547e8dfa5 (diff)
downloadefi-boot-shim-58df8d745c6516818ba6ebfa8fe826702c1621a0.tar.gz
efi-boot-shim-58df8d745c6516818ba6ebfa8fe826702c1621a0.zip
tpm: Don't log duplicate identical events
According to the comment in tpm_measure_variable ("Don't measure something that we've already measured"), shim shouldn't measure duplicate events if they are identical, which also aligns with section 2.3.4.8 of the TCG PC Client Platform Firmware Profile Specification ("If it has been measured previously, it MUST NOT be measured again"). This is currently broken because tpm_data_measured() uses the return value of CompareGuid() incorrectly. Upstream-commit-id: 103adc89ce5
-rw-r--r--tpm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tpm.c b/tpm.c
index c0617bb4..196b93c3 100644
--- a/tpm.c
+++ b/tpm.c
@@ -241,7 +241,7 @@ static BOOLEAN tpm_data_measured(CHAR16 *VarName, EFI_GUID VendorGuid, UINTN Var
for (i=0; i<measuredcount; i++) {
if ((StrCmp (VarName, measureddata[i].VariableName) == 0) &&
- (CompareGuid (&VendorGuid, measureddata[i].VendorGuid)) &&
+ (CompareGuid (&VendorGuid, measureddata[i].VendorGuid) == 0) &&
(VarSize == measureddata[i].Size) &&
(CompareMem (VarData, measureddata[i].Data, VarSize) == 0)) {
return TRUE;