Skip to content

Commit

Permalink
Use ArrayVec instead of a slice.
Browse files Browse the repository at this point in the history
  • Loading branch information
clundin25 committed Jan 27, 2025
1 parent 3d07a38 commit bc07af4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dpe
Submodule dpe updated 1 files
+1 −1 platform/src/lib.rs
6 changes: 3 additions & 3 deletions runtime/src/dpe_platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct DpePlatform<'a> {
not_before: &'a NotBefore,
not_after: &'a NotAfter,
dmtf_device_info: Option<&'a [u8]>,
ueid: Option<&'a [u8; 17]>,
ueid: Option<&'a Ueid>,
}

pub const VENDOR_ID: u32 = u32::from_be_bytes(*b"CTRA");
Expand All @@ -53,7 +53,7 @@ impl<'a> DpePlatform<'a> {
not_before: &'a NotBefore,
not_after: &'a NotAfter,
dmtf_device_info: Option<&'a [u8]>,
ueid: Option<&'a [u8; 17]>,
ueid: Option<&'a Ueid>,
) -> Self {
Self {
auto_init_locality,
Expand Down Expand Up @@ -196,6 +196,6 @@ impl Platform for DpePlatform<'_> {
}

fn get_ueid(&mut self) -> Result<Ueid, PlatformError> {
Ok(*self.ueid.ok_or(PlatformError::MissingUeidError)?)
Ok(self.ueid.ok_or(PlatformError::MissingUeidError)?.clone())
}
}
5 changes: 3 additions & 2 deletions runtime/src/invoke_dpe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Abstract:
use crate::{
CptraDpeTypes, DpeCrypto, DpeEnv, DpePlatform, Drivers, PauserPrivileges, PL0_PAUSER_FLAG,
};
use arrayvec::ArrayVec;
use caliptra_cfi_derive_git::cfi_impl_fn;
use caliptra_common::mailbox_api::{InvokeDpeReq, InvokeDpeResp, MailboxResp, MailboxRespHeader};
use caliptra_drivers::{CaliptraError, CaliptraResult};
Expand Down Expand Up @@ -64,7 +65,7 @@ impl InvokeDpeCmd {
);
let pl0_pauser = pdata.manifest1.header.pl0_pauser;
let (nb, nf) = Drivers::get_cert_validity_info(&pdata.manifest1);
let ueid = &drivers.soc_ifc.fuse_bank().ueid();
let ueid = ArrayVec::from(drivers.soc_ifc.fuse_bank().ueid());
let mut env = DpeEnv::<CptraDpeTypes> {
crypto,
platform: DpePlatform::new(
Expand All @@ -74,7 +75,7 @@ impl InvokeDpeCmd {
&nb,
&nf,
None,
Some(ueid),
Some(&ueid),
),
};

Expand Down

0 comments on commit bc07af4

Please sign in to comment.