-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPDM 1.3 Add Capability Support #159
SPDM 1.3 Add Capability Support #159
Conversation
44fbb38
to
6470b22
Compare
{ | ||
return None; | ||
} | ||
if context.negotiate_info.spdm_version_sel >= SpdmVersion::SpdmVersion13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capabilities Flags checks are aligned with spdm spec 1.3 and libspdm implementation.
This Patch Adds: 1. Definitions of get_capacity_req and capacity_rep added in spdm 1.3. 2. Capability Violation checks for newly added flags. 3. Unit test cases for capability 1.3 fields. 4. Error Response if responder does not support Large SPDM message transfer mechanism while Requester set bit0 of param1 in capability request message. (Spec requested). Remains: 1. Config info of capability as 1.2 since relative 1.3 features not implemented. 2. Supported Algorithms extend capability bit (Param 1 Bit 0) as unimplemented. Will track this feature in another issue.
6470b22
to
057be89
Compare
@@ -54,7 +54,19 @@ impl SpdmCodec for SpdmGetCapabilitiesRequestPayload { | |||
context: &mut common::SpdmContext, | |||
r: &mut Reader, | |||
) -> Option<SpdmGetCapabilitiesRequestPayload> { | |||
u8::read(r)?; // param1 | |||
if context.negotiate_info.spdm_version_sel >= SpdmVersion::SpdmVersion13 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the GET_CAPABILITIES request sets Bit 0 of Param1 to a value of 1 and the Responder
does not support the Large SPDM message transfer mechanism ( CHUNK_CAP=0 ), the Responder shall send an
ERROR message of ErrorCode=InvalidRequest .
@@ -43,3 +43,135 @@ fn test_capability_struct() { | |||
let res = SpdmCapabilitiesResponsePayload::spdm_read(&mut context, &mut reader); | |||
assert!(res.is_none()); | |||
} | |||
|
|||
#[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spdm 1.3 capacity test cases.
@@ -51,7 +51,12 @@ pub fn create_info() -> (SpdmConfigInfo, SpdmProvisionInfo) { | |||
| SpdmResponseCapabilityFlags::HBEAT_CAP | |||
| SpdmResponseCapabilityFlags::KEY_UPD_CAP | |||
| SpdmResponseCapabilityFlags::MUT_AUTH_CAP | |||
| SpdmResponseCapabilityFlags::ENCAP_CAP, | |||
| SpdmResponseCapabilityFlags::EP_INFO_CAP_NO_SIG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable the capacity settings in unit tests.
Could change this configuration based on implementation in the future.
@@ -51,7 +51,12 @@ pub fn create_info() -> (SpdmConfigInfo, SpdmProvisionInfo) { | |||
| SpdmResponseCapabilityFlags::HBEAT_CAP | |||
| SpdmResponseCapabilityFlags::KEY_UPD_CAP | |||
| SpdmResponseCapabilityFlags::MUT_AUTH_CAP | |||
| SpdmResponseCapabilityFlags::ENCAP_CAP, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated with line 50. Delete it.
@@ -111,3 +137,23 @@ impl Codec for SpdmResponseCapabilityFlags { | |||
SpdmResponseCapabilityFlags::from_bits(bits & SpdmResponseCapabilityFlags::VALID_MASK.bits) | |||
} | |||
} | |||
|
|||
bitflags! { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get_capacity_req/ capacity_rsp param1 definition structure.
if context.negotiate_info.spdm_version_sel >= SpdmVersion::SpdmVersion13 | ||
&& flags.contains(SpdmRequestCapabilityFlags::EP_INFO_CAP_SIG) | ||
{ | ||
return None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align with libspdm implementation.
Cannot support ep info signature without certificate or public key capabilities.
if context.negotiate_info.spdm_version_sel >= SpdmVersion::SpdmVersion13 | ||
&& flags.contains(SpdmRequestCapabilityFlags::EVENT_CAP) | ||
{ | ||
return None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align with libspdm implementation.
Cannot support event without key exchange capabilities.
Fix: #136
This Patch Adds:
1.3.
transfer mechanism while Requester set bit0 of param1 in capability
request message. (Spec requested).
Remains:
implemented.
unimplemented. Will track this feature in another issue.