From 7a8076b193caaaedf6ca12f8120179c94c81b952 Mon Sep 17 00:00:00 2001 From: Jiewen Yao Date: Tue, 12 Nov 2024 11:01:33 +0800 Subject: [PATCH] 1.4 change cap check to >= 1.3. Signed-off-by: Jiewen Yao --- library/spdm_requester_lib/libspdm_req_get_capabilities.c | 8 ++++---- library/spdm_responder_lib/libspdm_rsp_capabilities.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/library/spdm_requester_lib/libspdm_req_get_capabilities.c b/library/spdm_requester_lib/libspdm_req_get_capabilities.c index 8893e54ff6c..27ddfd641ec 100644 --- a/library/spdm_requester_lib/libspdm_req_get_capabilities.c +++ b/library/spdm_requester_lib/libspdm_req_get_capabilities.c @@ -91,7 +91,7 @@ static bool validate_responder_capability(uint32_t capabilities_flag, uint8_t ve (hbeat_cap == 1) || (key_upd_cap == 1)) { return false; } - if (version == SPDM_MESSAGE_VERSION_13) { + if (version >= SPDM_MESSAGE_VERSION_13) { if (event_cap == 1) { return false; } @@ -118,7 +118,7 @@ static bool validate_responder_capability(uint32_t capabilities_flag, uint8_t ve if ((chal_cap == 1) || (key_ex_cap == 1) || (meas_cap == 2) || (mut_auth_cap == 1)) { return false; } - if (version == SPDM_MESSAGE_VERSION_13) { + if (version >= SPDM_MESSAGE_VERSION_13) { if (ep_info_cap == 2) { return false; } @@ -153,8 +153,8 @@ static bool validate_responder_capability(uint32_t capabilities_flag, uint8_t ve } } - /* Checks specific to 1.3. */ - if (version == SPDM_MESSAGE_VERSION_13) { + /* Checks specific to 1.3 and higher. */ + if (version >= SPDM_MESSAGE_VERSION_13) { /* Illegal to return reserved values. */ if ((ep_info_cap == 3) || (multi_key_cap == 3)) { return false; diff --git a/library/spdm_responder_lib/libspdm_rsp_capabilities.c b/library/spdm_responder_lib/libspdm_rsp_capabilities.c index 0c34208244b..fb1a9587283 100644 --- a/library/spdm_responder_lib/libspdm_rsp_capabilities.c +++ b/library/spdm_responder_lib/libspdm_rsp_capabilities.c @@ -83,7 +83,7 @@ static bool libspdm_check_request_flag_compatibility(uint32_t capabilities_flag, (hbeat_cap == 1) || (key_upd_cap == 1)) { return false; } - if (version == SPDM_MESSAGE_VERSION_13) { + if (version >= SPDM_MESSAGE_VERSION_13) { if (event_cap == 1) { return false; } @@ -110,7 +110,7 @@ static bool libspdm_check_request_flag_compatibility(uint32_t capabilities_flag, if ((chal_cap == 1) || (mut_auth_cap == 1)) { return false; } - if (version == SPDM_MESSAGE_VERSION_13) { + if (version >= SPDM_MESSAGE_VERSION_13) { if (ep_info_cap == 2) { return false; } @@ -132,8 +132,8 @@ static bool libspdm_check_request_flag_compatibility(uint32_t capabilities_flag, } } - /* Checks specific to 1.3. */ - if (version == SPDM_MESSAGE_VERSION_13) { + /* Checks specific to 1.3 and higher. */ + if (version >= SPDM_MESSAGE_VERSION_13) { /* Illegal to return reserved values. */ if ((ep_info_cap == 3) || (multi_key_cap == 3)) { return false;