diff --git a/az-cvm-vtpm/Cargo.toml b/az-cvm-vtpm/Cargo.toml index 47f99c7..313f1eb 100644 --- a/az-cvm-vtpm/Cargo.toml +++ b/az-cvm-vtpm/Cargo.toml @@ -47,5 +47,5 @@ serde_json = "1.0.107" thiserror = "2.0.3" sev = "6.2.1" ureq = { version = "2.6.2", default-features = false, features = ["json"] } -zerocopy = { version = "0.7.26", features = ["derive"] } +zerocopy = { version = "0.8.26", features = ["derive"] } hex = "0.4" diff --git a/az-cvm-vtpm/az-tdx-vtpm/src/imds.rs b/az-cvm-vtpm/az-tdx-vtpm/src/imds.rs index f9501d4..66bf82c 100644 --- a/az-cvm-vtpm/az-tdx-vtpm/src/imds.rs +++ b/az-cvm-vtpm/az-tdx-vtpm/src/imds.rs @@ -4,7 +4,7 @@ use az_cvm_vtpm::tdx::TdReport; use serde::Deserialize; use thiserror::Error; -use zerocopy::AsBytes; +use zerocopy::IntoBytes; const IMDS_QUOTE_URL: &str = "http://169.254.169.254/acc/tdquote"; diff --git a/az-cvm-vtpm/src/tdx/mod.rs b/az-cvm-vtpm/src/tdx/mod.rs index 097f8a3..d1e0111 100644 --- a/az-cvm-vtpm/src/tdx/mod.rs +++ b/az-cvm-vtpm/src/tdx/mod.rs @@ -6,10 +6,10 @@ use serde::{Deserialize, Serialize}; use serde_big_array::BigArray; -use zerocopy::AsBytes; +use zerocopy::{Immutable, IntoBytes}; #[repr(C)] -#[derive(AsBytes, Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Immutable, IntoBytes, Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct ReportType { pub r#type: u8, pub subtype: u8, @@ -18,7 +18,7 @@ pub struct ReportType { } #[repr(C)] -#[derive(AsBytes, Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Immutable, IntoBytes, Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct ReportMac { pub reporttype: ReportType, pub _reserved_1: [u8; 12], @@ -34,14 +34,14 @@ pub struct ReportMac { } #[repr(C)] -#[derive(AsBytes, Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Immutable, IntoBytes, Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct Rtmr { #[serde(with = "BigArray")] pub register_data: [u8; 48], } #[repr(C)] -#[derive(AsBytes, Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Immutable, IntoBytes, Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct TdInfo { pub attributes: [u8; 8], pub xfam: [u8; 8], @@ -59,7 +59,7 @@ pub struct TdInfo { } #[repr(C)] -#[derive(AsBytes, Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Immutable, IntoBytes, Copy, Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct TdReport { pub report_mac: ReportMac, #[serde(with = "BigArray")]