]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
Add new interface GetVariable2 and GetEfiGlobalVariable2 to return more info. Also...
[mirror_edk2.git] / SecurityPkg / VariableAuthenticated / SecureBootConfigDxe / SecureBootConfigImpl.c
index f740c0ae755f193415bb60d903b4efef7cf764cb..0dc9c2b22d5c98dec7afa5024dd901d48a9baa24 100644 (file)
@@ -215,7 +215,7 @@ DeleteVariable (
   UINTN                   DataSize;\r
   UINT32                  Attr;\r
 \r
-  Variable = GetVariable (VariableName, VendorGuid);\r
+  GetVariable2 (VariableName, VendorGuid, &Variable, NULL);\r
   if (Variable == NULL) {\r
     return EFI_SUCCESS;\r
   }\r
@@ -2064,7 +2064,7 @@ SecureBootExtractConfigFromVariable (
   //\r
   // Get the SecureBootEnable Variable\r
   //\r
-  SecureBootEnable = GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid);\r
+  GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);\r
 \r
   //\r
   // If the SecureBootEnable Variable doesn't exist, hide the SecureBoot Enable/Disable\r
@@ -2088,7 +2088,7 @@ SecureBootExtractConfigFromVariable (
   //\r
   // If there is no PK then the Delete Pk button will be gray.\r
   //\r
-  SetupMode = GetVariable (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid);\r
+  GetVariable2 (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid, &SetupMode, NULL);\r
   if (SetupMode == NULL || (*SetupMode) == 1) {\r
     ConfigData->HasPk = FALSE;\r
   } else  {\r
@@ -2098,7 +2098,7 @@ SecureBootExtractConfigFromVariable (
   //\r
   // Get the SecureBootMode from CustomMode variable.\r
   //\r
-  SecureBootMode = GetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid);\r
+  GetVariable2 (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid, &SecureBootMode, NULL);\r
   if (SecureBootMode == NULL) {\r
     ConfigData->SecureBootMode = STANDARD_SECURE_BOOT_MODE;\r
   } else {\r
@@ -2298,6 +2298,9 @@ SecureBootCallback (
   UINTN                           BufferSize;\r
   SECUREBOOT_CONFIGURATION        *IfrNvData;\r
   UINT16                          LabelId;\r
+  UINT8                           *SecureBootEnable;\r
+\r
+  SecureBootEnable = NULL;\r
 \r
   if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -2326,7 +2329,8 @@ SecureBootCallback (
 \r
     switch (QuestionId) {\r
     case KEY_SECURE_BOOT_ENABLE:\r
-      if (NULL != GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid)) {\r
+      GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);\r
+      if (NULL != SecureBootEnable) {\r
         if (EFI_ERROR (SaveSecureBootVariable (Value->u8))) {\r
           CreatePopUp (\r
             EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
@@ -2513,7 +2517,8 @@ SecureBootCallback (
       break;\r
       \r
     case KEY_SECURE_BOOT_MODE:\r
-      if (NULL != GetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid)) {\r
+      GetVariable2 (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid, &SecureBootEnable, NULL);\r
+      if (NULL != SecureBootEnable) {\r
         Status = gRT->SetVariable (                          \r
                         EFI_CUSTOM_MODE_NAME,\r
                         &gEfiCustomModeEnableGuid,\r