From 798d607d4f51abd63c214a578bcf9843ddd0e73d Mon Sep 17 00:00:00 2001 From: "Yang, Longlong" Date: Mon, 22 Jan 2024 02:04:26 -0500 Subject: [PATCH] add SpdmVersion13 enum value. Signed-off-by: Yang, Longlong --- spdmlib/src/protocol/version.rs | 6 +++++- test/spdm-requester-emu/src/main.rs | 2 ++ test/spdm-responder-emu/src/main.rs | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spdmlib/src/protocol/version.rs b/spdmlib/src/protocol/version.rs index e42d487..b49e17e 100644 --- a/spdmlib/src/protocol/version.rs +++ b/spdmlib/src/protocol/version.rs @@ -10,6 +10,7 @@ pub enum SpdmVersion { SpdmVersion10, SpdmVersion11, SpdmVersion12, + SpdmVersion13, } impl Default for SpdmVersion { @@ -27,6 +28,8 @@ impl TryFrom for SpdmVersion { Ok(SpdmVersion::SpdmVersion11) } else if untrusted_spdm_version == 0x12 { Ok(SpdmVersion::SpdmVersion12) + } else if untrusted_spdm_version == 0x13 { + Ok(SpdmVersion::SpdmVersion13) } else { Err(()) } @@ -39,6 +42,7 @@ impl From for u8 { SpdmVersion::SpdmVersion10 => 0x10, SpdmVersion::SpdmVersion11 => 0x11, SpdmVersion::SpdmVersion12 => 0x12, + SpdmVersion::SpdmVersion13 => 0x13, } } } @@ -60,7 +64,7 @@ impl Codec for SpdmVersion { } } -pub const MAX_SPDM_VERSION_COUNT: usize = 3; +pub const MAX_SPDM_VERSION_COUNT: usize = 4; //SPDM V1.2 signing prefix context pub const SPDM_VERSION_1_2_SIGNING_PREFIX_CONTEXT: [u8; 64] = [ diff --git a/test/spdm-requester-emu/src/main.rs b/test/spdm-requester-emu/src/main.rs index 9c4077e..3cbc344 100644 --- a/test/spdm-requester-emu/src/main.rs +++ b/test/spdm-requester-emu/src/main.rs @@ -155,6 +155,7 @@ async fn test_spdm( Some(SpdmVersion::SpdmVersion10), Some(SpdmVersion::SpdmVersion11), Some(SpdmVersion::SpdmVersion12), + None, ], req_capabilities, req_ct_exponent: 0, @@ -460,6 +461,7 @@ async fn test_idekm_tdisp( Some(SpdmVersion::SpdmVersion10), Some(SpdmVersion::SpdmVersion11), Some(SpdmVersion::SpdmVersion12), + None, ], req_capabilities, req_ct_exponent: 0, diff --git a/test/spdm-responder-emu/src/main.rs b/test/spdm-responder-emu/src/main.rs index 2b558e0..c5d10a6 100644 --- a/test/spdm-responder-emu/src/main.rs +++ b/test/spdm-responder-emu/src/main.rs @@ -285,6 +285,7 @@ async fn handle_message( Some(SpdmVersion::SpdmVersion10), Some(SpdmVersion::SpdmVersion11), Some(SpdmVersion::SpdmVersion12), + None, ], rsp_capabilities, rsp_ct_exponent: 0,