feat(libSceLibreSsl3): implement numeric object identifier text parsing #12315

Closed
Ninot1Quyi wants to merge 6 commits from upstream-pr/12315 into main
Ninot1Quyi commented 2026-10-28 09:15:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ninot1Quyi on 2026-10-28T09:15:12Z.


What

Implements OBJ_txt2obj in libSceLibreSsl3 using the contracts and object metadata from LibreSSL 4.0.0 at ce488b78e0bd994780569df718596b9776ff681a.

  • Resolves short and long names against a separate 1,056-entry LibreSSL3 object table with 1,049 entries in each name index, keeping it separate from the older module's table.
  • Encodes numeric OIDs, including the reference's separators, rejection reasons and uint64 arithmetic. Parse failures use the existing LibreSSL error queue; null text throws.
  • Allocates numeric objects and OID data on the guest heap with ownership flags 9, and adds focused coverage for names, numeric boundaries, error state and allocation failures.

Public destruction depends on #10461, which is still open. The focused parser test releases its allocations directly and does not establish constructor/destructor interoperability through ASN1_OBJECT_free. PS5 object layout, cross-module error-queue sharing and allocator/ABI interoperability remain unverified and are recorded in docs/dev/debt/libSceLibreSsl3.md.

Submission-time python3 tools/pr_overlap.py --repo boykopovar/AnyPS5 --base main --branch feat/libressl3-object-text completed against 1,383 open PRs at main a57567928d2c0bac40aaf81f3ad4b189d49d0b8f. It found no duplicate export or new file, and shared-line edits with #10452, #10461, #10490, #10491, #10493, #10557, #10631 and #10960, principally in CMake and the debt record; #10631 also changes the adjacent OBJ_cmp declaration/stub. #9970 conflicts with main and could not be automatically compared; manual inspection of its shared-file diff confirms it implements OpenSSL_version and adjusts its test/debt entries, without implementing OBJ_txt2obj. The subsequent main updates through 284a487cd978824f442955918ec0f99ab9c556d3 do not change these library files or the contribution/CI rules. Shared-file merge order remains to be coordinated with their authors; #10461 is the functional lifecycle prerequisite and declares its own dependencies on #9970 and #10452.

Tested

The cloud validation below applies to commit 56f4e91f047af073b6b282bb48f66f4cd6d8b6e3, based on upstream b99bbebacd1d19e5be08f7858ac48527452bc4ba. For submission, the branch was rebased without conflicts onto 284a487cd978824f442955918ec0f99ab9c556d3; git range-diff confirms the patch is unchanged at 3636321d09342a04fe4bff55ccd6f6a8dfcf612a. The full build/runtime suite has not been rerun on the rebased commit.

  • Linux Release default full build: passed. Explicit libs build: passed.
  • Full CTest run: 2,651 tests; 2,404 passed, 130 failed, 117 skipped. These are the original results; neither failures nor skips are counted as passes.
  • autorun_exit_status passed a separate rerun after normalizing the build-environment permissions and adding umask 022 to its setup script. The original full-run totals remain unchanged; 129 failures still have no passing result.
  • guest_crypto_memcmp, all four guest_libressl3_* tests (including guest_libressl3_object_parser) and public_headers: passed.
  • Test-registration audit, diff whitespace check and contribution-conventions check: passed in the cloud validation.
  • Independent comparison against the pinned LibreSSL reference: 500,000 numeric OIDs and 2,098 name queries matched outputs and errors. Numeric comparisons also passed AddressSanitizer and UndefinedBehaviorSanitizer. All object-table fields, bytes and indexes matched.
  • Submission-time local checks: the source registration audit (python3 tools/check_test_registration.py --scripts) found all 209 test scripts registered; git diff --check origin/main...HEAD passed; python3 tools/check_conventions.py --base origin/main reported 0 errors and one debt-entry-length warning. The original Linux logs are retained in the cloud workspace; they are not attached here.

An independent self-process syscall probe in the cloud environment returned ENOSYS (38) for process_vm_readv, process_vm_writev and userfaultfd. The outstanding failures were classified as follows:

Remaining failures Count Evidence
Process-memory read/write syscalls unavailable 93 Test logs explicitly report ENOSYS; includes one AGC storage_file_write test
AGC write-tracking capability unavailable 35 29 directly report the missing prerequisite; 6 depend on write tracking according to the relevant source paths
guest_credentials 1 Source inference: the process_vm_writev failure return matches the failed assertion; its log does not print errno

check_skips.py --require-tests rejected 15 of the 117 skips; these also require the missing write-tracking capability. The other skips being allowed by policy does not mean those tests ran successfully. These findings explain the environment blocker, but do not guarantee that every assertion will pass in CI. No tests were disabled and no product behavior was changed to hide these failures.

