{\r
EFI_STATUS Status;\r
VARIABLE_POINTER_TRACK Variable;\r
+ VARIABLE_POINTER_TRACK PkVariable;\r
UINT8 VarValue;\r
UINT32 VarAttr;\r
UINT8 *Data;\r
CopyMem (mPubKeyStore, (UINT8 *) Data, DataSize);\r
mPubKeyNumber = (UINT32) (DataSize / EFI_CERT_TYPE_RSA2048_SIZE);\r
}\r
+\r
+ FindVariable (EFI_PLATFORM_KEY_NAME, &gEfiGlobalVariableGuid, &PkVariable, &mVariableModuleGlobal->VariableGlobal);\r
+ if (PkVariable.CurrPtr == NULL) {\r
+ DEBUG ((EFI_D_INFO, "Variable %s does not exist.\n", EFI_PLATFORM_KEY_NAME));\r
+ } else {\r
+ DEBUG ((EFI_D_INFO, "Variable %s exists.\n", EFI_PLATFORM_KEY_NAME));\r
+ }\r
+ \r
//\r
// Check "SetupMode" variable's existence.\r
// If it doesn't exist, check PK database's existence to determine the value.\r
);\r
\r
if (Variable.CurrPtr == NULL) {\r
- Status = FindVariable (\r
- EFI_PLATFORM_KEY_NAME,\r
- &gEfiGlobalVariableGuid,\r
- &Variable,\r
- &mVariableModuleGlobal->VariableGlobal\r
- );\r
- if (Variable.CurrPtr == NULL) {\r
+ if (PkVariable.CurrPtr == NULL) {\r
mPlatformMode = SETUP_MODE;\r
} else {\r
mPlatformMode = USER_MODE;\r
return Status;\r
}\r
\r
+ DEBUG ((EFI_D_INFO, "Variable %s is %x\n", EFI_SETUP_MODE_NAME, mPlatformMode));\r
+ DEBUG ((EFI_D_INFO, "Variable %s is %x\n", EFI_SECURE_BOOT_MODE_NAME, SecureBootMode));\r
+ DEBUG ((EFI_D_INFO, "Variable %s is %x\n", EFI_SECURE_BOOT_ENABLE_NAME, SecureBootEnable));\r
+\r
//\r
// Detect whether a secure platform-specific method to clear PK(Platform Key)\r
// is configured by platform owner. This method is provided for users force to clear PK\r
// in case incorrect enrollment mis-haps.\r
//\r
if (ForceClearPK ()) {\r
+ DEBUG ((EFI_D_INFO, "Variable PK/KEK/DB/DBX will be cleared in clear PK mode.\n"));\r
+\r
//\r
// 1. Clear PK.\r
//\r