diff options
Diffstat (limited to 'test/storage/PinTest.mc')
| -rw-r--r-- | test/storage/PinTest.mc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/storage/PinTest.mc b/test/storage/PinTest.mc index 7dc677d..0212936 100644 --- a/test/storage/PinTest.mc +++ b/test/storage/PinTest.mc @@ -248,3 +248,16 @@ function pinKeyBuffersAreWiped(logger as Test.Logger) as Boolean { keys.wipe(); return derived && wiped && StorageFixtures.allZero(keys.encKey) && StorageFixtures.allZero(keys.macKey); } + +// The UI-test fixture's wrap was computed in Python (tools/gen_fixture_wrap.py); +// the app's unlock code must accept it with the fixture PIN and recover the +// fixture master key, which cross-checks the wrap format. +(:test) +function pinOpensThePythonComputedFixtureWrap(logger as Test.Logger) as Boolean { + var store = new MemoryBackend(); + store.setValue(KeyManager.WRAP_KEY, Bytes.fromHex(Fixtures.FIXTURE_WRAP)); + var vault = new Vault(store, new FakeTime()); + var wrongRejected = !StorageFixtures.unlock(vault, StorageFixtures.OTHER_PIN); + var opened = StorageFixtures.unlock(vault, Fixtures.FIXTURE_PIN); + return wrongRejected && opened && Bytes.equal(vault.session.masterKey(), Bytes.fromHex(Fixtures.FIXTURE_MASTER_KEY)); +} |
