@@ -55,7 +55,9 @@ const TDX_UUID_SIZE: usize = 16;
5555/// # Errors
5656///
5757/// Returns `QuoteGeneratorError::ReportDataConversion` if input bytes length doesn't match `REPORT_DATA_SIZE`.
58- fn create_report_data ( input_bytes : & [ u8 ] ) -> Result < tdx_attest_rs:: tdx_report_data_t , QuoteGeneratorError > {
58+ fn create_report_data (
59+ input_bytes : & [ u8 ] ,
60+ ) -> Result < tdx_attest_rs:: tdx_report_data_t , QuoteGeneratorError > {
5961 let report_data = tdx_attest_rs:: tdx_report_data_t {
6062 d : input_bytes. try_into ( ) ?,
6163 } ;
@@ -75,7 +77,9 @@ fn create_report_data(input_bytes: &[u8]) -> Result<tdx_attest_rs::tdx_report_da
7577/// # Errors
7678///
7779/// Returns `QuoteGeneratorError::TdxReportFailed` if the report generation fails.
78- fn create_tdx_report ( report_data : & tdx_attest_rs:: tdx_report_data_t ) -> Result < tdx_attest_rs:: tdx_report_t , QuoteGeneratorError > {
80+ fn create_tdx_report (
81+ report_data : & tdx_attest_rs:: tdx_report_data_t ,
82+ ) -> Result < tdx_attest_rs:: tdx_report_t , QuoteGeneratorError > {
7983 let mut tdx_report = tdx_attest_rs:: tdx_report_t {
8084 d : [ 0 ; REPORT_SIZE ] ,
8185 } ;
@@ -106,7 +110,9 @@ fn create_tdx_report(report_data: &tdx_attest_rs::tdx_report_data_t) -> Result<t
106110///
107111/// * `QuoteGeneratorError::TdxQuoteFailed` - if the quote generation API call fails.
108112/// * `QuoteGeneratorError::TdxQuoteEmpty` - if the API succeeds but returns no quote data.
109- fn create_quote ( report_data : & tdx_attest_rs:: tdx_report_data_t ) -> Result < Vec < u8 > , QuoteGeneratorError > {
113+ fn create_quote (
114+ report_data : & tdx_attest_rs:: tdx_report_data_t ,
115+ ) -> Result < Vec < u8 > , QuoteGeneratorError > {
110116 let mut selected_att_key_id = tdx_attest_rs:: tdx_uuid_t {
111117 d : [ 0 ; TDX_UUID_SIZE ] ,
112118 } ;
@@ -118,11 +124,9 @@ fn create_quote(report_data: &tdx_attest_rs::tdx_report_data_t) -> Result<Vec<u8
118124 ) ;
119125
120126 match result {
121- tdx_attest_rs:: tdx_attest_error_t:: TDX_ATTEST_SUCCESS => {
122- match quote {
123- Some ( q) => Ok ( q) ,
124- None => Err ( QuoteGeneratorError :: TdxQuoteEmpty ) ,
125- }
127+ tdx_attest_rs:: tdx_attest_error_t:: TDX_ATTEST_SUCCESS => match quote {
128+ Some ( q) => Ok ( q) ,
129+ None => Err ( QuoteGeneratorError :: TdxQuoteEmpty ) ,
126130 } ,
127131 _ => {
128132 error ! ( "Failed to get TDX quote: {:?}" , result) ;
@@ -143,7 +147,10 @@ fn main() -> Result<(), QuoteGeneratorError> {
143147 let input = & args[ 1 ] ;
144148 let input_bytes = input. as_bytes ( ) ;
145149 if input_bytes. len ( ) > REPORT_DATA_SIZE {
146- return Err ( QuoteGeneratorError :: ReportDataTooLarge { max : REPORT_DATA_SIZE , actual : input_bytes. len ( ) } ) ;
150+ return Err ( QuoteGeneratorError :: ReportDataTooLarge {
151+ max : REPORT_DATA_SIZE ,
152+ actual : input_bytes. len ( ) ,
153+ } ) ;
147154 }
148155
149156 let mut report_bytes = [ 0u8 ; REPORT_DATA_SIZE ] ;
0 commit comments