fix(linux-tpm): skip PCR0 check with SHA384 algorithm
A third party service 'ftpm' does not throw a non-zero value
of PCR0 with SHA384 algorithm hence skip checking of PCR0
value when this algorithm gets selected.
Change-Id: Ie464e22917008fdf4eab9bb017928755c2794ed3
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
diff --git a/lava-expect/linux-tpm-384.exp b/lava-expect/linux-tpm-384.exp
new file mode 100644
index 0000000..16eab17
--- /dev/null
+++ b/lava-expect/linux-tpm-384.exp
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2021, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Expect script for Linux/Buildroot using Measured Boot & fTPM
+# It is a copy of linux-tpm.exp which doesn't check PCR0 value,
+# as that doesn't apply to this config
+#
+
+# Parse the event log from the debug logs and store the digests
+# so they can be matched later with what the fTPM read.
+expect_string+=('m;Booting Trusted Firmware;Booting BL31;Digest(\s|\w)*:\s(\w{2}\s){16}@: (\w{2}\s){16}@Event(\s|\w)*:\s\w+\s')
+
+# Wait for the login prompt
+expect_string+=("i;buildroot login:")
+
+# Login then load the fTPM driver
+# Note: Do not check sanity of PCR0
+expect_string+=("i;#;;;root")
+expect_string+=("i;;;;ftpm")
+
+# Iterate over the rest of PCRs and check that they all are zeros.
+zero_pcr="(\s00){16}\s+(00\s){16}"
+for i in $(seq 1 11); do
+ expect_string+=("i;#")
+ expect_string+=("i;${zero_pcr};;;pcrread -ha $i")
+done