@@ -7,6 +7,7 @@ export BG_COLOR_MAIN_MENU="normal"
77
88. /etc/functions.sh
99. /etc/gui_functions.sh
10+ . /etc/gpg_functions.sh
1011. /etc/luks-functions.sh
1112. /tmp/config
1213
@@ -427,12 +428,16 @@ EOF
427428 return 1
428429 ;;
429430 # "Reset the TPM" from the TOTP failure whiptail menu.
430- # The gate runs first to verify /boot integrity. If the gate
431- # fails *because* TPM reset is required (e.g. stale counters),
432- # the || tpm_reset_required bypass lets reset_tpm() proceed —
433- # it clears counters and creates a fresh one.
431+ # Show the integrity report so the user can see the state,
432+ # but do not force the investigation / signing path —
433+ # that would attempt TPM counter operations requiring the
434+ # current owner password, which is unknown (that is why
435+ # we are resetting). reset_tpm() handles everything:
436+ # new password, counter create, /boot signing, TOTP/HOTP
437+ # generation, DUK reseal, and reboot.
434438 p)
435- if { gate_reseal_with_integrity_report || tpm_reset_required; } && reset_tpm && update_totp && BG_COLOR_MAIN_MENU=" normal" ; then
439+ report_integrity_measurements
440+ if reset_tpm && update_totp && BG_COLOR_MAIN_MENU=" normal" ; then
436441 reseal_tpm_disk_decryption_key || prompt_missing_gpg_key_action
437442 fi
438443 ;;
@@ -829,10 +834,16 @@ show_tpm_totp_hotp_options_menu() {
829834 fi
830835 ;;
831836 # "Reset the TPM" from the TPM/TOTP/HOTP options whiptail menu.
832- # Same gate-bypass pattern: if the gate fails because TPM
833- # reset is required, proceed to reset_tpm() anyway.
837+ # Show the integrity report so the user can see the state,
838+ # but do not force the investigation / signing path —
839+ # that would attempt TPM counter operations requiring the
840+ # current owner password, which is unknown (that is why
841+ # we are resetting). reset_tpm() handles everything:
842+ # new password, counter create, /boot signing, TOTP/HOTP
843+ # generation, DUK reseal, and reboot.
834844 r)
835- if { gate_reseal_with_integrity_report || tpm_reset_required; } && reset_tpm; then
845+ report_integrity_measurements
846+ if reset_tpm; then
836847 reseal_tpm_disk_decryption_key || prompt_missing_gpg_key_action
837848 fi
838849 ;;
@@ -942,6 +953,7 @@ reset_tpm() {
942953 if [ -s /boot/kexec_key_devices.txt ] || [ -s /boot/kexec_key_lvm.txt ]; then
943954 reseal_tpm_disk_decryption_key || prompt_missing_gpg_key_action
944955 fi
956+ /bin/reboot.sh
945957 fi
946958 fi
947959}
0 commit comments