feat(libSceLibreSsl): implement SSL_get_ex_data #15279
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15279"
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 alvaroelpob on 2026-11-02T22:37:39Z.
What
Implements
SSL_get_ex_data(const SSL*, int)in libSceLibreSsl, which threw and was declared without parameters.As in LibreSSL 2.5.4
ssl_lib.c, it isCRYPTO_get_ex_data(&s->internal->ex_data, idx).ex_data.creturns null without a stack or for an index past it, and thesk_valuealready onmainreturns null for a negative one. This is the same code asmain'sX509_STORE_CTX_get_ex_data.ex_datais at offset 272 of the 432-byte internal state, measured by compiling the 2.5.4 release'sssl_locl.h. That compile also gives therwstate(156) andshutdown(168) offsets #10481 already uses; this splits #10481's padding around it.Builds on the PRs below, which extend the same file and test. A null connection or internal state throws. The pending count drops by one.
Tested
Ubuntu 26.04 (WSL2, kernel 6.18), GCC 15.2.0, Release, full build with
BUILD_TESTING=ON.guest_libressl_ssltest: null connection and null internal state throw; no stack returns null; a three-slot stack returns slot 0, the null slot 1 and slot 2; indexes 3 and -1 return null.ctest -j16on head 85322e1469: 3538/3538 pass.check_conventions.py --base upstream/mainpasses.pr_overlap.py: no open pull request implements these functions. The shared lines are the pending-export count indocs/dev/debt/libSceLibreSsl.mdand the lines its base PR also changes.main4f41f4c375, head 7a489bb527, to resolve the conflicts on the sharedCMakeLists.txt,Export.cppand debt-file lines; both sides are kept and the debt count is recomputed fromExport.cpp.mainnow declaresnamespace LibreSslinBio.hpp, so the SSL struct is renamedLibreSslSslin every commit; layout andstatic_asserts are unchanged. Full build andctest -j16: 3796/3800 pass;guest_sce_net,guest_poll,guest_select_waitandguest_memoryfailed under that load, pass when run alone, andmain4f41f4c375passes all 3799 with-j16on the same machine.check_conventions.py --base upstream/mainpasses.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 BunnyFl on 2026-11-04T00:37:43Z.
Review: APPROVED
@alvaroelpob approved at
7a489bb527. I only looked at the newSSL_get_ex_data; the code from #10481 and #15278 is theirs to review.What I ran: this head merged onto
main(mergee358ef916d), Windows 11, WinLibs GCC, Release.guest_libressl_sslandpublic_headerspass (2 of 2). That covers the Windows run your description lists as not tested.tools/check_conventions.py --base upstream/main --headon this head: all checks pass.SSL_get_ex_datareturningnullptrfirst,guest_libressl_sslfails at line 161 (1 of 1).Firmware: this answers what the layout compile left open. In 13.42
system/common/lib/libSceLibreSsl.sprx(sha25657de57100cdeecdf8db74d6914b0c50ac9a9113fead232d03dce2df227cd9032),SSL_get_ex_data(QuI09j4a8-k) is, read from disassembly and not run:It takes
internalat0xe0andex_dataat+0x110, then tail-calls the sharedex_datareader with the index still inesi. That is yourinternalat 224 andexDataat 272.So the offsets you got from compiling LibreSSL 2.5.4 match the console module.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:21:13Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and its focused tests support merging, though the reported full test run on the rebased head had four failures under load.
What I ran
Reviewed head
e19e1c3c42ee62f4f2732f67916fb8fbc58c85d2. No build or tests were run during this review; the test results below were reported in the PR description.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not independently run the build, tests, or convention check. Did not verify behavior on Windows or a physical console. All five changed files listed in the manifest were read:
core/libs/prx/libSceLibreSsl/Export.cpp,core/libs/prx/libSceLibreSsl/include/Api.hpp,core/libs/prx/libSceLibreSsl/src/Ssl.cpp,core/libs/tests/GuestLibreSslSsl.cpp, anddocs/dev/debt/libSceLibreSsl.md. The review-folderfiles.jsonwas unavailable; no changed files were excluded according to the manifest.To get this to a good state
Nothing is required. The reported load-sensitive failures are optional follow-up context; they are also reported to pass when run alone.
Pull request closed