Skip to content

Commit

Permalink
fix SPDM 1.3 MEL algorithm negotiate
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaohanjlll <[email protected]>
  • Loading branch information
Xiaohanjlll committed Jan 24, 2024
1 parent 33ed7e3 commit 6866a44
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions library/spdm_requester_lib/libspdm_req_negotiate_algorithms.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,30 @@ static libspdm_return_t libspdm_try_negotiate_algorithms(libspdm_context_t *spdm
if (spdm_response->header.spdm_version >= SPDM_MESSAGE_VERSION_13) {
if (libspdm_is_capabilities_flag_supported(
spdm_context, true, 0,
SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEL_CAP) &&
(spdm_request->mel_specification != 0)) {
if (spdm_context->connection_info.algorithm.mel_spec !=
SPDM_MEL_SPECIFICATION_DMTF) {
status = LIBSPDM_STATUS_INVALID_MSG_FIELD;
goto receive_done;
SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEL_CAP)){
if(spdm_request->mel_specification != 0){
if (spdm_context->connection_info.algorithm.mel_spec !=
SPDM_MEL_SPECIFICATION_DMTF) {
status = LIBSPDM_STATUS_INVALID_MSG_FIELD;
goto receive_done;
}
} else {
if (spdm_context->connection_info.algorithm.mel_spec != 0) {
status = LIBSPDM_STATUS_INVALID_MSG_FIELD;
goto receive_done;
}
}
} else {
if(spdm_request->mel_specification != 0){
if (spdm_context->connection_info.algorithm.mel_spec != 0) {
status = LIBSPDM_STATUS_INVALID_MSG_FIELD;
goto receive_done;
}
} else {
if (spdm_context->connection_info.algorithm.mel_spec != 0) {
status = LIBSPDM_STATUS_INVALID_MSG_FIELD;
goto receive_done;
}
}
}
}
Expand Down

0 comments on commit 6866a44

Please sign in to comment.