TianoCore EDK2 master
Loading...
Searching...
No Matches
StandaloneMmCryptLib.c File Reference
#include <PiMm.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/MmServicesTableLib.h>
#include <Protocol/SmmCrypto.h>

Go to the source code of this file.

Functions

VOID * GetCryptoServices (VOID)
 
EFI_STATUS EFIAPI StandaloneMmCryptLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_MM_SYSTEM_TABLE *MmSystemTable)
 

Variables

EDKII_SMM_CRYPTO_PROTOCOLmSmmCryptoProtocol = NULL
 

Detailed Description

Implements the GetCryptoServices() API that retuns a pointer to the EDK II SMM Crypto Protocol.

Copyright (c) 2024, American Megatrends International LLC. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file StandaloneMmCryptLib.c.

Function Documentation

◆ GetCryptoServices()

VOID * GetCryptoServices ( VOID  )

Internal worker function that returns the pointer to an EDK II Crypto Protocol/PPI. The layout of the PPI, DXE Protocol, and SMM Protocol are identical which allows the implementation of the BaseCryptLib functions that call through a Protocol/PPI to be shared for the PEI, DXE, and SMM implementations.

This SMM implementation returns the pointer to the EDK II SMM Crypto Protocol that was found in the library constructor SmmCryptLibConstructor().

Definition at line 29 of file StandaloneMmCryptLib.c.

◆ StandaloneMmCryptLibConstructor()

EFI_STATUS EFIAPI StandaloneMmCryptLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_MM_SYSTEM_TABLE MmSystemTable 
)

Constructor looks up the EDK II SMM Crypto Protocol and verifies that it is not NULL and has a high enough version value to support all the BaseCryptLib functions.

Parameters
ImageHandleThe firmware allocated handle for the EFI image.
MmSystemTableA pointer to the MM System Table.
Return values
EFI_SUCCESSThe EDK II SMM Crypto Protocol was found.
EFI_NOT_FOUNDThe EDK II SMM Crypto Protocol was not found.

Definition at line 49 of file StandaloneMmCryptLib.c.

Variable Documentation

◆ mSmmCryptoProtocol

EDKII_SMM_CRYPTO_PROTOCOL* mSmmCryptoProtocol = NULL

Definition at line 16 of file StandaloneMmCryptLib.c.