feat(libSceLibreSsl3): return from the error-string and digest loaders #17246

Merged
fishingpvalues merged 39 commits from upstream-pr/17246 into main 2026-11-17 23:39:01 +00:00
fishingpvalues commented 2026-11-08 16:05:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fishingpvalues on 2026-11-08T16:05:41Z.


What

feat(libSceLibreSsl3): return from the error-string and digest loaders. ERR_load_X509_strings, ERR_load_PEM_strings and OpenSSL_add_all_digests are void (void) in LibreSSL, and in firmware 13.42 libSceLibreSsl3.sprx each body is a lone ret (0xc37b0, 0x989d0 and 0x10100, read from the disassembly, not run on a console), so they return without loading anything. The implementations live in src/ErrorStringLoaders.cpp, the exports leave AdditionalExports.cpp, their declarations become void in include/Api.hpp, and the Silent stubs section of docs/dev/debt/libSceLibreSsl3.md records why the tables they would fill are not modelled.

#15591 no longer implements these three: at its head 925b6e1c71 it covers only four SSL_* exports, so this PR goes first. Both PRs still edit the Additional exports count line in docs/dev/debt/libSceLibreSsl3.md; if #15591 merges second it will recount that line from the merged AdditionalExports.cpp. This branch is based on main bfdb58119e.

Tested

Linux x86-64 (Debian 13, glibc 2.41, GCC 14.2.0), Release, BUILD_TESTING=ON, base main f9c2d92b91:

  • cmake --build build --target guest_libressl3_error_string_loaders_tests --parallel 8: passed.
  • ctest --test-dir build -R '^guest_libressl3_error_string_loaders$' --output-on-failure: 1/1 passed.
  • python3 tools/check_conventions.py --base origin/main: all checks passed.
  • Merged main f9c2d92b91 and resolved the technical-debt inventory conflicts; rebuilt and reran the test.
  • Not run: Windows, a console or a title.

