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

Add handshake mode switch check in FINISH and PSK_FINISH. #2007

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions library/spdm_responder_lib/libspdm_rsp_finish.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ libspdm_return_t libspdm_get_response_finish(void *context, size_t request_size,
SPDM_ERROR_CODE_SESSION_REQUIRED, 0,
response_size, response);
}
if (session_info->use_psk) {
return libspdm_generate_error_response(spdm_context,
SPDM_ERROR_CODE_UNEXPECTED_REQUEST, 0,
response_size, response);
}
session_state = libspdm_secured_message_get_session_state(
session_info->secured_message_context);
if (session_state != LIBSPDM_SESSION_STATE_HANDSHAKING) {
Expand Down
5 changes: 5 additions & 0 deletions library/spdm_responder_lib/libspdm_rsp_psk_finish.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ libspdm_return_t libspdm_get_response_psk_finish(void *context,
SPDM_ERROR_CODE_SESSION_REQUIRED, 0,
response_size, response);
}
if (!session_info->use_psk) {
return libspdm_generate_error_response(spdm_context,
SPDM_ERROR_CODE_UNEXPECTED_REQUEST, 0,
response_size, response);
}
session_state = libspdm_secured_message_get_session_state(
session_info->secured_message_context);
if (session_state != LIBSPDM_SESSION_STATE_HANDSHAKING) {
Expand Down