diff --git a/attestation-agent/attester/src/lib.rs b/attestation-agent/attester/src/lib.rs index d1fd146ad..34bd20d6a 100644 --- a/attestation-agent/attester/src/lib.rs +++ b/attestation-agent/attester/src/lib.rs @@ -78,10 +78,6 @@ pub trait Attester { // Detect which TEE platform the KBC running environment is. pub fn detect_tee_type() -> Option { - if sample::detect_platform() { - return Some(Tee::Sample); - } - #[cfg(feature = "tdx-attester")] if tdx::detect_platform() { return Some(Tee::Tdx); @@ -117,5 +113,10 @@ pub fn detect_tee_type() -> Option { return Some(Tee::Cca); } + // Always detected + if sample::detect_platform() { + return Some(Tee::Sample); + } + None } diff --git a/attestation-agent/attester/src/sample/mod.rs b/attestation-agent/attester/src/sample/mod.rs index e9a0af29c..012b479b1 100644 --- a/attestation-agent/attester/src/sample/mod.rs +++ b/attestation-agent/attester/src/sample/mod.rs @@ -9,10 +9,9 @@ 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.