@@ -65,6 +65,44 @@ SpdmRegisterGetResponseFunc (
65
65
IN SPDM_GET_RESPONSE_FUNC GetResponseFunc
66
66
);
67
67
68
+ /**
69
+ Process a transport layer message.
70
+
71
+ The message can be a normal message or a secured message in SPDM session.
72
+ The message can be an SPDM message or an APP message.
73
+
74
+ This function is called in SpdmResponderDispatchMessage to process the message.
75
+ The alternative is: an SPDM responder may receive the request message directly
76
+ and call this function to process it, then send the response message.
77
+
78
+ @param SpdmContext A pointer to the SPDM context.
79
+ @param SessionId Indicates if it is a secured message protected via SPDM session.
80
+ If *SessionId is NULL, it is a normal message.
81
+ If *SessionId is NOT NULL, it is a secured message.
82
+ @param Request A pointer to the request data.
83
+ @param RequestSize Size in bytes of the request data.
84
+ @param Response A pointer to the response data.
85
+ @param ResponseSize Size in bytes of the response data.
86
+ On input, it means the size in bytes of response data buffer.
87
+ On output, it means the size in bytes of copied response data buffer if RETURN_SUCCESS is returned,
88
+ and means the size in bytes of desired response data buffer if RETURN_BUFFER_TOO_SMALL is returned.
89
+
90
+ @retval RETURN_SUCCESS The SPDM request is set successfully.
91
+ @retval RETURN_BUFFER_TOO_SMALL The buffer is too small to hold the data.
92
+ @retval RETURN_DEVICE_ERROR A device error occurs when communicates with the device.
93
+ @retval RETURN_SECURITY_VIOLATION Any verification fails.
94
+ **/
95
+ RETURN_STATUS
96
+ EFIAPI
97
+ SpdmProcessMessage (
98
+ IN VOID * Context ,
99
+ IN OUT UINT32 * * SessionId ,
100
+ IN VOID * Request ,
101
+ IN UINTN RequestSize ,
102
+ OUT VOID * Response ,
103
+ IN OUT UINTN * ResponseSize
104
+ );
105
+
68
106
/**
69
107
This is the main dispatch function in SPDM responder.
70
108
0 commit comments