Skip to content

feat: show the board's five request words and keep labels to printable ASCII - #19

Merged
TheCryptoDonkey merged 2 commits into
mainfrom
feat/enrol-request-words
Sep 25, 2026
Merged

TheCryptoDonkey merged 2 commits into
mainfrom
feat/enrol-request-words

Conversation

@TheCryptoDonkey

Copy link
Copy Markdown
Member

Companion to forgesworn/heartwood-esp32 feat/phone-enrol-over-relay. Ship together with it.

  • The enrol screen shows five spoken-token words derived from the phone's one-off enrolment key: HMAC-SHA256(P, "heartwood-unlock:enrol-request" || 0u32), en-v1 word list. The board shows the same words on its card. The owner holds the button only if they match, because the phone made the key and a browser's copy proves nothing.
  • fitLabel now reduces labels to printable ASCII (NFKD transliteration, then stripping), because the firmware refuses anything else, on the cable as well.
  • Wording: the check code is compared with the board. If the board says it added the phone but nothing arrives, revoke the id it shows.

Tests: ./gradlew :app:testDebugUnitTest, 243 passed. The four frozen firmware vectors and the word-list SHA-256 are pinned.

Not run on a device; the layout has not been checked on a screen.

… ASCII

The board now shows a four-word request code on its "ADD UNLOCK PHONE"
card, derived from the phone's one-off enrolment pubkey. The owner
must compare it against the phone's own copy before holding the
button, since the phone made the key and a browser's copy proves
nothing. Cambium now derives and shows the same words next to the
enrol code, using spoken-token's en-v1 word list copied verbatim from
the firmware.

The firmware also now refuses any label that is not printable ASCII,
on the cable as well as over the relay. fitLabel transliterates
accented and fullwidth characters to their plain ASCII base via NFKD
decomposition and drops everything else, rather than only trimming to
the byte limit, so it can never hand the board something it will
reject.
The firmware now derives a five-word request code (55 bits) instead
of four; Cambium's requestWords follows the same count and the
updated frozen vectors. The hint text and enrol screen copy are
updated to match: "five words" instead of "four", "the board" rather
than "Sapwood" for where the check code now also shows, and a new
line where Cambium waits for the board's answer, telling the owner to
revoke the id in Sapwood if the board says it added the phone but
nothing arrives here.
@TheCryptoDonkey
TheCryptoDonkey marked this pull request as ready for review September 25, 2026 20:58
@TheCryptoDonkey
TheCryptoDonkey merged commit 912197b into main Sep 25, 2026
2 checks passed
@TheCryptoDonkey TheCryptoDonkey mentioned this pull request Sep 25, 2026
@TheCryptoDonkey
TheCryptoDonkey deleted the feat/enrol-request-words branch September 25, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant