Skip to content
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

Invalid SessionRequired messages #2844

Open
steven-bellock opened this issue Sep 18, 2024 · 3 comments
Open

Invalid SessionRequired messages #2844

steven-bellock opened this issue Sep 18, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@steven-bellock
Copy link
Contributor

steven-bellock commented Sep 18, 2024

The SessionRequired error code was introduced in SPDM 1.2. However libspdm will send this error if the version is 1.1 for the following messages

  • END_SESSION
  • FINISH
  • HEARTBEAT
  • KEY_UPDATE
  • PSK_FINISH

This error needs to be conditional based on the negotiated version. For 1.1 the error code should probably be Unspecified since none of the other errors fit in this situation. In addition SessionRequired is never exercised in the unit tests, and test cases should be added.

Example

if (!spdm_context->last_spdm_request_session_id_valid) {
return libspdm_generate_error_response(spdm_context,
SPDM_ERROR_CODE_SESSION_REQUIRED, 0,
response_size, response);
}

@steven-bellock steven-bellock added the bug Something isn't working label Sep 18, 2024
@steven-bellock
Copy link
Contributor Author

This was introduced in #690 when the error code was InvalidRequest.

@jyao1
Copy link
Member

jyao1 commented Sep 18, 2024

Maybe do the check and convert in libspdm_generate_error_response().

@steven-bellock
Copy link
Contributor Author

Keep the error code the same in libspdm_rsp_end_session.c but "downgrade" the error code in libspdm_generate_error_response()? That might be misleading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants