|
1 | 1 | #!/usr/bin/env python3 |
2 | 2 | # |
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. |
4 | 4 | # SPDX-License-Identifier : Apache-2.0 |
5 | 5 | # |
6 | 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
|
29 | 29 | "EV_EFI_VARIABLE_DRIVER_CONFIG", |
30 | 30 | "Verify BootOrder and Boot#### variables are measured in PCR[1] with" |
31 | 31 | "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", |
33 | 33 | "Verify security relevant configuration data are measured in into PCR[1] with " |
34 | 34 | "EV_EFI_HANDOFF_TABLES", |
35 | 35 | "Verify presence of EV_SEPARATOR event for each PCR", |
@@ -161,17 +161,17 @@ def check_events(event_list): |
161 | 161 | if not match_found : |
162 | 162 | print_buffer.append(f"Event {event['event_num']:2} data doesn't comply " + \ |
163 | 163 | "with recommended string") |
164 | | - status = "FAIL" |
| 164 | + status = "WARN" |
165 | 165 | # reset flag for next iteration |
166 | 166 | match_found = False |
167 | 167 | if count == 0: |
168 | 168 | print_buffer.append(f"Event of type EV_POST_CODE measured into PCR[0] not found") |
169 | 169 | TestResult(3, "FAIL") |
170 | | - elif status != "FAIL": |
| 170 | + elif status == "WARN": |
171 | 171 | # all events of type EV_POST_CODE has event string as recommended. |
172 | | - TestResult(3, "PASS") |
| 172 | + TestResult(3, "WARN") |
173 | 173 | else: |
174 | | - TestResult(3, "FAIL") |
| 174 | + TestResult(3, "PASS") |
175 | 175 |
|
176 | 176 | # Verify EV_POST_CODE events for measurements of signed critical to data PCR[0]. |
177 | 177 | match_found = False |
@@ -230,12 +230,12 @@ def check_events(event_list): |
230 | 230 | status = "FAIL" |
231 | 231 | TestResult(6, status) |
232 | 232 |
|
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 |
234 | 234 | # and action string "Calling EFI Application from Boot Option" |
235 | 235 | status = "FAIL" |
236 | 236 | match_found = False |
237 | 237 | for event in event_list: |
238 | | - if event['event_type'] == "EV_ACTION" and \ |
| 238 | + if event['event_type'] == "EV_EFI_ACTION" and \ |
239 | 239 | event['event_data'] == "Calling EFI Application from Boot Option": |
240 | 240 | match_found = True |
241 | 241 | if event['pcr_index'] != 4: |
@@ -319,17 +319,17 @@ def check_events(event_list): |
319 | 319 | if not match_found : |
320 | 320 | print_buffer.append(f"Event {event['event_num']:2} data doesn't " + \ |
321 | 321 | "comply with recommended string") |
322 | | - status = "FAIL" |
| 322 | + status = "WARN" |
323 | 323 | # reset flag for next iteration |
324 | 324 | match_found = False |
325 | 325 | if count == 0: |
326 | 326 | print_buffer.append("Event of type EV_TABLE_OF_DEVICES measured into PCR[1] not found") |
327 | 327 | TestResult(10, "FAIL") |
328 | | - elif status != "FAIL": |
| 328 | + elif status == "WARN": |
329 | 329 | # all events of type EV_TABLE_OF_DEVICES has event string as recommended. |
330 | | - TestResult(10, "PASS") |
| 330 | + TestResult(10, "WARN") |
331 | 331 | else: |
332 | | - TestResult(10, "FAIL") |
| 332 | + TestResult(10, "PASS") |
333 | 333 |
|
334 | 334 | # If ExitBootServices() is invoked, then an EV_EFI_ACTION event |
335 | 335 | # “Exit Boot Services Invocation” must be measured. |
@@ -373,3 +373,4 @@ def check_events(event_list): |
373 | 373 | except Exception as e: |
374 | 374 | print(f"ERROR: {e}") |
375 | 375 | exit(1) |
| 376 | + |
0 commit comments