summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/tpm2_tlcl.c10
-rw-r--r--src/vendorcode/google/chromeos/vboot2/antirollback.c1
2 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/tpm2_tlcl.c b/src/lib/tpm2_tlcl.c
index 8412ed0784..ec20ca9446 100644
--- a/src/lib/tpm2_tlcl.c
+++ b/src/lib/tpm2_tlcl.c
@@ -81,7 +81,15 @@ uint32_t tlcl_finalize_physical_presence(void)
uint32_t tlcl_force_clear(void)
{
- printk(BIOS_INFO, "%s:%s:%d\n", __FILE__, __func__, __LINE__);
+ struct tpm2_response *response;
+
+ response = tpm_process_command(TPM2_Clear, NULL);
+ printk(BIOS_INFO, "%s: response is %x\n",
+ __func__, response ? response->hdr.tpm_code : -1);
+
+ if (!response || response->hdr.tpm_code)
+ return TPM_E_IOERROR;
+
return TPM_SUCCESS;
}
diff --git a/src/vendorcode/google/chromeos/vboot2/antirollback.c b/src/vendorcode/google/chromeos/vboot2/antirollback.c
index bce2ca118a..5b738c4897 100644
--- a/src/vendorcode/google/chromeos/vboot2/antirollback.c
+++ b/src/vendorcode/google/chromeos/vboot2/antirollback.c
@@ -145,6 +145,7 @@ static uint32_t set_kernel_space(const void *kernel_blob)
static uint32_t _factory_initialize_tpm(struct vb2_context *ctx)
{
+ RETURN_ON_FAILURE(tlcl_force_clear());
RETURN_ON_FAILURE(set_firmware_space(ctx->secdata));
RETURN_ON_FAILURE(set_kernel_space(secdata_kernel));
return TPM_SUCCESS;