Skip to content

Commit 001fa03

Browse files
steven-bellockjyao1
authored andcommitted
Add EP_INFO_CAP check
Fix #2972. Signed-off-by: Steven Bellock <[email protected]>
1 parent 5f0c665 commit 001fa03

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Diff for: library/spdm_requester_lib/libspdm_req_get_capabilities.c

+7
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,14 @@ static bool validate_responder_capability(uint32_t capabilities_flag, uint8_t ve
106106
if ((cert_cap == 1) && (pub_key_id_cap == 1)) {
107107
return false;
108108
}
109+
/* If certificates or public keys are enabled then at least one of these capabilities
110+
* must be enabled to use the key. */
109111
if ((chal_cap == 0) && (key_ex_cap == 0) && ((meas_cap == 0) || (meas_cap == 1))) {
112+
if (version >= SPDM_MESSAGE_VERSION_13) {
113+
if ((ep_info_cap == 0) || (ep_info_cap == 1)) {
114+
return false;
115+
}
116+
}
110117
return false;
111118
}
112119
} else {

Diff for: library/spdm_responder_lib/libspdm_rsp_capabilities.c

+7
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ static bool libspdm_check_request_flag_compatibility(uint32_t capabilities_flag,
9898
if ((cert_cap == 1) && (pub_key_id_cap == 1)) {
9999
return false;
100100
}
101+
/* If certificates or public keys are enabled then at least one of these capabilities
102+
* must be enabled to use the key. */
101103
if ((chal_cap == 0) && (key_ex_cap == 0)) {
104+
if (version >= SPDM_MESSAGE_VERSION_13) {
105+
if ((ep_info_cap == 0) || (ep_info_cap == 1)) {
106+
return false;
107+
}
108+
}
102109
return false;
103110
}
104111
} else {

0 commit comments

Comments
 (0)