]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add debug information for secure boot test convenient.
authorgdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 4 Nov 2011 05:41:06 +0000 (05:41 +0000)
committergdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 4 Nov 2011 05:41:06 +0000 (05:41 +0000)
Signed-off-by: gdong1
Reviewed-by: tye
Reviewed-by: xdu2
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12660 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/VariableAuthenticated/RuntimeDxe/AuthService.c

index bb625ff2c0ca8bf2a25e42f079ca40a0b36178c6..5287c20cba067d728901735e52f8bb0f2371ff64 100644 (file)
@@ -91,6 +91,7 @@ AutenticatedVariableServiceInitialize (
 {\r
   EFI_STATUS              Status;\r
   VARIABLE_POINTER_TRACK  Variable;\r
+  VARIABLE_POINTER_TRACK  PkVariable;\r
   UINT8                   VarValue;\r
   UINT32                  VarAttr;\r
   UINT8                   *Data;\r
@@ -164,6 +165,14 @@ AutenticatedVariableServiceInitialize (
     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
@@ -177,13 +186,7 @@ AutenticatedVariableServiceInitialize (
              );\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
@@ -284,12 +287,18 @@ AutenticatedVariableServiceInitialize (
     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