security/tpm/crtm.c: Fix !CONFIG_BOOTBLOCK_IN_CBFS measuring
On some platforms the bootblock is not placed in cbfs, but embedded
inside another binary that loads in into DRAM/SRAM.
e8217b11f1 (Kconfig: Add an option to skip adding a cbfs bootblock on
x86) removed adding a cbfs file containing the bootblock in that case.
Change-Id: Id47ecedbc8713ebd5d9814f1c4faf43c52780447
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64418
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/security/tpm/tspi/crtm.c b/src/security/tpm/tspi/crtm.c
index 2d0901d..24b9fbd 100644
--- a/src/security/tpm/tspi/crtm.c
+++ b/src/security/tpm/tspi/crtm.c
@@ -60,7 +60,7 @@
TPM_CRTM_PCR,
"FMAP: BOOTBLOCK"))
return VB2_ERROR_UNKNOWN;
- } else {
+ } else if (CONFIG(BOOTBLOCK_IN_CBFS)){
/* Mapping measures the file. We know we can safely map here because
bootblock-as-a-file is only used on x86, where we don't need cache to map. */
enum cbfs_type type = CBFS_TYPE_BOOTBLOCK;
@@ -71,7 +71,7 @@
return VB2_ERROR_UNKNOWN;
}
cbfs_unmap(mapping);
- }
+ } /* else: TODO: Add SoC specific measurement methods. */
return VB2_SUCCESS;
}