Skip to content

fix: stop refusing private-key writes on a config-mode guess - #239

Open
bmatusiak wants to merge 2 commits into
trustcrypto:release/5.7.0-modern-rewritefrom
bm-ok:release/5.7.0-modern-rewrite
Open

fix: stop refusing private-key writes on a config-mode guess#239
bmatusiak wants to merge 2 commits into
trustcrypto:release/5.7.0-modern-rewritefrom
bm-ok:release/5.7.0-modern-rewrite

Conversation

@bmatusiak

Copy link
Copy Markdown
Member

Advanced refused to send when the store's isConfigMode read false, showing "Put your OnlyKey in config mode (flashing red LED)" to users whose key was in config mode with the LED flashing. The flag is an inference - the firmware reports the same UNLOCKED status either way - and it reads false whenever the app missed the one transition that sets it, such as starting up with the key already in config mode. There was no way to recover from inside the app.

The legacy app carries the same flag but never gated a write on it, so this was a regression introduced by the rewrite. Removing the gate restores that behaviour: send, and let the device answer. Its refusal already routes through the existing catch blocks, and formatDeviceLockedError turns "Error not in config mode" into the instructions - so nothing there needs changing now that the firmware names the right reason.

Measured end to end against the emulator: in config mode the wipe reports "Private key wiped from slot 101", and outside it the user gets the config-mode instructions rather than "unlock your device". The protocol side is pinned by onlykey-testing
01-protocol/27-config-mode-observability.

ok-diy1 and others added 2 commits September 1, 2026 16:11
Advanced refused to send when the store's isConfigMode read false,
showing "Put your OnlyKey in config mode (flashing red LED)" to users
whose key was in config mode with the LED flashing. The flag is an
inference - the firmware reports the same UNLOCKED status either way -
and it reads false whenever the app missed the one transition that sets
it, such as starting up with the key already in config mode. There was
no way to recover from inside the app.

The legacy app carries the same flag but never gated a write on it, so
this was a regression introduced by the rewrite. Removing the gate
restores that behaviour: send, and let the device answer. Its refusal
already routes through the existing catch blocks, and
formatDeviceLockedError turns "Error not in config mode" into the
instructions - so nothing there needs changing now that the firmware
names the right reason.

Measured end to end against the emulator: in config mode the wipe
reports "Private key wiped from slot 101", and outside it the user gets
the config-mode instructions rather than "unlock your device". The
protocol side is pinned by onlykey-testing
01-protocol/27-config-mode-observability.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants