From c91e3152722eaa827ea5b86aaf8da8558f74c29b Mon Sep 17 00:00:00 2001 From: Yi Chou Date: Thu, 30 Dec 2021 14:11:00 +0800 Subject: crossystem: Remove the stale TPM simulator support We don't need the MOUNT_ENCRYPTED_KEY_PATH after we replaced the stale TPM simulator with the driver-level TPM simulator. It's time to remove it. BUG=b:203195852, b:174807059 BRANCH=none TEST=crossystem clear_tpm_owner_request=1 Signed-off-by: Yi Chou Change-Id: I7c1c9c16697b1bbda9adea13448fdb9cffd9cc7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3358669 Reviewed-by: Julius Werner Reviewed-by: Leo Lai --- Makefile | 9 --------- host/lib/crossystem.c | 17 +++-------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 7a3b3190..75ea8e4f 100644 --- a/Makefile +++ b/Makefile @@ -214,15 +214,6 @@ else CFLAGS += -DTPM2_SIMULATOR=0 endif -# VTPM_PROXY indicates whether the TPM driver simulator feature -# is enable or not. -# This flag only takes effect when TPM2_SIMULATOR is enabled. -ifneq ($(filter-out 0,${VTPM_PROXY}),) -CFLAGS += -DVTPM_PROXY=1 -else -CFLAGS += -DVTPM_PROXY=0 -endif - # NOTE: We don't use these files but they are useful for other packages to # query about required compiling/linking flags. PC_IN_FILES = vboot_host.pc.in diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index 1c2415d5..7c3ee879 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -30,11 +30,6 @@ /* Filename for kernel command line */ #define KERNEL_CMDLINE_PATH "/proc/cmdline" -/* Filename for the mount-encrypted key */ -/* TODO(b/174807059): Remove this after we land driver-level TPM simulator on - * all VM boards */ -#define MOUNT_ENCRYPTED_KEY_PATH "/mnt/stateful_partition/encrypted.key" - /* Filename for the TPM simulator NV data */ #define TPM_SIMULATOR_NVCHIP_PATH \ "/mnt/stateful_partition/unencrypted/tpm2-simulator/NVChip" @@ -412,12 +407,9 @@ int VbGetSystemPropertyInt(const char *name) } else if (!strcasecmp(name,"disable_dev_request")) { value = vb2_get_nv_storage(VB2_NV_DISABLE_DEV_REQUEST); } else if (!strcasecmp(name,"clear_tpm_owner_request")) { - if (TPM2_SIMULATOR && VTPM_PROXY) + if (TPM2_SIMULATOR) /* Check TPM simulator NVChip status */ value = access(TPM_SIMULATOR_NVCHIP_PATH, F_OK) != 0; - else if (TPM2_SIMULATOR) - /* Check mount-encrypted key status */ - value = access(MOUNT_ENCRYPTED_KEY_PATH, F_OK) != 0; else value = vb2_get_nv_storage( VB2_NV_CLEAR_TPM_OWNER_REQUEST); @@ -610,13 +602,10 @@ static int VbSetSystemPropertyIntInternal(const char *name, int value) * on simulator */ if (value == 0) return -1; - const char *tpm_path = - VTPM_PROXY ? TPM_SIMULATOR_NVCHIP_PATH - : MOUNT_ENCRYPTED_KEY_PATH; /* Check TPM simulator data status */ - if (!access(tpm_path, F_OK)) { + if (!access(TPM_SIMULATOR_NVCHIP_PATH, F_OK)) { /* Remove the TPM2.0 simulator data */ - return remove(tpm_path); + return remove(TPM_SIMULATOR_NVCHIP_PATH); } else { /* Return success when the file is already * removed */ -- cgit v1.2.1