Skip to content

Commit

Permalink
Use general term "attestation evidence" in watcher
Browse files Browse the repository at this point in the history
Previously `mc-watcher` used "verification report" or similar to refer
to the `VerificationReport`. With the anticipated use of `DcapEvidence`
`mc-watcher` has been updated to use a more generic term of "attestation
evidence" where appropriate.
  • Loading branch information
nick-mobilecoin committed Oct 6, 2023
1 parent 9fbaa76 commit b2510ac
Show file tree
Hide file tree
Showing 8 changed files with 306 additions and 290 deletions.
12 changes: 6 additions & 6 deletions attest/ake/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,26 +314,26 @@ impl From<AuthResponseInput> for Vec<u8> {
/// An authentication response input to a responder
impl MealyInput for AuthResponseInput {}

/// An unverified report is used when the initiator may not know the identity of
/// the enclave.
pub struct UnverifiedReport {
/// An unverified attestation evidence is used when the initiator may not
/// know the identity of the enclave.
pub struct UnverifiedAttestationEvidence {
pub(crate) data: Vec<u8>,
}

impl UnverifiedReport {
impl UnverifiedAttestationEvidence {
pub fn new(data: AuthResponseOutput) -> Self {
Self { data: data.0 }
}
}

impl AsRef<[u8]> for UnverifiedReport {
impl AsRef<[u8]> for UnverifiedAttestationEvidence {
fn as_ref(&self) -> &[u8] {
self.data.as_ref()
}
}

/// An authentication response from a responder
impl MealyInput for UnverifiedReport {}
impl MealyInput for UnverifiedAttestationEvidence {}

/// The IAS report is the final output when authentication succeeds.
impl MealyOutput for VerificationReport {}
Expand Down
7 changes: 4 additions & 3 deletions attest/ake/src/initiator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use crate::{
AuthPending, AuthRequestOutput, AuthResponseInput, ClientInitiate, Error, NodeInitiate, Ready,
Start, Terminated, Transition, UnverifiedReport,
Start, Terminated, Transition, UnverifiedAttestationEvidence,
};
use alloc::vec::Vec;
use mc_attest_core::{ReportDataMask, VerificationReport};
Expand Down Expand Up @@ -198,7 +198,8 @@ where
}

/// AuthPending + UnverifiedReport => Terminated + VerificationReport
impl<KexAlgo, Cipher, DigestAlgo> Transition<Terminated, UnverifiedReport, VerificationReport>
impl<KexAlgo, Cipher, DigestAlgo>
Transition<Terminated, UnverifiedAttestationEvidence, VerificationReport>
for AuthPending<KexAlgo, Cipher, DigestAlgo>
where
KexAlgo: Kex,
Expand All @@ -210,7 +211,7 @@ where
fn try_next<R: CryptoRng + RngCore>(
self,
_csprng: &mut R,
input: UnverifiedReport,
input: UnverifiedAttestationEvidence,
) -> Result<(Terminated, VerificationReport), Self::Error> {
let output = self
.state
Expand Down
2 changes: 1 addition & 1 deletion attest/ake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub use crate::{
event::{
AuthRequestOutput, AuthResponseInput, AuthResponseOutput, Ciphertext,
ClientAuthRequestInput, ClientInitiate, NodeAuthRequestInput, NodeInitiate, Plaintext,
UnverifiedReport,
UnverifiedAttestationEvidence,
},
mealy::Transition,
state::{AuthPending, Ready, Start, Terminated},
Expand Down
Loading

0 comments on commit b2510ac

Please sign in to comment.