Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions verifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,19 @@ impl std::iter::IntoIterator for MeasurementSet {
}
}

impl std::fmt::Display for MeasurementSet {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(f, "measurement set")?;
for m in &self.0 {
writeln!(f, " {}", m)?;
}
if self.0.is_empty() {
writeln!(f, "(set is empty)")?;
}
Ok(())
}
}

/// A collection of measurement values that is used as a source of truth when
/// appraising the set of measurements derived from an attestation.
pub struct ReferenceMeasurements(pub(crate) HashSet<Measurement>);
Expand Down Expand Up @@ -488,6 +501,19 @@ impl TryFrom<&[Corim]> for ReferenceMeasurements {
}
}

impl std::fmt::Display for ReferenceMeasurements {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(f, "Reference measurements")?;
for m in &self.0 {
writeln!(f, " {}", m)?;
}
if self.0.is_empty() {
writeln!(f, "(set is empty)")?;
}
Ok(())
}
}

/// Errors produced by the `verify_attestation` function
#[derive(Debug, Error)]
pub enum VerifyAttestationError {
Expand Down
Loading