feat(storage): per-app/owner/system encryption live: gatekeeper hands seed + fresh flag, storage unlocks layer, init seeds areas from factory/ (empties on new key); rmdir op; test-qemu checks sealed home + reboot persistence
This commit is contained in:
@@ -101,7 +101,11 @@ fn memory() -> Vec<Block> {
|
||||
}
|
||||
|
||||
fn run_with(dev: &mut Device, owner: &mut Owner) -> Result<keystore::Key, Failure> {
|
||||
run(dev, &mut Counter(5), owner, FAST, &mut memory())
|
||||
run(dev, &mut Counter(5), owner, FAST, &mut memory()).map(|u| u.key)
|
||||
}
|
||||
|
||||
fn fresh(dev: &mut Device, owner: &mut Owner) -> bool {
|
||||
run(dev, &mut Counter(5), owner, FAST, &mut memory()).unwrap().fresh
|
||||
}
|
||||
|
||||
/// A device set up with passcode 1234 and duress 0000; its master key.
|
||||
@@ -219,3 +223,11 @@ fn a_duress_whose_wipe_is_torn_still_wipes_next_boot() {
|
||||
dev.cut_after = None;
|
||||
assert!(dev.record().unwrap().must_wipe(), "the duress was recorded before the wipe began");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn only_a_new_master_key_counts_as_fresh() {
|
||||
let mut dev = Device::new();
|
||||
assert!(fresh(&mut dev, &mut Owner::types(&["1234", "1234", "0000", "0000"])), "first boot");
|
||||
assert!(!fresh(&mut dev, &mut Owner::types(&["1234"])), "an unlock");
|
||||
assert!(fresh(&mut dev, &mut Owner::types(&["0000", "5678", "5678", "", ""])), "after a duress wipe");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user