Skip to content

Commit

Permalink
printing self report paramts during attestation (not only trace)
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad committed Oct 27, 2024
1 parent 5e162db commit c8a6671
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions cosmwasm/enclaves/execute/src/registration/attestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ use super::ocalls::{
#[cfg(feature = "SGX_MODE_HW")]
use super::{hex, report::EndorsedAttestationReport};

use ::hex as orig_hex;

#[cfg(feature = "SGX_MODE_HW")]
pub const DEV_HOSTNAME: &str = "api.trustedservices.intel.com";

Expand Down Expand Up @@ -409,9 +411,15 @@ pub fn verify_quote_ecdsa(
let my_p_quote = vec_quote.as_ptr() as *const sgx_quote_t;
let report_body = unsafe { (*my_p_quote).report_body };

trace!("body.mr_signer = {:?}", report_body.mr_signer.m);
trace!("body.mr_enclave = {:?}", report_body.mr_enclave.m);
trace!("body.report_data = {:?}", report_body.report_data.d);
// trace!(
// "body.mr_signer = {}",
// orig_hex::encode(&report_body.mr_signer.m)
// );
// trace!(
// "body.mr_enclave = {}",
// orig_hex::encode(&report_body.mr_enclave.m)
// );
// trace!("body.report_data = {}", orig_hex::encode(&report_body.report_data.d));

Ok((report_body, qv_result))
}
Expand Down Expand Up @@ -527,6 +535,19 @@ pub fn get_quote_ecdsa_untested(pub_k: &[u8]) -> Result<(Vec<u8>, Vec<u8>), sgx_
}
}

println!(
"mr_signer = {}",
orig_hex::encode(&my_report.body.mr_signer.m)
);
println!(
"mr_enclave = {}",
orig_hex::encode(&my_report.body.mr_enclave.m)
);
println!(
"report_data = {}",
orig_hex::encode(&my_report.body.report_data.d)
);

Ok((vec_quote, vec_coll))
}

Expand Down

0 comments on commit c8a6671

Please sign in to comment.