summaryrefslogtreecommitdiff
path: root/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-01-28 09:36:43 +0800
committerStar Zeng <star.zeng@intel.com>2016-02-26 16:52:51 +0800
commit762d8ddb2877581eaf20e0f090692f06a83c7588 (patch)
treea1c913692a3ed93434ae3bac66508e275641cfca /SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
parent2a7ee1151efd2c9c57d08fc326dd4f8040afca15 (diff)
downloadedk2-platforms-762d8ddb2877581eaf20e0f090692f06a83c7588.tar.xz
SecurityPkg: Use FileExplorerLib in SecureBootConfigDxe
Using existing library FileExplorerLib to replace the same logic in SecureBootConfigDxe to make the code clear. After using FileExplorerLib, the UI behavior for enroll PK will change, previously when select one PK file, commit/discard changes will return to Device Manager,press ESC will return to FileExplorer. Now using FileExplorerLib the behavior will keep same with enroll KEK/DB/..., commit/discard changes will return to Custom Secure Boot Options form and ESC will return to PK options form. Cc: Chao Zhang <chao.b.zhang@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Diffstat (limited to 'SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h')
-rw-r--r--SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h142
1 files changed, 69 insertions, 73 deletions
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
index bcb1c12e23..a8dbd92ee4 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
@@ -2,7 +2,7 @@
The header file of HII Config Access protocol implementation of SecureBoot
configuration module.
-Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -39,6 +39,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/PrintLib.h>
#include <Library/PlatformSecureLib.h>
#include <Library/BaseCryptLib.h>
+#include <Library/FileExplorerLib.h>
+
#include <Guid/MdeModuleHii.h>
#include <Guid/AuthenticatedVariableFormat.h>
#include <Guid/FileSystemVolumeLabelInfo.h>
@@ -118,22 +120,6 @@ typedef struct {
CHAR16 TargetName[1];
} ISCSI_DEVICE_PATH_WITH_NAME;
-typedef enum _FILE_EXPLORER_DISPLAY_CONTEXT {
- FileExplorerDisplayFileSystem,
- FileExplorerDisplayDirectory,
- FileExplorerDisplayUnknown
-} FILE_EXPLORER_DISPLAY_CONTEXT;
-
-typedef enum _FILE_EXPLORER_STATE {
- FileExplorerStateInActive = 0,
- FileExplorerStateEnrollPkFile,
- FileExplorerStateEnrollKekFile,
- FileExplorerStateEnrollSignatureFileToDb,
- FileExplorerStateEnrollSignatureFileToDbx,
- FileExplorerStateEnrollSignatureFileToDbt,
- FileExplorerStateUnknown
-} FILE_EXPLORER_STATE;
-
typedef struct {
CHAR16 *Str;
UINTN Len;
@@ -159,32 +145,9 @@ typedef struct {
UINTN MenuNumber;
} SECUREBOOT_MENU_OPTION;
-extern SECUREBOOT_MENU_OPTION FsOptionMenu;
-extern SECUREBOOT_MENU_OPTION DirectoryMenu;
-
-typedef struct {
- UINTN Signature;
- LIST_ENTRY Link;
- UINTN OptionNumber;
- UINT16 *DisplayString;
- UINT16 *HelpString;
- EFI_STRING_ID DisplayStringToken;
- EFI_STRING_ID HelpStringToken;
- VOID *FileContext;
-} SECUREBOOT_MENU_ENTRY;
-
typedef struct {
- EFI_HANDLE Handle;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_FILE_HANDLE FHandle;
UINT16 *FileName;
- EFI_FILE_SYSTEM_VOLUME_LABEL *Info;
-
- BOOLEAN IsRoot;
- BOOLEAN IsDir;
- BOOLEAN IsRemovableMedia;
- BOOLEAN IsLoadFile;
- BOOLEAN IsBootLegacy;
} SECUREBOOT_FILE_CONTEXT;
@@ -216,16 +179,13 @@ typedef struct {
EFI_HII_HANDLE HiiHandle;
EFI_HANDLE DriverHandle;
- FILE_EXPLORER_STATE FeCurrentState;
- FILE_EXPLORER_DISPLAY_CONTEXT FeDisplayContext;
-
- SECUREBOOT_MENU_ENTRY *MenuEntry;
SECUREBOOT_FILE_CONTEXT *FileContext;
EFI_GUID *SignatureGUID;
} SECUREBOOT_CONFIG_PRIVATE_DATA;
extern SECUREBOOT_CONFIG_PRIVATE_DATA mSecureBootConfigPrivateDateTemplate;
+extern SECUREBOOT_CONFIG_PRIVATE_DATA *gSecureBootPrivateData;
#define SECUREBOOT_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('S', 'E', 'C', 'B')
#define SECUREBOOT_CONFIG_PRIVATE_FROM_THIS(a) CR (a, SECUREBOOT_CONFIG_PRIVATE_DATA, ConfigAccess, SECUREBOOT_CONFIG_PRIVATE_DATA_SIGNATURE)
@@ -496,35 +456,6 @@ CleanUpPage (
/**
- Update the file explorer page with the refreshed file system.
-
- @param[in] PrivateData Module private data.
- @param[in] KeyValue Key value to identify the type of data to expect.
-
- @retval TRUE Inform the caller to create a callback packet to exit file explorer.
- @retval FALSE Indicate that there is no need to exit file explorer.
-
-**/
-BOOLEAN
-UpdateFileExplorer (
- IN SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData,
- IN UINT16 KeyValue
- );
-
-
-/**
- Free resources allocated in Allocate Rountine.
-
- @param[in, out] MenuOption Menu to be freed
-
-**/
-VOID
-FreeMenu (
- IN OUT SECUREBOOT_MENU_OPTION *MenuOption
- );
-
-
-/**
Read file content into BufferPtr, the size of the allocate buffer
is *FileSize plus AddtionAllocateSize.
@@ -621,4 +552,69 @@ GuidToString (
IN UINTN BufferSize
);
+/**
+ Update the PK form base on the input file path info.
+
+ @param FilePath Point to the file path.
+
+ @retval TRUE Exit caller function.
+ @retval FALSE Not exit caller function.
+**/
+BOOLEAN
+UpdatePKFromFile (
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath
+ );
+
+/**
+ Update the KEK form base on the input file path info.
+
+ @param FilePath Point to the file path.
+
+ @retval TRUE Exit caller function.
+ @retval FALSE Not exit caller function.
+**/
+BOOLEAN
+UpdateKEKFromFile (
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath
+ );
+
+/**
+ Update the DB form base on the input file path info.
+
+ @param FilePath Point to the file path.
+
+ @retval TRUE Exit caller function.
+ @retval FALSE Not exit caller function.
+**/
+BOOLEAN
+UpdateDBFromFile (
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath
+ );
+
+/**
+ Update the DBX form base on the input file path info.
+
+ @param FilePath Point to the file path.
+
+ @retval TRUE Exit caller function.
+ @retval FALSE Not exit caller function.
+**/
+BOOLEAN
+UpdateDBXFromFile (
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath
+ );
+
+/**
+ Update the DBT form base on the input file path info.
+
+ @param FilePath Point to the file path.
+
+ @retval TRUE Exit caller function.
+ @retval FALSE Not exit caller function.
+**/
+BOOLEAN
+UpdateDBTFromFile (
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath
+ );
+
#endif