mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
40c34453df
Exception: scripts sourcing/calls within etc/ash_functions continues to use old TRACE functions until we switch to bash completely getting rid of ash. This would mean getting rid of legacy boards (flash + legacy boards which do not have enough space for bash in flash boards) once and for all. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
22 lines
452 B
Bash
Executable File
22 lines
452 B
Bash
Executable File
#!/bin/bash
|
|
# Retrieve the sealed file from the NVRAM, unseal it and compute the totp
|
|
|
|
. /etc/functions
|
|
|
|
TOTP_SECRET="/tmp/secret/totp.key"
|
|
|
|
TRACE_FUNC
|
|
|
|
if [ "$CONFIG_TPM" = "y" ]; then
|
|
tpmr unseal 4d47 0,1,2,3,4,7 312 "$TOTP_SECRET" ||
|
|
die "Unable to unseal TOTP secret"
|
|
fi
|
|
|
|
if ! totp -q <"$TOTP_SECRET"; then
|
|
shred -n 10 -z -u "$TOTP_SECRET" 2>/dev/null
|
|
die 'Unable to compute TOTP hash?'
|
|
fi
|
|
|
|
shred -n 10 -z -u "$TOTP_SECRET" 2>/dev/null
|
|
exit 0
|