X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FPei%2FSecurity%2FSecurity.c;fp=MdeModulePkg%2FCore%2FPei%2FSecurity%2FSecurity.c;h=cf3344760208164c6420a5379e22556058d2e6be;hp=ac02f594f3b251279dfe3476113646f1fae601f4;hb=b1f6a7c636fca9eda65a3045302de577c00e438d;hpb=e94358a3fe824986cfaa777690170f26aa5a8200 diff --git a/MdeModulePkg/Core/Pei/Security/Security.c b/MdeModulePkg/Core/Pei/Security/Security.c index ac02f594f3..cf33447602 100644 --- a/MdeModulePkg/Core/Pei/Security/Security.c +++ b/MdeModulePkg/Core/Pei/Security/Security.c @@ -1,5 +1,6 @@ /** @file - + EFI PEI Core Security services + Copyright (c) 2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -9,19 +10,21 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: +**/ - Security.c +#include -Abstract: +/** - EFI PEI Core Security services + Provide a callback for when the security PPI is installed. -**/ + @param PeiServices - The PEI core services table. + @param NotifyDescriptor - The descriptor for the notification event. + @param Ppi - Pointer to the PPI in question. -#include + @return Always success -STATIC +**/ EFI_STATUS EFIAPI SecurityPpiNotifyCallback ( @@ -30,33 +33,27 @@ SecurityPpiNotifyCallback ( IN VOID *Ppi ); -static EFI_PEI_NOTIFY_DESCRIPTOR mNotifyList = { +STATIC EFI_PEI_NOTIFY_DESCRIPTOR mNotifyList = { EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, &gEfiPeiSecurity2PpiGuid, SecurityPpiNotifyCallback }; -VOID -InitializeSecurityServices ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_CORE_INSTANCE *OldCoreData - ) -/*++ - -Routine Description: +/** Initialize the security services. -Arguments: - PeiServices - The PEI core services table. - OldCoreData - Pointer to the old core data. - NULL if being run in non-permament memory mode. -Returns: + @param PeiServices - The PEI core services table. + @param OldCoreData - Pointer to the old core data. + NULL if being run in non-permament memory mode. - None - ---*/ +**/ +VOID +InitializeSecurityServices ( + IN EFI_PEI_SERVICES **PeiServices, + IN PEI_CORE_INSTANCE *OldCoreData + ) { if (OldCoreData == NULL) { PeiServicesNotifyPpi (&mNotifyList); @@ -64,7 +61,17 @@ Returns: return; } -STATIC +/** + + Provide a callback for when the security PPI is installed. + + @param PeiServices - The PEI core services table. + @param NotifyDescriptor - The descriptor for the notification event. + @param Ppi - Pointer to the PPI in question. + + @return Always success + +**/ EFI_STATUS EFIAPI SecurityPpiNotifyCallback ( @@ -72,23 +79,6 @@ SecurityPpiNotifyCallback ( IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi ) -/*++ - -Routine Description: - - Provide a callback for when the security PPI is installed. - -Arguments: - - PeiServices - The PEI core services table. - NotifyDescriptor - The descriptor for the notification event. - Ppi - Pointer to the PPI in question. - -Returns: - - EFI_SUCCESS - The function is successfully processed. - ---*/ { PEI_CORE_INSTANCE *PrivateData; @@ -106,29 +96,25 @@ Returns: return EFI_SUCCESS; } -EFI_STATUS -VerifyPeim ( - IN PEI_CORE_INSTANCE *PrivateData, - IN EFI_PEI_FV_HANDLE VolumeHandle, - IN EFI_PEI_FILE_HANDLE FileHandle - ) -/*++ - -Routine Description: +/** Provide a callout to the security verification service. -Arguments: - PeiServices - The PEI core services table. - CurrentPeimAddress - Pointer to the Firmware File under investigation. + @param PrivateData PeiCore's private data structure + @param VolumeHandle Handle of FV + @param FileHandle Handle of PEIM's ffs -Returns: + @retval EFI_SUCCESS Image is OK + @retval EFI_SECURITY_VIOLATION Image is illegal - EFI_SUCCESS - Image is OK - EFI_SECURITY_VIOLATION - Image is illegal - ---*/ +**/ +EFI_STATUS +VerifyPeim ( + IN PEI_CORE_INSTANCE *PrivateData, + IN EFI_PEI_FV_HANDLE VolumeHandle, + IN EFI_PEI_FILE_HANDLE FileHandle + ) { EFI_STATUS Status; UINT32 AuthenticationStatus; @@ -161,26 +147,19 @@ Returns: } +/** + Verify a Firmware volume. + + @param CurrentFvAddress - Pointer to the current Firmware Volume under consideration + + @retval EFI_SUCCESS - Firmware Volume is legal + @retval EFI_SECURITY_VIOLATION - Firmware Volume fails integrity test + +**/ EFI_STATUS VerifyFv ( IN EFI_FIRMWARE_VOLUME_HEADER *CurrentFvAddress ) -/*++ - -Routine Description: - - Verify a Firmware volume - -Arguments: - - CurrentFvAddress - Pointer to the current Firmware Volume under consideration - -Returns: - - EFI_SUCCESS - Firmware Volume is legal - EFI_SECURITY_VIOLATION - Firmware Volume fails integrity test - ---*/ { // // Right now just pass the test. Future can authenticate and/or check the