summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsuan Ting Chen <roccochen@chromium.org>2020-08-11 15:49:20 +0800
committerCommit Bot <commit-bot@chromium.org>2020-08-17 07:17:39 +0000
commitbfa9f18ac341731873b48c0fdc854ba2a3b2f649 (patch)
treef8a92541fa2d1701a55ef28b15846011fc2fa2ed
parent7fcc0094872caed80868e04cd25f7663cb0a5967 (diff)
downloadvboot-bfa9f18ac341731873b48c0fdc854ba2a3b2f649.tar.gz
vboot/ui: Display error for untrusted confirmation
Display a error dialog box while user confirms with untrusted keyboard. BUG=b:144969091, b:161866932 BRANCH=puff TEST=PHYSICAL_PRESENCE_KEYBOARD=1; emerge-puff depthcharge Cq-Depend: chromium:2355656 Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: I2b0fdc217bbaa23ac71a41bf400c412be634ec0c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2353778 Reviewed-by: Joel Kitching <kitching@chromium.org>
-rw-r--r--firmware/2lib/2ui_screens.c7
-rw-r--r--firmware/2lib/include/2api.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c
index 9cd3446a..c1768756 100644
--- a/firmware/2lib/2ui_screens.c
+++ b/firmware/2lib/2ui_screens.c
@@ -529,6 +529,13 @@ vb2_error_t recovery_to_dev_confirm_action(struct vb2_ui_context *ui)
if (!ui->key_trusted) {
VB2_DEBUG("Reject untrusted %s confirmation\n",
ui->key == VB_KEY_ENTER ? "ENTER" : "POWER");
+ /*
+ * If physical presence is confirmed using the keyboard,
+ * beep and notify the user when the ENTER key comes
+ * from an untrusted keyboard.
+ */
+ if (PHYSICAL_PRESENCE_KEYBOARD && ui->key == VB_KEY_ENTER)
+ ui->error_code = VB2_UI_ERROR_UNTRUSTED_CONFIRMATION;
return VB2_REQUEST_UI_CONTINUE;
}
return recovery_to_dev_finalize(ui);
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index eb5864e1..776d759e 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -1257,6 +1257,8 @@ enum vb2_ui_error {
VB2_UI_ERROR_DEBUG_LOG,
/* Firmware log screen initialization failed */
VB2_UI_ERROR_FIRMWARE_LOG,
+ /* Untrusted confirmation */
+ VB2_UI_ERROR_UNTRUSTED_CONFIRMATION,
};
/**