mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-01 16:58:06 +00:00
5bc2bc88e4
-qemu-coreboot-*whiptail-tpm1(-hotp) boards have 'export CONFIG_DEBUG_OUTPUT=y' by default now
22 lines
594 B
Bash
Executable File
22 lines
594 B
Bash
Executable File
#!/bin/sh
|
|
# Measure all of the luks disk encryption headers into
|
|
# a PCR so that we can detect disk swap attacks.
|
|
. /etc/functions
|
|
|
|
DEBUG "Under /bin/qubes-measure-luks"
|
|
|
|
die() { echo >&2 "$@"; exit 1; }
|
|
|
|
# Measure the luks headers into PCR 6
|
|
for dev in "$@"; do
|
|
cryptsetup luksHeaderBackup $dev \
|
|
--header-backup-file /tmp/lukshdr-$(echo "$dev" | sed 's/\//_/g') \
|
|
|| die "$dev: Unable to read luks header"
|
|
done
|
|
|
|
sha256sum /tmp/lukshdr-* > /tmp/luksDump.txt || die "Unable to hash luks headers"
|
|
rm /tmp/lukshdr-*
|
|
|
|
tpm extend -ix 6 -if /tmp/luksDump.txt \
|
|
|| die "Unable to extend PCR"
|