diff --git a/kernel/src/svsm.rs b/kernel/src/svsm.rs index dd879305a..dd9206ba1 100755 --- a/kernel/src/svsm.rs +++ b/kernel/src/svsm.rs @@ -311,9 +311,15 @@ pub extern "C" fn svsm_main() { panic!("Failed to prepare guest FW: {e:#?}"); } - let mut attest_driver = AttestationDriver::from(kbs_types::Tee::Snp); - let _secret = attest_driver.attest(); + #[cfg(feature = "attest")] + { + let mut attest_driver = AttestationDriver::try_from(kbs_types::Tee::Snp).unwrap(); + let secret = attest_driver.attest().unwrap(); + + let msg = core::str::from_utf8(&secret).unwrap(); + log::info!("Decrypted secret from attestation server: {}", msg); + } #[cfg(all(feature = "vtpm", not(test)))] vtpm_init().expect("vTPM failed to initialize");