feat(libSceLibreSsl3): implement signature algorithm lookup #15406
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15406"
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 atharvjairath on 2026-11-03T05:52:59Z.
What
OBJ_find_sigid_algsnow looks up 33 LibreSSL 4.0.0 signature mappings whose signature, digest and key identifiers all fit the parent registry’s built-in range. Either output is optional. The function writes the digest first, so the key wins when outputs alias. A zero digest is a successful result for mappings that specify it. LibreSSL 4.0.0 lookup · Object numbersThe parent registry allocates custom identifiers from 956. The 18 higher signature identifiers at 980–989 and 1045–1052 therefore return zero and preserve outputs before, during and after custom object allocation. A compile-time check constrains all three identifiers in each supported tuple. Algorithm execution and certificate/TLS interoperability remain open. Custom-object collision review
The fixture exercises 102 real custom-object allocations, cleanup, the error queue, optional outputs, aliases and output canaries. It calls the parent registry directly. The export identifier is pW329hq95Hc.
The source scanner classifies 23/276 bodies as implemented on main and 24/276 on this branch. The difference is the 1 export above. The scanner classifies source bodies and does not measure firmware compatibility. The additional export inventory has 174 pending entries (164 named, 10 known only by NID).
Integration order is #14992 → #15031 → #15045 → #15119 → #15406. This branch is based directly on main
6d173c1a1978. Each branch keeps its own changes. The order allows the shared CMake registrations and debt counts to be reconciled after each merge.Tested
Validated head
673f3997b451against main6d173c1a1978.7ad9749ed0preserved the exact branch and upstream diffs. Runtime results above are pinned to the tested base.The earlier regression run on 24ac9f770105 created 102 custom objects. Substituting the old 03c55fc1dc98 LibreSSL3 binaries made that fixture fail at custom identifier 980 on both platforms. The source approval for the collision fix was on 24ac9f770105. Earlier approval
Both loader runs printed
signature mappings: 15977 cases, 623311 checks, 33 mappings, 102 custom objects.Earlier validation on 24ac9f770105 and the historical commits cited below
Exact current head
24ac9f770105c98bc55a4584208e5d760e0af5b3, on implementation head03c55fc1dc98f97ec23cef6f24a17a2ef455a761and tested maind1ae628bc2f62459cce1e9872ba5632c938c71f2. The affected real LibreSSL3 module and fixture were rebuilt on both platforms. Unchanged real libc and parent LibreSSL artifacts from the original fully rebuilt d1ae integration were reused, with identical source inputs and artifact hashes verified; they were not rebuilt again for this fix.OBJ_createallocations reach the previously colliding, unnamed NID 980 and all 18 excluded IDs. Supported built-ins are checked throughout allocation; repeated OIDs, cleanup, monotonic allocation after cleanup, unchanged error queue, optional/aliased outputs and canaries are covered. The signed-range, extrema, walking-bit and deterministic-value matrix remains. All 33 retained tuples match the previously primary-source-checked table.python3 tools/pr_overlap.py --branch feat/libressl3-signature-algorithmsexits 2, not an automated pass: 1,730 open PRs, 32 shared candidates and 19 reported peers. All 19 were freshly verified open/current. Full/shared patches and every merge base were retained; all 20 shared merge-base payloads, including both for #13486, match the previously reviewed baseline. Ten base-conflicted peers were manually compared through those verified payloads. No duplicate selected export or runtime prerequisite; shared CMake/debt integration order remains declared above.These are focused real-module tests, not independent native Windows, full-product, packaged module/NID (including protocol-NID), title/homebrew or physical-console validation. Separate error-string fixtures were not run; the default-off upstream oracle was not enabled. Known unrelated Wine failures outside this selection are not claimed fixed. No assertion, timeout, workflow gate or runtime workaround was weakened. Warnings remain. Current remote success on the previous head is not validation or approval of this new fix; no new-head native CI claim is made.
Current reproduction scripts, manifests, complete logs/JUnit, 86 artifact hashes, old-module controls and fresh peer snapshots are retained in
/private/tmp/anyps5-monitor-20261103-1228(reproduce.txt,validation-evidence.tar.gz,manual-shared-review.txt,peers-final). Original primary references and historical validation remain in/private/tmp/anyps5-advance-20261103-0127.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)Overlap report before the branch refresh was pushed
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/debt/libSceLibreSsl3.mdL35, L215docs/dev/debt/libSceLibreSsl3.mdL35, L215docs/dev/debt/libSceLibreSsl3.mdL32, L35, L215docs/dev/debt/libSceLibreSsl3.mdL35docs/dev/debt/libSceLibreSsl3.mdL35OBJ_find_sigid_algscore/libs/prx/libSceLibreSsl3/src/SignatureAlgorithms.cppcore/libs/prx/libSceLibreSsl3/tests/SignatureAlgorithms.cppdocs/dev/debt/libSceLibreSsl3.mdL35, L215docs/dev/debt/libSceLibreSsl3.mdL35docs/dev/debt/libSceLibreSsl3.mdL35docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL35core/libs/prx/libSceLibreSsl3/AdditionalExports.cppL610-618core/libs/prx/libSceLibreSsl3/include/Api.hppL279-280docs/dev/debt/libSceLibreSsl3.mdL35, L180-181docs/dev/debt/libSceLibreSsl3.mdL35Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mddocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppcore/libs/prx/libSceLibreSsl3/src/SignatureAlgorithms.cppcore/libs/prx/libSceLibreSsl3/tests/SignatureAlgorithms.cppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T05:58:08Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The current implementation can report a built-in signature mapping for an unrelated custom object ID allocated by the same LibreSSL object registry.
What I ran
Reviewed all six changed files at head
03c55fc1dc98f97ec23cef6f24a17a2ef455a761against based1ae628bc2f62459cce1e9872ba5632c938c71f2; the stack preview is clean against that base. The PR declares the landing order #14992 → #15031 → #15045 → #15119 → #15406; those dependency heads are not included, so preserve the order and reassess integration as they land. Environment: Debian Linux x86_64, Python 3.11.2, Git 2.39.5. I did not build or run CTest. I independently compared all 51 mapping rows with the pinned LibreSSL 4.0.0 source.Results
main.Precheck output and mapping comparison
Negative control
Findings
Blocking
OBJ_create_nid_postfixstarts allocating at NID 956, and the LibreSSL 3 forwarding export routesOBJ_createto that registry. After 25 custom registrations, the returned NID is 980. The new table contains 980 and the lookup returns success with digest NID 64 and key NID 990, even though that value identifies a custom object in this runtime. This can make callers treat an unrelated custom signature object as a DH signature algorithm. Reconcile the table with the target registry's built-in NID range (or otherwise make static and dynamic NIDs distinguishable), and add a regression that creates enough custom objects to reach a mapped value such as 980 and verifies that lookup does not return the unrelated built-in mapping.Non-blocking
The 51 rows match the pinned LibreSSL reference, but that establishes source-table parity only; the compatibility issue above arises from AnyPS5's forwarded dynamic object registry.
Sources
Not verified
No local build, CTest, module runtime test, Linux or Windows integration run, title/homebrew behavior, or console behavior was verified. The PR body reports extensive Linux and Windows focused testing; I did not independently reproduce those runs. The six hosted jobs, including intake and conventions, remain queued. The optional lexical ABI and test-quality helpers were unavailable in the isolated head.
To get this to a good state
Make dynamic IDs disjoint from the lookup table or exclude mappings that can alias runtime-created IDs, then add the
OBJ_createcollision regression. On the new head, rerun the convention and overlap checks, the signature-algorithm CTest, and the hosted jobs; I will recheck the exact new head and results.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T05:58:11Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The current implementation can report a built-in signature mapping for an unrelated custom object ID allocated by the same LibreSSL object registry.
What I ran
Reviewed all six changed files at head
03c55fc1dc98f97ec23cef6f24a17a2ef455a761against based1ae628bc2f62459cce1e9872ba5632c938c71f2; the stack preview is clean against that base. The PR declares the landing order #14992 → #15031 → #15045 → #15119 → #15406; those dependency heads are not included, so preserve the order and reassess integration as they land. Environment: Debian Linux x86_64, Python 3.11.2, Git 2.39.5. I did not build or run CTest. I independently compared all 51 mapping rows with the pinned LibreSSL 4.0.0 source.Results
main.Precheck output and mapping comparison
Negative control
Findings
Blocking
OBJ_create_nid_postfixstarts allocating at NID 956, and the LibreSSL 3 forwarding export routesOBJ_createto that registry. After 25 custom registrations, the returned NID is 980. The new table contains 980 and the lookup returns success with digest NID 64 and key NID 990, even though that value identifies a custom object in this runtime. This can make callers treat an unrelated custom signature object as a DH signature algorithm. Reconcile the table with the target registry's built-in NID range (or otherwise make static and dynamic NIDs distinguishable), and add a regression that creates enough custom objects to reach a mapped value such as 980 and verifies that lookup does not return the unrelated built-in mapping.Non-blocking
The 51 rows match the pinned LibreSSL reference, but that establishes source-table parity only; the compatibility issue above arises from AnyPS5's forwarded dynamic object registry.
Sources
Not verified
No local build, CTest, module runtime test, Linux or Windows integration run, title/homebrew behavior, or console behavior was verified. The PR body reports extensive Linux and Windows focused testing; I did not independently reproduce those runs. The six hosted jobs, including intake and conventions, remain queued. The optional lexical ABI and test-quality helpers were unavailable in the isolated head.
To get this to a good state
Make dynamic IDs disjoint from the lookup table or exclude mappings that can alias runtime-created IDs, then add the
OBJ_createcollision regression. On the new head, rerun the convention and overlap checks, the signature-algorithm CTest, and the hosted jobs; I will recheck the exact new head and results.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T07:31:59Z.
Review: APPROVED
Re-checked — new head, collision risk addressed
The new head prevents the shared custom-object allocator from making custom NIDs appear to be signature algorithms, and the current applicable hosted checks have passed.
What I ran
Reviewed all six changed files at head
24ac9f770105c98bc55a4584208e5d760e0af5b3against based1ae628bc2f62459cce1e9872ba5632c938c71f2. The current-base merge preview is clean. Environment: Debian Linux x86_64, Python 3.11.2, Git 2.39.5; no local C++ build was run.Results
add_test.Precheck summary, heuristic output and hosted statuses
Precheck table excerpt:
The isolated-snapshot helper errors were:
The CMake file explicitly adds
tests/SignatureAlgorithms.cpptoguest_libressl3_signature_algorithms_testsand registers that executable withadd_test.Negative control
I did not run a local C++ negative control because that requires building the test. The PR description reports the previous implementation's collision behavior; I did not independently reproduce that result.
Findings
Blocking
None found in the six files reviewed at this head. The previous review's false-match concern is addressed: the test allocates custom NIDs through the shared registry and confirms those IDs do not match the signature table.
Non-blocking
The implementation deliberately leaves 18 higher-ID LibreSSL 4.0.0 mappings unsupported because the shared object registry allocates custom IDs starting at 956. The PR records this limitation as debt; it returns no match for those IDs rather than misclassifying dynamically created custom objects. Console identifier coverage and certificate interoperability remain unverified.
Sources
Not verified
No local C++ build, local CTest, PS5 firmware behavior, console behavior, or negative control was verified. The workflow skipped Linux and specialized jobs. The PR's reported Linux test and negative-control runs are author-reported, not runs I performed.
To get this to a good state
No code change is requested for this reviewed head. The documented unsupported mappings and console-verification debt remain visible. If the head changes, I will review the new diff and rerun the applicable checks.