feat(libSceLibreSsl): select advertised application protocols #9785
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9785"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-22T14:51:22Z.
What
Implement
SSL_select_next_proto(CpIzEs1Q1Ug) for valid wire-format protocol lists. The first peer-preferred match returns a borrowed pointer into the peer list and status 1; no overlap returns the first supported protocol and status 2. Names are byte strings and may contain zero or high-bit bytes.The six-argument signature and valid-input contract follow LibreSSL 3.4.1 ssl.h and ssl_lib.c, with no new dependency.
BunnyFl's independent firmware 13.42 report executed the decrypted
libSceLibreSsl.sprxon a host PC, not console hardware. It reports matching six-argument valid-list status, selected-list offset and length across 200,000 random pairs repeated three times plus 500,000 pairs with a second seed. Its invalid-list observations differ from the current guards: zero-length names can be selected, fallback lengths are unchecked, and an empty supported list is read. Those paths remain unsupported and are recorded as functional debt. Null outputs were not measured. This is attributed evidence, not a local firmware run.Tested
Submitted and tested head
809350e09cfbe0cfc6156a15b842e9c89012f59a, including upstream main48c160c58b589157ebd94ebd53736a182f8303bf.Windows 11 x64 / WinLibs GCC 15.2.0 r7 and local Ubuntu 24.04.1 x86-64 under WSL2 / GCC 13.3.0 / glibc 2.39: Ninja Release, bundled dependencies,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=OFF. On each platform the completelibstarget and selected test executables build, and 68/68 CTests pass, zero skips: the public-header audit, all 64 public-header compilation batches and 3 focused runtime tests. The new upstream JPEG XR and updated SPIR-V dependencies use their pinned submodule commits. Both normal-symbol and actual packaged-NID modes exercise the 7,056 generated protocol-list pairs and valid-list boundaries, alongside the packaged-library loader.Final upstream recheck:
88795ed44801fa719eb2df990cbe1f11a1f9bd81merges cleanly; no FreeType/LibreSSL production, shared-header, test-registration or debt changes appeared after the tested base. Results remain pinned to the exact submitted head and its stated base.Conventions, whitespace and all 15 pairwise merge checks across the six maintained PRs pass. Open/closed/merged history was rechecked; no replacement implementation was found.
The earlier macOS report by @jotitadev used Apple M2 Max, macOS 27.2, Xcode 27 and x86-64 under Rosetta on #8658 at
fa063d8b07plus the original diff and conditional libc-link fix. That host-support PR was closed for splitting. It remains attributed historical evidence; no fresh macOS runtime host is available here, so validation on the current macOS stack remains outstanding. No title or physical-console execution is claimed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-22T14:51:54Z.
@Felipebmaitan This PR only implements
SSL_select_next_proto; the local overlap audit found no shared exports, implementation changes, or new files with #9535, #9536 or #9571. The remaining overlap is where the debt sections are inserted.Proposed merge order for that documentation: #9785 first, then #9535 -> #9536 -> #9571, retaining the protocol entry when those branches are rebased. There is no code/build dependency. If your stack lands first, I will rebase this PR and place its entry alongside the merged sections instead. Please let me know if you prefer a different order.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T16:31:21Z.
Review: DISMISSED
The exact protocol-selection function passes the PR’s own
GuestLibreSslProtocol.cppharness locally: 7,056 generated list pairs plus the boundary and malformed-input cases. I compiled the exact PR source and harness into a temporary shared object with a throwing stub forNotImplemented_nid_no_patch; this validates the selection algorithm, but not the packaged-library/NID path or the full build.check_conventions.pyandgit diff --checkagainst current main pass. The PR reports a full Windows build and 3/3 packaged tests; upstream PR checks currently run policy checks only and skip product builds.The branch is eight commits behind live
main(8499ea52e571b0edfc1feecfd3f6b9944012b359). CONTRIBUTING.md requires branches to be based on and kept up to date withmain. Please update the branch and rerun the reported full build and packaged-library/NID tests on the resulting head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T16:56:30Z.
Review: COMMENTED
I rechecked exact head
19230580171979188d3d86b3229ddbd3d708526cagainst currentmain(11f976b27c16ed91633f00039dba5dfd97dd7cc1). Conventions and diff-check pass; the merge tree is clean. The reported Windows build and protocol/packaged-library 3/3 results are contributor-run, while hosted product builds are skipped. I previously ran the exact source/harness algorithm locally (7,056 generated protocol-list pairs and malformed/boundary cases), but that does not validate the packaged NID path. The author’s overlap note proposes the documentation order for #9535/#9536/#9571 and no code overlap. This branch is 21 commits behind current main; please rebase and rerun the focused packaged-library/NID tests on the new head before merge.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-23T06:12:47Z.
Review: COMMENTED
macOS test:
guest_libressl_protocol_nidloads the unpatched libcApple M2 Max, macOS 27.2, Apple clang (Xcode 27), x86-64 Release build under Rosetta 2,
BUILD_TESTING=ON, full default build. Head1ec05748ff.maindoes not build on macOS, so the platform is #8658 (feat/macos-port) @fa063d8b07with this PR's diff applied (clean apply).guest_libressl_protocolpasses.guest_libressl_protocol_nidaborts:guest_libressl_protocol_testslinkslibcon every platform, so the process starts withunpatched/libc.prxloaded. Both libc builds have the install name@rpath/libc.prx, so when the patchedlibkernel.prxasks for@rpath/libc.prx, dyld reuses the unpatched image that is already loaded, and it has no NID exports.guest_jxr_lookup_testsin #9954 avoids this by linkinglibconly on Windows. Doing the same inProtocolSelection.cmakefixes it here:With that change both tests pass 3/3 (
--repeat until-fail:3). I did not run Linux here, but the same pattern failed on Linux in #9646 (patched tests could not resolve NIDs untillibcwas linked only on Windows), so this is likely not macOS-only.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.