Adding Session ID to Vendor Defined Response #2681
Closed
m-milinkovic
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
At a minimum we can expose |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi libspdm contributors,
I'd like to raise a discussion about adding a pointer to Session ID to Vendor Defined Response. For example, it could be [potentially] added as a new argument to vendor_response_callback (i.e., to libspdm_vendor_response_callback_func type definition, introduced in libspdm v3.2), and then simply compared against NULL.
RATIONALE / MOTIVATION
IDE_KM and TDISP (i.e., from DMTF/spdm-emu repo: pci_ide_km_get_response, pci_tdisp_get_response, cxl_ide_km_get_response) can be processed through vendor_response_callback, instead of get_response_func callback (type: libspdm_get_response_func) as prior to libspdm v3.2. These protocols are coupled with SPDM secure session, e.g in PCI-SIG base specification 6.x it is explicitly stated that any IDE_KM exchange must occur through a Secure SPDM session.
Consequently, this is potentially a security threat because it is easy to forget checking if Session ID is valid in vendor_response_callback, thus allowing exchange of insecure Vendor Defined Messages.
I'm aware that Session ID can be obtained through last_spdm_request_session_id_valid and last_spdm_request_session_id. However, taking all into account (it's easy to forget and it's not quite trivial to obtain Session ID), it seems error prone. Also, in order to use related content of libspdm_context_t, internal/libspdm_common_lib.h must be included - this might be an overstatement, but maybe it could be treated as unnecessary breaking of libspdm encapsulation.
Please share your thoughts, I'd appreciate it very much.
If what's being said makes sense to you, I'd be happy to propose a solution.
BR!
Beta Was this translation helpful? Give feedback.
All reactions