From ea5c9246ed4e1752057708de7aaadcaf89fdb3ee Mon Sep 17 00:00:00 2001 From: Jiewen Yao Date: Mon, 14 Aug 2023 14:49:57 +0800 Subject: [PATCH] Provision SPDM1.3 to default version. Signed-off-by: Jiewen Yao --- include/industry_standard/spdm.h | 4 ++-- library/spdm_common_lib/libspdm_com_context_data.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/industry_standard/spdm.h b/include/industry_standard/spdm.h index 0bcdc81e1b4..93920541f1a 100644 --- a/include/industry_standard/spdm.h +++ b/include/industry_standard/spdm.h @@ -14,8 +14,8 @@ #pragma pack(1) -/* 3 means SPDM spec 1.0, 1.1, 1.2 */ -#define SPDM_MAX_VERSION_COUNT 3 +/* 4 means SPDM spec 1.0, 1.1, 1.2, 1.3 */ +#define SPDM_MAX_VERSION_COUNT 4 #define SPDM_MAX_SLOT_COUNT 8 #define SPDM_MAX_OPAQUE_DATA_SIZE 1024 diff --git a/library/spdm_common_lib/libspdm_com_context_data.c b/library/spdm_common_lib/libspdm_com_context_data.c index 874dd07bc46..1ff9f5cae87 100644 --- a/library/spdm_common_lib/libspdm_com_context_data.c +++ b/library/spdm_common_lib/libspdm_com_context_data.c @@ -2649,13 +2649,15 @@ libspdm_return_t libspdm_init_context_with_secured_context(void *spdm_context, sizeof(context->transcript.message_m.buffer); #endif context->response_state = LIBSPDM_RESPONSE_STATE_NORMAL; - context->local_context.version.spdm_version_count = 3; + context->local_context.version.spdm_version_count = SPDM_MAX_VERSION_COUNT; context->local_context.version.spdm_version[0] = SPDM_MESSAGE_VERSION_10 << SPDM_VERSION_NUMBER_SHIFT_BIT; context->local_context.version.spdm_version[1] = SPDM_MESSAGE_VERSION_11 << SPDM_VERSION_NUMBER_SHIFT_BIT; context->local_context.version.spdm_version[2] = SPDM_MESSAGE_VERSION_12 << SPDM_VERSION_NUMBER_SHIFT_BIT; + context->local_context.version.spdm_version[3] = SPDM_MESSAGE_VERSION_13 << + SPDM_VERSION_NUMBER_SHIFT_BIT; context->local_context.secured_message_version.spdm_version_count = 2; context->local_context.secured_message_version.spdm_version[0] = SPDM_MESSAGE_VERSION_10 << SPDM_VERSION_NUMBER_SHIFT_BIT;