Skip to content

Commit eb3ee36

Browse files
committed
qubes-measure-luks: Change implementation from luksDump to luksHeaderBackup
Fixes #1089
1 parent fba79ab commit eb3ee36

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

initrd/bin/qubes-measure-luks

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@
44

55
die() { echo >&2 "$@"; exit 1; }
66

7+
#Following file should be clean since the actual script is called to populate /tmp/luksDump.txt
8+
# /tmp/luksDump.txt is then used kexec-seal-key to calcfuturepcr into pcr 10 (unused)
9+
# and then extend that clean value into PCR 6 (which should be zeroed too).
10+
rm -f /tmp/luksDump.txt
11+
712
# Measure the luks headers into PCR 6
813
for dev in "$@"; do
9-
cryptsetup luksDump $dev \
14+
cryptsetup luksHeaderBackup $dev --header-backup-file /tmp/tmp_luks_header \
1015
|| die "$dev: Unable to measure"
11-
done > /tmp/luksDump.txt
16+
cat /tmp/tmp_luks_header >> /tmp/luksDump.txt
17+
rm -f /tmp/tmp_luks_header
18+
done
1219

1320
tpm extend -ix 6 -if /tmp/luksDump.txt \
1421
|| die "Unable to extend PCR"

0 commit comments

Comments
 (0)