Skip to content

Commit

Permalink
gui-init: put change-time under TOTP mismatch where it should be, rem…
Browse files Browse the repository at this point in the history
…ove unneeded duplicate menu options to change system time

Signed-off-by: Thierry Laurion <[email protected]>

Signed-off-by: Thierry Laurion <[email protected]>
  • Loading branch information
tlaurion committed Jul 29, 2024
1 parent a99298a commit 2189636
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions initrd/bin/gui-init
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ update_totp()
If you have not just reflashed your BIOS, THIS COULD INDICATE TAMPERING!\n
How would you like to proceed?" 0 80 4 \
'g' ' Generate new HOTP/TOTP secret' \
'h' ' Change system time' \
'i' ' Ignore error and continue to main menu' \
'p' ' Reset the TPM' \
'x' ' Exit to recovery shell' \
Expand All @@ -235,9 +234,6 @@ update_totp()
generate_totp_hotp && update_totp && BG_COLOR_MAIN_MENU="normal" && reseal_tpm_disk_decryption_key
fi
;;
h )
change-time
;;
i )
skip_to_menu="true"
return 1
Expand Down Expand Up @@ -551,16 +547,9 @@ prompt_totp_mismatch()
{
TRACE_FUNC
if (whiptail_warning --title "TOTP/HOTP code mismatched" \
--yesno "TOTP/HOTP code mismatches could indicate either TPM tampering or clock drift:\n\nTo correct clock drift: 'date -s yyyy-MM-DD hh:mm:ss' in UTC timezone\nand save it to the RTC: 'hwclock -w'\nthen reboot and try again.\n\nWould you like to exit to a recovery console?" 0 80) then
echo ""
echo "To correct clock drift: 'date -s yyyy-MM-DD hh:mm:ss' in UTC timezone"
echo "and save it to the RTC: 'hwclock -w'"
echo ""
echo "Alternatively you could do this automatically with an Ethernet cable connected to a functional network: 'network-init-recovery'"
echo ""
echo "Then reboot and try again"
echo ""
recovery "TOTP/HOTP mismatch"
--yesno "TOTP/HOTP code mismatches could indicate either TPM tampering or clock drift.\n\nHere, we will manually set system time to see if TOTP code mismatch was because of time drift." 0 80) then
"Alternatively you could sync time from network automatically; either with an Ethernet cable connected to network or through Smartphone tethering. From Recovery shell, type : 'network-init-recovery'"
change-time
fi
}

Expand Down

0 comments on commit 2189636

Please sign in to comment.