diff --git a/include/library/spdm_common_lib.h b/include/library/spdm_common_lib.h index 1cc5d236f93..687d57d46c6 100644 --- a/include/library/spdm_common_lib.h +++ b/include/library/spdm_common_lib.h @@ -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 diff --git a/library/spdm_common_lib/libspdm_com_context_data.c b/library/spdm_common_lib/libspdm_com_context_data.c index 16b68dd84f9..8156984bd1d 100644 --- a/library/spdm_common_lib/libspdm_com_context_data.c +++ b/library/spdm_common_lib/libspdm_com_context_data.c @@ -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;