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

Replace VerificationReport With New Evidence Types #3602

Merged
merged 36 commits into from
Oct 13, 2023

Conversation

dolanbernard
Copy link
Contributor

  • Implement client-side handling of both old and new attestation evidence types
  • Replace VerificationReport with EvidenceKind/EvidenceMessage
  • Add placeholder logic in a few places to be replaced with server dcap upgrade

Motivation

Clients will be upgraded to 6.0 before servers. MobileCoin 5.0 used EPID verification and 6.0 uses DCAP. Because of this, clients need to be updated to handle both EPID and DCAP verification.

This PR also replaces the rigid VerificationReport type with the flexible EvidenceKind. Server code has been updated to assume this is the Epid variant for now. This placeholder code needs to be there for builds to work, but it will never run as it is being replaced with dcap verification.

Future Work

  • Server side dcap verification

Copy link
Contributor

@eranrund eranrund left a comment

Choose a reason for hiding this comment

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

There's a lot to digest here, so I made a first pass but I'll probably have more questions and will need to defer a lot to @nick-mobilecoin since he's much more familiar with this than I am.

My biggest confusion right now is that there seems to be places where DCAP is explicitly handled, places where it is skipped, and some confusing (to me) places that sometimes pass along serialized VerificationReport bytes, sometimes DcapEvidence, and try to deserialize either both or just one...

attest/ake/src/event.rs Outdated Show resolved Hide resolved
attest/ake/src/event.rs Outdated Show resolved Hide resolved
attest/ake/src/initiator.rs Outdated Show resolved Hide resolved
attest/ake/src/initiator.rs Outdated Show resolved Hide resolved
attest/ake/src/event.rs Outdated Show resolved Hide resolved
fog/enclave_connection/Cargo.toml Outdated Show resolved Hide resolved
fog/ingest/server/src/controller.rs Show resolved Hide resolved
fog/ledger/connection/Cargo.toml Outdated Show resolved Hide resolved
fog/view/connection/Cargo.toml Outdated Show resolved Hide resolved
sgx/report-cache/untrusted/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@nick-mobilecoin nick-mobilecoin left a comment

Choose a reason for hiding this comment

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

I realize Eran got comments in first so there may be some duplicates hopefully it's not too bad.

attest/ake/Cargo.toml Outdated Show resolved Hide resolved
attest/ake/src/event.rs Outdated Show resolved Hide resolved
attest/ake/src/event.rs Outdated Show resolved Hide resolved
attest/ake/src/event.rs Outdated Show resolved Hide resolved
attest/ake/src/event.rs Outdated Show resolved Hide resolved
attest/ake/src/initiator.rs Outdated Show resolved Hide resolved
attest/ake/src/initiator.rs Outdated Show resolved Hide resolved
attest/ake/src/responder.rs Outdated Show resolved Hide resolved
connection/src/thick.rs Outdated Show resolved Hide resolved
connection/src/thick.rs Outdated Show resolved Hide resolved
dolanbernard and others added 7 commits October 11, 2023 02:34
Co-authored-by: Nick Santana <nick@mobilecoin.com>
Co-authored-by: Eran Rundstein <eran@rundste.in>
Co-authored-by: Nick Santana <nick@mobilecoin.com>
Co-authored-by: Eran Rundstein <eran@rundste.in>
Refactor dual verification logic and fix failing test
Co-authored-by: Nick Santana <nick@mobilecoin.com>
Copy link
Collaborator

@nick-mobilecoin nick-mobilecoin left a comment

Choose a reason for hiding this comment

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

LGTM other than it should be comparing the remote_id to the report_data in the dcap verification

attest/ake/src/initiator.rs Outdated Show resolved Hide resolved
attest/ake/src/initiator.rs Outdated Show resolved Hide resolved
attest/ake/src/initiator.rs Outdated Show resolved Hide resolved
attest/ake/src/initiator.rs Show resolved Hide resolved
dolanbernard and others added 6 commits October 11, 2023 23:50
Co-authored-by: Nick Santana <nick@mobilecoin.com>
Co-authored-by: Nick Santana <nick@mobilecoin.com>
Co-authored-by: Nick Santana <nick@mobilecoin.com>
Copy link
Contributor

@eranrund eranrund left a comment

Choose a reason for hiding this comment

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

This is much cleaner, thank you!
I think the last remaining piece from my perspective is that maybe we should change APIs that are in-enclave-only to just return either the Epid or Dcap struct instead of the enum, since if I understood things correctly, there isn't ever a case where the actual enclave implementation supports both...

attest/ake/src/responder.rs Show resolved Hide resolved
crypto/ake/enclave/src/lib.rs Outdated Show resolved Hide resolved
crypto/ake/enclave/src/lib.rs Outdated Show resolved Hide resolved
fog/ingest/server/src/controller.rs Show resolved Hide resolved
@eranrund
Copy link
Contributor

Gonna do another review pass and in the meanwhile I triggered CD deployment for this (https://github.com/mobilecoinfoundation/mobilecoin/actions/runs/6511334658) to further verify everything still works as expected.

@nick-mobilecoin
Copy link
Collaborator

Gonna do another review pass and in the meanwhile I triggered CD deployment for this (https://github.com/mobilecoinfoundation/mobilecoin/actions/runs/6511334658) to further verify everything still works as expected.

I don't think CD will work right now, we're depending on some dcap libraries, but the docker run container is the minimal container for EPID. I've crated a dcap run container for future DCAP CD.

Copy link
Contributor

@eranrund eranrund left a comment

Choose a reason for hiding this comment

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

CD will be handled in a followup PR, so LGTM.

@dolanbernard dolanbernard merged commit 89d90c4 into master Oct 13, 2023
20 checks passed
@dolanbernard dolanbernard deleted the client-evidence-decode2 branch October 13, 2023 21:52
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.

3 participants