From aea415cca837b397c7e6fe2e4e0503181c542f99 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 1 Feb 2025 02:35:09 +0800 Subject: [PATCH] figure out changes necessary at the external API level --- services/pddb/src/api.rs | 4 ++++ services/pddb/src/lib.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/services/pddb/src/api.rs b/services/pddb/src/api.rs index c5169d217..8417e4070 100644 --- a/services/pddb/src/api.rs +++ b/services/pddb/src/api.rs @@ -148,12 +148,14 @@ pub(crate) enum Opcode { KeyDrop = 20, /// Menu opcodes + #[cfg(feature = "gen1")] MenuListBasis = 21, /// Security state checks IsEfuseSecured = 22, /// Suspend/resume callback + #[cfg(feature = "gen1")] SuspendResume = 23, /// quit the server Quit = 24, @@ -215,12 +217,14 @@ pub(crate) enum Opcode { ListKeyV2 = 45, /// change unlock PIN + #[cfg(feature = "gen1")] MenuChangePin = 46, /// run a test or diagnostic command (depends on the build) InternalTest = 47, /// Clear password cache and ask for it again + #[cfg(feature = "gen1")] UncacheAndAskPassword = 48, /// Unmount the PDDB. diff --git a/services/pddb/src/lib.rs b/services/pddb/src/lib.rs index 3af3e7af1..2e5cd8429 100644 --- a/services/pddb/src/lib.rs +++ b/services/pddb/src/lib.rs @@ -21,6 +21,9 @@ use core::ops::DerefMut; use std::cell::RefCell; use std::convert::TryInto; +#[cfg(feature = "gen2")] +use cram_hal_service::trng; + #[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Debug)] pub enum CbOp { Change, @@ -263,6 +266,7 @@ impl Pddb { /// Computes checksums on the entire PDDB database. This operation can take some time and causes a /// progress bar to pop up. This should be called only after the PDDB has been unmounted, to ensure /// that the disk contents do not change after the checksums have been computed. + #[cfg(feature = "gen1")] pub fn compute_checksums(&self) -> root_keys::api::Checksums { let alloc = root_keys::api::Checksums::default(); let mut buf = Buffer::into_buf(alloc).expect("Couldn't convert memory structure");