Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ thiserror = "2.0.17"
clap = { version = "4.5.51", features = ["derive"] }
webpki-roots = "1.0.4"
rustls-pemfile = "2.2.0"
anyhow = "1.0.100"

[dev-dependencies]
rcgen = "0.14.5"
Expand Down
9 changes: 7 additions & 2 deletions src/attestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ use x509_parser::prelude::*;

/// Represents a CVM technology with quote generation and verification
pub trait AttestationPlatform: Clone + Send + 'static {
/// Whether this is CVM attestation. This should always return true except for the [NoAttestation] case.
///
/// When false, allows TLS client to be configured without client authentication
fn is_cvm(&self) -> bool;

/// Generate an attestation
fn create_attestation(
&self,
cert_chain: &[CertificateDer<'_>],
exporter: [u8; 32],
) -> Result<Vec<u8>, AttestationError>;

/// Verify the given attestation payload
fn verify_attestation(
&self,
input: Vec<u8>,
Expand Down Expand Up @@ -71,7 +76,7 @@ impl AttestationPlatform for NoAttestation {
false
}

/// Mocks creating an attestation
/// Create an empty attestation
fn create_attestation(
&self,
_cert_chain: &[CertificateDer<'_>],
Expand All @@ -80,7 +85,7 @@ impl AttestationPlatform for NoAttestation {
Ok(Vec::new())
}

/// Mocks verifying an attestation
/// Ensure that an empty attestation is given
fn verify_attestation(
&self,
input: Vec<u8>,
Expand Down
Loading