figure out changes necessary at the external API level

This commit is contained in:
bunnie 2025-02-01 02:35:09 +08:00
parent 73458dbd4c
commit aea415cca8
2 changed files with 8 additions and 0 deletions

View file

@ -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.

View file

@ -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");