Skip to content

Commit

Permalink
Add libspdm_get_data enum for accessing the request
Browse files Browse the repository at this point in the history
Provide an enum to allow libspdm_get_data to return the current
request and its size.

Signed-off-by: Will Marone <[email protected]>
  • Loading branch information
wmaroneAMD committed Oct 23, 2024
1 parent 238fb80 commit ff7607f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/library/spdm_common_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ typedef enum {
/* VCA cached for CACHE_CAP in 1.2 for transcript. */
LIBSPDM_DATA_VCA_CACHE,

/* Raw request buffer and size */
LIBSPDM_DATA_REQUEST_AND_SIZE,

/* if the context is for a requester. It only needs to be set in VCA cache.
* In normal flow, the value is set in GET_VERSION or VERSION automatically.
* false means responder
Expand Down
4 changes: 4 additions & 0 deletions library/spdm_common_lib/libspdm_com_context_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,10 @@ libspdm_return_t libspdm_get_data(void *spdm_context, libspdm_data_type_t data_t
target_data_size = context->transcript.message_a.buffer_size;
target_data = context->transcript.message_a.buffer;
break;
case LIBSPDM_DATA_REQUEST_AND_SIZE:
target_data_size = context->last_spdm_request_size;
target_data = context->last_spdm_request;
break;
case LIBSPDM_DATA_SPDM_VERSION_10_11_VERIFY_SIGNATURE_ENDIAN:
target_data_size = sizeof(uint8_t);
target_data = &context->spdm_10_11_verify_signature_endian;
Expand Down

0 comments on commit ff7607f

Please sign in to comment.