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

feat(dcap): Impl DCAP RA types/handlers #139

Merged
merged 8 commits into from
Aug 2, 2024
Merged

Conversation

hu55a1n1
Copy link
Member

@hu55a1n1 hu55a1n1 commented Jul 31, 2024

Resolves: #38
Preps for: #70

What's in this PR

This PR defines quartz lib types and handlers for DCAP attestation.
The way this resolves #38 is by removing the ReportDataHashVerifier altogether, so the expectation is that users will verify the report data out-of-band. This approach is consistent with our EPID RA verification impl.

Note for reviewers

I will make DCAP the default impl in a follow-up PR. Will also add tests to make sure the attestations created by our enclave work with our on-chain verifiers in that PR. So for now, there's nothing to test.

@hu55a1n1 hu55a1n1 changed the title Hu55a1n1/38 dcap report data feat(dcap): Impl DCAP RA types/handlers Jul 31, 2024
@hu55a1n1 hu55a1n1 marked this pull request as ready for review August 1, 2024 11:02
Copy link
Contributor

@thanethomson thanethomson left a comment

Choose a reason for hiding this comment

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

Without having a solid understanding of how DCAP works vs EPID, I can at least say this all seems good from a Rust perspective. Is there a particular part of the code whose logic you'd like someone to double-check?

Otherwise just some minor requests for documentation in the code, and a bunch of questions to help me understand what's going on.

core/quartz/src/attestor.rs Show resolved Hide resolved
Comment on lines +47 to +48
#[derive(Clone, PartialEq, Debug, Default)]
pub struct DcapAttestor;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend adding docstrings for this type. Not sure in which PR(s) to do it, but I'd also recommend adding some docstrings for the Attestor trait and its methods.

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +157 to +158
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct DcapAttestation {
Copy link
Contributor

Choose a reason for hiding this comment

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

Docstring would be helpful here

Copy link
Member Author

Choose a reason for hiding this comment

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

use serde::Serialize;

pub type Quote = Quote3<Vec<u8>>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Docstring explaining what this is would be helpful.

Copy link
Member Author

Choose a reason for hiding this comment

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

#[derive(Clone, PartialEq, Debug, Default)]
pub struct DcapAttestor;

impl Attestor for DcapAttestor {
Copy link
Contributor

Choose a reason for hiding this comment

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

The logic in this impl looks exactly the same as the EpidAttestor's - is that right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes! I was thinking about using an alias, but I thought I should have duplicate code for now until we verify it works correctly (hopefully in a subsequent PR that makes DCAP attestation the default). Also I think we should remove EPID at some point.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good!

core/quartz/src/attestor.rs Show resolved Hide resolved
@hu55a1n1
Copy link
Member Author

hu55a1n1 commented Aug 2, 2024

Is there a particular part of the code whose logic you'd like someone to double-check?

Thank you for the review @thanethomson! This is more like a preparatory PR, so the newly added code isn;t being used at all. I will open a separate PR for resolving #70. I think we can review the logic then.

@hu55a1n1 hu55a1n1 merged commit eb90043 into main Aug 2, 2024
7 checks passed
@hu55a1n1 hu55a1n1 deleted the hu55a1n1/38-dcap-report-data branch August 2, 2024 16:31
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.

Make DCAP EnclaveReportDataContents generic
2 participants