Skip to content

Commit 0752843

Browse files
authored
Merge pull request #1291 from tlaurion/warn_user_when_totp-hotp_seal_requires_tpm_reset
gui-init: warn the user when sealing measurements through TOTP/HOTP reset
2 parents f2ba667 + e00280e commit 0752843

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

initrd/bin/gui-init

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,20 @@ prompt_update_checksums()
149149
generate_totp_htop()
150150
{
151151
echo "Scan the QR code to add the new TOTP secret"
152-
/bin/seal-totp "$BOARD_NAME"
153-
if [ -x /bin/hotp_verification ]; then
154-
echo "Once you have scanned the QR code, hit Enter to configure your HOTP USB Security Dongle (e.g. Librem Key or Nitrokey)"
155-
read
156-
/bin/seal-hotpkey
152+
if /bin/seal-totp "$BOARD_NAME"; then
153+
if [ -x /bin/hotp_verification ]; then
154+
echo "Once you have scanned the QR code, hit Enter to configure your HOTP USB Security Dongle (e.g. Librem Key or Nitrokey)"
155+
read
156+
/bin/seal-hotpkey
157+
else
158+
echo "Once you have scanned the QR code, hit Enter to continue"
159+
read
160+
fi
161+
# clear screen
162+
printf "\033c"
157163
else
158-
echo "Once you have scanned the QR code, hit Enter to continue"
159-
read
164+
warn "Sealing of measurements inside of TPM failed. You might want to take ownership of TPM by resetting it."
160165
fi
161-
# clear screen
162-
printf "\033c"
163166
}
164167

165168
update_totp()

0 commit comments

Comments
 (0)