diff options
| author | cirakg <cirakg@cirakg.xyz> | 2026-10-25 12:46:42 +0100 |
|---|---|---|
| committer | cirakg <cirakg@cirakg.xyz> | 2026-10-25 12:46:42 +0100 |
| commit | 096b5a4d17c85fa5f87db3e72364e9c3506d1e64 (patch) | |
| tree | 9846544fe7d76d849df4a1ee2058f4847f674e7e /tools/tests/test_gen_fixture_wrap.py | |
| parent | e0384274bbeab999279bdc35bdddbd8a3a451aeb (diff) | |
feat(pin): exactly 4 digits, entered on the 4th digit
The keypad has no OK key; the 4th digit submits, so a tap that also
arrives as START can no longer submit a partial PIN (the likely cause
of "Wrong PIN" before the code opened). PINs set by earlier versions
still unlock and are then replaced by a 4-digit one. Opening an entry
ignores a second request from the same tap. A Require PIN sent from
the phone while the watch is locked now applies at the next PIN
instead of waiting for Confirm all. The linter skips .claude.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tools/tests/test_gen_fixture_wrap.py')
| -rw-r--r-- | tools/tests/test_gen_fixture_wrap.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/tests/test_gen_fixture_wrap.py b/tools/tests/test_gen_fixture_wrap.py index 1c72e66..c7b11d5 100644 --- a/tools/tests/test_gen_fixture_wrap.py +++ b/tools/tests/test_gen_fixture_wrap.py @@ -31,3 +31,11 @@ def test_hkdf_matches_rfc5869_case_3() -> None: def test_generated_wrap_matches_the_fixture() -> None: assert gen_fixture_wrap.fixture_wrap().hex() == fixture_constant("FIXTURE_WRAP") assert gen_fixture_wrap.MASTER_KEY.hex() == fixture_constant("FIXTURE_MASTER_KEY") + + +def test_fixture_pin_has_the_new_pin_length() -> None: + assert gen_fixture_wrap.PIN.decode() == fixture_constant("FIXTURE_PIN") + assert len(gen_fixture_wrap.PIN) == gen_fixture_wrap.PIN_DIGITS + key_manager = (ROOT / "source" / "storage" / "KeyManager.mc").read_text(encoding="utf-8") + assert f"static const PIN_DIGITS = {gen_fixture_wrap.PIN_DIGITS};" in key_manager + assert f'static const PIN_LENGTH_KEY = "{gen_fixture_wrap.PIN_LENGTH_KEY}";' in key_manager |
