feat(ssl): implement context-scoped PS5 certificate PEM reading #6511

Merged
JJenkx merged 3 commits from upstream-pr/6511 into main 2026-10-19 03:01:15 +00:00
JJenkx commented 2026-10-15 18:08:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-15T18:08:37Z.


What

Implement sceSslGetPem with the PS5 context-first four-argument call: context, certificate, caller-owned destination and in/out size_t length. A null destination queries the size; short buffers throw before writing. The PEM backend originated in jagrat Singh’s #5969 proposal; that PR merged without PEM.

Both #5953 and #5969 are now merged. This refresh removes their prerequisite commits and retains main’s serial/name, validity and fingerprint readers and tests unchanged, including its unknown-context checks. The remaining regression checks PEM query/copy guards and the PS5 reader call shapes, context ownership and snapshot lifetime.

Static inspection of PPSA28002 confirms the four-argument PEM call, caller-owned buffer and 64-bit length; PPSA17330/PPSA28002 establish the serial/name call shapes. This is call-shape evidence, not console error precedence or exact PEM length semantics. Remaining uncertainty is recorded in library debt.

Overlap review: #6828 has merged. This refresh preserves its TLS transport implementation, transport tests and debt; the conflicts were resolved by retaining both test registrations and adding only the PEM debt entry. #7319 concerns TLS transport, not PEM reading. #6044 reorganizes test paths and registration; #6039 moves unrelated debt. Neither is a prerequisite for PEM.

Tested

Latest refresh: three linear commits on main 40393b0f959c, head f4630b2144. The debt conflict retains main’s updated TLS verify-option documentation and adds only the PEM limitation entry. All four SSL test executables and their library dependencies rebuilt; guest_ssl, guest_ssl_load, guest_ssl_ps5_readers, guest_ssl_transport_kernel, and guest_ssl_transport_net pass 5/5, zero skips, 1.92 seconds on Linux x86-64/GCC Release. Conventions and whitespace pass. No fresh full-runtime build, console or native-title validation is claimed. Earlier validation below remains historical.

Arch Linux x86-64, Ryzen 9 7950X, Release, bundled source-built dependencies. Exact source b5eeee0250dc2f5c9c338bb52ab2bf84f01520cc is three linear commits on main ccb0c092683aa9012769394d2f1a0b43b7b7e89a, with no merge commits.

Full runtime libs and all four SSL executables build. guest_ssl, guest_ssl_load, guest_ssl_ps5_readers, guest_ssl_transport_kernel and guest_ssl_transport_net pass, 5/5, no skips, 0.65 seconds. Conventions and whitespace checks pass. Both transport tests perform local TLS handshakes and data transfer through their respective guest socket tables.

