summaryrefslogtreecommitdiff
path: root/src/security/vboot
diff options
context:
space:
mode:
authorShelley Chen <shchen@google.com>2020-10-20 10:42:26 -0700
committerJulius Werner <jwerner@chromium.org>2020-10-20 23:26:01 +0000
commitc1040f3ef43bf906b71746e3e0a07dbb4a44febe (patch)
tree41e14c13023ff5eaa53019596f36de60a3c1ede5 /src/security/vboot
parentdf0481e9e1f46193a9f456602987a1a3694102f3 (diff)
mrc_cache: Add tpm_hash_index field to cache_region struct
Pull selection of tpm hash index logic into cache_region struct. This CL also enables the storing of the MRC hash into the TPM NVRAM space for both recovery and non-recovery cases. This will affect all platforms with TPM2 enabled and use the MRC_CACHE driver. BUG=b:150502246 BRANCH=None TEST=make sure memory training still works on nami and lazor Change-Id: I1a744d6f40f062ca3aab6157b3747e6c1f6977f9 Signed-off-by: Shelley Chen <shchen@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46514 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/security/vboot')
-rw-r--r--src/security/vboot/mrc_cache_hash_tpm.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/security/vboot/mrc_cache_hash_tpm.c b/src/security/vboot/mrc_cache_hash_tpm.c
index fede488e85..77c23f63e4 100644
--- a/src/security/vboot/mrc_cache_hash_tpm.c
+++ b/src/security/vboot/mrc_cache_hash_tpm.c
@@ -24,10 +24,6 @@ void mrc_cache_update_hash(uint32_t index, const uint8_t *data, size_t size)
};
const uint8_t *hash_ptr = data_hash;
- /* We do not store normal mode data hash in TPM. */
- if (!vboot_recovery_mode_enabled())
- return;
-
/* Initialize TPM driver. */
if (tlcl_lib_init() != VB2_SUCCESS) {
printk(BIOS_ERR, "MRC: TPM driver initialization failed.\n");
@@ -64,10 +60,6 @@ int mrc_cache_verify_hash(uint32_t index, const uint8_t *data, size_t size)
uint8_t data_hash[VB2_SHA256_DIGEST_SIZE];
uint8_t tpm_hash[VB2_SHA256_DIGEST_SIZE];
- /* We do not store normal mode data hash in TPM. */
- if (!vboot_recovery_mode_enabled())
- return 1;
-
/* Calculate hash of data read from MRC_CACHE. */
if (vb2_digest_buffer(data, size, VB2_HASH_SHA256, data_hash,
sizeof(data_hash))) {