From 1c6f623c25bb9af759c7052817ae038bf19bc76b Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Wed, 29 Sep 2021 16:32:18 -0500 Subject: [PATCH] gui-init: update $TOTP after generating new secret or resetting TPM After updating/flashing a new ROM, a new TOTP secret must be generated, but the $TOTP variable needs to be updated afterwards, otherwise it will show the previous failure which led to the new secret being created. Fix this by re-calling update_totp() after generating a new secret or resetting the TPM. Signed-off-by: Matt DeVillier --- initrd/bin/gui-init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/initrd/bin/gui-init b/initrd/bin/gui-init index 533d4c32..6c0fc9dd 100755 --- a/initrd/bin/gui-init +++ b/initrd/bin/gui-init @@ -170,14 +170,14 @@ update_totp() g ) if (whiptail $BG_COLOR_WARNING --title 'Generate new TOTP/HOTP secret' \ --yesno "This will erase your old secret and replace it with a new one!\n\nDo you want to proceed?" 16 90) then - generate_totp_htop && BG_COLOR_MAIN_MENU="" + generate_totp_htop && update_totp && BG_COLOR_MAIN_MENU="" fi ;; i ) return 1 ;; p ) - reset_tpm && BG_COLOR_MAIN_MENU="" + reset_tpm && update_totp && BG_COLOR_MAIN_MENU="" ;; x ) recovery "User requested recovery shell"