-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RNR: do not update ErrorData if a previous request has not been completed #2872
Comments
The original code can be used to validate the requester. Yes, if we need responder, we need a design. |
I think a real ResponseNotReady design will be needed as the lower transport layers will not always be dedicated for SPDM use. It becomes a concern especially for the SET_CERTIFICATE command, which could use several crypto operations to verify the certificate chain plus it also needs to erase/write the NVRAM. That consumes quite a lot of time and is very possible to cause such side effects. |
How does |
The high level idea is the handler function could create another task to process the request, set response state to LIBSPDM_RESPONSE_STATE_NOT_READY and return ResponseNotReady from the libspdm running task. The created task populates the response and sets the response state back to LIBSPDM_RESPONSE_STATE_NORMAL. The handler function needs a mechanism to tell if it should return ResponseNotReady and delegate the work to other task or the response populated by the created task. I didn't think of a general design to implement it with current code. Perhaps it will need to allow integrators to override the default libspdm handler function to realize their own ResponseNotReady design for specific request. Probably could be done via something similar to libspdm_register_get_response_func? |
Actually I probably could just create a separate task running libspdm. |
As described in the first line comment below, the code shouldn't update the ErrorData.
Returning a Busy SPDM error message looks more appropriate as the Responder is supposed to be busy processing the previous request when response state is LIBSPDM_RESPONSE_STATE_NOT_READY?
libspdm/library/spdm_responder_lib/libspdm_rsp_handle_response_state.c
Lines 34 to 45 in 00a7155
The text was updated successfully, but these errors were encountered: