feat(libSceSsl): implement certificate validity period and fingerprint queries #5969
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5969"
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-14T17:31:04Z.
What
Implements
sceSslGetNotBefore,sceSslGetNotAfter,sceSslGetFingerprint, and updatessceSslClosesignature.sceSslGetNotBeforeandsceSslGetNotAfterconvert Mbed TLS certificate validity times (valid_fromandvalid_to) into microsecondRtcTickvalues (microseconds since civil year 0001 epoch) matchinglibSceRtc.sceSslGetFingerprintcomputes certificate digests (MD5,SHA-1,SHA-224,SHA-256,SHA-384,SHA-512) over the raw DER certificate payload using Mbed TLS message digest API.sceSslClosesignature is updated to takeint sslConnectionIdin line with SharpProspero, resolving its unknown signature technical debt entry.Tested
guest_ssl_load_testsverifying:sceSslGetNotBeforeandsceSslGetNotAftertick calculations against known fixture timestampssceSslGetFingerprintMD5, SHA-1, and SHA-256 digests against known hashessceSslClosethrows until transport is implementedctest -R guest_ssl(100% passed)python tools/check_conventions.py --base origin/mainChecklist
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 github-actions[bot] on 2026-10-14T17:31:50Z.
Progress report (
f8b22ed→fd5eb84)📈 System libraries: 89.45% (+0.01%, +3 implemented functions)
✅ 3 implemented
sceSslGetFingerprintsceSslGetNotAftersceSslGetNotBeforeImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T17:35:31Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceSsl/Export.cppL6, L29-30docs/dev/debt/libSceSsl.mdL5-9core/libs/prx/libSceSsl/Export.cppL6, L29-30, L521-525docs/dev/debt/libSceSsl.mdL5-7sceSslCloseSome 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.cppImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T18:15:39Z.
Review: COMMENTED
Linux run, full build. The description covers only Windows 10.
Machine: Ubuntu 26.04, Intel i7-8700, GCC 15.2, Release, full build (
-DBUILD_TESTING=ON), non-GPU tests. Head490ced064merged onto main03c4cb5e7(clean merge).guest_sslandguest_ssl_loadpass, including the new PEM, validity-period and fingerprint cases.GuestSslLoad.cppdoes not compile (SceSsl::RtcTickis undeclared), so the test cannot run against main. It only covers the change together with the new types.file_writer_binaryandfile_writer_text, also fail on plain main on this machine.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-16T10:44:12Z.
Cross-validation on Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), MinGW GCC 15.2. This PR contains #5953's commit, so I built the stack main
332b0b1b7+ #5953 (80d257396) + this PR (490ced064); both merges are clean and the tree equals main + this PR. (332b0b1b7is5d9dcc42dplus #6371, logging only; main moved during the session.)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 to #5953's head,guest_ssl_load_testsno longer links (undefinedsceSslGetFingerprint,sceSslGetNotAfter,sceSslGetNotBefore); restored, both tests pass. I did not run a separate run-time check ofsceSslGetPem.ctest -j8 --timeout 120 -E '^agc_driver_|^video_out_flip'on the stack: 833 of 839 pass, 2 skipped, 4 timeouts on a heavily loaded host (conventions_function_bodies, two of its shards,hardware_oracle_compare); one shard passes serially, the shard scripts take about as long onmainwhen timed directly, andhardware_oracle_comparetimes out onmaintoo. Nothing SSL-related.tools/check_conventions.py --base origin/main(on5d9dcc42d) andgit diff --check: pass.libSceSsl.prxgainssceSslGetNotBefore(Eo0S65Jy28Q),sceSslGetNotAfter(xHpt6+2pGYk) andsceSslGetFingerprint(brRtwGBu4A8); NIDs match aerolib.sceSslGetPemhere and the six from #5953. No title importssceSslGetNotBefore,sceSslGetNotAfter,sceSslGetFingerprintorsceSslClose. With both PRs PPSA28319 has no libSceSsl stub import left (17 -> 10 stub imports overall, 881 -> 888 implemented, 4 absent unchanged).--trace-imports,APS5_TRACE_CALLS=libSceSsl, 120 s per run, call report 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 in 2 runs onmain(3834 and 5536 frames) or 2 runs on the stack (6860 and 6847 frames). A positive control on the stack build withlibSceSsl,libScePadtraced recorded 3233 calls, all libScePad. The title does not exercise these functions in its first two minutes.Export.cpp(two hunks aroundsceSslEnableVerifyOption/sceSslDisableVerifyOption, next tosceSslGetSerialNumberandsceSslGetSubjectName) and indocs/dev/debt/libSceSsl.md; I did not resolve them.The ABI question raised on #5953 applies here as well: the SharpProspero lines this PR cites (
60977b29,Http.csL306-347) declaresceSslGetNotAfter(int sslCtxId, void* sslCert, ulong*),sceSslGetNotBefore(int sslCtxId, void* sslCert, ulong*)andsceSslGetFingerprint(int sslCtxId, void* sslCert, int hashType, byte*), while the PR drops the context id. The hash-type numbering (0 = MD5 ... 5 = SHA-512) has no cited source either. I would hold this until the signatures are reconciled together with #5953.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:52Z.
Rebased onto PR #5953's updated head (
9c72c453d) and reconciled all certificate query signatures with the PS5 context ABI:sceSslGetNotBefore,sceSslGetNotAfter,sceSslGetFingerprint, andsceSslGetPemnow takeint sslCtxIdas their first parameter.0 = MD5through5 = SHA-512) cite SharpProspero'sSceSslFingerprintHashAlgorithmenum indocs/dev/debt/libSceSsl.md.GuestSslLoad.cppto verify context-scoped querying, invalid argument handling, and lifecycle cleanup.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T23:24:47Z.
Review: DISMISSED
Checked on the PR merged onto current
main: build + ctest in scope pass (guest_ssl_loadincluded), and the new test no longer compiles without theExport.cpp/SslTypes.hppchange.sceSslGetNotBefore/sceSslGetNotAfter/sceSslGetFingerprintmatch SharpProspero'sHttp.cs(context id first,ulong*ticks, hash types 0..5 as inSceSslFingerprintHashAlgorithm), and the 0001-01-01 epoch arithmetic is right. One thing to fix:core/libs/prx/libSceSsl/Export.cpp:687sceSslGetPem(int, void*, char*, size_t, size_t*)has no source. SharpProspero'sHttp.cshas nosceSslGetPem, shadPS4's is an empty stub, and no reference gives the parameter order, the length semantics or the error for a too-small buffer (ErrorInvalidArgat line 699 is a guess).docs/dev/debt/libSceSsl.mdsays the signatures "follow SharpProspero", which is false for this one. Either keepsceSslGetPemthrowingNotImplemented_nid_no_patchand drop it (and its tests) from this PR, or cite a source for the signature and behaviour and list the unmeasured parts under "Unknown function info" in the debt line.Everything else can stay as is.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T02:53:21Z.
Picking this up while @adriadam10 is away. The code now leaves
sceSslGetPemthrowing, which answers his review, thanks. Please update the PR title and body to match (validity period and fingerprint only).Imported from boykopovar/AnyPS5. Originally posted by jagrat04 on 2026-10-18T03:12:05Z.
Updated the PR title and body to match (validity period and fingerprint queries only). Thanks!