]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
MdeModulePkg: Move IsaBusDxe driver to MdeModulePkg.
[mirror_edk2.git] / SecurityPkg / VariableAuthenticated / SecureBootConfigDxe / SecureBootConfigFileExplorer.c
index 548d95df530ce273ab63d1048be5ec3b2f62a48e..5ca013c92df21f91a0e635a1549349c632c5a766 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Internal file explorer functions for SecureBoot configuration module.\r
 \r
-Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -65,7 +65,7 @@ StrDuplicate (
 }\r
 \r
 /**\r
-  Helper function called as part of the code needed to allocate \r
+  Helper function called as part of the code needed to allocate\r
   the proper sized buffer for various EFI interfaces.\r
 \r
   @param[in, out]   Status          Current status\r
@@ -122,7 +122,7 @@ GrowBuffer (
 }\r
 \r
 /**\r
-  Append file name to existing file name, and allocate a new buffer \r
+  Append file name to existing file name, and allocate a new buffer\r
   to hold the appended result.\r
 \r
   @param[in]  Str1  The existing file name\r
@@ -149,7 +149,7 @@ AppendFileName (
   Str   = AllocateZeroPool (Size1 + Size2 + sizeof (CHAR16));\r
   ASSERT (Str != NULL);\r
 \r
-  TmpStr = AllocateZeroPool (Size1 + Size2 + sizeof (CHAR16)); \r
+  TmpStr = AllocateZeroPool (Size1 + Size2 + sizeof (CHAR16));\r
   ASSERT (TmpStr != NULL);\r
 \r
   StrCat (Str, Str1);\r
@@ -170,7 +170,7 @@ AppendFileName (
       //\r
 \r
       //\r
-      // Use TmpStr as a backup, as StrCpy in BaseLib does not handle copy of two strings \r
+      // Use TmpStr as a backup, as StrCpy in BaseLib does not handle copy of two strings\r
       // that overlap.\r
       //\r
       StrCpy (TmpStr, Ptr + 3);\r
@@ -182,7 +182,7 @@ AppendFileName (
       //\r
 \r
       //\r
-      // Use TmpStr as a backup, as StrCpy in BaseLib does not handle copy of two strings \r
+      // Use TmpStr as a backup, as StrCpy in BaseLib does not handle copy of two strings\r
       // that overlap.\r
       //\r
       StrCpy (TmpStr, Ptr + 2);\r
@@ -196,7 +196,7 @@ AppendFileName (
   }\r
 \r
   FreePool (TmpStr);\r
-  \r
+\r
   return Str;\r
 }\r
 \r
@@ -354,7 +354,7 @@ DestroyMenuEntry (
   Free resources allocated in Allocate Rountine.\r
 \r
   @param[in, out]  MenuOption        Menu to be freed\r
-  \r
+\r
 **/\r
 VOID\r
 FreeMenu (\r
@@ -459,7 +459,7 @@ FileSystemVolumeLabelInfo (
   This function opens a file with the open mode according to the file path. The\r
   Attributes is valid only for EFI_FILE_MODE_CREATE.\r
 \r
-  @param[in, out]  FilePath        On input, the device path to the file.  \r
+  @param[in, out]  FilePath        On input, the device path to the file.\r
                                    On output, the remaining device path.\r
   @param[out]      FileHandle      Pointer to the file handle.\r
   @param[in]       OpenMode        The mode to open the file with.\r
@@ -495,7 +495,7 @@ OpenFileByDevicePath(
   EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *EfiSimpleFileSystemProtocol;\r
   EFI_FILE_PROTOCOL               *Handle1;\r
   EFI_FILE_PROTOCOL               *Handle2;\r
-  EFI_HANDLE                      DeviceHandle; \r
+  EFI_HANDLE                      DeviceHandle;\r
 \r
   if ((FilePath == NULL || FileHandle == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -652,7 +652,6 @@ FindFileSystem (
 {\r
   UINTN                     NoBlkIoHandles;\r
   UINTN                     NoSimpleFsHandles;\r
-  UINTN                     NoLoadFileHandles;\r
   EFI_HANDLE                *BlkIoHandle;\r
   EFI_HANDLE                *SimpleFsHandle;\r
   UINT16                    *VolumeLabel;\r
@@ -669,7 +668,6 @@ FindFileSystem (
 \r
 \r
   NoSimpleFsHandles = 0;\r
-  NoLoadFileHandles = 0;\r
   OptionNumber      = 0;\r
   InitializeListHead (&FsOptionMenu.Head);\r
 \r
@@ -816,7 +814,7 @@ FindFileSystem (
   if (NoSimpleFsHandles != 0) {\r
     FreePool (SimpleFsHandle);\r
   }\r
-  \r
+\r
   //\r
   // Remember how many file system options are here\r
   //\r
@@ -826,7 +824,7 @@ FindFileSystem (
 \r
 \r
 /**\r
-  Find files under the current directory. All files and sub-directories \r
+  Find files under the current directory. All files and sub-directories\r
   in current directory will be stored in DirectoryMenu for future use.\r
 \r
   @param[in] MenuEntry     The Menu Entry.\r
@@ -892,7 +890,7 @@ FindFiles (
   if (DirInfo == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   //\r
   // Get all files in current directory\r
   // Pass 1 to get Directories\r
@@ -934,7 +932,7 @@ FindFiles (
                                     NewFileContext->FileName\r
                                     );\r
       NewMenuEntry->HelpString = NULL;\r
-      \r
+\r
       NewFileContext->IsDir = (BOOLEAN) ((DirInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY);\r
       if (NewFileContext->IsDir) {\r
         BufferSize = StrLen (DirInfo->FileName) * 2 + 6;\r
@@ -977,7 +975,7 @@ RefreshUpdateData (
 {\r
   //\r
   // Free current updated date\r
-  //  \r
+  //\r
   if (mStartOpCodeHandle != NULL) {\r
     HiiFreeOpCodeHandle (mStartOpCodeHandle);\r
   }\r
@@ -1032,6 +1030,9 @@ UpdateFileExplorePage (
   } else if (FeCurrentState == FileExplorerStateEnrollSignatureFileToDbx) {\r
     FormId     = SECUREBOOT_ENROLL_SIGNATURE_TO_DBX;\r
     FileFormId = FORM_FILE_EXPLORER_ID_DBX;\r
+  } else if (FeCurrentState == FileExplorerStateEnrollSignatureFileToDbt) {\r
+    FormId     = SECUREBOOT_ENROLL_SIGNATURE_TO_DBT;\r
+    FileFormId = FORM_FILE_EXPLORER_ID_DBT;\r
   } else {\r
     return;\r
   }\r
@@ -1069,7 +1070,7 @@ UpdateFileExplorePage (
         NewMenuEntry->DisplayStringToken,\r
         STRING_TOKEN (STR_NULL),\r
         EFI_IFR_FLAG_CALLBACK,\r
-        (UINT16) (FILE_OPTION_OFFSET + Index)\r
+        (UINT16) (FILE_OPTION_GOTO_OFFSET + Index)\r
         );\r
     }\r
   }\r
@@ -1118,7 +1119,7 @@ UpdateFileExplorer (
     //\r
     FreeMenu (&FsOptionMenu);\r
     FindFileSystem ();\r
-    \r
+\r
     CreateMenuStringToken (PrivateData->HiiHandle, &FsOptionMenu);\r
     UpdateFileExplorePage (PrivateData->HiiHandle, &FsOptionMenu, PrivateData->FeCurrentState);\r
 \r
@@ -1156,13 +1157,15 @@ UpdateFileExplorer (
         FormId = SECUREBOOT_ENROLL_SIGNATURE_TO_DB;\r
       } else if (PrivateData->FeCurrentState == FileExplorerStateEnrollSignatureFileToDbx) {\r
         FormId = SECUREBOOT_ENROLL_SIGNATURE_TO_DBX;\r
+      } else if (PrivateData->FeCurrentState == FileExplorerStateEnrollSignatureFileToDbt) {\r
+        FormId = SECUREBOOT_ENROLL_SIGNATURE_TO_DBT;\r
       } else {\r
         return FALSE;\r
       }\r
 \r
       PrivateData->MenuEntry = NewMenuEntry;\r
       PrivateData->FileContext->FileName = NewFileContext->FileName;\r
-      \r
+\r
       TmpDevicePath = NewFileContext->DevicePath;\r
       OpenFileByDevicePath (\r
         &TmpDevicePath,\r
@@ -1200,7 +1203,7 @@ OnExit:
 }\r
 \r
 /**\r
-  Clean up the dynamic opcode at label and form specified by both LabelId. \r
+  Clean up the dynamic opcode at label and form specified by both LabelId.\r
 \r
   @param[in] LabelId         It is both the Form ID and Label ID for opcode deletion.\r
   @param[in] PrivateData     Module private data.\r
@@ -1226,4 +1229,3 @@ CleanUpPage (
     mEndOpCodeHandle    // LABEL_END\r
     );\r
 }\r
-\r