Windows, PS5 hardware, actual game execution, physical GPUs and cross-module ABI interoperability have no passing result from this work.

Original cloud commands and log locations
source /workspace/.onboarding/activate.sh
cd /workspace/AnyPS5
umask 022
cmake --build build --parallel 4
cmake --build build --target libs --parallel 4
ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx ctest --test-dir build --parallel 4 --output-on-failure --timeout 120 --no-tests=error --output-log /workspace/.onboarding/full-ctest.log --output-junit /workspace/.onboarding/full-ctest.xml
python3 tools/check_skips.py /workspace/.onboarding/full-ctest.xml --require-tests

Cloud workspace records:

  • /workspace/.onboarding/full-build.log
  • /workspace/.onboarding/full-libs-build.log
  • /workspace/.onboarding/full-ctest.log
  • /workspace/.onboarding/full-ctest.xml
  • /workspace/.onboarding/full-failures.txt
  • /workspace/.onboarding/autorun-recheck.xml

Maintainer CI request: please run the upstream Build workflow for this PR's merge with current main, with full=true, linux=true and select=false, so both full Linux and Windows jobs run without PR-based test selection. This account has no upstream write permission; the Linux job requires the upstream self-hosted anyps5 runner.

gh workflow run build.yml --repo boykopovar/AnyPS5 --ref main --field pr=12315 --field full=true --field linux=true --field select=false

