Skip to content
This repository was archived by the owner on Jul 22, 2021. It is now read-only.

Commit c629300

Browse files
committed
expose SpdmProcessMessage().
Other implementation may receive/send the transport layer message directly. Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
1 parent 2620791 commit c629300

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

Include/Library/SpdmResponderLib.h

+38
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,44 @@ SpdmRegisterGetResponseFunc (
6565
IN SPDM_GET_RESPONSE_FUNC GetResponseFunc
6666
);
6767

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+
68106
/**
69107
This is the main dispatch function in SPDM responder.
70108

0 commit comments

Comments
 (0)