fix(libSceLibreSsl3): throw the documented d2i fault arguments #14292
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14292"
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-01T06:54:30Z.
What
d2i_ASN1_INTEGER(libSceLibreSsl3) already implements every measured input: the parsing, error codes, old-output handling and allocation-failure rows from the 13.42 native-PC evidence. Two fault-only guards still calledNotImplemented_nid_no_patch, sotools/progress.pyreported the export as unfinished:ASN1_STRINGrelease already throws rather than erasing out of bounds (docs/dev/debt/libSceLibreSsl.md,GeneralName_free).Both now throw
std::invalid_argument, the exception the parent library's ASN.1 free uses and the one the merged libressl fault-argument PR (#14178) established. Nothing else changes: every measured input keeps its result, error queue, old output and input pointer, and both replaced paths still throw. The debt sentence records the negative old-output length and no longer implies a placeholder there.python3 tools/progress.py: libSceLibreSsl3 12/258 -> 13/257; all libraries 8836/34187 (25.85%) -> 8837/34187 (25.85%).d2i_ASN1_INTEGER_nid_postfixmoves fromtodo_namestodone_names. libSceLibreSsl (103/298) and libSceSsl (35/20) are unchanged, and no export, library or file is added.Tested
Host only; no console use. Behaviour comes from this worktree and
docs/dev/debt/libSceLibreSsl3.md(with the parent ASN.1 free policy indocs/dev/debt/libSceLibreSsl.md).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: 549/549 passed, 0 failed (atupstream/main1ff6c8739b).g++ -std=c++20 -fsyntax-only -Icore/libs -Icore/libs/prx/libSceLibreSsl3/includeon the changedsrc/IntegerDecoder.cppandtests/Asn1.cpp: rc=0. The relinker-only build does not include the guest ASN.1 test target.src/IntegerDecoder.cppwith a small host harness providing the guestmalloc_nid_postfix/free_nid_postfix/LibreSslPutError_nid_no_patchand exercised the two fault paths plus a normal decode: all cases pass.tests/Asn1.cppcases pin bothstd::invalid_argumentpaths (nullinputpointer, null*input, and a negative old-output length with non-null data) and are compiled by the-fsyntax-onlycheck above.python3 tools/check_conventions.py --base upstream/main: passed.python3 tools/pr_overlap.py --branch fix/libressl3-d2i-fault-arguments: no shared source or test file. It exits 2 because seven open PRs share onlydocs/dev/debt/libSceLibreSsl3.mdand cannot be compared automatically; their patches were checked manually and all of them edit the pending-export bullet or add new entries near lines 1-15, none edits the ASN.1 integer entry. No open PR changessrc/IntegerDecoder.cpportests/Asn1.cpp.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-01T07:50:12Z.
Review: COMMENTED
Reviewed — no blocking findings
The change turns three unimplemented-path throws into
std::invalid_argumentfaults that match the parent library's ASN.1 free policy, and I found no blocking defect, but the hosted Windows log does not show the changed ASN.1 test passing on this head.What I ran
1dc2835234ab91524f419489f8d2c784f35261c2, unchanged at the end of the precheck. Base: PR base1ff6c8739bdea5151f1fb3ff6429947c78603530. Current-base merge preview: clean, via the precheck's stack check.The precheck's ABI and test-quality steps could not run in its isolated checkout because the helper scripts are absent there, so I ran both helpers by hand from
/marc/AnyPS5/tools.Results
git diff --check(precheck)passed: 8 symbols, 0 findings.possible-unregistered-cpp-testforAsn1.cpp. False positive: the test is registered atcore/libs/prx/libSceLibreSsl3/CMakeLists.txt:37, using${CMAKE_CURRENT_SOURCE_DIR}in the path.success. The changed test binary was compiled and linked, but the changed-test CTest step printed only one passing test,#232 trace_digest_.... Noguest_libressl3_asn1result appears in the log.Precheck conventions output (unedited)
ABI audit output (JSON summary fields; the symbol list of 8 entries is omitted)
Test-quality output (unedited JSON)
Hosted Windows log lines for this head (unedited)
Negative control
d2i_ASN1_INTEGER_nid_postfixthrowsstd::invalid_argumentfor a nullinputand for a null*input, and for a negative old-output length it throws while leaving*outputand*inputunchanged.NotImplemented_nid_no_patch, which throwsstd::runtime_error(core/libs/prx/libc/src/General.cpp:1020-1023).RequireInvalidArgumentcatches onlystd::invalid_argument, so that exception would escapemainand the binary would terminate.Findings
Blocking
None.
Non-blocking
guest_libressl3_asn1_testsfor this head, but the changed-test CTest output shows onlyTest #232: trace_digest_...as run. The log has no pass line forguest_libressl3_asn1, so CI does not show the newFaultingArgumentscases running on this head. This is not a code defect.NotImplementedCalls_nid_no_patch(), whichcore/libs/prx/libSceAgcDriver/Execution/src/PerformanceOverlay.cpp:948reads as its unimplemented count. That fits the intent that these are native faults rather than unimplemented paths, so no change is needed; it is noted for the overlay's counts.Sources
d2i_ASN1_INTEGER_nid_postfixASN1_STRING_freestd::runtime_errorFaultingArgumentstest, called frommainat line 350inand a null*inboth make the 13.42libSceLibreSsl3.sprxread address 0 and fault when run natively on a PC. I read that note; it is not a console measurement.Not verified
-fsyntax-onlycheck were not reproduced.To get this to a good state
guest_libressl3_asn1passing on this head, for example withctest --test-dir <build> -R '^guest_libressl3_asn1$' --output-on-failureon Windows or Linux, and paste the output. No code change is requested.