fix(aoss): restore WLAN arguments and complete key bounds #1038

Merged
coah80 merged 1 commits from agent/bittle/aoss-key-contract-review into main 2026-10-03 04:18:15 +00:00
coah80 commented 2026-10-03 04:17:24 +00:00 (Migrated from github.com)

Two source contracts, separately measured

  1. AOSSConnectAndAwaitHost was calling AOSSi_WLANConnect through a false zero-argument declaration. The original wrapper forwards incoming r3/r4, and the callee consumes connection/status pointers. Restore the actual two-argument declaration and explicit call, using forward-declared existing struct tags.
  2. The cipher consumes ten contiguous key bytes, but source supplied a two-byte nonce array and read onward into its neighboring eight-byte address field. Introduce a real ten-byte AOSSKeyMaterial subobject and pass a byte view of that complete object in decrypt/hello paths. Layout remains nonce0/address2/payload10, total104 bytes, with no padding or added storage.

Independent parent verification

  • All 1027 allocated objects/relocations and complete report unchanged; existing exact code/data preserved
  • Wrapper remains 60/60 exact; its target prologue preserves r3/r4 until the WLAN call, and actual callee entry saves both inputs
  • Parent reran 30600 production-source pointer-forwarding/timeout/error cases and 68423 key-layout/full-nonce-range/decrypt/hello cases under ASan/UBSan
  • Leak checks disabled due executor ptrace; no leak-check claim
  • Key-only checkpoint is whole-object byte-identical; initial call fix changes only compiler-generated nonallocated local symbol names
  • Pool1/1; literal advisory checks12 arguments in19 functions, explicitly skipping unequal-sized AOSS_Init_old and AOSSSendHelloRequest
  • Full43U all_source/report/progress/DOL and worktree/diff checks pass

No matching percentage gain, live network/Wii execution, protocol hardening, shared-header, metadata, compiler or linking changes. Deeper opaque representations are not claimed globally type-consistent.

Base: 74dcb16a50
Tested tree: 6467a15aeb
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d

No merge performed or requested by this author.

Note

Fix AOSS WLAN call arguments and unify key material struct

  • Restores the missing arguments to the AOSSi_WLANConnect call: AOSSConnectAndAwaitHost now forwards its settings and config pointers, and the interface declaration is updated to accept connection and status pointers
  • Introduces an AOSSKeyMaterial type holding the nonce and access-point address, replacing the separate members in s_packetState; AOSSDecryptMessage and AOSSSendHelloRequest now pass the complete key-material object to the key schedule, keeping the ten-byte key and field order unchanged
  • Adds decomp-assist reports covering the call-contract fix and the key-material change in AOSS.c
  • Behavioral Change: AOSSi_WLANConnect now takes two pointer arguments instead of none; the payload member in s_packetState follows the embedded key-material object

Macroscope summarized 939902f.

## Two source contracts, separately measured 1. AOSSConnectAndAwaitHost was calling AOSSi_WLANConnect through a false zero-argument declaration. The original wrapper forwards incoming r3/r4, and the callee consumes connection/status pointers. Restore the actual two-argument declaration and explicit call, using forward-declared existing struct tags. 2. The cipher consumes ten contiguous key bytes, but source supplied a two-byte nonce array and read onward into its neighboring eight-byte address field. Introduce a real ten-byte AOSSKeyMaterial subobject and pass a byte view of that complete object in decrypt/hello paths. Layout remains nonce0/address2/payload10, total104 bytes, with no padding or added storage. ## Independent parent verification - All 1027 allocated objects/relocations and complete report unchanged; existing exact code/data preserved - Wrapper remains 60/60 exact; its target prologue preserves r3/r4 until the WLAN call, and actual callee entry saves both inputs - Parent reran 30600 production-source pointer-forwarding/timeout/error cases and 68423 key-layout/full-nonce-range/decrypt/hello cases under ASan/UBSan - Leak checks disabled due executor ptrace; no leak-check claim - Key-only checkpoint is whole-object byte-identical; initial call fix changes only compiler-generated nonallocated local symbol names - Pool1/1; literal advisory checks12 arguments in19 functions, explicitly skipping unequal-sized AOSS_Init_old and AOSSSendHelloRequest - Full43U all_source/report/progress/DOL and worktree/diff checks pass No matching percentage gain, live network/Wii execution, protocol hardening, shared-header, metadata, compiler or linking changes. Deeper opaque representations are not claimed globally type-consistent. Base: 74dcb16a50a803604362b80e7d535744b0b765d1 Tested tree: 6467a15aebef583e4d3278b1b912b7efdcf4091f DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d No merge performed or requested by this author. <!-- Macroscope's pull request summary starts here --> <!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. --> <!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. --> > [!NOTE] > ### Fix AOSS WLAN call arguments and unify key material struct > - Restores the missing arguments to the `AOSSi_WLANConnect` call: `AOSSConnectAndAwaitHost` now forwards its settings and config pointers, and the interface declaration is updated to accept connection and status pointers > - Introduces an `AOSSKeyMaterial` type holding the nonce and access-point address, replacing the separate members in `s_packetState`; `AOSSDecryptMessage` and `AOSSSendHelloRequest` now pass the complete key-material object to the key schedule, keeping the ten-byte key and field order unchanged > - Adds decomp-assist reports covering the call-contract fix and the key-material change in [AOSS.c](https://github.com/coah80/wii-ipl/pull/1038/files#diff-c9d178769a3c839c7dccd0eba548dd59c264dfe097f6aa29f6df6f8bb7546c98) > - Behavioral Change: `AOSSi_WLANConnect` now takes two pointer arguments instead of none; the payload member in `s_packetState` follows the embedded key-material object > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 939902f.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 04:18:13 +00:00 (Migrated from github.com)

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.
Sign in to join this conversation.