forked from osresearch/safeboot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tpm2-pcr-validate: test various attestation failures
Signed-off-by: Trammell hudson <[email protected]>
- Loading branch information
1 parent
510b7cd
commit db1905b
Showing
4 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pcrs: | ||
sha256: | ||
0 : 0x3FBF10A9DD919CD821C71C71B203F3839233120537798917F53714F1EFF7F036 | ||
1 : 0x6BAD0D93219F5B1E3BA7031BAB290ECA4D973AE6468145847A49D44BCC0905BD | ||
2 : 0x3D458CFE55CC03EA1F443F1562BEEC8DF51C75E14A9FCF9A7234A13F198E7969 | ||
4 : 0xC28F2726BA0A11B9FBA161419FF95BE3DA6CA9ADDC286D5FA1E1E9EC0B79DC35 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
# Verify that the quote verification works | ||
set -e -o pipefail | ||
export LC_ALL=C | ||
|
||
die() { echo "$@" >&2 ; exit 1 ; } | ||
warn() { echo "$@" >&2 ; } | ||
|
||
DIR="`dirname $0`" | ||
export PATH="$DIR/../sbin:$DIR/../bin:$PATH" | ||
|
||
warn "----- Good test -----" | ||
tpm2-attest verify \ | ||
"$DIR/quote-t490.tgz" \ | ||
"$DIR/pcrs-t490.txt" \ | ||
abcdef \ | ||
"$DIR/../certs" \ | ||
> /tmp/attest-good.log \ | ||
|| die "attestion verification failed" | ||
|
||
|
||
warn "--- Wrong nonce (should fail)" | ||
tpm2-attest verify \ | ||
"$DIR/quote-t490.tgz" \ | ||
"$DIR/pcrs-t490.txt" \ | ||
12345678 \ | ||
"$DIR/../certs" \ | ||
> /tmp/attest-fail.log \ | ||
&& die "wrong nonce: attestion verification should have failed" | ||
|
||
warn "--- Wrong PCRs (should fail)" | ||
sed -e 's/0xC/0xD/' < "$DIR/pcrs-t490.txt" > /tmp/bad-pcrs.txt | ||
tpm2-attest verify \ | ||
"$DIR/quote-t490.tgz" \ | ||
"/tmp/bad-pcrs.txt" \ | ||
abcdef \ | ||
"$DIR/../certs" \ | ||
>> /tmp/attest-fail.log \ | ||
&& die "wrong PCRs: attestion verification should have failed" | ||
|
||
warn "--- Missing PCR (should fail)" | ||
( cat "$DIR/pcrs-t490.txt" ; echo " 5 : 0xC28F2726BA0A11B9FBA161419FF95BE3DA6CA9ADDC286D5FA1E1E9EC0B79DC35" ) > /tmp/bad-pcrs.txt | ||
tpm2-attest verify \ | ||
"$DIR/quote-t490.tgz" \ | ||
"/tmp/bad-pcrs.txt" \ | ||
abcdef \ | ||
"$DIR/../certs" \ | ||
>> /tmp/attest-fail.log \ | ||
&& die "missing PCR: attestion verification should have failed" | ||
|