feat(libSceLibreSsl3): accept null point and key-context disposal #16690

Closed
MarrasFederico wants to merge 12 commits from upstream-pr/16690 into main
MarrasFederico commented 2026-11-07 13:28:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-11-07T13:28:03Z.


Supersedes #16186, which GitHub closed when the head fork was deleted. Earlier review comments and Windows checks are on #16186.

What

EC_POINT_clear_free and EVP_PKEY_CTX_free now accept null as a no-op. All non-null objects remain unsupported and throw before dereference. Their void(void*) declarations replace the unknown-signature placeholders; the bodies move out of AdditionalExports.cpp. Export.cpp has 45 remaining throwing exports. The additional inventory contains 137 entries (127 named and ten NID-only), counted independently for this PR.

EC_POINT_clear_free and EVP_PKEY_CTX_free - not measured on a PS5; non-null point or key-context disposal remains unsupported and throws before dereference. The null no-ops follow LibreSSL 4.0.0 EC_POINT_free and its EC_POINT_clear_free wrapper and EVP_PKEY_CTX_free.

The LibreSSL3 debt/count edits share inventory bookkeeping with #16111, #15599 and #15601; CMake/header and neighboring debt insertions also overlap other open LibreSSL3 work. The totals have been recalculated against main; none is a functional dependency.

python3 tools/pr_overlap.py --branch feat/libressl3-point-context-null-free --repo boykopovar/AnyPS5 --base main --jobs 2 examined 1899 open PRs. It returned 2 because some older heads cannot merge with its base. I compared all 44 reported shared-file heads with their own merge bases, including the original placeholder locations and added declarations/definitions: none changes or implements these exports. Searches by function name found no existing implementation PR.

The related #16185 handles different null frees and also changes the additional-export table/count and CMake insertion point. Its bookkeeping must be reconciled according to merge order; no export is shared.

Tested

Linux, GCC 15.2.0, Release, BUILD_TESTING=ON. Merged upstream main 990481cdbf3eb6a9d8b1167b17f67bdbd54f1c78 with a normal merge; original branch history is retained. Reviewed the resolution against the original feature and its cited sources, keeping main's implementations, tests and debt entries.

  • nice -n 19 cmake --build build --parallel 2 --target core/libs/prx/libSceLibreSsl3/all passes; builds ran one target at a time.
  • ctest --test-dir build/core/libs/prx/libSceLibreSsl3 -R guest_libressl3 --output-on-failure: 100% tests passed out of 35.
  • python3 tools/check_conventions.py --base upstream/main, the public-header audit and git diff --check upstream/main pass. Existing debt-length warnings remain.
  • Export.cpp has 45 remaining throwing exports. The additional inventory contains 137 entries (127 named and ten NID-only), counted independently for this PR.

No new Windows, macOS or console execution was performed. Shared header, test and debt edits still require normal reconciliation when other independent library PRs merge.

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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5202055108 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16690). Originally posted by [MarrasFederico](https://github.com/MarrasFederico) on 2026-11-07T13:28:03Z. --- Supersedes #16186, which GitHub closed when the head fork was deleted. Earlier review comments and Windows checks are on #16186. ### What `EC_POINT_clear_free` and `EVP_PKEY_CTX_free` now accept null as a no-op. All non-null objects remain unsupported and throw before dereference. Their `void(void*)` declarations replace the unknown-signature placeholders; the bodies move out of AdditionalExports.cpp. `Export.cpp` has 45 remaining throwing exports. The additional inventory contains 137 entries (127 named and ten NID-only), counted independently for this PR. [EC_POINT_clear_free and EVP_PKEY_CTX_free](https://github.com/MarrasFederico/AnyPS5/blob/49d0664302976e90fce4a7fb2be9a6a4bbc8c806/core/libs/prx/libSceLibreSsl3/src/NullFrees.cpp#L6) - not measured on a PS5; non-null point or key-context disposal remains unsupported and throws before dereference. The null no-ops follow LibreSSL 4.0.0 [`EC_POINT_free` and its `EC_POINT_clear_free` wrapper](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/ec/ec_lib.c#L697-L716) and [`EVP_PKEY_CTX_free`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/evp/pmeth_lib.c#L201-L212). The LibreSSL3 debt/count edits share inventory bookkeeping with #16111, #15599 and #15601; CMake/header and neighboring debt insertions also overlap other open LibreSSL3 work. The totals have been recalculated against main; none is a functional dependency. `python3 tools/pr_overlap.py --branch feat/libressl3-point-context-null-free --repo boykopovar/AnyPS5 --base main --jobs 2` examined 1899 open PRs. It returned 2 because some older heads cannot merge with its base. I compared all 44 reported shared-file heads with their own merge bases, including the original placeholder locations and added declarations/definitions: none changes or implements these exports. Searches by function name found no existing implementation PR. The related #16185 handles different null frees and also changes the additional-export table/count and CMake insertion point. Its bookkeeping must be reconciled according to merge order; no export is shared. ### Tested Linux, GCC 15.2.0, Release, `BUILD_TESTING=ON`. Merged upstream main `990481cdbf3eb6a9d8b1167b17f67bdbd54f1c78` with a normal merge; original branch history is retained. Reviewed the resolution against the original feature and its cited sources, keeping main's implementations, tests and debt entries. - `nice -n 19 cmake --build build --parallel 2 --target core/libs/prx/libSceLibreSsl3/all` passes; builds ran one target at a time. - `ctest --test-dir build/core/libs/prx/libSceLibreSsl3 -R guest_libressl3 --output-on-failure`: **100% tests passed out of 35**. - `python3 tools/check_conventions.py --base upstream/main`, the public-header audit and `git diff --check upstream/main` pass. Existing debt-length warnings remain. - `Export.cpp` has 45 remaining throwing exports. The additional inventory contains 137 entries (127 named and ten NID-only), counted independently for this PR. No new Windows, macOS or console execution was performed. Shared header, test and debt edits still require normal reconciliation when other independent library PRs merge. ### 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: none <!-- #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 -->
gabichuuuuu commented 2026-11-08 21:44:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T21:44:31Z.

Review: COMMENTED


Windows run of head d1c2455512, merged onto main 095ff72367 in one tree with other open PRs that touch different files (each PR's test is its own file, so they don't interact). Setup: Windows 11, WinLibs GCC 15.2 r7 (x86_64-ucrt-posix-seh, the CI toolchain), Release, BUILD_TESTING=ON.

  • guest_libressl3_null_frees with --repeat until-fail:5: 5 / 5 pass.
  • No runnable negative control: the test calls the new prototypes, which main doesn't have.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5819795250 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16690#pullrequestreview-5819795250). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-08T21:44:31Z. **Review:** COMMENTED --- Windows run of head `d1c2455512`, merged onto `main` `095ff72367` in one tree with other open PRs that touch different files (each PR's test is its own file, so they don't interact). Setup: Windows 11, WinLibs GCC 15.2 r7 (`x86_64-ucrt-posix-seh`, the CI toolchain), Release, `BUILD_TESTING=ON`. - `guest_libressl3_null_frees` with `--repeat until-fail:5`: 5 / 5 pass. - No runnable negative control: the test calls the new prototypes, which `main` doesn't have.

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!16690
No description provided.