blob: 27adf92bb00da381150e4702f966185becf4bc8e [file] [log] [blame]
Leonardo Sandoval6eff3f72021-05-03 11:12:37 -05001#
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
7#
8
Leonardo Sandoval5cfc11f2021-09-08 16:08:13 -05009non_zero_pcr='(?!(\s00){16})((\s([0-9a-f]){2}){16}\s)'
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
14expect_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')
15
16# Wait for the login prompt
17expect_string+=('i;buildroot login:')
18
19# Load the fTPM driver and retrieves PCR0
20# Pass condition: PCR0 must not be all zeros.
21expect_string+=("i;#;${non_zero_pcr};;root@ftpm")
22
23# Iterate over the rest of PCRs and check that they all are zeros.
24zero_pcr="(\s00){16}\s+(00\s){16}"
25for i in $(seq 1 11); do
26 expect_string+=("i;#;${zero_pcr};;pcrread -ha $i")
27done
28