feat(libSceLibreSsl): implement SSL_CTX_get_ex_data #15281
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15281"
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:45Z.
What
Implements
SSL_CTX_get_ex_data(const SSL_CTX*, int)in libSceLibreSsl, which threw and was declared without parameters.As in LibreSSL 2.5.4
ssl_lib.candCRYPTO_get_ex_datainex_data.c, it reads the stack ofinternal->ex_data. It returns null without a stack, null for an index past or before it, and the stored pointer otherwise.ex_datais at offset 248 of the 464-byte context internal state, measured by compiling the 2.5.4 release'sssl_locl.h. That compile also gives thequiet_shutdownoffset (292) #10483 already uses; this splits #10483's padding around it.The function is added to #10483's
src/SslCtx.cppand its test toGuestLibreSslSslCtx.cpp, so this builds on it. A null context 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_ssl_ctxtest: null context and null internal state throw; no stack returns null; a two-slot stack returns both slots and null for 2 andINT_MIN; settingquiet_shutdownnext to it does not disturb the read.ctest -j16on head e2becae94b: 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 103a84772f, 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. Full build andctest -j16: 3795/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:50Z.
Review: APPROVED
@alvaroelpob approved at
103a84772f. I only looked at the newSSL_CTX_get_ex_data; the code from #10483 is theirs to review.What I ran: this head merged onto
main(mergecde3bb9c12), Windows 11, WinLibs GCC, Release.guest_libressl_ssl_ctxandpublic_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_CTX_get_ex_datareturningnullptrfirst,guest_libressl_ssl_ctxfails at line 115 (1 of 1).Firmware: this answers what the layout compile left open. In 13.42
system/common/lib/libSceLibreSsl.sprx(sha25657de57100cdeecdf8db74d6914b0c50ac9a9113fead232d03dce2df227cd9032),SSL_CTX_get_ex_data(jLew9e14VI8) is, read from disassembly and not run:That is
internalat0x70andex_dataat+0xf8, your 112 and 248, and the same shared reader asSSL_get_ex_data.So the offsets you got from compiling LibreSSL 2.5.4 match the console module.