From 2313184c9e9819f7ae1aaa3ad59c080f427645e1 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Wed, 22 Jul 2020 09:54:09 +0200 Subject: [PATCH] Add sha1 pcr tests Signed-off-by: Patrick Uiterwijk --- tests/test_pcr | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_pcr b/tests/test_pcr index 2782394..82572e6 100755 --- a/tests/test_pcr +++ b/tests/test_pcr @@ -6,6 +6,9 @@ echo "Working: no sealing (clevis encrypt)" | clevis encrypt tpm2 '{}' | ./targe echo "Working: with PCRs" | ./target/debug/clevis-pin-tpm2 encrypt '{"pcr_ids":[23]}' | ./target/debug/clevis-pin-tpm2 decrypt || (echo "Failed: with PCRs"; exit 1) echo "Working: with PCRs (clevis decrypt)" | ./target/debug/clevis-pin-tpm2 encrypt '{"pcr_ids":[23]}' | clevis decrypt || (echo "Failed: with PCRs (clevis decrypt)"; exit 1) echo "Working: with PCRs (clevis encrypt)" | clevis encrypt tpm2 '{"pcr_ids":[23]}' | ./target/debug/clevis-pin-tpm2 decrypt || (echo "Failed: with PCRs (clevis encrypt)"; exit 1) +echo "Working: with PCRs sha1" | ./target/debug/clevis-pin-tpm2 encrypt '{"pcr_bank": "sha1", "pcr_ids":[23]}' | ./target/debug/clevis-pin-tpm2 decrypt || (echo "Failed: with PCRs"; exit 1) +echo "Working: with PCRs sha1 (clevis decrypt)" | ./target/debug/clevis-pin-tpm2 encrypt '{"pcr_bank": "sha1", "pcr_ids":[23]}' | clevis decrypt || (echo "Failed: with PCRs"; exit 1) +echo "Working: with PCRs sha1 (clevis encrypt)" | clevis encrypt tpm2 '{"pcr_bank": "sha1", "pcr_ids":[23]}' | ./target/debug/clevis-pin-tpm2 decrypt || (echo "Failed: with PCRs"; exit 1) # Negative test (PCR change) token=$(echo Failed | ./target/debug/clevis-pin-tpm2 encrypt '{"pcr_ids":[23]}') tpm2_pcrevent -Q README.md 23