summaryrefslogtreecommitdiff
path: root/src/security/vboot/antirollback.h
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@amd.corp-partner.google.com>2023-01-23 18:31:27 -0600
committerFelix Held <felix-coreboot@felixheld.de>2023-02-13 14:56:22 +0000
commit9ce755d05ed56753105bce6f4d75f4ddbc98cb26 (patch)
tree57ad7bc451400be69796046505c8fb660ff67053 /src/security/vboot/antirollback.h
parente47d9fd3b6cf23b0d98bdcd2a8176cefa4c5f089 (diff)
security/vboot: Add store/validate methods for AMD VBIOS FMAP cache
Add methods to store and retrieve the hash of the data stored in the VBIOS cache FMAP region. Add a dedicated index in TPM NVRAM to store the hash, and methods to calculate/read/write it. Modeled after mrc_cache_hash_tpm.{c,h} BUG=b:255812886 TEST=tested with rest of patch train Change-Id: I030017d3bf956b8593bc09073ad6545b80a5b52b Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72401 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@gmail.com>
Diffstat (limited to 'src/security/vboot/antirollback.h')
-rw-r--r--src/security/vboot/antirollback.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/security/vboot/antirollback.h b/src/security/vboot/antirollback.h
index 10a9e21e37..ab7c43aac9 100644
--- a/src/security/vboot/antirollback.h
+++ b/src/security/vboot/antirollback.h
@@ -29,6 +29,7 @@ enum vb2_pcr_digest;
#define MRC_RW_HASH_NV_INDEX 0x100d
#define HASH_NV_SIZE VB2_SHA256_DIGEST_SIZE
#define ENT_ROLLBACK_SPACE_INDEX 0x100e
+#define VBIOS_CACHE_NV_INDEX 0x100f
/* Widevine Secure Counter space */
#define WIDEVINE_COUNTER_NV_INDEX(n) (0x3000 + (n))
#define NUM_WIDEVINE_COUNTERS 4
@@ -99,4 +100,17 @@ uint32_t antirollback_write_space_mrc_hash(uint32_t index, const uint8_t *data,
*/
uint32_t antirollback_lock_space_mrc_hash(uint32_t index);
+/*
+ * Read VBIOS hash data from TPM.
+ * @param data pointer to buffer where hash from TPM read into
+ * @param size size of buffer
+ */
+uint32_t antirollback_read_space_vbios_hash(uint8_t *data, uint32_t size);
+/*
+ * Write new hash data to VBIOS space in TPM.
+ * @param data pointer to buffer of hash value to be written
+ * @param size size of buffer
+*/
+uint32_t antirollback_write_space_vbios_hash(const uint8_t *data, uint32_t size);
+
#endif /* ANTIROLLBACK_H_ */