allow key file to be specified on command line

This commit is contained in:
Trammell Hudson 2016-11-23 10:45:39 -05:00
parent e9e6d661d3
commit da2a6580ce
Failed to extract signature

View File

@ -8,6 +8,11 @@ TPM_SIZE=312
die() { echo >&2 "$@"; exit 1; }
warn() { echo >&2 "$@"; }
key_file="$1"
if [ -z "$key_file" ]; then
key_file=/tmp/secret.key
fi
read -s -p "Encryption password: " tpm_password
echo
@ -19,9 +24,11 @@ nv_readvalue \
unsealfile \
-if /tmp/sealed \
-of /tmp/secret.key \
-of "$key_file" \
-pwdd "$tpm_password" \
-hk 40000000 \
|| die "Unable to unseal disk encryption key"
rm /tmp/sealed