Skip to content

bootloader: support current firmware hash formats - #195

Merged
benma merged 1 commit into
BitBoxSwiss:masterfrom
benma-agent:benma-agent/bootloader-firmware-hashes
Nov 3, 2026
Merged

benma merged 1 commit into
BitBoxSwiss:masterfrom
benma-agent:benma-agent/bootloader-firmware-hashes

Conversation

@benma-agent

Copy link
Copy Markdown
Contributor

Stage1 bootloaders hash the product ID along with the firmware, and
v1.2.3 adds a 0x01 format prefix. The legacy hash helper therefore
misidentifies erased flash and causes the app to classify a valid
latest firmware installation as broken.

Support all three formats, selecting the release format from the
monotonic firmware version (legacy through 50, product ID from 51,
format prefix from 57). HashFirmware now takes the product and
returns errors for unknown products or oversized images.

Erased selects the format using the running bootloader version.
The v9.27.2 intermediate leaves the firmware counter at 56 after
installing v1.2.3, so the counter cannot identify the erased-flash
hash format.

Stage1 bootloaders hash the product ID along with the firmware, and
v1.2.3 adds a 0x01 format prefix. The legacy hash helper therefore
misidentifies erased flash and causes the app to classify a valid
latest firmware installation as broken.

Support all three formats, selecting the release format from the
monotonic firmware version (legacy through 50, product ID from 51,
format prefix from 57). HashFirmware now takes the product and
returns errors for unknown products or oversized images.

Erased selects the format using the running bootloader version.
The v9.27.2 intermediate leaves the firmware counter at 56 after
installing v1.2.3, so the counter cannot identify the erased-flash
hash format.
@benma
benma requested a review from cedwies November 3, 2026 12:52
@benma
benma marked this pull request as ready for review November 3, 2026 12:52

@cedwies cedwies left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@benma
benma merged commit bdd3532 into BitBoxSwiss:master Nov 3, 2026
3 checks passed
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.

3 participants