Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 27 lines (21 sloc) 467 Bytes
#!/bin/sh
# Retrieve the sealed file from the NVRAM, unseal it and compute the totp
die() {
echo >&2 "$@"
rm /tmp/sealed /tmp/secret 2>&-
exit 1
}
tpm nv_readvalue \
-in 4d47 \
-sz 312 \
-of /tmp/sealed \
|| die "Unable to retrieve sealed file from TPM NV"
tpm unsealfile \
-hk 40000000 \
-if /tmp/sealed \
-of /tmp/secret \
|| die "Unable to unseal totp secret"
rm /tmp/sealed
totp < /tmp/secret \
|| die "Unable to compute TOTP hash"
rm /tmp/secret