summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolai Artemiev <nartemiev@google.com>2022-03-22 18:46:28 +1100
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-06 03:56:52 +0000
commit23a1f64d4704cd1d69365eaf33cbc55af48ca34b (patch)
tree3b008e64ec09314352bfbfeb867107d77012df7c
parentdd04ea86966be157e1962475c42c23a44081038d (diff)
downloadvboot-23a1f64d4704cd1d69365eaf33cbc55af48ca34b.tar.gz
updater_utils: fix implicit conversion to enum wp_state
The getter for HWWP implicitly converted the integer returned by crossystem to an `enum wp_state`. This only worked because of the particular values assigned to the enum values, so explicitly convert instead. BUG=b:223291615 BRANCH=none TEST=builds Change-Id: Ib572733f8b05a5a992f09ba98050a7eab5e3bcce Signed-off-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3540784 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org>
-rw-r--r--futility/updater_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/futility/updater_utils.c b/futility/updater_utils.c
index c6ddae63..37f3be31 100644
--- a/futility/updater_utils.c
+++ b/futility/updater_utils.c
@@ -419,7 +419,7 @@ static int host_get_tpm_fwver(void)
static int host_get_wp_hw(void)
{
/* wpsw refers to write protection 'switch', not 'software'. */
- return VbGetSystemPropertyInt("wpsw_cur");
+ return VbGetSystemPropertyInt("wpsw_cur") ? WP_ENABLED : WP_DISABLED;
}
/* A helper function to return "fw_vboot2" system property. */