}\r
\r
/**\r
- Measure and log an action string, and extend the measurement result into PCR[5].\r
+ Measure and log an action string, and extend the measurement result into PCR[PCRIndex].\r
\r
+ @param[in] PCRIndex PCRIndex to extend\r
@param[in] String A specific string that indicates an Action event. \r
\r
@retval EFI_SUCCESS Operation completed successfully.\r
**/\r
EFI_STATUS\r
TcgMeasureAction (\r
- IN CHAR8 *String\r
+ IN TPM_PCRINDEX PCRIndex,\r
+ IN CHAR8 *String\r
)\r
{\r
TCG_PCR_EVENT_HDR TcgEvent;\r
\r
- TcgEvent.PCRIndex = 5;\r
+ TcgEvent.PCRIndex = PCRIndex;\r
TcgEvent.EventType = EV_EFI_ACTION;\r
TcgEvent.EventSize = (UINT32)AsciiStrLen (String);\r
return TcgDxeHashLogExtendEvent (\r
// 1. This is the first boot attempt.\r
//\r
Status = TcgMeasureAction (\r
+ 4,\r
EFI_CALLING_EFI_APPLICATION\r
);\r
if (EFI_ERROR (Status)) {\r
// 6. Not first attempt, meaning a return from last attempt\r
//\r
Status = TcgMeasureAction (\r
+ 4,\r
EFI_RETURNING_FROM_EFI_APPLICATOIN\r
);\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_RETURNING_FROM_EFI_APPLICATOIN));\r
}\r
+\r
+ //\r
+ // 7. Next boot attempt, measure "Calling EFI Application from Boot Option" again\r
+ // TCG PC Client PFP spec Section 2.4.4.5 Step 4\r
+ //\r
+ Status = TcgMeasureAction (\r
+ 4,\r
+ EFI_CALLING_EFI_APPLICATION\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION));\r
+ }\r
}\r
\r
DEBUG ((EFI_D_INFO, "TPM2 Tcg2Dxe Measure Data when ReadyToBoot\n"));\r
// Measure invocation of ExitBootServices,\r
//\r
Status = TcgMeasureAction (\r
+ 5,\r
EFI_EXIT_BOOT_SERVICES_INVOCATION\r
);\r
if (EFI_ERROR (Status)) {\r
// Measure success of ExitBootServices\r
//\r
Status = TcgMeasureAction (\r
+ 5,\r
EFI_EXIT_BOOT_SERVICES_SUCCEEDED\r
);\r
if (EFI_ERROR (Status)) {\r
// Measure Failure of ExitBootServices,\r
//\r
Status = TcgMeasureAction (\r
+ 5,\r
EFI_EXIT_BOOT_SERVICES_FAILED\r
);\r
if (EFI_ERROR (Status)) {\r