mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
15 lines
366 B
Bash
Executable File
15 lines
366 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.
|
|
|
|
die() { echo >&2 "$@"; exit 1; }
|
|
|
|
# Measure the luks headers into PCR 6
|
|
for dev in "$@"; do
|
|
cryptsetup luksDump $dev \
|
|
|| die "$dev: Unable to measure"
|
|
done > /tmp/luksDump.txt
|
|
|
|
tpm extend -ix 6 -if /tmp/luksDump.txt \
|
|
|| die "Unable to extend PCR"
|