blob: 27adf92bb00da381150e4702f966185becf4bc8e [file] [log] [blame]
#
# Copyright (c) 2021, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Expect script for Linux/Buildroot using Measured Boot & fTPM
#
non_zero_pcr='(?!(\s00){16})((\s([0-9a-f]){2}){16}\s)'
# 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:')
# Load the fTPM driver and retrieves PCR0
# Pass condition: PCR0 must not be all zeros.
expect_string+=("i;#;${non_zero_pcr};;root@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;#;${zero_pcr};;pcrread -ha $i")
done