Skip to content

Commit

Permalink
Update to zerocopy 0.8.17
Browse files Browse the repository at this point in the history
Also updates DPE submodule to pull in the same zerocopy.

Zerocopy's derive macro for KnownLayout has changed. Compiling DPE in caliptra-sw fails because public interfaces are leaking these private types.

The solution is to mark them as a public field. There may be another workaround, but since these types are being serialized to and from raw bytes, it makes sense that these private fields should be visible to callers.
  • Loading branch information
clundin25 committed Feb 21, 2025
1 parent e1dcb71 commit 7a8faeb
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ ureg-schema = { path = "ureg/lib/schema" }
ureg-systemrdl = { path = "ureg/lib/systemrdl" }
wycheproof = "0.5.1"
x509-parser = "0.15.0"
zerocopy = { version = "0.8.8", features = ["derive"] }
zerocopy = { version = "0.8.17", features = ["derive"] }
serial_test = "2.0.0"
nix = "0.26.2"
libc = "0.2"
Expand Down
6 changes: 3 additions & 3 deletions api/src/mailbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ pub struct GetIdevInfoResp {
#[repr(C)]
#[derive(Default, Debug, IntoBytes, FromBytes, Immutable, KnownLayout, PartialEq, Eq)]
pub struct GetLdevCertReq {
header: MailboxReqHeader,
pub header: MailboxReqHeader,
}

impl Request for GetLdevCertReq {
Expand Down Expand Up @@ -506,7 +506,7 @@ impl Default for GetLdevCertResp {
#[repr(C)]
#[derive(Default, Debug, IntoBytes, FromBytes, Immutable, KnownLayout, PartialEq, Eq)]
pub struct GetRtAliasCertReq {
header: MailboxReqHeader,
pub header: MailboxReqHeader,
}
impl Request for GetRtAliasCertReq {
const ID: CommandId = CommandId::GET_RT_ALIAS_CERT;
Expand Down Expand Up @@ -734,7 +734,7 @@ impl Default for InvokeDpeResp {
#[repr(C)]
#[derive(Debug, Default, IntoBytes, FromBytes, Immutable, KnownLayout, PartialEq, Eq)]
pub struct GetFmcAliasCertReq {
header: MailboxReqHeader,
pub header: MailboxReqHeader,
}
impl Request for GetFmcAliasCertReq {
const ID: CommandId = CommandId::GET_FMC_ALIAS_CERT;
Expand Down
2 changes: 1 addition & 1 deletion drivers/src/pcr_reset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use zeroize::Zeroize;
#[repr(C, align(4))]
#[derive(IntoBytes, FromBytes, Immutable, KnownLayout, Zeroize)]
pub struct PcrResetCounter {
counter: [u32; PcrBank::ALL_PCR_IDS.len()],
pub counter: [u32; PcrBank::ALL_PCR_IDS.len()],
}

impl Default for PcrResetCounter {
Expand Down
4 changes: 2 additions & 2 deletions image/gen/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ impl<Crypto: ImageGeneratorCrypto> ImageGenerator<Crypto> {
where
E: ImageGenratorExecutable,
{
let r#type = ImageTocEntryType::Executable;
let image_type = ImageTocEntryType::Executable;
let digest = self.crypto.sha384_digest(image.content())?;

let entry = ImageTocEntry {
id: id.into(),
r#type: r#type.into(),
image_type: image_type.into(),
revision: *image.rev(),
version: image.version(),
svn: image.svn(),
Expand Down
6 changes: 3 additions & 3 deletions image/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ pub struct VendorSignedData {
/// Vendor End Date [ASN1 Time Format] For FMC alias certificate.
pub vendor_not_after: [u8; 15],

reserved: [u8; 10],
pub reserved: [u8; 10],
}

#[repr(C)]
Expand All @@ -320,7 +320,7 @@ pub struct OwnerSignedData {
/// Owner epoch, used to diversify stable SVN keys.
pub epoch: [u8; 2],

reserved: [u8; 8],
pub reserved: [u8; 8],
}

/// Caliptra Image header
Expand Down Expand Up @@ -396,7 +396,7 @@ pub struct ImageTocEntry {
pub id: u32,

/// Type
pub r#type: u32,
pub image_type: u32,

/// Commit revision
pub revision: ImageRevision,
Expand Down

0 comments on commit 7a8faeb

Please sign in to comment.