From 096b5a4d17c85fa5f87db3e72364e9c3506d1e64 Mon Sep 17 00:00:00 2001 From: cirakg Date: Sun, 25 Oct 2026 12:46:42 +0100 Subject: 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 --- tools/tests/test_gen_fixture_wrap.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools/tests/test_gen_fixture_wrap.py') 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 -- cgit v1.2.3