feat(libSceLibreSsl3): implement SSL_CTX_set_keylog_callback #16977
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16977"
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 GalaxyGamingFR on 2026-11-08T03:34:24Z.
What
Implement
SSL_CTX_set_keylog_callbackinlibSceLibreSsl3, replacing its parameterless throwing placeholder inAdditionalExports.cpp.ce488b78ssl_lib.c, the revision the library's debt file already uses. Upstream only stores the callback inctx->keylog_callback.ssl_local.hmarks that field "Unused. For OpenSSL compatibility.", and nothing in libssl calls it, so no key material is ever logged.LibreSsl3SslCtxinKey.hpppreviously stopped atmax_proto_version(136 bytes). It now covers the fullssl_ctx_stLP64 layout, 568 bytes, withkeylog_callbackat 552. The existing asserts are kept, and new ones pininfo_callback(216),ex_data(376),srtp_profiles(480) andkeylog_callback(552), so a wrong field in the middle fails to compile. Nothing in the tree allocates anSSL_CTXbysizeof, so the larger size changes no existing behaviour.Api.hppnow declares it asvoid SSL_CTX_set_keylog_callback(LibreSsl3SslCtx* context, LibreSsl3KeylogCallback callback), withLibreSsl3KeylogCallbackasvoid (*)(const LibreSsl3Ssl*, const char*), matchingSSL_CTX_keylog_cb_func.std::invalid_argument, where upstream would dereference it.The gap is recorded in
docs/dev/debt/libSceLibreSsl3.md: the console layout is not measured. The export inventory is updated (138 exports, 128 named).No title's trace or disassembly was used, and the export was not measured on a PS5.
Tested
Windows 11, WinLibs GCC 15.2.0 UCRT. This is not a full CMake build. I compiled
tests/GuestLibreSsl3Ssl.cppwith libSceLibreSsl3'sSsl.cpp,Key.cpp,X509.cpp,Asn1Values.cppandIntegerDecoder.cppand libSceLibreSsl'sError.cppinto one executable, withAPS5_VABIdefined empty, a one-lineNotImplementedAt_nid_no_patchthat throws, andmalloc/calloc/freeshims. No title or homebrew, and not built on Linux or macOS.CheckKeylogCallbackfills a guarded context with0x5A, sets a callback and checks that only the 8 bytes at offset 552 changed and now hold the callback. It then sets a null callback and checks that those bytes are cleared, and checks that a null context throws.num_tickets(offset 560) makes the test fail.-Wall -Wextrais clean for the changed files, andpython tools/check_conventions.py --base origin/mainpasses.I searched open and merged pull requests for
keylogjust before opening this one, and none implements it. #16586, #16588, #16589, #16848 and #16918 change the same export inventory count, so whichever lands later needs a one-line rebase.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)🤖 Generated with Claude Code