feat(libSceLibreSsl3): implement X509_STORE_CTX_new, free, get0_param and X509_STORE_up_ref #15544
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15544"
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 ashwin280802 on 2026-11-03T18:29:44Z.
What
Implements four
libSceLibreSsl3exports that threwNotImplemented_nid_no_patch:X509_STORE_CTX_new,X509_STORE_CTX_free,X509_STORE_CTX_get0_paramandX509_STORE_up_ref. The module forwardsX509_STORE_new,X509_STORE_freeand theX509_STORE_CTX_*getters and setters to libSceLibreSsl, so the new code uses that library's layouts: the 136-byte store withreferencesat offset 128 and the 240-byte context.Source: LibreSSL
x509_vfy.c(X509_STORE_CTX_new,X509_STORE_CTX_free,X509_STORE_CTX_cleanup,X509_STORE_CTX_get0_param) andx509_lu.c(X509_STORE_up_ref) at 078b3d1d.X509_STORE_CTX_newreturns a zeroed guest-heap context;X509_STORE_CTX_get0_paramreturnsparam.X509_STORE_up_refincrementsreferencesatomically and returns 1 when the new count is above 1, otherwise 0.X509_STORE_CTX_freeignores null and frees the context. Its cleanup also releases a cleanup callback, an owned verify parameter, the policy tree, the chain and the extra data; those paths throw without changing the context, because the code that releases them is not available here.Deliberate divergences, recorded in
docs/dev/debt/libSceLibreSsl3.md:X509_STORE_CTX_newdoes not queueERR_R_MALLOC_FAILURE(the error queue is not modelled), null arguments toget0_paramandup_refthrow where LibreSSL dereferences them, andup_refthrows atINT32_MAX.Open PRs: none implements these four functions; I searched the diffs of the open PRs that touch these files, including the 18 the overlap tool could not compare (#12315, #14465, #14499, #14612, #15163, #15514, #15627, #15629, #15631, #15737, #15758, #15760, #15761, #15765, #15770, #15826, #15831, #15854);
git log -Gfor the four exported names over those PR heads finds no commits. Several touch the same debt file and the test list inCMakeLists.txt, which will need a trivial rebase.Tested
Windows 11, at 8600542dc5.
ctest --test-dir build-full -R "guest_libressl3_(x509_store_context|x509_verify_param|stack)":The new test covers all four functions, the throwing free paths, leaks and 8 threads x 20000
up_refcalls.tools/check_conventions.py --base origin/mainpasses.I changed 17 conditions and statements in the new code one at a time and the test failed on each.
Not covered by a test: allocation failure of
X509_STORE_CTX_new.Not verified: I also ran all the repository's tests on Windows and Linux, and every libSceLibreSsl3 test passed; the only failures were select_tests_MissingCommandTests, vulkan_validation_gate_commands and guest_mmap_executable, which fail on main on this machine too. Nothing was run on a console, and the 240-byte context and 136-byte store layouts of the console's libSceLibreSsl3 are not checked against it.
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)