Validation report, CTest log. Earlier negative controls and patched-NID probes remain historical evidence, not rerun results for this refresh. No console, Windows or title runtime validation, title unblock or performance gain is claimed. Full hosted Linux/Windows builds require maintainer dispatch.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none (#5953 and #5969 are merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4877763648 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6511). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-15T18:08:37Z. --- ### What Implement `sceSslGetPem` with the PS5 context-first four-argument call: context, certificate, caller-owned destination and in/out `size_t` length. A null destination queries the size; short buffers throw before writing. The PEM backend originated in jagrat Singh’s #5969 proposal; that PR merged without PEM. Both #5953 and #5969 are now merged. This refresh removes their prerequisite commits and retains main’s serial/name, validity and fingerprint readers and tests unchanged, including its unknown-context checks. The remaining regression checks PEM query/copy guards and the PS5 reader call shapes, context ownership and snapshot lifetime. Static inspection of PPSA28002 confirms the four-argument PEM call, caller-owned buffer and 64-bit length; PPSA17330/PPSA28002 establish the serial/name call shapes. This is call-shape evidence, not console error precedence or exact PEM length semantics. Remaining uncertainty is recorded in library debt. Overlap review: #6828 has merged. This refresh preserves its TLS transport implementation, transport tests and debt; the conflicts were resolved by retaining both test registrations and adding only the PEM debt entry. #7319 concerns TLS transport, not PEM reading. #6044 reorganizes test paths and registration; #6039 moves unrelated debt. Neither is a prerequisite for PEM. ### Tested Latest refresh: three linear commits on main `40393b0f959c`, head `f4630b2144`. The debt conflict retains main’s updated TLS verify-option documentation and adds only the PEM limitation entry. All four SSL test executables and their library dependencies rebuilt; `guest_ssl`, `guest_ssl_load`, `guest_ssl_ps5_readers`, `guest_ssl_transport_kernel`, and `guest_ssl_transport_net` pass **5/5**, zero skips, 1.92 seconds on Linux x86-64/GCC Release. Conventions and whitespace pass. No fresh full-runtime build, console or native-title validation is claimed. Earlier validation below remains historical. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Arch Linux x86-64, Ryzen 9 7950X, Release, bundled source-built dependencies. Exact source `b5eeee0250dc2f5c9c338bb52ab2bf84f01520cc` is three linear commits on main `ccb0c092683aa9012769394d2f1a0b43b7b7e89a`, with no merge commits. Full runtime `libs` and all four SSL executables build. `guest_ssl`, `guest_ssl_load`, `guest_ssl_ps5_readers`, `guest_ssl_transport_kernel` and `guest_ssl_transport_net` pass, 5/5, no skips, 0.65 seconds. Conventions and whitespace checks pass. Both transport tests perform local TLS handshakes and data transfer through their respective guest socket tables. [Validation report](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/pr6511-mainccb0-validation-public.json), [CTest log](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/pr6511-mainccb0-tests.log). Earlier negative controls and patched-NID probes remain historical evidence, not rerun results for this refresh. No console, Windows or title runtime validation, title unblock or performance gain is claimed. Full hosted Linux/Windows builds require maintainer dispatch. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none (#5953 and #5969 are merged) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-15 18:09:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T18:09:10Z.


Progress report (40393b0 → f4630b2)

📈 System libraries: 91.68% (+0.02%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceSsl sceSslGetPem
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6198965569 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6511#issuecomment-6198965569). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T18:09:10Z. --- <!-- progress-report --> ### Progress report (40393b0 → f4630b2) 📈 **System libraries**: 91.68% (+0.02%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceSsl | `sceSslGetPem` | </details>
github-actions[bot] commented 2026-10-15 18:27:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T18:27:18Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6039 docs/dev/debt/libSceSsl.md
PR 6044 core/libs/prx/libSceSsl/CMakeLists.txt
core/libs/tests/GuestSslLoad.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6199324436 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6511#issuecomment-6199324436). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T18:27:18Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 6039](https://www.github.com/boykopovar/AnyPS5/pull/6039) | `docs/dev/debt/libSceSsl.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceSsl/CMakeLists.txt`<br>`core/libs/tests/GuestSslLoad.cpp` |
JJenkx commented 2026-10-18 17:51:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-18T17:51:13Z.


Parking this PR to free one of my 20 open slots for a demonstrated Crimson Spires startup crash fix. This SSL implementation has unit coverage, but no demonstrated title unblock or independent review yet, and console length/error-precedence semantics still need validation. The branch fix/ssl-ps5-reader-context and its evidence are preserved. I will reconsider reopening when a title exercises this path or independent validation strengthens the implementation; no source branch is being deleted.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6253151092 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6511#issuecomment-6253151092). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-18T17:51:13Z. --- Parking this PR to free one of my 20 open slots for a demonstrated Crimson Spires startup crash fix. This SSL implementation has unit coverage, but no demonstrated title unblock or independent review yet, and console length/error-precedence semantics still need validation. The branch fix/ssl-ps5-reader-context and its evidence are preserved. I will reconsider reopening when a title exercises this path or independent validation strengthens the implementation; no source branch is being deleted.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6511
No description provided.