transport: reset sessions on connect - #13
Merged
Merged
Conversation
This was referenced Sep 17, 2026
benma
marked this pull request as ready for review
September 17, 2026 14:37
Disconnecting after an intermediate signing response leaves the firmware waiting for a continuation while the device stays powered. On reconnect, the old workflow consumes the first unlock request and returns an encrypted error. Pairing can still succeed because the unlock response is ignored, masking the stale session. Send HWW_REQ_RESET (0x03) after version discovery and before unlock and Noise pairing on firmware v9.28.0 or newer. Keep the helper private, retry BUSY responses once per second, and require an ACK without a payload. Older firmware keeps its existing connection flow. Invalid reset replies use the internal `resetSession` code and surface as `communication error: error resetting session` through the public API. Add unit coverage for the version gate, startup order, BUSY retries, malformed reset replies and public error mapping. Add a simulator regression that disconnects with signing unfinished, reconnects to the same running process, checks the real unlock response, pairs, and reads the root fingerprint. Firmware counterpart: BitBoxSwiss/bitbox02-firmware#2111 Related client PRs in this change: - [Go #187](BitBoxSwiss/bitbox02-api-go#187) - [Rust #134](BitBoxSwiss/bitbox-api-rs#134)
benma-agent
force-pushed
the
benma-agent/reset-session
branch
from
September 29, 2026 10:13
6b473fd to
0989eff
Compare
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.
Disconnecting after an intermediate signing response leaves the firmware
waiting for a continuation while the device stays powered. On reconnect,
the old workflow consumes the first unlock request and returns an
encrypted error. Pairing can still succeed because the unlock response is
ignored, masking the stale session.
Send HWW_REQ_RESET (0x03) after version discovery and before unlock and
Noise pairing on firmware v9.28.0 or newer. Keep the helper private, retry
BUSY responses once per second, and require an ACK without a payload.
Older firmware keeps its existing connection flow. Invalid reset replies
use the internal
resetSessioncode and surface ascommunication error: error resetting sessionthrough the public API.Add unit coverage for the version gate, startup order, BUSY retries,
malformed reset replies and public error mapping. Add a simulator
regression that disconnects with signing unfinished, reconnects to the
same running process, checks the real unlock response, pairs, and reads
the root fingerprint.
Firmware counterpart: BitBoxSwiss/bitbox02-firmware#2111
Related client PRs in this change: