feat(libSceLibreSsl): implement TLS alert descriptions #9870

Merged
lost9409 merged 1 commit from upstream-pr/9870 into main 2026-10-26 12:00:24 +00:00
lost9409 commented 2026-10-22 20:05:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by lost9409 on 2026-10-22T20:05:02Z.


What

Implement SSL_alert_desc_string_long in libSceLibreSsl, replacing its throwing stub.

The implementation follows LibreSSL 2.5.4:
github.com/libressl/openbsd@2e2c612066/src/lib/libssl/ssl_stat.c

It selects the low byte, returns the 30 recognized descriptions, and returns "unknown" for other codes. The public Api.hpp declaration now has the correct const char* return type and int argument. Both the implementation and fixture include the library umbrella header; there is no duplicate test-local declaration.

Existing upstream LibreSSL sources and test registrations are retained. This adds one implemented system library function; no title-unblock claim.

BunnyFl independently reports identical strings against the firmware 13.42 module executed natively on a PC: 3,841 inputs, three identical runs, with mutations detected. This was not a console run:
https://github.com/boykopovar/AnyPS5/pull/9870#issuecomment-6406774281
The debt entry now reflects this evidence and retains the console/other-firmware limitations.

Integration: the tested base is main at 204c6747d0, including the merged #9529 and #10071.

