Skip to content

Commit

Permalink
1.3 digest Add slot mask check
Browse files Browse the repository at this point in the history
Signed-off-by: Jiewen Yao <[email protected]>
  • Loading branch information
jyao1 committed Nov 29, 2023
1 parent e0ad1d4 commit 6e2838d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions library/spdm_requester_lib/libspdm_req_get_digests.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@ static libspdm_return_t libspdm_try_get_digest(libspdm_context_t *spdm_context,
*slot_mask = spdm_response->header.param2;
}

LIBSPDM_DEBUG((LIBSPDM_DEBUG_INFO, "provisioned_slot_mask - 0x%02x\n",
spdm_response->header.param2));
if (spdm_request->header.spdm_version >= SPDM_MESSAGE_VERSION_13) {
LIBSPDM_DEBUG((LIBSPDM_DEBUG_INFO, "supported_slot_mask - 0x%02x\n",
spdm_response->header.param1));
if ((spdm_response->header.param1 & spdm_response->header.param2) !=
spdm_response->header.param2) {
status = LIBSPDM_STATUS_INVALID_MSG_FIELD;
goto receive_done;
}
}

digest_count = 0;
for (index = 0; index < SPDM_MAX_SLOT_COUNT; index++) {
if (spdm_response->header.param2 & (1 << index)) {
Expand Down

0 comments on commit 6e2838d

Please sign in to comment.