@@ -42,7 +42,7 @@ pub fn run_dcap_ra(
4242 ) ?;
4343
4444 key_manager
45- . save_ra_quote ( target_enclave_key, result. get_quote ( ) . into ( ) )
45+ . save_ra_quote ( target_enclave_key, result. get_ra_quote ( current_time ) . into ( ) )
4646 . map_err ( |e| {
4747 Error :: key_manager ( format ! ( "cannot save DCAP quote: {}" , target_enclave_key) , e)
4848 } ) ?;
@@ -62,7 +62,9 @@ pub(crate) fn dcap_ra(
6262 e,
6363 )
6464 } ) ?;
65- let raw_quote = rsgx_qe_get_quote ( & ek_info. report ) . unwrap ( ) ;
65+ let raw_quote = rsgx_qe_get_quote ( & ek_info. report )
66+ . map_err ( |status| Error :: sgx_qe3_error ( status, "failed to get quote" . into ( ) ) ) ?;
67+
6668 info ! ( "Successfully get the quote: {}" , hex:: encode( & raw_quote) ) ;
6769
6870 let quote = QuoteV3 :: from_bytes ( & raw_quote) . map_err ( Error :: dcap_quote_verifier) ?;
@@ -91,13 +93,13 @@ pub struct DCAPRemoteAttestationResult {
9193}
9294
9395impl DCAPRemoteAttestationResult {
94- pub fn get_quote ( & self ) -> DCAPQuote {
96+ pub fn get_ra_quote ( & self , attested_at : Time ) -> DCAPQuote {
9597 DCAPQuote :: new (
9698 self . raw_quote . clone ( ) ,
9799 self . output . fmspc ,
98100 self . output . tcb_status . to_string ( ) ,
99101 self . output . advisory_ids . clone ( ) ,
100- Time :: now ( ) ,
102+ attested_at ,
101103 DcapCollateral {
102104 tcbinfo_bytes : self . collateral . tcbinfo_bytes . clone ( ) ,
103105 qeidentity_bytes : self . collateral . qeidentity_bytes . clone ( ) ,
0 commit comments