fix(libSceLibreSsl): throw the documented exception for faulting lookup and verify-parameter arguments #14717
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14717"
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 rooklz on 2026-11-01T17:24:58Z.
What
X509_STORE_add_lookupand the internalFreeVerifyParamin libSceLibreSsl already implement every defined input; their remainingNotImplemented_nid_no_patchcalls only covered inputs where the module faults.docs/dev/debt/libSceLibreSsl.mdrecords forX509_STORE_add_lookupthat "a null store, method or listed lookup throws where LibreSSL faults" and that "callbacks of a guest-supplied method (new_item,shutdown,free) throw instead of being called", and for the verify parameters that no export adds a policy object and that null verify parameters or identity "throw where LibreSSL faults". Only those faulting inputs now throwstd::invalid_argumentinstead of the unimplemented marker; no defined behaviour changes. The guest-callback site (new_item) and the policy-object free keepNotImplemented_nid_no_patch: those inputs are valid but unimplemented, not caller errors. No debt edit: the entries already document both kinds of path. No new exports, libraries, files or silent stubs; every replaced marker still throws and every unimplemented path still throws through the marker.X509_STORE_add_lookup_nid_postfixstays intodo_namesfor now becauseprogress.pyalso counts the stub-calling internal helpers its body reaches (Elements,Push,FreeLookup); those guards are carried by the open sibling PRs #14179 and #13285, whose hunks this change deliberately does not touch. Coverage fromtools/progress.py: libSceLibreSsl 103/298 and all libraries unchanged by this commit alone.Tested
Linux host, no PS5 and no console use. Behaviour comes only from this worktree and
docs/dev/debt/libSceLibreSsl.md; the debt entries already state that these inputs throw where LibreSSL faults.cmake -S . -B build-libressl -G Ninja -DCMAKE_BUILD_TYPE=Release -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ONandcmake --build build-libressl --parallel: rc=0.ctest --test-dir build-libressl --output-on-failure: 557/557 passed, 0 failed (61.08 s), atupstream/mainf2d874c1fd.g++ -std=c++20 -fsyntax-only -Icore/libson the changedsrc/X509Store.cpp: rc=0. A host harness linkingsrc/X509Store.cppwith recording allocator stubs confirmsX509_STORE_add_lookup_nid_postfixthrowsstd::invalid_argumentfor a null store and a null method, still throws throughNotImplemented_nid_no_patchfor a guest method with anew_itemcallback, and still returns the existing lookup for a repeated method. A full guest-library build is not possible on this host (3rdparty/SDL2is empty), so the relinker build, the syntax check and the harness are the host-side verification.python3 tools/check_conventions.py --base upstream/main: pass.python3 tools/pr_overlap.py --branch fix/libressl-store-lookup-arguments: no overlap with open pull requests.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 MarcZX10 on 2026-11-01T17:29:53Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed fault paths now throw as the pinned debt notes describe; no blocking source issue was found, but the hosted checks remain queued and the compiler/harness evidence in the PR description was not independently reproduced.
What I ran
Reviewed exact head
36b2336b98b406dcabb3e4ed69ec352af29faec6against basef2d874c1fdccf781c0fa5d86619bb5dd8894b958; the merge preview was clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or compile was run.Results
Precheck output
Unedited convention-check stdout:
Unedited missing-helper diagnostics:
Unedited merge-check output:
Negative control
Not run. A useful negative control for these C++ fault paths requires compiling and running the relevant harness against the base and changed source.
Findings
Blocking
None found in the reviewed source change.
Non-blocking
The PR description reports a successful relinker build, full CTest run, syntax check, and host harness. I did not independently run them. The changed paths align with the documented fault behavior, while the optional ABI and test-quality scripts could not run because they were missing from the isolated snapshot; those tool errors do not indicate a code defect.
Sources
X509_STORE_add_lookupat the reviewed headNot verified
No local compiler run, CTest, host harness, PS5/console run, or other operating system was tested. Hosted checks were queued when inspected. The PR's reported tests are author-supplied evidence, not tests run by me.
To get this to a good state
No source change is requested. Allow the hosted checks to finish; I will re-check this head if new CI evidence or a code update changes the review basis.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T20:40:53Z.
Review: COMMENTED
Reviewed — no blocking findings
The three null-pointer paths and the null verify-parameter identity now throw
std::invalid_argumentinstead of the not-implemented exception. I checked each path against the LibreSSL 2.5.4 sources the debt entries cite, and each one matches a point where LibreSSL dereferences a null pointer. The hosted Windows job passed, but it ran no CTest for this head, so no LibreSSL test ran hosted.What I ran
6211803937681763d48a2d6c390912b95a1bd061; basef2d874c1fdccf781c0fa5d86619bb5dd8894b958. main is now5bae1a4bc2; the live stack check passed. 1 file, +6/-4 (core/libs/prx/libSceLibreSsl/src/X509Store.cpp).FreeVerifyParam(line 150) andX509_STORE_add_lookup_nid_postfix(line 219 onward) at this head.X509_STORE_add_lookupreadsv->get_cert_methodsfirst, so it faults. Matches.lu->methodin the loop. Matches.X509_LOOKUP_new(m)readsmethod->new_item. Matches.X509_VERIFY_PARAM_freecallsx509_verify_param_zero, which readsparamid->hosts(x509_vpm.cline 186) with no null check. A null identity faults there. Matches.passed_with_warnings:CompareObjectsandLoadFileare internal helpers in this file without an APS5_VABI declaration, and the diff does not touch them. The test-quality helper found nothing when run by hand; no test file changed.Results
X509_STORE_add_lookupx509_verify_param_zero(x509_vpm.cline 186)CompareObjectsandLoadFileare internal helpers this diff does not touchCommands and unedited precheck output
Commands:
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14717 --output-dir <scratch>/precheck/14717p(report.md in that directory).git fetch https://github.com/boykopovar/AnyPS5.git pull/14717/head.python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 6211803937681763d48a2d6c390912b95a1bd061 --json(status passed_with_warnings, the two internal helpers above) andpython3 tools/pr_test_quality.py --root <archive of the head> --json core/libs/prx/libSceLibreSsl/src/X509Store.cpp(0 findings).https://raw.githubusercontent.com/libressl/openbsd/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/x509/x509_vpm.cand.../x509_lu.c.gh api repos/boykopovar/AnyPS5/commits/6211803937681763d48a2d6c390912b95a1bd061/check-runs; Windows log:gh api repos/boykopovar/AnyPS5/actions/jobs/<windows job id>/logs(no CTest section).Precheck table (unedited):
The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...6211803937681763d48a2d6c390912b95a1bd061/marc/DeusMachina_0x1914/.venv/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 6211803937681763d48a2d6c390912b95a1bd061 --title fix(libSceLibreSsl): throw the documented exception for faulting lookup and verify-parameter arguments --body /dev/shm/reviewer-run/precheck/14717p/pr-body.md/marc/DeusMachina_0x1914/.venv/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 6211803937681763d48a2d6c390912b95a1bd061 --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./marc/DeusMachina_0x1914/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14717 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14717p/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./marc/DeusMachina_0x1914/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14717p/head-621180393768-6b09c228/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14717p/head-621180393768-6b09c228 --json core/libs/prx/libSceLibreSsl/src/X509Store.cppNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
Not run here. The throw paths need a build to exercise, and the existing checks would not tell the two exception types apart.
Findings
Blocking
None.
Non-blocking
X509_STORE_free(docs/dev/debt/libSceLibreSsl.mdline 42) describes null store and verify-parameter cases, but not the null identity case this change now throws for. Please name it in that entry.tests/X509Lookup.cpp(lines 83-89) only require that some exception is thrown, so they pass with either exception type. Assertingstd::invalid_argumentfor the new paths would pin the behaviour this change intends.<stdexcept>and<string>are inserted before<cstdint>, which breaks the alphabetical order of the include block.Sources
github.com/boykopovar/AnyPS5@6211803937/core/libs/prx/libSceLibreSsl/src/X509Store.cpp (L150-L158)and #L219-L240github.com/boykopovar/AnyPS5@6211803937/core/libs/prx/libSceLibreSsl/tests/X509Lookup.cpp (L83-L89)github.com/libressl/openbsd@2e2c612066/src/lib/libcrypto/x509/x509_vpm.c(x509_verify_param_zero, line 185-186) andgithub.com/libressl/openbsd@2e2c612066/src/lib/libcrypto/x509/x509_lu.c(X509_STORE_add_lookup, lines 272-286)Not verified
f2d874c1fd, not at this head, and I did not reproduce the host harness it describes.To get this to a good state
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T05:09:44Z.
Review: COMMENTED
Reviewed — no blocking findings
This is a re-review at the current head. The earlier review (on
6211803937) raised three non-blocking points: the debt entry did not name the null identity case, the existing throw checks accepted any exception, and the include order. The new head addresses the first two: the debt line now names "a null verify parameter identity", and the tests assertstd::invalid_argumentfor each null path, including the free with a null identity. The include order is unchanged. The newguest_libressl_x509_lookuptest passed in the hosted Windows CTest run. The three null paths still match LibreSSL 2.5.4 as before.What I ran
4a88d31c932e99f29c7efcf9e610682be4ca8b53; base0580e5c951a8d436af2976a3f86a980c798ef5c2(the base moved since the earlier review). 3 files, +25/-8:core/libs/prx/libSceLibreSsl/src/X509Store.cpp,core/libs/prx/libSceLibreSsl/tests/X509Lookup.cpp(+21/-3) anddocs/dev/debt/libSceLibreSsl.md(one line).invalid_argumentthrows and the identity throw inFreeVerifyParam; the newRequireInvalidArgumenthelper and its calls, including the free withstore->param->id = nullptr; and the debt line.passed_with_warningswith 2 findings, neither about an X509 symbol.guest_libressl_x509_lookupis Passed.Results
invalid_argumentX509Store.cpp(lines 155, 218-234)FreeVerifyParamRequireInvalidArgument(read); the free case covers the identity pathguest_libressl_x509_lookup(hosted)Read-only check output
Precheck was not run: no PR-head code is run here. Conventions: passed. Stack check: passed. ABI audit: passed with warnings (2 findings, not X509). Hosted:
gh api repos/boykopovar/AnyPS5/commits/4a88d31c932e99f29c7efcf9e610682be4ca8b53/check-runs.Negative control
Not run here. A negative control needs a build, and code from this head is not run here.
Findings
Blocking
None.
Non-blocking
None.
Sources
github.com/boykopovar/AnyPS5@4a88d31c93/core/libs/prx/libSceLibreSsl/src/X509Store.cppgithub.com/boykopovar/AnyPS5@4a88d31c93/core/libs/prx/libSceLibreSsl/tests/X509Lookup.cppgithub.com/boykopovar/AnyPS5@4a88d31c93/docs/dev/debt/libSceLibreSsl.mdNot verified
To get this to a good state