Skip to content

fix: a merged update is accepted when hactool's unverifiable signature checks print (FAIL) - #46

Merged
ly05010419 merged 1 commit into
ly05010419:mainfrom
oneincase:fix/bktr-signature-lines
Oct 19, 2026
Merged

ly05010419 merged 1 commit into
ly05010419:mainfrom
oneincase:fix/bktr-signature-lines

Conversation

@oneincase

Copy link
Copy Markdown
Contributor

hactool also checks the NCA's fixed-key signature and the NPDM signature. Without Nintendo's public keys it can only report those two lines as (FAIL), and merge() scanned the whole log for (FAIL) — so a merge that succeeded stopped with ValueError: BKTR verification failed even though all six IVFC levels were (GOOD) and the extracted image matched the version's pinned SHA-256 (verified on 1.0.0 + 1.4.3: romfs_sha256 797e66f2efa5b99bdafe4af2d6e778a5ef2f2ca5dc3b45136dd601daea419e9b, the value pinned for 1.4.3).

The pinned fast path stays as it was; only those two declaration lines are filtered before the failure scan. The six IVFC levels and the image SHA-256 are still the deciding checks, and the failure log still keeps hactool's whole output (long hex still redacted).

  • games/totk/scripts/extract_update_romfs.py: build checked = log minus the two signature lines; the failure branch and require(...) judge checked, the failure log still writes log.
  • tests/test_updates.py: regression test with a mock hactool that prints both lines plus all six Level i (GOOD); the merge is accepted and its output image compared.

python -m unittest discover -s tests passes (84 tests; the two that need cryptography run with games/totk/requirements.txt installed).

Fixes #44.

…e checks print (FAIL)

hactool also checks the NCA's fixed-key signature and the NPDM signature.
Without Nintendo's public keys it can only report those two lines as (FAIL),
which the merge step's log scan read as a data failure: the build stopped with
"BKTR verification failed" although every IVFC level was (GOOD) and the image
matched the version's pinned SHA-256.

Filter those two lines out of the log scan; the six IVFC levels and the image
SHA-256 remain the deciding checks, and the failure log still keeps the whole
output. Add a regression test that mocks hactool printing both lines on a
successful merge.
@ly05010419
ly05010419 merged commit d66bea3 into ly05010419:main Oct 19, 2026
1 check passed
@oneincase
oneincase deleted the fix/bktr-signature-lines branch October 20, 2026 01:33
ly05010419 added a commit that referenced this pull request Oct 20, 2026
…ultrawide HUD, 1.4.3 survey, mods, controls.txt) into the Breath of the Wild branch

Resolved by hand: nvn_mtl.m (PR #34's paged-bitmap serial sets keep the serial forgetting of 635fb31: totk_serial_del
clears a bit; the memory line shows both; the BotW frame reset stays in mtl_present), build_app.py (make -j and the
per-game launcher defines), the Makefile (the BotW targets and the Opus test), loader.c (the #57 stale-reference handler
and 1.4.3's survey return address are TOTK-only: Breath of the Wild has no GAME_ADDR for them), world_survey.c (BotW
keeps its stub, with runtime_survey_sync), README (both update-history rows).

Found by the merged build: Breath of the Wild lacked runtime_output_size_current (frontend.m's shortcut text) and
runtime_survey_sync (hle_nvn.c); and the add-on content file handles shared fs_host.c's 0x200000000 range, so closing a
host file at the title ended the game ("close invalid add-on content handle"): they now start at 0x400000000.

Tested on the merged binaries: TOTK 1.2.1 jump session (anomalies 0, occlusion normal, serial set 48,606 / 13 pages),
Breath of the Wild DLC + key 3 (k3a6) and key 2 (k2c, 11 of 12 pairs within 5 px).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.

extract_update_romfs.py: 'BKTR verification failed' on a successful merge (hactool's unverifiable signature lines trip the log regex)

2 participants