Skip to content

Conversation

@parvathib
Copy link
Collaborator

No description provided.

@parvathib parvathib requested a review from vsonims April 25, 2025 03:20
@parvathib parvathib marked this pull request as draft April 25, 2025 03:20
@parvathib parvathib marked this pull request as ready for review April 25, 2025 20:25
@parvathib parvathib changed the title SPDM Certificate Store Design - draft SPDM Certificate Store Design Apr 25, 2025
Copy link
Collaborator

@vsonims vsonims left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!


## Transcript Manager
The Transcript Manager is for managing the transcript and the transcript hash. The transcript is a sequential concatenation of prescribed full messages or message fields. The transcript hash is the cryptographic hash of this transcript, computed using the negotiated hash algorithm. This component ensures the integrity and authenticity of SPDM communications by managing these essential elements.
The Transcript Manager is responsible for handling the transcript and its associated hash. The transcript represents a sequential concatenation of specific full SPDM messages or message fields, while the transcript hash is a cryptographic hash of this transcript. The transcript hash is computed using the negotiated hash algorithm (SHA384).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is specifying SHA384 necessary?

Copy link
Collaborator Author

@parvathib parvathib May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caliptra only supports SHA384. I just added it here for the information. I could rephrase it to indicate that the SHA384 hash is calculated.

docs/src/spdm.md Outdated
/// - `hash`: Buffer to copy the hash to.
/// # Arguments
/// * `slot_id` - The slot ID of the certificate chain.
/// * `asym_algo` - The asymmetric algorithm to indicate the type of Certificate chain.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: 'certificate chain'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

hash: &mut [u8]
) -> Result<(), SpdmError>;
/// * `usize` - The length of the certificate chain in bytes or error.
async fn cert_chain_len(&mut self, asym_algo: AsymAlgo, slot_id: u8) -> CertStoreResult<usize>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is algo needed here? Slot Id should be enough to get to the cert chain, correct?

Copy link
Collaborator Author

@parvathib parvathib May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on the negotiated asymmetric algorithm (ECC or MLDSA), we need the certificate store to provide the certificate chain. For now, I have only defined ECC384.

/// * `usize` - The number of bytes read or error.
/// If the cert portion size is smaller than the buffer size, the remaining bytes in the buffer will be filled with 0,
/// indicating the end of the cert chain.
async fn get_cert_chain<'a>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here on the algo paramter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to my comment above.

docs/src/spdm.md Outdated
/// * u8 - The KeyPairID associated with the certificate chain or None if not supported or not found.
fn key_pair_id(&mut self, slot_id: u8) -> Option<u8>;

/// Get CertificateInfo associated with the certificate chain if SPDM responder supports
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest explaining what this 'CertificateInfo' is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

docs/src/spdm.md Outdated
fn cert_info(&mut self, slot_id: u8) -> Option<CertificateInfo>;

/// Get the KeyUsageMask associated with the certificate chain if SPDM responder supports
/// multiple assymmetric keys in connection.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'asymmetric'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

Copy link
Collaborator

@mhatrevi mhatrevi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the feedback.

@parvathib parvathib changed the title SPDM Certificate Store Design SPDM Design updates May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants