blob: 88410edbde89e3542ad48c66caec367f2536d9b8 [file] [log] [blame]
#
# Copyright (c) 2021-2022, 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
#
source [file join [file dirname [info script]] utils.inc]
source [file join [file dirname [info script]] handle-arguments.inc]
# File to store the event log from the ftpm service.
set TFA_DIGEST [get_param tfa_digest "tfa_event_log"]
set FTPM_DIGEST [get_param ftpm_digest "ftpm_event_log"]
# regexp for non-zero PCR0
set non_zero_pcr "(?!(\\s00){16})((\\s(\[0-9a-f\]){2}){16}\\s)"
capture_log $TFA_DIGEST "Booting BL31"
expect {
"login" {
send "root\n"
}
}
expect {
"#" {
# Load the fTPM driver
send "ftpm\n"
}
}
expect {
"#" { }
}
# Iterate over the rest of PCRs and check that they all are zeros.
for {set i 1} {$i < 11} {incr i} {
send "pcrread -ha $i\n"
expect {
-re "(\\s00){16}\\s+(00\\s){16}" { }
-re $non_zero_pcr {
exit_uart -1
}
}
}
expect_string "#" "finished reading PCRs"
compare_log $TFA_DIGEST $FTPM_DIGEST