Repository navigation
Use the session's peer slot for the FINISH signature - #4313
Merged
Merged
Conversation
steven-bellock
approved these changes
Nov 11, 2026
Fix DMTF#4312. With LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT, libspdm_generate_finish_req_signature() looked up the Responder's certificate chain for the transcript it signs with its slot_id parameter, which libspdm_send_receive_finish() sets to req_slot_id_param, the Requester's own slot. In a session on any other Responder slot the signed transcript held the wrong chain, and the Responder answered FINISH with ERROR(DecryptError). Take the slot from session_info->peer_used_cert_chain_slot_id, as libspdm_verify_finish_rsp_hmac() and libspdm_generate_finish_req_hmac() do since DMTF#3435. slot_id is set to the Requester's slot again before its own chain is read, so the key pair it signs with is unchanged. Fixes: 13db511 ("Add key_pair_id param for signing HAL API for multi-key.") Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Chung-Wei Lan <zwwe1f@gmail.com>
Jhongwe1
force-pushed
the
finish-signature-peer-slot
branch
from
November 11, 2026 17:52
d65fe0e to
6495195
Compare
This was referenced Nov 11, 2026
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.
Fix #4312.
With
LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT,libspdm_generate_finish_req_signature()looked up the Responder's certificate chain with itsslot_idparameter, which isreq_slot_id_param, the Requester's own slot. This takes it fromsession_info->peer_used_cert_chain_slot_id, aslibspdm_verify_finish_rsp_hmac()andlibspdm_generate_finish_req_hmac()in the same file do since #3435.slot_idis set to the Requester's slot again before its own chain is read, as before, so the key pair the Requester signs with does not change.Tested in spdm-emu
0e9d60c, whose libspdm,6cb52f2, has thelibspdm_req_finish.cofmain,839bc24: mbedtls, Release, the Requester built withLIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT=1, spdm-emu's default flow, which opens a secondKEY_EXCHANGEsession on slot 4 with mutual authentication.RECORD_TRANSCRIPT_DATA_SUPPORT(twice)FINISHansweredERROR(DecryptError),0x8001000fFINISH_RSP, both sessions open--slot_id 4on the RequesterFINISH, the first, answeredERROR(DecryptError)FINISH_RSPlibspdm at
839bc24, Linux, GCC, OpenSSL, Release: everytest_*program gives the same exit status and the same cmocka summary with and without the change, in the default configuration and withLIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT=1(test_spdm_samplefails the same two cases in each, as without it), andscript/format_nix.sh --checkon a clean export is clean.