Add SLOT_MANAGEMENT command to spdm-emu#496
Open
jyao1 wants to merge 1 commit into
Open
Conversation
Wire the SPDM 1.4 SLOT_MANAGEMENT command into the requester and responder emulators, mirroring the existing key_pair_info layering: - spdm_emu_common: EXE_CONNECTION_SLOT_MGMT / EXE_SESSION_SLOT_MGMT flags, string-table entries, default enablement, and usage/help text. - responder: advertise its extended capability flags via LIBSPDM_DATA_CAPABILITY_EXT_FLAGS (m_use_responder_capability_ext_flags, which defaults to SLOT_MGMT_CAP when built with SLOT_MGMT_CAP). - requester: do_slot_management_via_spdm exercises the full set of SubCodes the Responder advertises (SupportedSubCodes, GetBankInfo, GetBankDetails, GetCertificateChain, GetCSR, ManageBank, SetCertificate, and ManageSlot), invoked from both the connection and session flows, gated on SPDM 1.4. SetCertificate is issued only for Bank 0, since the Responder rejects writing a non-zero Bank outside a trusted environment; ManageSlot Erase is issued last, on the last enumerated Bank, because it changes the SlotMask reported for subsequent SubCodes. The Requester only sends SLOT_MANAGEMENT when the Responder negotiated SLOT_MGMT_CAP. Add command-line control of the extended capability flags (GET_CAPABILITIES ExtendedFlags), mirroring --cap / --peer_cap: - --ext_cap NO|SLOT_MGMT selects the extended flags this endpoint advertises; --peer_ext_cap selects the peer's (used with --exe_conn VER_ONLY, like --peer_cap). By default the Requester advertises NO and the Responder advertises SLOT_MGMT, via the new m_use_requester_capability_ext_flags / m_use_responder_capability_ext_flags globals. - Because the empty selection "NO" is the encoded value 0 yet must still override a non-zero default, a *_set flag records whether the option was given (a non-zero test, as --cap uses, cannot express "clear to NO"). The extended capability flags are a generic SPDM 1.4 field (SLOT_MGMT is only one bit, more may follow), so the ExtendedFlags plumbing - advertising it, reading the negotiated value, and persisting it in save_state / load_state - is unconditional; only the SLOT_MGMT bit default and the SLOT_MANAGEMENT command itself are gated on SLOT_MGMT_CAP. The negotiated state struct gains requester_cap_ext_flags / responder_cap_ext_flags (struct version bumped to 2). Document --ext_cap / --peer_ext_cap and the SLOT_MGMT exe options in doc/spdm_emu.md. Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It need DMTF/libspdm#3637.