Manish V Badarkhe | b87f37b | 2021-11-10 18:53:05 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2021, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | # Expect script for Linux/Buildroot using Measured Boot & fTPM |
Manish V Badarkhe | fc146c4 | 2021-11-24 15:34:00 +0000 | [diff] [blame] | 7 | # It is a copy of linux-tpm.exp which doesn't check PCR0,PCR1 |
| 8 | # value, as that doesn't apply to this config |
Manish V Badarkhe | b87f37b | 2021-11-10 18:53:05 +0000 | [diff] [blame] | 9 | # |
| 10 | |
| 11 | # Parse the event log from the debug logs and store the digests |
| 12 | # so they can be matched later with what the fTPM read. |
| 13 | 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') |
| 14 | |
| 15 | # Wait for the login prompt |
| 16 | expect_string+=("i;buildroot login:") |
| 17 | |
| 18 | # Login then load the fTPM driver |
| 19 | # Note: Do not check sanity of PCR0 |
| 20 | expect_string+=("i;#;;;root") |
| 21 | expect_string+=("i;;;;ftpm") |
| 22 | |
| 23 | # Iterate over the rest of PCRs and check that they all are zeros. |
| 24 | zero_pcr="(\s00){16}\s+(00\s){16}" |
Manish V Badarkhe | fc146c4 | 2021-11-24 15:34:00 +0000 | [diff] [blame] | 25 | for i in $(seq 2 11); do |
Manish V Badarkhe | b87f37b | 2021-11-10 18:53:05 +0000 | [diff] [blame] | 26 | expect_string+=("i;#") |
| 27 | expect_string+=("i;${zero_pcr};;;pcrread -ha $i") |
| 28 | done |
Chris Kay | 07756bc | 2022-11-24 17:21:48 +0000 | [diff] [blame] | 29 | |
| 30 | expect_string+=("i;#;;;@") # Flush newline after final prompt |