Skip to content

Port upstream game fixes: Linux TLS, saves across drives, controllers, alarms - #7

Merged
mitch030504 merged 6 commits into
openxr-workfrom
claude/project-thread-ix2nko
Oct 5, 2026
Merged

mitch030504 merged 6 commits into
openxr-workfrom
claude/project-thread-ix2nko

Conversation

@mitch030504

@mitch030504 mitch030504 commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Requested by Mitch · project thread

Before: on SteamOS and Android, every SSL session the game opens fails. That includes Retro Rewind's login and GameSpy connections, which the fork reroutes to plaintext port 80: the reroute happens at connect time, but the plaintext handshake, read and write existed only in the Windows code. On Linux the stub returned SSL_ERR_FAILED for every session. A save the game moves from its temp folder to a folder on another drive (for example a Retro Rewind save redirected to the SD card) also fails.

After: Linux and Android handle the plaintext Retro sessions and do real TLS for everything else, through mbed TLS 3.6.7 and a bundled Mozilla CA file. Moves across mount points fall back to copying. Several smaller runtime and translator fixes are also included.

How: these are cherry-picks from patchzyy/Wiicompiled since the fork split at 7e6604c, each with -x so the upstream commit is recorded:

Validation:

  • Translator tests pass (658 of 658, dotnet test translator/Translator.sln -c Release).
  • The changed runtime sources (network_ssl.cpp, network_core.cpp, network_socket.cpp, nand_api.cpp, os_alarm.cpp) compile with clang++ -fsyntax-only, using the mbed TLS 3.6.7 headers.
  • No full runtime build was run: this environment can't download Aurora's dependencies from GitHub. The pad, input and wizard changes were not compiled here. They apply cleanly and use APIs that exist in the fork.
  • Nothing has been tested on the headset yet. That needs a Frame build, then a Retro Rewind online login and a save.

🤖 Generated with Claude Code

https://claude.ai/code/session_011tcyLz63pXjoYEwsFjfg8F

DaanVervacke and others added 4 commits October 5, 2026 12:56
* Fix NAND moves across mount points

* Harden cross-mount NAND move fallback

* Preserve directory copy on NAND move cleanup failure

* Clarify NAND move cleanup behavior

* Use exclusive scratch paths for NAND moves

* Copy NAND move directories into reserved destination

* Publish NAND move directories without replacement

(cherry picked from commit 8346376)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011tcyLz63pXjoYEwsFjfg8F
patchzyy#251)

* Fix macOS controller platform, sync player indices, and preserve socket send error

- Preserve captured socket send error across diagnostic logging in network_socket.cpp
- Use SDL_GetPlatform() instead of hardcoded Windows in controller mapping wizard
- Synchronize Aurora and SDL player indices on port assignment and clear in pad.cpp
- Auto-assign Player 1 on macOS when unconfigured in input.cpp

* fix(input): refine macOS port 0 assignment and persistence logic

- Persist port 0 preference for newly connected controller even if already assigned player index 0
- Verify controller has no preference on other ports before assigning to port 0

(cherry picked from commit 85f2501)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011tcyLz63pXjoYEwsFjfg8F
(cherry picked from commit 583e702)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011tcyLz63pXjoYEwsFjfg8F
* Implement real TLS for non-Windows via vendored mbed TLS

Windows gets TLS for the guest network HLE's SSL ioctlvs for free from
Schannel; every other platform fell into a stub that always returned
failure, meaning any HTTPS-based network feature (WFC login, fetching
the Retro-WFC payload) silently could not work at all on those
platforms regardless of server availability.