Checklist

  • Based on current main; mergeable with the current tip; no other open PR implements the same functions (#15591 now covers four SSL_* exports only)
  • 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:5212846446 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17246). Originally posted by [fishingpvalues](https://github.com/fishingpvalues) on 2026-11-08T16:05:41Z. --- ### What feat(libSceLibreSsl3): return from the error-string and digest loaders. `ERR_load_X509_strings`, `ERR_load_PEM_strings` and `OpenSSL_add_all_digests` are `void (void)` in LibreSSL, and in firmware 13.42 `libSceLibreSsl3.sprx` each body is a lone `ret` (`0xc37b0`, `0x989d0` and `0x10100`, read from the disassembly, not run on a console), so they return without loading anything. The implementations live in `src/ErrorStringLoaders.cpp`, the exports leave `AdditionalExports.cpp`, their declarations become `void` in `include/Api.hpp`, and the `Silent stubs` section of `docs/dev/debt/libSceLibreSsl3.md` records why the tables they would fill are not modelled. #15591 no longer implements these three: at its head `925b6e1c71` it covers only four `SSL_*` exports, so this PR goes first. Both PRs still edit the `Additional exports` count line in `docs/dev/debt/libSceLibreSsl3.md`; if #15591 merges second it will recount that line from the merged `AdditionalExports.cpp`. This branch is based on `main` `bfdb58119e`. ### Tested Linux x86-64 (Debian 13, glibc 2.41, GCC 14.2.0), Release, `BUILD_TESTING=ON`, base `main` `f9c2d92b91`: - `cmake --build build --target guest_libressl3_error_string_loaders_tests --parallel 8`: passed. - `ctest --test-dir build -R '^guest_libressl3_error_string_loaders$' --output-on-failure`: 1/1 passed. - `python3 tools/check_conventions.py --base origin/main`: all checks passed. - Merged `main` `f9c2d92b91` and resolved the technical-debt inventory conflicts; rebuilt and reran the test. - Not run: Windows, a console or a title. ### Checklist - [x] Based on current `main`; mergeable with the current tip; no other open PR implements the same functions (#15591 now covers four `SSL_*` exports only) - [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
gabichuuuuu commented 2026-11-08 16:27:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T16:27:30Z.

Review: COMMENTED


Read against the LibreSSL in 3rdparty/libressl-openbsd (078b3d1d), which is what this module follows. I haven't built or run this branch.

The three functions are empty bodies. In LibreSSL they do work. ERR_load_X509_strings and ERR_load_PEM_strings register the reason strings (x509/x509_err.c, pem/pem_err.c). OpenSSL_add_all_digests registers the digests that EVP_get_digestbyname looks up (evp/c_all.c).

Returning without doing either is a silent stub, which CONTRIBUTING doesn't allow unless the debt file lists it under Silent stubs.

  • If the module's error strings and digest lookup don't depend on registration, because the tables are always populated, the debt entry should say that and point to where.
  • Otherwise these should throw until registration exists.

Debt file: compared with main, this branch's docs/dev/debt/libSceLibreSsl3.md drops a BIO_meth line that main now has (src/BioMethod.cpp, #15761), and it repeats the new bullet on two consecutive lines. It looks rebased from an older copy of the file.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5818654092 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17246#pullrequestreview-5818654092). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-08T16:27:30Z. **Review:** COMMENTED --- Read against the LibreSSL in `3rdparty/libressl-openbsd` (`078b3d1d`), which is what this module follows. I haven't built or run this branch. **The three functions are empty bodies.** In LibreSSL they do work. `ERR_load_X509_strings` and `ERR_load_PEM_strings` register the reason strings (`x509/x509_err.c`, `pem/pem_err.c`). `OpenSSL_add_all_digests` registers the digests that `EVP_get_digestbyname` looks up (`evp/c_all.c`). Returning without doing either is a silent stub, which CONTRIBUTING doesn't allow unless the debt file lists it under Silent stubs. - If the module's error strings and digest lookup don't depend on registration, because the tables are always populated, the debt entry should say that and point to where. - Otherwise these should throw until registration exists. **Debt file:** compared with `main`, this branch's `docs/dev/debt/libSceLibreSsl3.md` drops a `BIO_meth` line that `main` now has (`src/BioMethod.cpp`, #15761), and it repeats the new bullet on two consecutive lines. It looks rebased from an older copy of the file.
MarcZX10 commented 2026-11-17 14:29:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T14:29:54Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Head 74bb3b04c4f4b31513c4795510ec52886c45df6e, base main. No build and no test run here. I read the diff for all six files and searched the repository at the head with the reader (repo_read.py search and repo_read.py cat).

Results

Check Result Note
Loader declarations and definitions match passed Header, src/ErrorStringLoaders.cpp and the test agree
Other references to the three loaders passed Only the header, the new source, the test and the debt doc
Doc claims about existing code passed DigestNames.cpp, Export.cpp and ErrorStrings.cpp do what the doc says
Build and CTest of the new target not run The author reports a pass; I did not repeat it
tools/check_conventions.py not run The author reports a pass; I did not repeat it

Findings

Blocking

None.

Non-blocking

  • docs/dev/debt/libSceLibreSsl3.md:10: the entry sits under ### Functional (heading at line 8). The house rule in CONTRIBUTING.md and the PR checklist put silent stubs under Silent stubs. These loaders are silent no-ops, so the entry belongs there. The PR checklist line "silent stubs are listed under Silent stubs" is therefore not met as written.
  • core/libs/prx/libSceLibreSsl3/tests/ErrorStringLoaders.cpp:23: the test only checks that the digest lookup returns the same pointer before and after the loader calls. It does not check anything the loaders do, so it would pass if they did nothing at all. It only shows that calling them does not crash.

Not verified

  • The build and the CTest target are not run here. The author-reported pass is not something I performed.
  • The description says this PR edits the Additional exports count line in the debt doc. The diff shows no change to a count line. I did not confirm whether the count needs updating.
  • Export binding: I checked that no other source names the three loaders. I did not check how the export table is generated from AdditionalExports.cpp and Api.hpp.
  • The firmware 13.42 disassembly claims (0xc37b0, 0x989d0, 0x10100) are not verified. Nothing here runs on a console.
  • The Silent stubs heading in the debt doc was not located in the lines I read.
  • Files read: ErrorStringLoaders.cpp and tests/ErrorStringLoaders.cpp (new files, read in full from the diff); the diffs of AdditionalExports.cpp, CMakeLists.txt, include/Api.hpp and docs/dev/debt/libSceLibreSsl3.md; the head of include/Api.hpp (lines 1–30), AdditionalExports.cpp (lines 1–20), Export.cpp (lines 20–32) and the debt doc (lines 1–40). Not read in full: AdditionalExports.cpp (219 lines), CMakeLists.txt (934 lines), include/Api.hpp (466 lines) and the debt doc (187 lines).

To get this to a good state

Nothing is required.

Optional:

  • Move the ERR_load_X509_strings entry from Functional into Silent stubs.
  • Make the test check something the loaders are meant to do, or say in the test that it only checks for no crash.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5940290227 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17246#pullrequestreview-5940290227). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T14:29:54Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Head `74bb3b04c4f4b31513c4795510ec52886c45df6e`, base `main`. No build and no test run here. I read the diff for all six files and searched the repository at the head with the reader (`repo_read.py search` and `repo_read.py cat`). ## Results | Check | Result | Note | | --- | --- | --- | | Loader declarations and definitions match | passed | Header, `src/ErrorStringLoaders.cpp` and the test agree | | Other references to the three loaders | passed | Only the header, the new source, the test and the debt doc | | Doc claims about existing code | passed | `DigestNames.cpp`, `Export.cpp` and `ErrorStrings.cpp` do what the doc says | | Build and CTest of the new target | not run | The author reports a pass; I did not repeat it | | `tools/check_conventions.py` | not run | The author reports a pass; I did not repeat it | ## Findings **Blocking** None. **Non-blocking** - `docs/dev/debt/libSceLibreSsl3.md:10`: the entry sits under `### Functional` (heading at line 8). The house rule in `CONTRIBUTING.md` and the PR checklist put silent stubs under **Silent stubs**. These loaders are silent no-ops, so the entry belongs there. The PR checklist line "silent stubs are listed under Silent stubs" is therefore not met as written. - `core/libs/prx/libSceLibreSsl3/tests/ErrorStringLoaders.cpp:23`: the test only checks that the digest lookup returns the same pointer before and after the loader calls. It does not check anything the loaders do, so it would pass if they did nothing at all. It only shows that calling them does not crash. ## Not verified - The build and the CTest target are not run here. The author-reported pass is not something I performed. - The description says this PR edits the `Additional exports` count line in the debt doc. The diff shows no change to a count line. I did not confirm whether the count needs updating. - Export binding: I checked that no other source names the three loaders. I did not check how the export table is generated from `AdditionalExports.cpp` and `Api.hpp`. - The firmware 13.42 disassembly claims (`0xc37b0`, `0x989d0`, `0x10100`) are not verified. Nothing here runs on a console. - The `Silent stubs` heading in the debt doc was not located in the lines I read. - Files read: `ErrorStringLoaders.cpp` and `tests/ErrorStringLoaders.cpp` (new files, read in full from the diff); the diffs of `AdditionalExports.cpp`, `CMakeLists.txt`, `include/Api.hpp` and `docs/dev/debt/libSceLibreSsl3.md`; the head of `include/Api.hpp` (lines 1–30), `AdditionalExports.cpp` (lines 1–20), `Export.cpp` (lines 20–32) and the debt doc (lines 1–40). Not read in full: `AdditionalExports.cpp` (219 lines), `CMakeLists.txt` (934 lines), `include/Api.hpp` (466 lines) and the debt doc (187 lines). ## To get this to a good state Nothing is required. Optional: - Move the `ERR_load_X509_strings` entry from **Functional** into **Silent stubs**. - Make the test check something the loaders are meant to do, or say in the test that it only checks for no crash.
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!17246
No description provided.