Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add certificate generation code to DeriveContext #376

Conversation

clundin25
Copy link
Contributor

This will return a self-signed certificate and a CDI for the key handle.

Comment on lines +293 to +306
let mut exported_cdi_handle = [0; MAX_EXPORTED_CDI_SIZE];
env.crypto
.rand_bytes(&mut exported_cdi_handle)
.map_err(DpeErrorCode::Crypto)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once refactored this will happen in the call to create_exported_dpe_cert and return in CreateDpeCertResult

@clundin25 clundin25 requested a review from jhand2 January 15, 2025 21:37
@clundin25 clundin25 force-pushed the create-cert-in-derive-context branch from 848c7bb to 37d063b Compare January 15, 2025 21:46
@clundin25 clundin25 closed this Jan 21, 2025
@clundin25 clundin25 force-pushed the create-cert-in-derive-context branch from 37d063b to 8b54c17 Compare January 21, 2025 17:23
@clundin25 clundin25 reopened this Jan 21, 2025
@clundin25 clundin25 force-pushed the create-cert-in-derive-context branch from fdd83b8 to d25ecbb Compare January 21, 2025 17:28
@clundin25
Copy link
Contributor Author

Will follow up in a separate PR with verification tests update.


Ok(Response::DeriveContextExportedCdi(DeriveContextExportedCdiResp {
handle: ContextHandle::new_invalid(),
parent_handle: dpe.contexts[parent_idx].handle,
Copy link
Collaborator

Choose a reason for hiding this comment

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

If export_cdi, then retains_parent must be false. So I think the parent handle should be new_invalid. We should see if we can share the logic from line 374 so it doesn't need to be duploicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the parent invalidation logic further up so it is shared with export-cdi.

@clundin25 clundin25 force-pushed the create-cert-in-derive-context branch 2 times, most recently from f69d748 to 47c5068 Compare January 22, 2025 00:37
@clundin25 clundin25 force-pushed the create-cert-in-derive-context branch from 47c5068 to ccb2db2 Compare January 22, 2025 00:45
@clundin25 clundin25 requested a review from jhand2 January 22, 2025 00:51
Copy link
Collaborator

@jhand2 jhand2 left a comment

Choose a reason for hiding this comment

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

Thanks!

@jhand2 jhand2 merged commit 27b8300 into chipsalliance:feature/gh-issue-caliptra-sw-1807 Jan 22, 2025
2 checks passed
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.

2 participants