Add firmware protection to the environment
This commit is contained in:
12
src/env/test/mod.rs
vendored
12
src/env/test/mod.rs
vendored
@@ -1,4 +1,5 @@
|
||||
use self::upgrade_storage::BufferUpgradeStorage;
|
||||
use crate::api::firmware_protection::FirmwareProtection;
|
||||
use crate::ctap::hid::ChannelID;
|
||||
use crate::ctap::status_code::Ctap2StatusCode;
|
||||
use crate::env::{Env, UserPresence};
|
||||
@@ -38,11 +39,18 @@ impl UserPresence for TestUserPresence {
|
||||
}
|
||||
}
|
||||
|
||||
impl FirmwareProtection for TestEnv {
|
||||
fn lock(&mut self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
impl Env for TestEnv {
|
||||
type Rng = ThreadRng256;
|
||||
type UserPresence = TestUserPresence;
|
||||
type Storage = BufferStorage;
|
||||
type UpgradeStorage = BufferUpgradeStorage;
|
||||
type FirmwareProtection = Self;
|
||||
|
||||
fn rng(&mut self) -> &mut Self::Rng {
|
||||
&mut self.rng
|
||||
@@ -70,4 +78,8 @@ impl Env for TestEnv {
|
||||
fn upgrade_storage(&mut self) -> StorageResult<Self::UpgradeStorage> {
|
||||
BufferUpgradeStorage::new()
|
||||
}
|
||||
|
||||
fn firmware_protection(&mut self) -> &mut Self::FirmwareProtection {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user