From feca95a0c191979582e92876e09a21dfa1413fc5 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Mon, 27 Sep 2021 14:21:38 -0500 Subject: [PATCH] gui-init: improve handling when HOTPKEY not present Allow user to cancel HOTPKEY check, set BG color appropriately Signed-off-by: Matt DeVillier --- initrd/bin/gui-init | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/initrd/bin/gui-init b/initrd/bin/gui-init index 85017b5d..34c9316d 100755 --- a/initrd/bin/gui-init +++ b/initrd/bin/gui-init @@ -198,10 +198,15 @@ update_hotp() HOTP=`unseal-hotp` enable_usb if ! hotp_verification info ; then - whiptail $BG_COLOR_WARNING --clear \ ---title "WARNING: Please Insert Your $HOTPKEY_BRANDING" \ ---msgbox "Your $HOTPKEY_BRANDING was not detected.\n\nPlease insert your $HOTPKEY_BRANDING" 30 90 + if ! whiptail $BG_COLOR_WARNING --clear \ + --title "WARNING: Please Insert Your $HOTPKEY_BRANDING" \ + --yes-button "Retry" --no-button "Skip" \ + --yesno "Your $HOTPKEY_BRANDING was not detected.\n\nPlease insert your $HOTPKEY_BRANDING" 30 90 ; then + HOTP="Error checking code, Insert $HOTPKEY_BRANDING and retry" + BG_COLOR_MAIN_MENU=$BG_COLOR_WARNING + return fi + fi # Don't output HOTP codes to screen, so as to make replay attacks harder hotp_verification check $HOTP case "$?" in