mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-19 21:17:55 +00:00
initrd/bin/unseal-hotp: Prevent script errors if unseal fails
If the secret can't be unsealed, die immediately rather than continuing on to generate errors. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
parent
8272d33e7c
commit
4d7c1cb388
@ -39,7 +39,7 @@ fi
|
||||
#counter_value=$(printf "%d" 0x${counter_value})
|
||||
if [ "$CONFIG_TPM" = "y" ]; then
|
||||
DEBUG "Unsealing HOTP secret reuses TOTP sealed secret..."
|
||||
tpmr unseal 4d47 0,1,2,3,4,7 312 "$HOTP_SECRET"
|
||||
tpmr unseal 4d47 0,1,2,3,4,7 312 "$HOTP_SECRET" || die "Unable to unseal HOTP secret"
|
||||
else
|
||||
# without a TPM, generate a secret based on the SHA-256 of the ROM
|
||||
secret_from_rom_hash > "$HOTP_SECRET" || die "Reading ROM failed"
|
||||
|
Loading…
Reference in New Issue
Block a user