Skip to content

Commit 4523104

Browse files
Updated the script for string mismatch and EV_EFI_ACTION (#413)
Signed-off-by: Manjunath Divakar <manjunatha.d@arm.com>
1 parent fc2c40c commit 4523104

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

common/linux_scripts/verify_tpm_measurements.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# Copyright (c) 2023-2024, Arm Limited or its affiliates. All rights reserved.
3+
# Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved.
44
# SPDX-License-Identifier : Apache-2.0
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -29,7 +29,7 @@
2929
"EV_EFI_VARIABLE_DRIVER_CONFIG",
3030
"Verify BootOrder and Boot#### variables are measured in PCR[1] with"
3131
"EV_EFI_VARIABLE_BOOT/EV_EFI_VARIABLE_BOOT2",
32-
"Verify boot attempts measured in PCR[4] with EV_ACTION event type",
32+
"Verify boot attempts measured in PCR[4] with EV_EFI_ACTION event type",
3333
"Verify security relevant configuration data are measured in into PCR[1] with "
3434
"EV_EFI_HANDOFF_TABLES",
3535
"Verify presence of EV_SEPARATOR event for each PCR",
@@ -161,17 +161,17 @@ def check_events(event_list):
161161
if not match_found :
162162
print_buffer.append(f"Event {event['event_num']:2} data doesn't comply " + \
163163
"with recommended string")
164-
status = "FAIL"
164+
status = "WARN"
165165
# reset flag for next iteration
166166
match_found = False
167167
if count == 0:
168168
print_buffer.append(f"Event of type EV_POST_CODE measured into PCR[0] not found")
169169
TestResult(3, "FAIL")
170-
elif status != "FAIL":
170+
elif status == "WARN":
171171
# all events of type EV_POST_CODE has event string as recommended.
172-
TestResult(3, "PASS")
172+
TestResult(3, "WARN")
173173
else:
174-
TestResult(3, "FAIL")
174+
TestResult(3, "PASS")
175175

176176
# Verify EV_POST_CODE events for measurements of signed critical to data PCR[0].
177177
match_found = False
@@ -230,12 +230,12 @@ def check_events(event_list):
230230
status = "FAIL"
231231
TestResult(6, status)
232232

233-
# Verify boot attempt measurements into PCR[4] with event type EV_ACTION
233+
# Verify boot attempt measurements into PCR[4] with event type EV_EFI_ACTION
234234
# and action string "Calling EFI Application from Boot Option"
235235
status = "FAIL"
236236
match_found = False
237237
for event in event_list:
238-
if event['event_type'] == "EV_ACTION" and \
238+
if event['event_type'] == "EV_EFI_ACTION" and \
239239
event['event_data'] == "Calling EFI Application from Boot Option":
240240
match_found = True
241241
if event['pcr_index'] != 4:
@@ -319,17 +319,17 @@ def check_events(event_list):
319319
if not match_found :
320320
print_buffer.append(f"Event {event['event_num']:2} data doesn't " + \
321321
"comply with recommended string")
322-
status = "FAIL"
322+
status = "WARN"
323323
# reset flag for next iteration
324324
match_found = False
325325
if count == 0:
326326
print_buffer.append("Event of type EV_TABLE_OF_DEVICES measured into PCR[1] not found")
327327
TestResult(10, "FAIL")
328-
elif status != "FAIL":
328+
elif status == "WARN":
329329
# all events of type EV_TABLE_OF_DEVICES has event string as recommended.
330-
TestResult(10, "PASS")
330+
TestResult(10, "WARN")
331331
else:
332-
TestResult(10, "FAIL")
332+
TestResult(10, "PASS")
333333

334334
# If ExitBootServices() is invoked, then an EV_EFI_ACTION event
335335
# “Exit Boot Services Invocation” must be measured.
@@ -373,3 +373,4 @@ def check_events(event_list):
373373
except Exception as e:
374374
print(f"ERROR: {e}")
375375
exit(1)
376+

0 commit comments

Comments
 (0)