feat: show the board's five request words and keep labels to printable ASCII - #19
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to forgesworn/heartwood-esp32
feat/phone-enrol-over-relay. Ship together with it.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.fitLabelnow reduces labels to printable ASCII (NFKD transliteration, then stripping), because the firmware refuses anything else, on the cable as well.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.