Vendors mbed TLS 3.6.7 LTS under runtime/third_party/mbedtls (same
convention as Crypto++/pugixml - a real source checkout, not a
submodule/FetchContent download) and a standard Mozilla CA bundle
(runtime/assets/certs/cacert.pem, via curl.se's redistribution) copied
next to the built product the same way dsp_coef.bin already is.

Verified against real HTTPS servers: a valid certificate completes the
handshake and an HTTP round-trip; a known-expired certificate is
correctly rejected with a real X509 verification failure, not silently
accepted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qmdewk7VfVVJTfCVd2WStu

* Fix TLS handshake hang and partial-write truncation on non-Windows

Add a POSIX socket timeout to match Windows' existing 15s one, plus a
deadline on the handshake retry loop itself, so a peer that accepts the
TCP connection but never sends TLS data can no longer hang the thread
forever. Also fix SslWrite to loop on partial mbedTLS writes instead of
returning the first partial count, and add mbedTLS to
THIRD-PARTY-NOTICES.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Fetch mbedTLS from a pinned, checksum-verified release instead of vendoring it

Replace the committed mbedTLS source tree with a CMake FetchContent download
of the official mbedtls-3.6.7 release tarball, verified against its signed
SHA-256, matching how aurora-main's own dependencies (SDL, zlib, etc.) are
pulled in. Ships the compiled dependency instead of ~280 tracked upstream
files. CA bundle packaging and THIRD-PARTY-NOTICES.md coverage are unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Limit the mbedTLS dependency to the platforms that use it

The FetchContent block ran on every platform, including Windows, whose builds
configure with FETCHCONTENT_FULLY_DISCONNECTED=ON against the offline
dependency set from Launcher/Prepare-Dependencies.ps1 - which has no
mkw_mbedtls_upstream entry, so a clean Windows configure failed. Windows
compiles the Schannel path (network_ssl.cpp is `#ifndef _WIN32` for mbed TLS)
and never links mbed TLS, so nothing needs preparing there: the fetch, the
linkage and the cacert.pem copy are now guarded to non-Windows, while the
mkw::mbedtls alias stays defined everywhere so the link lines in
PublicProducts.cmake remain platform-independent.

Also copy cacert.pem alongside the installed executable in the Linux and macOS
publication paths (Launcher/local-build.sh and Launcher/macos/publish-app.command),
which already copied the other runtime assets but left the TLS root bundle in
the build directory, so published builds could not verify any certificate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Harden mbed TLS socket I/O handling

* delete wii socket

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: patchzyy <64382339+patchzyy@users.noreply.github.com>
(cherry picked from commit b59e035)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011tcyLz63pXjoYEwsFjfg8F
@mitch030504 mitch030504 self-assigned this Oct 5, 2026
claude added 2 commits October 5, 2026 12:58
From patchzyy/Wiicompiled 6f14bde (patchzyy#244), runtime and translator parts only:
- Keep KD and NCD devices available while networking is off; only IP and
  SSL need the network.
- Run RFLiIsWorking's alarm pump in a private interrupt context so callback
  register writes don't clobber the caller, and release the alarm recursion
  guard before rescheduling.
- Share one LR continuation dispatch per translated function when it has
  several continuation calls.

The renderer half of that commit is left out: it conflicts with the stereo
renderer, and upstream reverted part of it (e409d9f) for stutters.

(cherry picked from part of commit 6f14bde)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011tcyLz63pXjoYEwsFjfg8F
The mbed TLS path looks for cacert.pem in the runtime resources folder on
Android, the same place as dsp_coef.bin.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011tcyLz63pXjoYEwsFjfg8F
@mitch030504
mitch030504 force-pushed the claude/project-thread-ix2nko branch from 8ae1cd6 to cfb9623 Compare October 5, 2026 12:58
@mitch030504
mitch030504 marked this pull request as ready for review October 5, 2026 13:14
@mitch030504
mitch030504 merged commit a132a82 into openxr-work Oct 5, 2026
2 checks passed
@mitch030504
mitch030504 deleted the claude/project-thread-ix2nko branch October 5, 2026 13:15
mitch030504 pushed a commit that referenced this pull request Oct 5, 2026
Bootstrap seeding only created missing files, so a WC24 file that had
been emptied (nwc24dl.bin, nwc24fl.bin, misc.bin) stayed at zero bytes
on every boot. WC24 rejects a zero-length download or friend list and
MKW reports that as a save error, which matters now that #7 lets KD
open while offline. A file is re-copied only when it is empty and the
payload's copy is not, so player data is never replaced.

Adapted from nx-mod/wiicompiled-nx d0149e6. That version falls through
to copy_file with copy_options::none, which fails on the existing empty
file; this one overwrites in that case only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018NKSMYZU43wUfYtm1sxGsC
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.

6 participants