Skip to content

Commit

Permalink
fix to use quote_size instead of hardcoded quote size
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele committed Nov 19, 2024
1 parent aca4366 commit c195872
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/remote-attestation/src/ias_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub(crate) fn get_quote(
info!("quote size = {}", quote_size);

let mut qe_report = sgx_report_t::default();
let quote = [0u8; 2048];
let quote: Vec<u8> = vec![0; quote_size as usize];
let p_quote = quote.as_ptr();
let ret = unsafe {
sgx_get_quote(
Expand All @@ -105,7 +105,7 @@ pub(crate) fn get_quote(
if ret != sgx_status_t::SGX_SUCCESS {
return Err(Error::sgx_error(ret, "failed to sgx_get_quote".into()));
}
(quote[..quote_size as usize].to_vec(), qe_report)
(quote, qe_report)
};

// Check qe_report to defend against replay attack
Expand Down

0 comments on commit c195872

Please sign in to comment.