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

Go to the source code of this file.

Macros

#define CONNECTUIN_FAILURE_GET_SPDM_UID_FAILED   "Fail to get Spdm Uid"
 
#define CONNECTUIN_FAILURE_STGNATURE_DB_FUL_STRING   "The Signature database devdb is full"
 

Functions

VOID RecordSpdmDeviceContextInList (IN SPDM_DEVICE_CONTEXT *SpdmDeviceContext)
 
VOID *EFIAPI GetSpdmIoProtocolViaSpdmContext (IN VOID *SpdmContext)
 
EFI_STATUS GetSpdmUid (UINT64 *SpdmUid)
 
EFI_STATUS RecordConnectionFailureStatus (IN CHAR8 *FailureString, IN UINT32 StringLen)
 
SPDM_DEVICE_CONTEXT *EFIAPI CreateSpdmDeviceContext (IN EDKII_SPDM_DEVICE_INFO *SpdmDeviceInfo, OUT EDKII_DEVICE_SECURITY_STATE *SecurityState)
 
VOID EFIAPI DestroySpdmDeviceContext (IN SPDM_DEVICE_CONTEXT *SpdmDeviceContext)
 

Variables

LIST_ENTRY mSpdmDeviceContextList = INITIALIZE_LIST_HEAD_VARIABLE (mSpdmDeviceContextList)
 

Detailed Description

EDKII Device Security library for SPDM device. It follows the SPDM Specification.

Copyright (c) 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SpdmConnectionInit.c.

Macro Definition Documentation

◆ CONNECTUIN_FAILURE_GET_SPDM_UID_FAILED

#define CONNECTUIN_FAILURE_GET_SPDM_UID_FAILED   "Fail to get Spdm Uid"

Definition at line 14 of file SpdmConnectionInit.c.

◆ CONNECTUIN_FAILURE_STGNATURE_DB_FUL_STRING

#define CONNECTUIN_FAILURE_STGNATURE_DB_FUL_STRING   "The Signature database devdb is full"

Definition at line 15 of file SpdmConnectionInit.c.

Function Documentation

◆ CreateSpdmDeviceContext()

SPDM_DEVICE_CONTEXT *EFIAPI CreateSpdmDeviceContext ( IN EDKII_SPDM_DEVICE_INFO SpdmDeviceInfo,
OUT EDKII_DEVICE_SECURITY_STATE SecurityState 
)

This function creates the spdm device context and init connection to the responder with the device info.

Parameters
[in]SpdmDeviceInfoA pointer to device info.
[out]SecurityStateA pointer to the security state of the requester.
Returns
the spdm device conext after the init connection succeeds.

Definition at line 167 of file SpdmConnectionInit.c.

◆ DestroySpdmDeviceContext()

VOID EFIAPI DestroySpdmDeviceContext ( IN SPDM_DEVICE_CONTEXT SpdmDeviceContext)

This function destories the spdm device context.

Parameters
[in]SpdmDeviceContextA pointer to device info.

Definition at line 460 of file SpdmConnectionInit.c.

◆ GetSpdmIoProtocolViaSpdmContext()

VOID *EFIAPI GetSpdmIoProtocolViaSpdmContext ( IN VOID *  SpdmContext)

get Spdm Io protocol from Context list via spdm context.

Parameters
[in]SpdmContextThe SPDM context of the requester.

return a pointer to the Spdm Io protocol.

Definition at line 55 of file SpdmConnectionInit.c.

◆ GetSpdmUid()

EFI_STATUS GetSpdmUid ( UINT64 *  SpdmUid)

creates and returns Spdm Uid from the volatile variable.

Parameters
[in]SpdmUidA pointer to Spdm Uid.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_OUT_OF_RESOURCESOut of memory.
EFI_DEVICE_ERRORThe operation was unsuccessful.

Definition at line 90 of file SpdmConnectionInit.c.

◆ RecordConnectionFailureStatus()

EFI_STATUS RecordConnectionFailureStatus ( IN CHAR8 *  FailureString,
IN UINT32  StringLen 
)

Record and log the connection failure string to PCR1.

Parameters
[in]FailureStringThe failure string.
[in]StringLenThe length of the string.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_OUT_OF_RESOURCESOut of memory.
EFI_DEVICE_ERRORThe operation was unsuccessful.

Definition at line 136 of file SpdmConnectionInit.c.

◆ RecordSpdmDeviceContextInList()

VOID RecordSpdmDeviceContextInList ( IN SPDM_DEVICE_CONTEXT SpdmDeviceContext)

record Spdm Io protocol into the context list.

Parameters
[in]SpdmDeviceContextThe SPDM context of the device.

Definition at line 24 of file SpdmConnectionInit.c.

Variable Documentation

◆ mSpdmDeviceContextList

LIST_ENTRY mSpdmDeviceContextList = INITIALIZE_LIST_HEAD_VARIABLE (mSpdmDeviceContextList)

Definition at line 12 of file SpdmConnectionInit.c.