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

Support decoding both evidence types #3429

Closed
Tracked by #3428 ...
nick-mobilecoin opened this issue Jul 20, 2023 · 1 comment
Closed
Tracked by #3428 ...

Support decoding both evidence types #3429

nick-mobilecoin opened this issue Jul 20, 2023 · 1 comment

Comments

@nick-mobilecoin
Copy link
Collaborator

nick-mobilecoin commented Jul 20, 2023

At

let remote_report = VerificationReport::decode(payload.as_slice())
and similar locations where the EPID verification report is decoded there will need to be logic to handle the EPID verification report (legacy attestation evidence) or the newer DCAP attestation evidence.

One way to achieve this could be to wrap the new DCAP attestation evidence similar to:

#[derive(Clone, prost::Oneof)]
pub enum Evidence {
    #[prost(message, tag = "4")]
    Dcap(DcapEvidence),
}


#[derive(Clone, prost::Message)]
struct EvidenceMessage {
    #[prost(oneof = "Evidence", tags = "4")]
    evidence: Option<Evidence>,
}   

This would allow one to update the decoding code to be:

let decoded = EvidenceMessage::decode(payload.as_slice()).map_err(|_| Error::Deserialization)?;
match decoded.evidence
    Some(evidence) => verify_dcap_evidence(evidence),
    None => original_epid_logic(payload.as_slice())
}

The new evidence message would only contain data if the protobuf message happened to start with one of the tags that the EvidenceMessage knows about.
This requires that the new evidence message does not use a tag that's found in the legacy EPID verification report.

This was referenced Jul 20, 2023
@nick-mobilecoin
Copy link
Collaborator Author

Done in #3602

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

No branches or pull requests

1 participant