@@ -16,7 +16,9 @@ pub const PCS_URL: &str = "https://api.trustedservices.intel.com";
1616
1717/// Quote generation using configfs_tsm
1818pub async fn create_dcap_attestation ( input_data : [ u8 ; 64 ] ) -> Result < Vec < u8 > , AttestationError > {
19- Ok ( generate_quote ( input_data) ?)
19+ let quote = generate_quote ( input_data) ?;
20+ tracing:: info!( "Generated TDX quote of {} bytes" , quote. len( ) ) ;
21+ Ok ( quote)
2022}
2123
2224/// Verify a DCAP TDX quote, and return the measurement values
@@ -30,6 +32,7 @@ pub async fn verify_dcap_attestation(
3032 . duration_since ( std:: time:: UNIX_EPOCH ) ?
3133 . as_secs ( ) ;
3234 let quote = Quote :: parse ( & input) ?;
35+ tracing:: info!( "Verifying DCAP attestation: {quote:?}" ) ;
3336
3437 let ca = quote. ca ( ) ?;
3538 let fmspc = hex:: encode_upper ( quote. fmspc ( ) ?) ;
@@ -99,27 +102,13 @@ pub fn get_quote_input_data(report: Report) -> [u8; 64] {
99102 }
100103}
101104
102- /// An error when generating or verifying an attestation
105+ /// An error when verifying a DCAP attestation
103106#[ derive( Error , Debug ) ]
104107pub enum DcapVerificationError {
105- // #[error("Certificate chain is empty")]
106- // NoCertificate,
107- // #[error("X509 parse: {0}")]
108- // X509Parse(#[from] x509_parser::asn1_rs::Err<x509_parser::error::X509Error>),
109- // #[error("X509: {0}")]
110- // X509(#[from] x509_parser::error::X509Error),
111108 #[ error( "Quote input is not as expected" ) ]
112109 InputMismatch ,
113- // #[error("Configuration mismatch - expected no remote attestation")]
114- // AttestationGivenWhenNoneExpected,
115- // #[error("Configfs-tsm quote generation: {0}")]
116- // QuoteGeneration(#[from] configfs_tsm::QuoteGenerationError),
117110 #[ error( "SGX quote given when TDX quote expected" ) ]
118111 SgxNotSupported ,
119- // #[error("Platform measurements do not match any accepted values")]
120- // UnacceptablePlatformMeasurements,
121- // #[error("OS image measurements do not match any accepted values")]
122- // UnacceptableOsImageMeasurements,
123112 #[ error( "System Time: {0}" ) ]
124113 SystemTime ( #[ from] std:: time:: SystemTimeError ) ,
125114 #[ error( "DCAP quote verification: {0}" ) ]
0 commit comments