Please verify the tested head/merge commit, that both jobs actually execute, and their CTest and skip-policy results. A partial set of green checks does not establish full validation. Any subsequent commits require another full run. Please also confirm #10461 is satisfied before merging.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #10461
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5048015462 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12315). Originally posted by [Ninot1Quyi](https://github.com/Ninot1Quyi) on 2026-10-28T09:15:12Z. --- ### What Implements `OBJ_txt2obj` in libSceLibreSsl3 using the contracts and object metadata from [LibreSSL 4.0.0 at ce488b78e0bd994780569df718596b9776ff681a](https://github.com/libressl/openbsd/tree/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto). - Resolves short and long names against a separate 1,056-entry LibreSSL3 object table with 1,049 entries in each name index, keeping it separate from the older module's table. - Encodes numeric OIDs, including the reference's separators, rejection reasons and uint64 arithmetic. Parse failures use the existing LibreSSL error queue; null text throws. - Allocates numeric objects and OID data on the guest heap with ownership flags 9, and adds focused coverage for names, numeric boundaries, error state and allocation failures. Public destruction depends on #10461, which is still open. The focused parser test releases its allocations directly and does not establish constructor/destructor interoperability through `ASN1_OBJECT_free`. PS5 object layout, cross-module error-queue sharing and allocator/ABI interoperability remain unverified and are recorded in `docs/dev/debt/libSceLibreSsl3.md`. Submission-time `python3 tools/pr_overlap.py --repo boykopovar/AnyPS5 --base main --branch feat/libressl3-object-text` completed against 1,383 open PRs at main `a57567928d2c0bac40aaf81f3ad4b189d49d0b8f`. It found no duplicate export or new file, and shared-line edits with #10452, #10461, #10490, #10491, #10493, #10557, #10631 and #10960, principally in CMake and the debt record; #10631 also changes the adjacent `OBJ_cmp` declaration/stub. #9970 conflicts with main and could not be automatically compared; manual inspection of its shared-file diff confirms it implements `OpenSSL_version` and adjusts its test/debt entries, without implementing `OBJ_txt2obj`. The subsequent main updates through `284a487cd978824f442955918ec0f99ab9c556d3` do not change these library files or the contribution/CI rules. Shared-file merge order remains to be coordinated with their authors; #10461 is the functional lifecycle prerequisite and declares its own dependencies on #9970 and #10452. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> The cloud validation below applies to commit `56f4e91f047af073b6b282bb48f66f4cd6d8b6e3`, based on upstream `b99bbebacd1d19e5be08f7858ac48527452bc4ba`. For submission, the branch was rebased without conflicts onto `284a487cd978824f442955918ec0f99ab9c556d3`; `git range-diff` confirms the patch is unchanged at `3636321d09342a04fe4bff55ccd6f6a8dfcf612a`. The full build/runtime suite has not been rerun on the rebased commit. - Linux Release default full build: passed. Explicit `libs` build: passed. - Full CTest run: **2,651 tests; 2,404 passed, 130 failed, 117 skipped**. These are the original results; neither failures nor skips are counted as passes. - `autorun_exit_status` passed a separate rerun after normalizing the build-environment permissions and adding `umask 022` to its setup script. The original full-run totals remain unchanged; **129 failures still have no passing result**. - `guest_crypto_memcmp`, all four `guest_libressl3_*` tests (including `guest_libressl3_object_parser`) and `public_headers`: passed. - Test-registration audit, diff whitespace check and contribution-conventions check: passed in the cloud validation. - Independent comparison against the pinned LibreSSL reference: **500,000 numeric OIDs and 2,098 name queries** matched outputs and errors. Numeric comparisons also passed AddressSanitizer and UndefinedBehaviorSanitizer. All object-table fields, bytes and indexes matched. - Submission-time local checks: the source registration audit (`python3 tools/check_test_registration.py --scripts`) found all 209 test scripts registered; `git diff --check origin/main...HEAD` passed; `python3 tools/check_conventions.py --base origin/main` reported 0 errors and one debt-entry-length warning. The original Linux logs are retained in the cloud workspace; they are not attached here. An independent self-process syscall probe in the cloud environment returned `ENOSYS (38)` for `process_vm_readv`, `process_vm_writev` and `userfaultfd`. The outstanding failures were classified as follows: | Remaining failures | Count | Evidence | | --- | ---: | --- | | Process-memory read/write syscalls unavailable | 93 | Test logs explicitly report ENOSYS; includes one AGC storage_file_write test | | AGC write-tracking capability unavailable | 35 | 29 directly report the missing prerequisite; 6 depend on write tracking according to the relevant source paths | | guest_credentials | 1 | Source inference: the process_vm_writev failure return matches the failed assertion; its log does not print errno | `check_skips.py --require-tests` rejected 15 of the 117 skips; these also require the missing write-tracking capability. The other skips being allowed by policy does not mean those tests ran successfully. These findings explain the environment blocker, but do not guarantee that every assertion will pass in CI. No tests were disabled and no product behavior was changed to hide these failures. Windows, PS5 hardware, actual game execution, physical GPUs and cross-module ABI interoperability have no passing result from this work. <details> <summary>Original cloud commands and log locations</summary> ```sh source /workspace/.onboarding/activate.sh cd /workspace/AnyPS5 umask 022 cmake --build build --parallel 4 cmake --build build --target libs --parallel 4 ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx ctest --test-dir build --parallel 4 --output-on-failure --timeout 120 --no-tests=error --output-log /workspace/.onboarding/full-ctest.log --output-junit /workspace/.onboarding/full-ctest.xml python3 tools/check_skips.py /workspace/.onboarding/full-ctest.xml --require-tests ``` Cloud workspace records: - `/workspace/.onboarding/full-build.log` - `/workspace/.onboarding/full-libs-build.log` - `/workspace/.onboarding/full-ctest.log` - `/workspace/.onboarding/full-ctest.xml` - `/workspace/.onboarding/full-failures.txt` - `/workspace/.onboarding/autorun-recheck.xml` </details> **Maintainer CI request:** please run the upstream Build workflow for this PR's merge with current main, with `full=true`, `linux=true` and `select=false`, so both full Linux and Windows jobs run without PR-based test selection. This account has no upstream write permission; the Linux job requires the upstream self-hosted `anyps5` runner. ```sh gh workflow run build.yml --repo boykopovar/AnyPS5 --ref main --field pr=12315 --field full=true --field linux=true --field select=false ``` Please verify the tested head/merge commit, that both jobs actually execute, and their CTest and skip-policy results. A partial set of green checks does not establish full validation. Any subsequent commits require another full run. Please also confirm #10461 is satisfied before merging. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #10461 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-10-28 09:18:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T09:18:02Z.

Review: CHANGES_REQUESTED


The PR identifies obj_dat.c and a_object.c as implementation references, and the cited LibreSSL revision's files carry Eric Young's BSD license notice. The new ObjectParser.cpp has no source notice. Please retain the applicable upstream notice for any derived implementation, or clarify the independent provenance and license handling; verify the generated table's source metadata as well. This is a source-redistribution requirement, not a functional objection. The PR's hosted checks are still queued, so I have not assessed those as passing.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5680296316 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12315#pullrequestreview-5680296316). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T09:18:02Z. **Review:** CHANGES_REQUESTED --- The PR identifies `obj_dat.c` and `a_object.c` as implementation references, and the cited LibreSSL revision's files carry Eric Young's BSD license notice. The new `ObjectParser.cpp` has no source notice. Please retain the applicable upstream notice for any derived implementation, or clarify the independent provenance and license handling; verify the generated table's source metadata as well. This is a source-redistribution requirement, not a functional objection. The PR's hosted checks are still queued, so I have not assessed those as passing.
MarcZX10 commented 2026-11-18 15:42:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T15:42:28Z.

Review: COMMENTED


Reviewed — comments

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 2ed4f784045b3bd2489fe99dae67be0004a27dda. Read the prepared diff and changed source, test, and build-registration lines; no commands or tests were run.

Results

Check Result Note
Source review passed Numeric parsing and allocation paths inspected
Tests not run Author-reported results only
Console and ABI not run Limitations disclosed in the description

Findings

Blocking

None.

Non-blocking

  • The implementation deliberately leaves name lookup unimplemented and throws for nonnumeric text when noName == 0 (core/libs/prx/libSceLibreSsl3/src/NumericObject.cpp:118). This is recorded in the debt entry; consider keeping the PR title and user-facing scope clear that it provides numeric parsing only.

  • The submission description reports that the full build and runtime suite was not rerun on this rebased head and requests full Linux and Windows CI. Those results should be checked before merging; the supplied results are author-reported, not run in this review.

Not verified

No tests or build checks were run. PS5 layout, cross-module error-queue sharing, allocator and ABI interoperability, ASN1_OBJECT_free lifecycle behavior, and Windows or console behavior remain unverified as described by the author. Read all changed-line ranges for CMakeLists.txt, Api.hpp, NumericObject.cpp, tests/ObjectParser.cpp, docs/dev/debt/libSceLibreSsl3.md, and tools/observe_libressl3_oid.py; Export.cpp has no added lines. No changed files were excluded by the supplied manifest.

To get this to a good state

Nothing is required.

Optional: confirm the requested full Linux and Windows CI on the exact merge head, and retain the disclosed numeric-only scope until name lookup and lifecycle compatibility are verified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5959899573 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12315#pullrequestreview-5959899573). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T15:42:28Z. **Review:** COMMENTED --- # Reviewed — comments Nothing blocks this; the points below are optional. ## What I ran Reviewed head `2ed4f784045b3bd2489fe99dae67be0004a27dda`. Read the prepared diff and changed source, test, and build-registration lines; no commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Numeric parsing and allocation paths inspected | | Tests | not run | Author-reported results only | | Console and ABI | not run | Limitations disclosed in the description | ## Findings ### Blocking None. ### Non-blocking - The implementation deliberately leaves name lookup unimplemented and throws for nonnumeric text when `noName == 0` (`core/libs/prx/libSceLibreSsl3/src/NumericObject.cpp:118`). This is recorded in the debt entry; consider keeping the PR title and user-facing scope clear that it provides numeric parsing only. - The submission description reports that the full build and runtime suite was not rerun on this rebased head and requests full Linux and Windows CI. Those results should be checked before merging; the supplied results are author-reported, not run in this review. ## Not verified No tests or build checks were run. PS5 layout, cross-module error-queue sharing, allocator and ABI interoperability, `ASN1_OBJECT_free` lifecycle behavior, and Windows or console behavior remain unverified as described by the author. Read all changed-line ranges for `CMakeLists.txt`, `Api.hpp`, `NumericObject.cpp`, `tests/ObjectParser.cpp`, `docs/dev/debt/libSceLibreSsl3.md`, and `tools/observe_libressl3_oid.py`; `Export.cpp` has no added lines. No changed files were excluded by the supplied manifest. ## To get this to a good state Nothing is required. Optional: confirm the requested full Linux and Windows CI on the exact merge head, and retain the disclosed numeric-only scope until name lookup and lifecycle compatibility are verified.
ligmaSec commented 2026-12-03 22:56:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:56:34Z.

Review: COMMENTED


Current main already routes this NID to LibreSsl3::ObjectFromText in Objects.cpp, introduced in fbfc42d7a3. The trial merge conflicts in CMakeLists.txt, Export.cpp and Api.hpp at that boundary. Please compare the numeric encoding and error-queue assertions here with the shipped implementation and carry forward only distinct compatibility coverage. The numeric-only implementation in this branch still throws for named inputs when lookup is enabled, so restoring that export would lose behavior already on main. Please put any retained debt update in a fragment.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6180102444 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12315#pullrequestreview-6180102444). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:56:34Z. **Review:** COMMENTED --- Current `main` already routes this NID to `LibreSsl3::ObjectFromText` in `Objects.cpp`, introduced in `fbfc42d7a3`. The trial merge conflicts in `CMakeLists.txt`, `Export.cpp` and `Api.hpp` at that boundary. Please compare the numeric encoding and error-queue assertions here with the shipped implementation and carry forward only distinct compatibility coverage. The numeric-only implementation in this branch still throws for named inputs when lookup is enabled, so restoring that export would lose behavior already on `main`. Please put any retained debt update in a fragment. AI-assisted: yes.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12315
No description provided.