The corrected overlap scan used --branch HEAD against main at b27cc8416f. It reported no duplicate exports or new files. Manual inspection of the patches for the ten incomplete comparisons (#9446, #9535, #9536, #9571, #9745, #10248, #10418, #10475, #10570, #10571) found no added implementation of SSL_alert_desc_string_long.

Shared debt edits remain, plus CMake overlaps with #10078, #11003, #11089, #11100, #11105, #11189, #11261 and #11359. No new merge order has been agreed. Please confirm sequencing for these shared-file changes; all source/test registrations and the pending-export count must be retained when resolving them.

Tested

Windows 11 Pro build 26200, Intel i7-14700KF, WinLibs GCC 15.2.0 r7, CMake 4.3.1, Ninja 1.13.2, Release.

Tested head: 9a848d0b99.
Tested base: 204c6747d0.

  • Reconfigured from the project root with BUILD_TESTING=ON, using the existing build directory.
  • Built all registered LibreSSL test executables and patched_libraries_tests.
  • Focused CTest: 77/77 passed, zero failures, 77.98 seconds.
  • Includes 11 LibreSSL tests, patched_libraries, public_headers and 64 public_headers_compile batches.
  • guest_libressl_alert passed in 0.02 seconds.
  • Conventions against the tested base and git diff --check passed.
  • Alert coverage includes all 256 low bytes, upper bits, negative inputs, INT_MIN/INT_MAX and returned-string lifetime.

Additional Linux development validation: isolated compilation and execution of the updated alert implementation/fixture with -Wall -Wextra -Werror passed, as did the public-header audit. This was not a full Linux project build.

Not tested: a clean Windows build directory, console execution, a title, or the full repository test suite. These are local results, not hosted product CI.
AI-assisted: ChatGPT/Codex.

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 (ChatGPT/Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4973394390 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9870). Originally posted by [lost9409](https://github.com/lost9409) on 2026-10-22T20:05:02Z. --- ### What Implement SSL_alert_desc_string_long in libSceLibreSsl, replacing its throwing stub. The implementation follows LibreSSL 2.5.4: https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libssl/ssl_stat.c It selects the low byte, returns the 30 recognized descriptions, and returns "unknown" for other codes. The public Api.hpp declaration now has the correct const char* return type and int argument. Both the implementation and fixture include the library umbrella header; there is no duplicate test-local declaration. Existing upstream LibreSSL sources and test registrations are retained. This adds one implemented system library function; no title-unblock claim. BunnyFl independently reports identical strings against the firmware 13.42 module executed natively on a PC: 3,841 inputs, three identical runs, with mutations detected. This was not a console run: https://github.com/boykopovar/AnyPS5/pull/9870#issuecomment-6406774281 The debt entry now reflects this evidence and retains the console/other-firmware limitations. Integration: the tested base is main at 204c6747d0a1cbaf932def3dea0778810cc3935e, including the merged #9529 and #10071. The corrected overlap scan used --branch HEAD against main at b27cc8416f820e40ce187f165d34138e24373dd7. It reported no duplicate exports or new files. Manual inspection of the patches for the ten incomplete comparisons (#9446, #9535, #9536, #9571, #9745, #10248, #10418, #10475, #10570, #10571) found no added implementation of SSL_alert_desc_string_long. Shared debt edits remain, plus CMake overlaps with #10078, #11003, #11089, #11100, #11105, #11189, #11261 and #11359. No new merge order has been agreed. Please confirm sequencing for these shared-file changes; all source/test registrations and the pending-export count must be retained when resolving them. ### Tested Windows 11 Pro build 26200, Intel i7-14700KF, WinLibs GCC 15.2.0 r7, CMake 4.3.1, Ninja 1.13.2, Release. Tested head: 9a848d0b99366bec87296362329ec9114f0b5821. Tested base: 204c6747d0a1cbaf932def3dea0778810cc3935e. - Reconfigured from the project root with BUILD_TESTING=ON, using the existing build directory. - Built all registered LibreSSL test executables and patched_libraries_tests. - Focused CTest: 77/77 passed, zero failures, 77.98 seconds. - Includes 11 LibreSSL tests, patched_libraries, public_headers and 64 public_headers_compile batches. - guest_libressl_alert passed in 0.02 seconds. - Conventions against the tested base and git diff --check passed. - Alert coverage includes all 256 low bytes, upper bits, negative inputs, INT_MIN/INT_MAX and returned-string lifetime. Additional Linux development validation: isolated compilation and execution of the updated alert implementation/fixture with -Wall -Wextra -Werror passed, as did the public-header audit. This was not a full Linux project build. Not tested: a clean Windows build directory, console execution, a title, or the full repository test suite. These are local results, not hosted product CI. AI-assisted: ChatGPT/Codex. <!-- 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. --> ### 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 (ChatGPT/Codex) <!-- yes / no -->
MarcZX10 commented 2026-10-22 20:11:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T20:11:29Z.

Review: CHANGES_REQUESTED


I checked the source against the cited LibreSSL 2.5.4 ssl_stat.c; the 30 descriptions, low-byte selection and unknown fallback match that revision, and the reported exhaustive test matrix is useful.

There is an integration blocker in the current patch: upstream core/libs/CMakeLists.txt only adds a library-specific CMakeLists.txt when one exists under core/libs/prx/<name>/. Before this PR, libSceLibreSsl has no such file, so its fallback target includes only Export.cpp. The new Alert.cpp implementation and GuestLibreSslAlert.cpp test target therefore are not built or registered by a normal project configure. Please add the required top-level test registration (and ensure the implementation is part of the library target), then demonstrate the focused CMake build/CTest path from that configuration.

Also, GitHub's compare API currently reports this head as two commits behind and one ahead of current main (merge base f6075c2f4a), while the checklist says based on current main. Please rebase/update to current main, rerun conventions and the focused test on the final head, and update the Tested section. Hosted checks currently pass only conventions, intake and labels; no product build has run. I have not run the PR binary locally because this checkout has no configured build directory.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5620233693 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9870#pullrequestreview-5620233693). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T20:11:29Z. **Review:** CHANGES_REQUESTED --- I checked the source against the cited LibreSSL 2.5.4 `ssl_stat.c`; the 30 descriptions, low-byte selection and `unknown` fallback match that revision, and the reported exhaustive test matrix is useful. There is an integration blocker in the current patch: upstream `core/libs/CMakeLists.txt` only adds a library-specific `CMakeLists.txt` when one exists under `core/libs/prx/<name>/`. Before this PR, `libSceLibreSsl` has no such file, so its fallback target includes only `Export.cpp`. The new `Alert.cpp` implementation and `GuestLibreSslAlert.cpp` test target therefore are not built or registered by a normal project configure. Please add the required top-level test registration (and ensure the implementation is part of the library target), then demonstrate the focused CMake build/CTest path from that configuration. Also, GitHub's compare API currently reports this head as two commits behind and one ahead of current `main` (merge base `f6075c2f4a`), while the checklist says based on current main. Please rebase/update to current `main`, rerun conventions and the focused test on the final head, and update the Tested section. Hosted checks currently pass only conventions, intake and labels; no product build has run. I have not run the PR binary locally because this checkout has no configured build directory.
MarcZX10 commented 2026-10-23 03:39:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T03:39:31Z.

Review: DISMISSED


The open PRs listed in my inline discussion each add the same new CMakeLists.txt and define the same library target with separate sources and tests. Contribution rules require coordination on shared-file changes and an accurate Depends on entry. Please obtain an agreed landing order and update the checklist/combined CMake integration before approval. I reviewed the alert implementation and reported test evidence; this request is only for the unresolved build integration conflict. The PR reports Windows focused tests and checks; product CI is skipped by policy.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5623608539 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9870#pullrequestreview-5623608539). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T03:39:31Z. **Review:** DISMISSED --- The open PRs listed in my inline discussion each add the same new CMakeLists.txt and define the same library target with separate sources and tests. Contribution rules require coordination on shared-file changes and an accurate `Depends on` entry. Please obtain an agreed landing order and update the checklist/combined CMake integration before approval. I reviewed the alert implementation and reported test evidence; this request is only for the unresolved build integration conflict. The PR reports Windows focused tests and checks; product CI is skipped by policy.
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!9870
No description provided.