feat(libSceLibreSsl): report missing context certificates #16682

Merged
MarrasFederico merged 39 commits from upstream-pr/16682 into main 2026-11-11 08:47:43 +00:00
MarrasFederico commented 2026-11-07 13:27:16 +00:00 (Migrated from github.com)

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


Supersedes #16157, which GitHub closed when the head fork was deleted. The commits are unchanged; earlier review comments and Windows checks are on #16157.

What

Report NO_CERTIFICATE_ASSIGNED for a null context or a context with no certificate container. A null internal pointer throws where the source dereferences it. Non-null certificate containers and private-key matching remain unsupported.

Source and remaining gap: SSL_CTX_check_private_key - not measured on a PS5. Null-context and context-without-certificate errors follow LibreSSL 2.5.4 and its reason codes; a null internal pointer throws safely where the source dereferences it. A nonnull certificate pointer, missing private key and certificate/key match remain unsupported because the guest certificate layout and console behaviour are unverified.

python3 tools/pr_overlap.py --branch feat/libressl-ctx-check-key-errors --repo boykopovar/AnyPS5 --base main --jobs 2 examined 1885 open PRs. Confirmed textual overlaps: none; the report contains no shared export. The command exited 2 because 51 older heads conflict with its base. I compared each reported head against its own merge base, including the original stub location: none changes or adds SSL_CTX_check_private_key. Pairwise merge checks also report shared-file conflicts; these do not establish a functional dependency. Shared debt insertions may need textual reconciliation when merging the other pending-export PRs. Upstream now omits the unstable numeric total.

Tested

Ubuntu 26.04.1 LTS x86-64, GCC 15.2.0, Release, BUILD_TESTING=ON; tested main commit ce694129c4ffaaafe7fe3621ac7e038aca7b79f7.

  • Built guest_libressl_ssl_ctx_fields_tests with nice -n 19 cmake --build build --parallel 2 --target guest_libressl_ssl_ctx_fields_tests. Only one target was built at a time.
  • ctest --test-dir build -R '^guest_libressl_ssl_ctx_fields$' --output-on-failure passes with the new cases in the existing guest test.
  • Main has a throwing placeholder. Negative control kept the corrected declaration and replaced only SSL_CTX_check_private_key_nid_postfix with the original throwing body. After rebuilding the same target, the test failed with SSL_CTX_check_private_key_nid_postfix not implemented. Restoring the implementation, rebuilding and rerunning passes.
  • python3 tools/check_conventions.py --base upstream/main and git diff --check pass. No title, console or Windows run.

After merging upstream main 04cdd527604d521845afc58f9374afb92ff85f76, rebuilt the same target with the same limits and reran the focused test: it passes. The feature code and test changes are identical to those used for the negative control above; only upstream updates and the debt inventory reconciliation were merged.

After merging upstream main 151a2cb6e274f594a09c8a2ca42f44af2e5c40d8, rebuilt the same target with the same limits and reran the focused test: it passes. The feature code and test changes are identical to those used for the negative control above; only upstream updates and the debt inventory reconciliation were merged.

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

Merge verification: updated against main eed8517b310a55adbbb178df781d7d9ed2eeee7b with a normal merge. Main and this PR are preserved independently; the implemented function bodies are unchanged. Built guest_libressl_ssl_ctx_fields_tests with nice -n 19 cmake --build build --parallel 2 --target guest_libressl_ssl_ctx_fields_tests; ctest --test-dir build -R '^guest_libressl_ssl_ctx_fields$' --output-on-failure passes. Conventions and the public-header audit pass. No console or Windows run.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5202049286 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16682). Originally posted by [MarrasFederico](https://github.com/MarrasFederico) on 2026-11-07T13:27:16Z. --- Supersedes #16157, which GitHub closed when the head fork was deleted. The commits are unchanged; earlier review comments and Windows checks are on #16157. ### What Report NO_CERTIFICATE_ASSIGNED for a null context or a context with no certificate container. A null internal pointer throws where the source dereferences it. Non-null certificate containers and private-key matching remain unsupported. Source and remaining gap: [SSL_CTX_check_private_key](https://github.com/MarrasFederico/AnyPS5/blob/74782c34a0e015c48e57f8c81b99b4290f448e58/core/libs/prx/libSceLibreSsl/src/SslCtx.cpp#L254) - not measured on a PS5. Null-context and context-without-certificate errors follow [LibreSSL 2.5.4](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libssl/ssl_lib.c#L869-L882) and its [reason codes](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libssl/ssl.h#L1894-L1909); a null internal pointer throws safely where the source dereferences it. A nonnull certificate pointer, missing private key and certificate/key match remain unsupported because the guest certificate layout and console behaviour are unverified. `python3 tools/pr_overlap.py --branch feat/libressl-ctx-check-key-errors --repo boykopovar/AnyPS5 --base main --jobs 2` examined 1885 open PRs. Confirmed textual overlaps: none; the report contains no shared export. The command exited 2 because 51 older heads conflict with its base. I compared each reported head against its own merge base, including the original stub location: none changes or adds `SSL_CTX_check_private_key`. Pairwise merge checks also report shared-file conflicts; these do not establish a functional dependency. Shared debt insertions may need textual reconciliation when merging the other pending-export PRs. Upstream now omits the unstable numeric total. ### Tested Ubuntu 26.04.1 LTS x86-64, GCC 15.2.0, Release, `BUILD_TESTING=ON`; tested main commit `ce694129c4ffaaafe7fe3621ac7e038aca7b79f7`. - Built `guest_libressl_ssl_ctx_fields_tests` with `nice -n 19 cmake --build build --parallel 2 --target guest_libressl_ssl_ctx_fields_tests`. Only one target was built at a time. - `ctest --test-dir build -R '^guest_libressl_ssl_ctx_fields$' --output-on-failure` passes with the new cases in the existing guest test. - Main has a throwing placeholder. Negative control kept the corrected declaration and replaced only `SSL_CTX_check_private_key_nid_postfix` with the original throwing body. After rebuilding the same target, the test failed with `SSL_CTX_check_private_key_nid_postfix not implemented`. Restoring the implementation, rebuilding and rerunning passes. - `python3 tools/check_conventions.py --base upstream/main` and `git diff --check` pass. No title, console or Windows run. <!-- 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. --> After merging upstream main `04cdd527604d521845afc58f9374afb92ff85f76`, rebuilt the same target with the same limits and reran the focused test: it passes. The feature code and test changes are identical to those used for the negative control above; only upstream updates and the debt inventory reconciliation were merged. After merging upstream main `151a2cb6e274f594a09c8a2ca42f44af2e5c40d8`, rebuilt the same target with the same limits and reran the focused test: it passes. The feature code and test changes are identical to those used for the negative control above; only upstream updates and the debt inventory reconciliation were merged. ### 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes Merge verification: updated against main `eed8517b310a55adbbb178df781d7d9ed2eeee7b` with a normal merge. Main and this PR are preserved independently; the implemented function bodies are unchanged. Built `guest_libressl_ssl_ctx_fields_tests` with `nice -n 19 cmake --build build --parallel 2 --target guest_libressl_ssl_ctx_fields_tests`; `ctest --test-dir build -R '^guest_libressl_ssl_ctx_fields$' --output-on-failure` passes. Conventions and the public-header audit pass. No console or Windows run.
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!16682
No description provided.