diff options
author | Hsuan Ting Chen <roccochen@chromium.org> | 2020-08-11 15:49:20 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-18 11:12:09 +0000 |
commit | faf9cd3bbbc133487c272d81771b8bbf4d439915 (patch) | |
tree | 820653cb6c64cb2519206baae9d7eba4fbe2224f | |
parent | 075ce5e15eca906b937d5a2b4a8245bbbadcc272 (diff) | |
download | vboot-faf9cd3bbbc133487c272d81771b8bbf4d439915.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:2345837
Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org>
Change-Id: I2b0fdc217bbaa23ac71a41bf400c412be634ec0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2346455
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
-rw-r--r-- | firmware/2lib/2ui_screens.c | 7 | ||||
-rw-r--r-- | firmware/2lib/include/2api.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c index 2510392f..04f037bd 100644 --- a/firmware/2lib/2ui_screens.c +++ b/firmware/2lib/2ui_screens.c @@ -433,6 +433,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 205b2891..c6d99bdf 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -1309,6 +1309,8 @@ enum vb2_ui_error { VB2_UI_ERROR_DEV_MODE_ALREADY_ENABLED, /* Debug info screen initialization failed */ VB2_UI_ERROR_DEBUG_LOG, + /* Untrusted confirmation */ + VB2_UI_ERROR_UNTRUSTED_CONFIRMATION, }; /** |