spdm1.3: rsp_csr: handling `csr_tracking_tag = 0` case
From the 1.3 SPDM spec:
[758] If the device requires a reset to complete the GET_CSR request, the device shall respond with an ERROR message of ErrorCode=ResetRequired with Bit[2:0] of the Error Data field set to a Responder-assigned CSRTrackingTag in the range of 1 to 7 , inclusive
This implies that CSRTrackingTag takes on values [1, 7] as set by the responder. So in a case where there is a request with this field (param2) set to 0, would imply (?) that the requester is not following up on a previous CSR (?).
[758] ... the Requester sends a GET_CSR request with Bit[5:3] in Param2 set to the CSRTrackingTag that the Responder provided in the corresponding ERROR response, which signals to the Responder to send the CSR response associated with the previous request
- Is this understanding correct?
- If so, in the following case,
https://github.com/DMTF/libspdm/blob/9d562f4ba0cdf234fb654d34c12a457ee585be0d/library/spdm_responder_lib/libspdm_rsp_csr.c#L201
Should we not invoke libspdm_gen_csr() instead of libspdm_gen_csr_ex() if csr_tracking_tag == 0 ? So we can process the csr generation normally without depending on an implementation of libspdm_gen_csr_ex()?
Is this understanding correct?
Yes.
Should we not invoke libspdm_gen_csr() instead of libspdm_gen_csr_ex() if csr_tracking_tag == 0 ?
No. How would libspdm_gen_csr return a tracking tag to libspdm if one is needed?
However there is a bug in libspdm_gen_csr_ex. There is no parameter for the KeyPairID field. I'll file a separate issue for that.
Is this understanding correct?
Yes.
Should we not invoke libspdm_gen_csr() instead of libspdm_gen_csr_ex() if csr_tracking_tag == 0 ?
No. How would
libspdm_gen_csrreturn a tracking tag to libspdm if one is needed?
Okay that makes sense, I assume that is why the default behavior for version 1.3 is to return an error when LIBSPDM_ENABLE_CAPABILITY_CSR_CAP_EX disabled, to avoid this ambiguity? Thanks for clearing that up :)
However there is a bug in
libspdm_gen_csr_ex. There is no parameter for theKeyPairIDfield. I'll file a separate issue for that.