confidential-containers / td-shim

Confidential Containers Shim Firmware
Other
88 stars 50 forks source link

[Bug] Cannot create instances outside for some structs in tdx-tdcall/tdreport.rs #129

Closed liuw1 closed 2 years ago

liuw1 commented 2 years ago

Cannot create instances outside for some structs in tdx-tdcall/tdreport.rs. Since the element "resverd" is not public in these structs.

pub struct ReportMac { pub report_type: ReportType, reserved0: [u8; 12], pub cpu_svn: [u8; 16], pub tee_tcb_info_hash: [u8; 48], pub tee_info_hash: [u8; 48], pub report_data: [u8; 64], reserved1: [u8; 32], pub mac: [u8; 32], }

pub struct TeeTcbInfo { pub valid: [u8; 8], pub tee_tcb_svn: [u8; 16], pub mrseam: [u8; 48], pub mrsigner_seam: [u8; 48], pub attributes: [u8; 8], reserved: [u8; 111], }

pub struct TdInfo { pub attributes: [u8; 8], pub xfam: [u8; 8], pub mrtd: [u8; 48], pub mrconfig_id: [u8; 48], pub mrowner: [u8; 48], pub mrownerconfig: [u8; 48], pub rtmr0: [u8; 48], pub rtmr1: [u8; 48], pub rtmr2: [u8; 48], pub rtmr3: [u8; 48], reserved: [u8; 112], }

pub struct TdxReport { pub report_mac: ReportMac, pub tee_tcb_info: TeeTcbInfo, reserved: [u8; 17], pub td_info: TdInfo, }

jiangliu commented 2 years ago

If applicable, we may use #[derive(Default)] to solve this issue.

liuw1 commented 2 years ago

I will fix this issue.

liuw1 commented 2 years ago

It is not an real issue. So close it.