Show red background when HOTP code is invalid

Granted the user should really be using the Librem Key/phone to check
for tampering (since an attacker could control the Heads background
color) but this provides another visual queue for the user with
the GUI menu to catch less sophisticated tampering.
This commit is contained in:
Kyle Rankin 2018-06-21 16:04:46 -07:00
parent ec3248dbc9
commit be665ac4f9
No known key found for this signature in database
GPG Key ID: 555577116BFA74B9

View File

@ -107,6 +107,7 @@ update_totp()
last_half=X
while true; do
MAIN_MENU_OPTIONS=""
MAIN_MENU_BG_COLOR=""
unset totp_confirm
# update the TOTP code every thirty seconds
date=`date "+%Y-%m-%d %H:%M:%S"`
@ -142,6 +143,7 @@ while true; do
;;
4 )
HOTP="invalid code"
MAIN_MENU_BG_COLOR=$CONFIG_ERROR_BG_COLOR
;;
* )
HOTP="error checking code"
@ -151,7 +153,7 @@ while true; do
HOTP='N/A'
fi
whiptail --clear --title "$CONFIG_BOOT_GUI_MENU_NAME" \
whiptail $MAIN_MENU_BG_COLOR --clear --title "$CONFIG_BOOT_GUI_MENU_NAME" \
--menu "$date\nTOTP: $TOTP | HOTP: $HOTP" 20 90 10 \
'y' ' Default boot' \
'r' ' TOTP/HOTP does not match, refresh code' \