TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmCryptLib.c File Reference

Go to the source code of this file.

Functions

VOID * GetCryptoServices (VOID)
 
EFI_STATUS EFIAPI SmmCryptLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

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) Microsoft Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SmmCryptLib.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 SmmCryptLib.c.

◆ SmmCryptLibConstructor()

EFI_STATUS EFIAPI SmmCryptLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

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.
SystemTableA pointer to the EFI 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 SmmCryptLib.c.

Variable Documentation

◆ mSmmCryptoProtocol

EDKII_SMM_CRYPTO_PROTOCOL* mSmmCryptoProtocol = NULL

Definition at line 16 of file SmmCryptLib.c.