From 881534ea19fe9717015eb26425c4aead3c37c10e Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Thu, 25 Jul 2024 15:49:59 +1000 Subject: [PATCH] libspdm: responder: Support PSK with ResponderContext We currently advertise that we support Pre-Shared Key but does not provide ResponderContext for session key derivation. Let's update this to instead advertise Pre-Shared Key and provides ResponderContext for session key derivation The SPDM spec states that: the Responder is required to use ResponderContext if it can generate a nonce which we can, so let's adertise ResponderContext. This also allows the libspdm function libspdm_get_response_psk_finish() to work correctly. Signed-off-by: Alistair Francis --- src/libspdm/responder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libspdm/responder.rs b/src/libspdm/responder.rs index 82d4d6c..00827d3 100644 --- a/src/libspdm/responder.rs +++ b/src/libspdm/responder.rs @@ -62,7 +62,7 @@ pub fn setup_capabilities( let mut data: u32 = SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CERT_CAP | SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_ENCRYPT_CAP | SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_KEY_EX_CAP - | SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_PSK_CAP_RESPONDER + | SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_PSK_CAP_RESPONDER_WITH_CONTEXT | SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CHAL_CAP | SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_CAP_SIG | SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MAC_CAP