Skip to content

Commit 58a33dc

Browse files
committed
Add log::error! to src/attestation/src/attest.rs
1 parent be197ed commit 58a33dc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/attestation/src/attest.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ pub fn get_quote(td_report: &[u8]) -> Result<Vec<u8>, Error> {
9292
&mut quote_size as *mut u32,
9393
);
9494
if result != AttestLibError::Success {
95+
log::error!("get_quote_inner failed with error: {:?}", result);
9596
return Err(Error::GetQuote);
9697
}
9798
}
@@ -118,11 +119,17 @@ pub fn verify_quote(quote: &[u8]) -> Result<Vec<u8>, Error> {
118119
&mut report_verify_size as *mut u32,
119120
);
120121
if result != AttestLibError::Success {
122+
log::error!("verify_quote_integrity failed with error: {:?}", result);
121123
return Err(Error::VerifyQuote);
122124
}
123125
}
124126

125127
if report_verify_size as usize != TD_VERIFIED_REPORT_SIZE {
128+
log::error!(
129+
"Invalid report size: expected {}, got {}",
130+
TD_VERIFIED_REPORT_SIZE,
131+
report_verify_size
132+
);
126133
return Err(Error::InvalidOutput);
127134
}
128135

@@ -154,6 +161,7 @@ pub fn verify_quote_with_collaterals(
154161
&mut report_verify_size as *mut u32,
155162
);
156163
if result != AttestLibError::Success {
164+
log::error!("verify_quote_integrity_ex failed with error: {:?}", result);
157165
return Err(Error::VerifyQuote);
158166
}
159167
}

0 commit comments

Comments
 (0)