Skip to content

Commit

Permalink
sample: always enable sample attester
Browse files Browse the repository at this point in the history
Rather than setting an environment variable to enable
the sample attester, always enable it as a fallback.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
  • Loading branch information
fitzthum committed Jan 2, 2024
1 parent a1d5eed commit 7f45726
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 5 additions & 4 deletions attestation-agent/attester/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ pub trait Attester {

// Detect which TEE platform the KBC running environment is.
pub fn detect_tee_type() -> Option<Tee> {
if sample::detect_platform() {
return Some(Tee::Sample);
}

#[cfg(feature = "tdx-attester")]
if tdx::detect_platform() {
return Some(Tee::Tdx);
Expand Down Expand Up @@ -117,5 +113,10 @@ pub fn detect_tee_type() -> Option<Tee> {
return Some(Tee::Cca);
}

// Always detected
if sample::detect_platform() {
return Some(Tee::Sample);
}

None
}
6 changes: 2 additions & 4 deletions attestation-agent/attester/src/sample/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ use super::Attester;
use anyhow::*;
use base64::Engine;
use serde::{Deserialize, Serialize};
use std::env;

// If the environment variable "AA_SAMPLE_ATTESTER_TEST" is set,
// the TEE platform is considered as "sample".
// Sample attester is always supported
pub fn detect_platform() -> bool {
env::var("AA_SAMPLE_ATTESTER_TEST").is_ok()
true
}

// A simple example of TEE evidence.
Expand Down

0 comments on commit 7f45726

Please sign in to comment.