summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/SecurityStubDxe
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:02 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit1436aea4d5707e672672a11bda72be2c63c936c3 (patch)
tree370c9d5bd8823aa8ea7bce71a0f29bff71feff67 /MdeModulePkg/Universal/SecurityStubDxe
parent7c7184e201a90a1d2376e615e55e3f4074731468 (diff)
downloadedk2-1436aea4d5707e672672a11bda72be2c63c936c3.zip
edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.gz
edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.bz2
MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdeModulePkg/Universal/SecurityStubDxe')
-rw-r--r--MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c116
-rw-r--r--MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.h12
-rw-r--r--MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c57
3 files changed, 96 insertions, 89 deletions
diff --git a/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c b/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c
index dfa680b..bf04a02 100644
--- a/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c
+++ b/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c
@@ -11,27 +11,27 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
// The structure to save the deferred 3rd party image information.
//
typedef struct {
- EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
- BOOLEAN BootOption;
- BOOLEAN Loaded;
+ EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
+ BOOLEAN BootOption;
+ BOOLEAN Loaded;
} DEFERRED_3RD_PARTY_IMAGE_INFO;
//
// The table to save the deferred 3rd party image item.
//
typedef struct {
- UINTN Count; ///< deferred 3rd party image count
- DEFERRED_3RD_PARTY_IMAGE_INFO *ImageInfo; ///< deferred 3rd party image item
+ UINTN Count; ///< deferred 3rd party image count
+ DEFERRED_3RD_PARTY_IMAGE_INFO *ImageInfo; ///< deferred 3rd party image item
} DEFERRED_3RD_PARTY_IMAGE_TABLE;
-BOOLEAN mImageLoadedAfterEndOfDxe = FALSE;
-BOOLEAN mEndOfDxe = FALSE;
-DEFERRED_3RD_PARTY_IMAGE_TABLE mDeferred3rdPartyImage = {
+BOOLEAN mImageLoadedAfterEndOfDxe = FALSE;
+BOOLEAN mEndOfDxe = FALSE;
+DEFERRED_3RD_PARTY_IMAGE_TABLE mDeferred3rdPartyImage = {
0, // Deferred image count
NULL // The deferred image info
};
-EFI_DEFERRED_IMAGE_LOAD_PROTOCOL mDeferredImageLoad = {
+EFI_DEFERRED_IMAGE_LOAD_PROTOCOL mDeferredImageLoad = {
GetDefferedImageInfo
};
@@ -46,23 +46,23 @@ EFI_DEFERRED_IMAGE_LOAD_PROTOCOL mDeferredImageLoad = {
**/
BOOLEAN
FileFromFv (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *File
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *File
)
{
- EFI_STATUS Status;
- EFI_HANDLE DeviceHandle;
- EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;
+ EFI_STATUS Status;
+ EFI_HANDLE DeviceHandle;
+ EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;
//
// First check to see if File is from a Firmware Volume
//
DeviceHandle = NULL;
- TempDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) File;
- Status = gBS->LocateDevicePath (
- &gEfiFirmwareVolume2ProtocolGuid,
- &TempDevicePath,
- &DeviceHandle
- );
+ TempDevicePath = (EFI_DEVICE_PATH_PROTOCOL *)File;
+ Status = gBS->LocateDevicePath (
+ &gEfiFirmwareVolume2ProtocolGuid,
+ &TempDevicePath,
+ &DeviceHandle
+ );
if (!EFI_ERROR (Status)) {
Status = gBS->OpenProtocol (
DeviceHandle,
@@ -90,12 +90,12 @@ FileFromFv (
**/
DEFERRED_3RD_PARTY_IMAGE_INFO *
LookupImage (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath,
- IN BOOLEAN BootOption
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath,
+ IN BOOLEAN BootOption
)
{
- UINTN Index;
- UINTN DevicePathSize;
+ UINTN Index;
+ UINTN DevicePathSize;
DevicePathSize = GetDevicePathSize (ImageDevicePath);
@@ -118,11 +118,11 @@ LookupImage (
**/
VOID
QueueImage (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath,
- IN BOOLEAN BootOption
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath,
+ IN BOOLEAN BootOption
)
{
- DEFERRED_3RD_PARTY_IMAGE_INFO *ImageInfo;
+ DEFERRED_3RD_PARTY_IMAGE_INFO *ImageInfo;
//
// Expand memory for the new deferred image.
@@ -131,26 +131,27 @@ QueueImage (
mDeferred3rdPartyImage.Count * sizeof (DEFERRED_3RD_PARTY_IMAGE_INFO),
(mDeferred3rdPartyImage.Count + 1) * sizeof (DEFERRED_3RD_PARTY_IMAGE_INFO),
mDeferred3rdPartyImage.ImageInfo
- );
+ );
if (ImageInfo == NULL) {
return;
}
+
mDeferred3rdPartyImage.ImageInfo = ImageInfo;
//
// Save the deferred image information.
//
- ImageInfo = &mDeferred3rdPartyImage.ImageInfo[mDeferred3rdPartyImage.Count];
+ ImageInfo = &mDeferred3rdPartyImage.ImageInfo[mDeferred3rdPartyImage.Count];
ImageInfo->ImageDevicePath = DuplicateDevicePath (ImageDevicePath);
if (ImageInfo->ImageDevicePath == NULL) {
return;
}
+
ImageInfo->BootOption = BootOption;
ImageInfo->Loaded = FALSE;
mDeferred3rdPartyImage.Count++;
}
-
/**
Returns information about a deferred image.
@@ -183,14 +184,14 @@ EFIAPI
GetDefferedImageInfo (
IN EFI_DEFERRED_IMAGE_LOAD_PROTOCOL *This,
IN UINTN ImageIndex,
- OUT EFI_DEVICE_PATH_PROTOCOL **ImageDevicePath,
- OUT VOID **Image,
- OUT UINTN *ImageSize,
- OUT BOOLEAN *BootOption
+ OUT EFI_DEVICE_PATH_PROTOCOL **ImageDevicePath,
+ OUT VOID **Image,
+ OUT UINTN *ImageSize,
+ OUT BOOLEAN *BootOption
)
{
- UINTN Index;
- UINTN NewCount;
+ UINTN Index;
+ UINTN NewCount;
if ((This == NULL) || (ImageSize == NULL) || (Image == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -270,8 +271,8 @@ DxeSmmReadyToLock (
IN VOID *Context
)
{
- EFI_STATUS Status;
- VOID *Interface;
+ EFI_STATUS Status;
+ VOID *Interface;
Status = gBS->LocateProtocol (&gEfiDxeSmmReadyToLockProtocolGuid, NULL, &Interface);
if (EFI_ERROR (Status)) {
@@ -311,11 +312,11 @@ DxeSmmReadyToLock (
**/
EFI_STATUS
Defer3rdPartyImageLoad (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *File,
- IN BOOLEAN BootPolicy
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *File,
+ IN BOOLEAN BootPolicy
)
{
- DEFERRED_3RD_PARTY_IMAGE_INFO *ImageInfo;
+ DEFERRED_3RD_PARTY_IMAGE_INFO *ImageInfo;
//
// Ignore if File is NULL.
@@ -331,17 +332,20 @@ Defer3rdPartyImageLoad (
ImageInfo = LookupImage (File, BootPolicy);
DEBUG_CODE_BEGIN ();
- CHAR16 *DevicePathStr;
- DevicePathStr = ConvertDevicePathToText (File, FALSE, FALSE);
- DEBUG ((
- DEBUG_INFO,
- "[Security] 3rd party image[%p] %s EndOfDxe: %s.\n", ImageInfo,
- mEndOfDxe ? L"can be loaded after": L"is deferred to load before",
- DevicePathStr
- ));
- if (DevicePathStr != NULL) {
- FreePool (DevicePathStr);
- }
+ CHAR16 *DevicePathStr;
+
+ DevicePathStr = ConvertDevicePathToText (File, FALSE, FALSE);
+ DEBUG ((
+ DEBUG_INFO,
+ "[Security] 3rd party image[%p] %s EndOfDxe: %s.\n",
+ ImageInfo,
+ mEndOfDxe ? L"can be loaded after" : L"is deferred to load before",
+ DevicePathStr
+ ));
+ if (DevicePathStr != NULL) {
+ FreePool (DevicePathStr);
+ }
+
DEBUG_CODE_END ();
if (mEndOfDxe) {
@@ -353,6 +357,7 @@ Defer3rdPartyImageLoad (
if (ImageInfo != NULL) {
ImageInfo->Loaded = TRUE;
}
+
return EFI_SUCCESS;
} else {
//
@@ -362,6 +367,7 @@ Defer3rdPartyImageLoad (
if (ImageInfo == NULL) {
QueueImage (File, BootPolicy);
}
+
return EFI_ACCESS_DENIED;
}
}
@@ -374,10 +380,10 @@ Defer3rdPartyImageLoadInitialize (
VOID
)
{
- EFI_STATUS Status;
- EFI_HANDLE Handle;
- EFI_EVENT Event;
- VOID *Registration;
+ EFI_STATUS Status;
+ EFI_HANDLE Handle;
+ EFI_EVENT Event;
+ VOID *Registration;
Handle = NULL;
Status = gBS->InstallMultipleProtocolInterfaces (
diff --git a/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.h b/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.h
index 8986b3d..da4a017 100644
--- a/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.h
+++ b/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.h
@@ -55,10 +55,10 @@ EFIAPI
GetDefferedImageInfo (
IN EFI_DEFERRED_IMAGE_LOAD_PROTOCOL *This,
IN UINTN ImageIndex,
- OUT EFI_DEVICE_PATH_PROTOCOL **ImageDevicePath,
- OUT VOID **Image,
- OUT UINTN *ImageSize,
- OUT BOOLEAN *BootOption
+ OUT EFI_DEVICE_PATH_PROTOCOL **ImageDevicePath,
+ OUT VOID **Image,
+ OUT UINTN *ImageSize,
+ OUT BOOLEAN *BootOption
);
/**
@@ -74,8 +74,8 @@ GetDefferedImageInfo (
**/
EFI_STATUS
Defer3rdPartyImageLoad (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *File,
- IN BOOLEAN BootPolicy
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *File,
+ IN BOOLEAN BootPolicy
);
/**
diff --git a/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c b/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c
index d9c06b6..a5bd64a 100644
--- a/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c
+++ b/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c
@@ -6,7 +6,6 @@
**/
-
#include <Uefi.h>
#include <Protocol/Security.h>
#include <Protocol/Security2.h>
@@ -19,7 +18,7 @@
//
// Handle for the Security Architectural Protocol instance produced by this driver
//
-EFI_HANDLE mSecurityArchProtocolHandle = NULL;
+EFI_HANDLE mSecurityArchProtocolHandle = NULL;
/**
The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific
@@ -64,15 +63,16 @@ SecurityStubAuthenticateState (
IN CONST EFI_DEVICE_PATH_PROTOCOL *File
)
{
- EFI_STATUS Status;
-
- Status = ExecuteSecurity2Handlers (EFI_AUTH_OPERATION_AUTHENTICATION_STATE,
- AuthenticationStatus,
- File,
- NULL,
- 0,
- FALSE
- );
+ EFI_STATUS Status;
+
+ Status = ExecuteSecurity2Handlers (
+ EFI_AUTH_OPERATION_AUTHENTICATION_STATE,
+ AuthenticationStatus,
+ File,
+ NULL,
+ 0,
+ FALSE
+ );
if (Status == EFI_SUCCESS) {
Status = ExecuteSecurityHandlers (AuthenticationStatus, File);
}
@@ -128,14 +128,14 @@ SecurityStubAuthenticateState (
EFI_STATUS
EFIAPI
Security2StubAuthenticate (
- IN CONST EFI_SECURITY2_ARCH_PROTOCOL *This,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *File OPTIONAL,
- IN VOID *FileBuffer,
- IN UINTN FileSize,
- IN BOOLEAN BootPolicy
+ IN CONST EFI_SECURITY2_ARCH_PROTOCOL *This,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *File OPTIONAL,
+ IN VOID *FileBuffer,
+ IN UINTN FileSize,
+ IN BOOLEAN BootPolicy
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
if (FileBuffer != NULL) {
Status = Defer3rdPartyImageLoad (File, BootPolicy);
@@ -144,16 +144,17 @@ Security2StubAuthenticate (
}
}
- return ExecuteSecurity2Handlers (EFI_AUTH_OPERATION_VERIFY_IMAGE |
- EFI_AUTH_OPERATION_DEFER_IMAGE_LOAD |
- EFI_AUTH_OPERATION_MEASURE_IMAGE |
- EFI_AUTH_OPERATION_CONNECT_POLICY,
- 0,
- File,
- FileBuffer,
- FileSize,
- BootPolicy
- );
+ return ExecuteSecurity2Handlers (
+ EFI_AUTH_OPERATION_VERIFY_IMAGE |
+ EFI_AUTH_OPERATION_DEFER_IMAGE_LOAD |
+ EFI_AUTH_OPERATION_MEASURE_IMAGE |
+ EFI_AUTH_OPERATION_CONNECT_POLICY,
+ 0,
+ File,
+ FileBuffer,
+ FileSize,
+ BootPolicy
+ );
}
//
@@ -163,7 +164,7 @@ EFI_SECURITY_ARCH_PROTOCOL mSecurityStub = {
SecurityStubAuthenticateState
};
-EFI_SECURITY2_ARCH_PROTOCOL mSecurity2Stub = {
+EFI_SECURITY2_ARCH_PROTOCOL mSecurity2Stub = {
Security2StubAuthenticate
};