diff options
Diffstat (limited to 'source/app')
| -rw-r--r-- | source/app/Fixtures.mc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/app/Fixtures.mc b/source/app/Fixtures.mc index 7c21d9a..01b15a8 100644 --- a/source/app/Fixtures.mc +++ b/source/app/Fixtures.mc @@ -9,8 +9,9 @@ // FIXTURE_WRAP is that PIN's wrap of FIXTURE_MASTER_KEY, precomputed by // tools/gen_fixture_wrap.py (fake salt, IV and key): deriving the PIN key on // the watch in one event trips the watchdog, so the fixture stores the -// result. Unlocking it with the app's own code also cross-checks the wrap -// format against the Python implementation (test/storage/PinTest.mc). +// result, with the 4-digit PIN marker (KeyManager.PIN_LENGTH_KEY). +// Unlocking it with the app's own code also cross-checks the wrap format +// against the Python implementation (test/storage/PinTest.mc). import Toybox.Application; import Toybox.Lang; @@ -18,8 +19,8 @@ import Toybox.Lang; (:debug) module Fixtures { - const FIXTURE_PIN = "123456"; - const FIXTURE_WRAP = "101112131415161718191a1b1c1d1e1f000007d001202122232425262728292a2b2c2d2e2f857b961d4854e06740f602627bfb952efaac5383e800768221bf3a7b292ee881e2ce2f76b9dd744b2ac32322473df351929bc6dfcbfc2941527ae8b90614a8a6a6bd0f72d33161bafd16b1039caa670c"; // lint: allow-literal (fake fixture) + const FIXTURE_PIN = "1234"; + const FIXTURE_WRAP = "101112131415161718191a1b1c1d1e1f000007d001202122232425262728292a2b2c2d2e2f133549536635b7a7ae3add45a59c42953d4c666538390a99305164dba9c99961e7148e1c561b6cfc70cfde7f9e3e59179464ce65bf91dd08807ff8a52027d77c90c2b692ca22fe4cbd3fb20ffb440137"; // lint: allow-literal (fake fixture) const FIXTURE_MASTER_KEY = "404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"; // lint: allow-literal (fake fixture) // Erase all app storage (UI-test build only). @@ -33,6 +34,7 @@ module Fixtures { function load(vault as Vault) as Void { if (TestMode.ON && !vault.hasPin()) { Application.Storage.setValue(KeyManager.WRAP_KEY, Bytes.fromHex(FIXTURE_WRAP)); + Application.Storage.setValue(KeyManager.PIN_LENGTH_KEY, KeyManager.PIN_DIGITS); vault.session.unlock(Bytes.fromHex(FIXTURE_MASTER_KEY)); } var rfcKey = "12345678901234567890"; // lint: allow-literal (RFC 4226 test key) |
