]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update secure boot UI driver to handle “reset to default” hot key.
authorsfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Apr 2013 01:44:54 +0000 (01:44 +0000)
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Apr 2013 01:44:54 +0000 (01:44 +0000)
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14257 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.vfr
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigNvData.h

index ae4b71bffd0fbb480c7d9659a37fffceb56543d4..656befbb44fb70d0a431f74bcfdce54ae211bba2 100644 (file)
@@ -43,8 +43,10 @@ formset
     //\r
     suppressif TRUE;\r
       checkbox varid   = SECUREBOOT_CONFIGURATION.HideSecureBoot,\r
+              questionid = KEY_HIDE_SECURE_BOOT,\r
               prompt   = STRING_TOKEN(STR_NULL),\r
               help     = STRING_TOKEN(STR_NULL),\r
+              flags    = INTERACTIVE,\r
       endcheckbox;\r
     endif;  \r
     \r
index 51da86b6fdaabe57167e8b9c455bf612808abc73..3084f3364e73366e5c14ca37fac53c9df21aad44 100644 (file)
@@ -2378,6 +2378,11 @@ SecureBootRouteConfig (
        OUT EFI_STRING                          *Progress\r
   )\r
 {\r
+  UINT8                      *SecureBootEnable;\r
+  SECUREBOOT_CONFIGURATION   IfrNvData;\r
+  UINTN                      BufferSize;\r
+  EFI_STATUS                 Status;\r
+  \r
   if (Configuration == NULL || Progress == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -2387,6 +2392,31 @@ SecureBootRouteConfig (
     return EFI_NOT_FOUND;\r
   }\r
 \r
+  BufferSize = sizeof (SECUREBOOT_CONFIGURATION);\r
+  Status = gHiiConfigRouting->ConfigToBlock (\r
+                                gHiiConfigRouting,\r
+                                Configuration,\r
+                                (UINT8 *)&IfrNvData,\r
+                                &BufferSize,\r
+                                Progress\r
+                                );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Store Buffer Storage back to EFI variable if needed\r
+  //\r
+  SecureBootEnable = NULL;\r
+  GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, (VOID**)&SecureBootEnable, NULL);\r
+  if (NULL != SecureBootEnable) {\r
+    FreePool (SecureBootEnable);\r
+    Status = SaveSecureBootVariable (IfrNvData.AttemptSecureBoot);\r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
+  }\r
+\r
   *Progress = Configuration + StrLen (Configuration);\r
   return EFI_SUCCESS;\r
 }\r
@@ -2445,7 +2475,8 @@ SecureBootCallback (
 \r
   if ((Action != EFI_BROWSER_ACTION_CHANGED) &&\r
       (Action != EFI_BROWSER_ACTION_CHANGING) &&\r
-      (Action != EFI_BROWSER_ACTION_FORM_CLOSE)) {\r
+      (Action != EFI_BROWSER_ACTION_FORM_CLOSE) &&\r
+      (Action != EFI_BROWSER_ACTION_DEFAULT_STANDARD)) {\r
     return EFI_UNSUPPORTED;\r
   }\r
   \r
@@ -2733,6 +2764,17 @@ SecureBootCallback (
       }\r
       break;  \r
     }\r
+  } else if (Action == EFI_BROWSER_ACTION_DEFAULT_STANDARD) {\r
+    if (QuestionId == KEY_HIDE_SECURE_BOOT) {\r
+      GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, (VOID**)&SecureBootEnable, NULL);\r
+      if (SecureBootEnable == NULL) {\r
+        IfrNvData->HideSecureBoot = TRUE;\r
+      } else {\r
+        FreePool (SecureBootEnable);\r
+        IfrNvData->HideSecureBoot = FALSE;\r
+      }\r
+      Value->b = IfrNvData->HideSecureBoot;\r
+    }\r
   } else if (Action == EFI_BROWSER_ACTION_FORM_CLOSE) {\r
     //\r
     // Force the platform back to Standard Mode once user leave the setup screen.\r
index ea4319290026ca7780cc27a77a0ee9ce95baecb1..c15869a625764d442cb292bd009db85efb5868ee 100644 (file)
@@ -55,6 +55,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define KEY_VALUE_NO_SAVE_AND_EXIT_KEK        0x1009\r
 #define KEY_VALUE_SAVE_AND_EXIT_DBX           0x100a\r
 #define KEY_VALUE_NO_SAVE_AND_EXIT_DBX        0x100b\r
+#define KEY_HIDE_SECURE_BOOT                  0x100c\r
 \r
 #define KEY_SECURE_BOOT_OPTION                0x1100\r
 #define KEY_SECURE_BOOT_PK_OPTION             0x1101\r