feat(libSceSsl): implement certificate serial and name entry readers #5953
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5953"
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 jagrat04 on 2026-10-14T16:58:58Z.
What
Implements sceSslGetSerialNumber, sceSslGetSubjectName, sceSslGetIssuerName, sceSslGetNameEntryCount, sceSslGetNameEntryInfo, and sceSslFreeSslCertName.
Signatures follow VitaSDK. Mbed TLS extracts the certificate's serial number and X.509 subject and issuer distinguished names, parsing OID attribute short names (or numeric strings) and value strings.
Tested
Checklist
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T16:59:47Z.
Progress report (
9e9d86f→a315ce8)📈 System libraries: 89.15% (+0.16%, +6 implemented functions)
✅ 6 implemented
sceSslFreeSslCertNamesceSslGetIssuerNamesceSslGetNameEntryCountsceSslGetNameEntryInfosceSslGetSerialNumbersceSslGetSubjectNameImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T17:08:02Z.
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.
docs/dev/debt/libSceSsl.mdcore/libs/tests/GuestSslLoad.cppdocs/dev/debt/libSceSsl.mdcore/libs/prx/libSceSsl/Export.cppdocs/dev/debt/libSceSsl.mdImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T20:19:12Z.
Review: COMMENTED
Linux run (Ubuntu 26.04, Intel i7-8700, GCC 15.2, full build, non-GPU tests), head
80d257396merged ontomain44df21632. The description lists Windows 10 only.guest_ssl_loadandguest_sslpass.Export.cppfrommain(the PR's test kept):guest_ssl_loadfails withSSL load lifecycle failed: sceSslGetSerialNumber not implemented;guest_sslstill passes.Non-GPU suite (
ctest -E "^agc"): same result asmain; onlyfile_writer_binaryandfile_writer_textfail, and they fail onmaintoo on this machine (Ubuntu 26.04 coreutils).Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-16T07:41:52Z.
I found a calling-convention mismatch to reconcile before merging head 80d257396e0fc86de8c9e289b2d2b4adde7afcc3. The new tests repeat the Vita-style declarations, so they pass while calls using the PS5 reference already cited by libSceSsl fail.
SharpProspero, pinned Http.cs declares an initial int sslCtxId for all six readers/name operations. In particular:
(int sslCtxId, void* sslCert, byte* buffer, size_t* length), with a caller-owned output buffer and an input capacity/output byte count. The PR instead takes(void* cert, const char** data, unsigned int* length)and exposes an internal pointer. This changes both argument positions and the buffer contract.(int sslCtxId, void* sslCert).(int sslCtxId, void* name).Native Windows reproduction: PR composed with main
5d9dcc42d, supported WinLibs GCC 15.2r7 UCRT, Release full CMake configuration. Built the actual libSceSsl.prx, Mbed TLS, libc and both original SSL test targets.guest_sslandguest_ssl_loadpass (0.62 s total). A separate target, using the same dynamic-runtime/unwind settings, loads that unchanged PRX and calls the actual APS5_VABI exports with the reference signatures on the existing synthetic RootPem certificate:For the last three isolated calls, the harness obtains/cleans a valid name using the PR legacy one-argument subject/free shapes, so those failures do not merely cascade from the subject call. The context id is being interpreted as the certificate/name pointer.
Please reconcile the PS5 versus Vita signatures and migrate the regression declarations/calls, including context ownership and serial buffer/64-bit-length checks. Vita headers alone do not establish the PS5 ABI.
Limits: this proves incompatibility with the cited PS5 source interface, not console measurements or a real-title failure. Selected real library/test targets only; no complete all-target/libs build, full CTest, NID-patched/relinked guest, TLS connection, Linux/macOS, GPU/FPS or game run. No production source changes. AI-assisted: OpenAI Codex. Reproducer, exact source hash and results attached.
ssl-abi-review-pr5953.zip
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-16T10:42:26Z.
Cross-validation on Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), MinGW GCC 15.2. PR head
80d257396merged on main332b0b1b7(main moved during the session;332b0b1b7is5d9dcc42dplus #6371, logging only), clean merge:libs: pass, apart from the known MinGW 64 KiBalignasAGC test object that fails onmaintoo.guest_sslandguest_ssl_load,--repeat until-fail:3: 3 of 3 each.Export.cppreverted tomainand the test kept,guest_ssl_loadfails withsceSslGetSerialNumber not implemented; restored, it passes.tools/check_conventions.py --base origin/main(on5d9dcc42d) andgit diff --check: pass.sce*export (all six were throwing stubs onmain); their NIDs match aerolib.sceSslGetPem. Its audit goes from 17 to 11 stub imports (881 -> 887 implemented, 4 absent unchanged);sceSslGetPemis the remaining libSceSsl stub, which #5969 covers.--trace-imports,APS5_TRACE_CALLS=libSceSsl, 120 s per run (the call report is read withAPS5_HANG_DUMP_SECS=120, so the only stop line,FATAL: timed dump after 120 s (APS5_HANG_DUMP_SECS); aborting, is self-inflicted): no libSceSsl call at all in 2 runs onmain(3834 and 5536 frames) and 1 run with this PR (5372 frames). A positive control withlibSceSsl,libScePadtraced recorded 2335 calls, all libScePad. The title does not reach these functions in its first two minutes, so it cannot confirm the ABI either way.docs/dev/debt/libSceSsl.md(one hunk).I agree with the ABI point above: the SharpProspero
Http.csrevision this library cites (60977b29) passesint sslCtxIdfirst to all six functions, usessize_tlengths and copies the serial into a caller buffer, andsceSslGetCaList, which hands out these certificate handles, already takes the context id onmain. The tests repeat the Vita declarations, so they pass whichever ABI is right. I would hold this until the signatures are reconciled.Not checked: any TLS connection, Linux/macOS, a title that actually calls these functions.
Written with Claude Code assistance (validation by a subagent, reviewed in this session).
Imported from boykopovar/AnyPS5. Originally posted by jagrat04 on 2026-10-16T10:58:34Z.
Thanks @simonbronk and @screamm for the detailed review and reproducible probe!
I have updated the PR to reconcile with the PS5 context ABI from SharpProspero:
sceSslGetSerialNumber,sceSslGetSubjectName,sceSslGetIssuerName,sceSslGetNameEntryCount,sceSslGetNameEntryInfo,sceSslFreeSslCertName) now takeint sslCtxIdas their first parameter.sceSslGetSerialNumbernow copies into caller-allocatedunsigned char* sboDatawithstd::size_t* sboLen(returning required size when!sboData || *sboLen == 0, and0x8095177aif capacity is insufficient).sceSslGetNameEntryInfonow usestd::size_t.Context::certNamesand discarded when the context is terminated.GuestSslLoad.cpptests to verify buffer semantics, context isolation, and lifecycle teardown.docs/dev/debt/libSceSsl.md.Verified that full builds, convention checks (
tools/check_conventions.py), and all CTests pass 100% on both Windows and Linux (Ubuntu 26.04 / GCC 15.2 via WSL).(I have also rebased and updated the dependent PR #5969 to use matching context-scoped signatures.)
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T19:04:53Z.
Checked the reader signatures against the pinned SharpProspero
Http.cs(context id first,size_tlengths, caller-owned serial buffer), build + ctest in scope (34/34), and thatguest_ssl_loadfails without theExport.cppchange.Added one commit of ours: the
libSceSsldebt line now says the error codes, the zero-capacity length query, the truncation of name entries and the name handle lifetime are not measured on a PS5. Merging once CI is green.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T20:08:45Z.
Rebased onto current
main. The only conflict wasdocs/dev/debt/libSceSsl.md: dropped the stale "sceSslGetSerialNumber - unknown signature" line, kept the reader line, and changed "Certificate readers remain unimplemented" in thesceSslLoadCertline to say the reader queries reflect active certificates or outstanding snapshots. Code and tests are unchanged.Build + ctest in scope after the rebase: 35/35. Merging once CI is green.