@@ -56,69 +56,87 @@ pub enum MsgReportRspStatus {
5656pub enum AttestionReport {
5757 V2 ( AttestionReportV2 ) = 2 ,
5858 V3 ( AttestionReportV3 ) = 3 ,
59+ V5 ( AttestionReportV5 ) = 5 ,
5960}
6061
6162impl AttestionReport {
6263 pub fn policy ( & self ) -> GuestPolicy {
6364 match self {
6465 AttestionReport :: V2 ( report) => report. policy ,
6566 AttestionReport :: V3 ( report) => report. policy ,
67+ AttestionReport :: V5 ( report) => report. policy ,
6668 }
6769 }
6870
6971 pub fn vmpl ( & self ) -> u32 {
7072 match self {
7173 AttestionReport :: V2 ( report) => report. vmpl ,
7274 AttestionReport :: V3 ( report) => report. vmpl ,
75+ AttestionReport :: V5 ( report) => report. vmpl ,
7376 }
7477 }
7578
7679 pub fn signature_algo ( & self ) -> u32 {
7780 match self {
7881 AttestionReport :: V2 ( report) => report. signature_algo ,
7982 AttestionReport :: V3 ( report) => report. signature_algo ,
83+ AttestionReport :: V5 ( report) => report. signature_algo ,
8084 }
8185 }
8286
8387 pub fn report_data ( & self ) -> [ u8 ; 64 ] {
8488 match self {
8589 AttestionReport :: V2 ( report) => report. report_data ,
8690 AttestionReport :: V3 ( report) => report. report_data ,
91+ AttestionReport :: V5 ( report) => report. report_data ,
8792 }
8893 }
8994
9095 pub fn measurement ( & self ) -> [ u8 ; 48 ] {
9196 match self {
9297 AttestionReport :: V2 ( report) => report. measurement ,
9398 AttestionReport :: V3 ( report) => report. measurement ,
99+ AttestionReport :: V5 ( report) => report. measurement ,
94100 }
95101 }
96102
97103 pub fn host_data ( & self ) -> [ u8 ; 32 ] {
98104 match self {
99105 AttestionReport :: V2 ( report) => report. host_data ,
100106 AttestionReport :: V3 ( report) => report. host_data ,
107+ AttestionReport :: V5 ( report) => report. host_data ,
101108 }
102109 }
103110
104111 pub fn id_key_digest ( & self ) -> [ u8 ; 48 ] {
105112 match self {
106113 AttestionReport :: V2 ( report) => report. id_key_digest ,
107114 AttestionReport :: V3 ( report) => report. id_key_digest ,
115+ AttestionReport :: V5 ( report) => report. id_key_digest ,
108116 }
109117 }
110118
111119 pub fn launch_tcb ( & self ) -> TcbVersion {
112120 match self {
113121 AttestionReport :: V2 ( report) => report. launch_tcb ,
114122 AttestionReport :: V3 ( report) => report. launch_tcb ,
123+ AttestionReport :: V5 ( report) => report. launch_tcb ,
124+ }
125+ }
126+
127+ pub fn launch_mitigation_vector ( & self ) -> u64 {
128+ match self {
129+ AttestionReport :: V2 ( _) => 0 ,
130+ AttestionReport :: V3 ( _) => 0 ,
131+ AttestionReport :: V5 ( report) => report. launch_mitigation_vector ,
115132 }
116133 }
117134
118135 pub fn signature ( & self ) -> [ u8 ; 512 ] {
119136 match self {
120137 AttestionReport :: V2 ( report) => report. signature ,
121138 AttestionReport :: V3 ( report) => report. signature ,
139+ AttestionReport :: V5 ( report) => report. signature ,
122140 }
123141 }
124142}
@@ -200,6 +218,48 @@ pub struct AttestionReportV3 {
200218 pub signature : [ u8 ; 512 ] ,
201219}
202220
221+ #[ derive( Debug , Clone , Copy , CheckedBitPattern ) ]
222+ #[ repr( C , packed) ]
223+ pub struct AttestionReportV5 {
224+ pub guest_svn : u32 ,
225+ pub policy : GuestPolicy ,
226+ pub familiy_id : u128 ,
227+ pub image_id : u128 ,
228+ pub vmpl : u32 ,
229+ pub signature_algo : u32 ,
230+ pub current_tcb : TcbVersion ,
231+ pub platform_info : u64 ,
232+ pub fixme_key_stuff : u32 ,
233+ _reserved1 : Reserved < 4 > ,
234+ pub report_data : [ u8 ; 64 ] ,
235+ pub measurement : [ u8 ; 48 ] ,
236+ pub host_data : [ u8 ; 32 ] ,
237+ pub id_key_digest : [ u8 ; 48 ] ,
238+ pub author_key_digest : [ u8 ; 48 ] ,
239+ pub report_id : [ u8 ; 32 ] ,
240+ pub report_id_ma : [ u8 ; 32 ] ,
241+ pub reported_tcb : TcbVersion ,
242+ pub cpuid_fam_id : u8 ,
243+ pub cpuid_mod_id : u8 ,
244+ pub cpuid_step : u8 ,
245+ _reserved2 : Reserved < 21 > ,
246+ pub chip_id : [ u8 ; 64 ] ,
247+ pub commited_tcb : TcbVersion ,
248+ pub current_build : u8 ,
249+ pub current_minor : u8 ,
250+ pub current_major : u8 ,
251+ _reserved3 : Reserved < 1 > ,
252+ pub commited_build : u8 ,
253+ pub commited_minor : u8 ,
254+ pub commited_major : u8 ,
255+ _reserved4 : Reserved < 1 > ,
256+ pub launch_tcb : TcbVersion ,
257+ pub launch_mitigation_vector : u64 ,
258+ pub current_mitigation_vector : u64 ,
259+ _reserved5 : Reserved < 152 > ,
260+ pub signature : [ u8 ; 512 ] ,
261+ }
262+
203263#[ derive( Clone , Copy , AnyBitPattern , NoUninit ) ]
204264#[ repr( C ) ]
205265pub struct EcdsaP384Sha384Signature {
0 commit comments