Add firmware protection to the environment

This commit is contained in:
Julien Cretin
2022-03-04 11:24:10 +01:00
parent b80b67e2cf
commit bb40e3244a
6 changed files with 38 additions and 3 deletions

4
src/env/mod.rs vendored
View File

@@ -1,3 +1,4 @@
use crate::api::firmware_protection::FirmwareProtection;
use crate::api::upgrade_storage::UpgradeStorage;
use crate::ctap::hid::ChannelID;
use crate::ctap::status_code::Ctap2StatusCode;
@@ -21,6 +22,7 @@ pub trait Env {
type UserPresence: UserPresence;
type Storage: Storage;
type UpgradeStorage: UpgradeStorage;
type FirmwareProtection: FirmwareProtection;
fn rng(&mut self) -> &mut Self::Rng;
fn user_presence(&mut self) -> &mut Self::UserPresence;
@@ -34,4 +36,6 @@ pub trait Env {
///
/// This function is called at most once. Implementation may panic if called more than once.
fn upgrade_storage(&mut self) -> StorageResult<Self::UpgradeStorage>;
fn firmware_protection(&mut self) -> &mut Self::FirmwareProtection;
}