feat(libSceLibreSsl): return the measured version from SSLeay #9745

Merged
KernelPanicNT merged 1 commit from upstream-pr/9745 into main 2026-10-26 14:02:24 +00:00
KernelPanicNT commented 2026-10-22 11:54:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by KernelPanicNT on 2026-10-22T11:54:12Z.


What

Source of the behaviour.

  • Console measurement by @frankea in #8981 (comment), on a PS5 with firmware 13.40, with the module loaded in a game process through sceSysmoduleLoadModule:

    libSceLibreSsl is LibreSSL 2.5.4. SSLeay() returns 0x20000000, the constant every LibreSSL returns. The module's mapped image holds one "LibreSSL" string: "LibreSSL 2.5.4".

  • LibreSSL 2.5.4 (libressl-v2.5.4, 2e2c6120): SSLeay returns SSLEAY_VERSION_NUMBER, which is OPENSSL_VERSION_NUMBER, 0x20000000L. The prototype is unsigned long SSLeay(void).
  • LibreSSL 4.0.0 (libressl-v4.0.0, ce488b78) gives the same value: SSLeay, SSLEAY_VERSION_NUMBER, 0x20000000L.

SSLeay() in libSceLibreSsl now returns 0x20000000. On main it is one of the throwing stubs (Export.cpp L1629-L1632). The function takes no argument and reads no state, so this is its whole behaviour for every call. tools/progress.py lists it as a constant return; the constant is the measured one.

Changes:

  • Export.cpp: std::uint64_t SSLeay_nid_postfix(void) returns 0x20000000. The guest's unsigned long is 64 bits (SysV LP64), and std::uint64_t keeps it 64 bits on the Windows host too (LLP64), as #9529 does for ERR_get_error.
  • core/libs/prx/libSceLibreSsl/CMakeLists.txt (new): builds the module from Export.cpp as the default rule in core/libs/CMakeLists.txt does, and registers guest_libressl_version. It is the same layout as the open LibreSsl pull requests use (#9025, #9033, #9041, #9446, #9529).
  • core/libs/tests/GuestLibreSslVersion.cpp: SSLeay() returns 0x20000000, the same on a second call.
  • docs/dev/debt/libSceLibreSsl.md: the pending export count goes from 399 to 398. No new entry, as nothing is left unimplemented in this function.

How this fits with #8981: the maintainers have not chosen yet between a LibreSSL submodule and hand-written exports. This change does not depend on that choice. A submodule build at 2.5.4 or 4.0.0 returns the same constant from SSLeay, so the function and the test stay valid either way. If a submodule lands first, SSLeay_nid_postfix can forward to it, and the test can stay as it is.

Merge order with the open LibreSSL pull requests. #9025, #9033, #9041, #9043, #9047, #9446, #9448, #9529 and #9571 share this change's new core/libs/prx/libSceLibreSsl/CMakeLists.txt (all but #9571) and the count line of docs/dev/debt/libSceLibreSsl.md (all nine). There is no dependency in either direction: none of them needs SSLeay, and this change needs nothing from them. Whichever of them lands first, this pull request rebases on it, keeps its add_test blocks and source list, and lowers the count from the new value; it does not ask any of them to wait. The conflict is text only, and none of them changes SSLeay. #9535 and #9536 also edit Export.cpp and the debt file, in other functions and other lines, and do not create this CMakeLists.txt; the same applies to them.

Unblocks: none. No title is known to call SSLeay. The measurement was taken inside Gran Turismo 7 (PPSA01317), but that only means the module loads there, not that the game calls this export.

Tested

Linux x86-64 (GitHub Codespace, 4 cores, AMD EPYC 7763), this branch deff17579 rebased on main cbcb08308, built with BUILD_TESTING=ON. No title.

  • guest_libressl_version_tests: passed 5 times out of 5.
  • Negative control: with core/libs/prx/libSceLibreSsl/Export.cpp restored from main and rebuilt, the test aborts with what(): SSLeay_nid_postfix not implemented. With the change back, it passes 5 times out of 5.
  • tools/progress.py of main cbcb08308 against this branch: +1 implemented function (SSLeay_nid_postfix), 4835/11180 to 4836/11180.
  • python3 tools/check_conventions.py --base origin/main: all checks passed. git diff --check: clean.

Duplicate and overlap check

python3 tools/pr_overlap.py --branch feat/libressl-ssleay-version lists #9025, #9033, #9041, #9043, #9047, #9446, #9448 and #9529 (each creates core/libs/prx/libSceLibreSsl/CMakeLists.txt and edits the count line of docs/dev/debt/libSceLibreSsl.md) and #9571 (count line only). No shared exports. These are the text conflicts described above; none of them touches SSLeay.

Searches of open and closed pull requests for SSLeay (title, body, and the diffs of the 12 open libSceLibreSsl and libSceLibreSsl3 pull requests: #8956, #9025, #9033, #9041, #9043, #9047, #9446, #9448, #9529, #9535, #9536, #9571) find none that implements it. Searched again on 2026-10-22 up to #9732.

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 (no order needed in either direction with the open LibreSSL pull requests; see the merge order note above)
  • Fixes: none
  • Unblocks: none (no title is known to call SSLeay)
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4966912953 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9745). Originally posted by [KernelPanicNT](https://github.com/KernelPanicNT) on 2026-10-22T11:54:12Z. --- ### What **Source of the behaviour.** - Console measurement by @frankea in #8981 ([comment](https://github.com/boykopovar/AnyPS5/discussions/8981#discussioncomment-19111214)), on a PS5 with firmware 13.40, with the module loaded in a game process through `sceSysmoduleLoadModule`: > `libSceLibreSsl` is LibreSSL 2.5.4. `SSLeay()` returns 0x20000000, the constant every LibreSSL returns. The module's mapped image holds one "LibreSSL" string: "LibreSSL 2.5.4". - LibreSSL 2.5.4 (`libressl-v2.5.4`, `2e2c6120`): [`SSLeay`](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/cversion.c#L82-L86) returns `SSLEAY_VERSION_NUMBER`, which is [`OPENSSL_VERSION_NUMBER`](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/crypto.h#L138), [`0x20000000L`](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/opensslv.h#L10). The prototype is [`unsigned long SSLeay(void)`](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/crypto.h#L335). - LibreSSL 4.0.0 (`libressl-v4.0.0`, `ce488b78`) gives the same value: [`SSLeay`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/cversion.c#L83-L87), [`SSLEAY_VERSION_NUMBER`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/crypto.h#L139), [`0x20000000L`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/opensslv.h#L11). `SSLeay()` in libSceLibreSsl now returns `0x20000000`. On `main` it is one of the throwing stubs ([Export.cpp L1629-L1632](https://github.com/boykopovar/AnyPS5/blob/7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d/core/libs/prx/libSceLibreSsl/Export.cpp#L1629-L1632)). The function takes no argument and reads no state, so this is its whole behaviour for every call. `tools/progress.py` lists it as a constant return; the constant is the measured one. Changes: - `Export.cpp`: `std::uint64_t SSLeay_nid_postfix(void)` returns `0x20000000`. The guest's `unsigned long` is 64 bits (SysV LP64), and `std::uint64_t` keeps it 64 bits on the Windows host too (LLP64), as #9529 does for `ERR_get_error`. - `core/libs/prx/libSceLibreSsl/CMakeLists.txt` (new): builds the module from `Export.cpp` as the default rule in `core/libs/CMakeLists.txt` does, and registers `guest_libressl_version`. It is the same layout as the open LibreSsl pull requests use (#9025, #9033, #9041, #9446, #9529). - `core/libs/tests/GuestLibreSslVersion.cpp`: `SSLeay()` returns `0x20000000`, the same on a second call. - `docs/dev/debt/libSceLibreSsl.md`: the pending export count goes from 399 to 398. No new entry, as nothing is left unimplemented in this function. How this fits with #8981: the maintainers have not chosen yet between a LibreSSL submodule and hand-written exports. This change does not depend on that choice. A submodule build at 2.5.4 or 4.0.0 returns the same constant from `SSLeay`, so the function and the test stay valid either way. If a submodule lands first, `SSLeay_nid_postfix` can forward to it, and the test can stay as it is. **Merge order with the open LibreSSL pull requests.** #9025, #9033, #9041, #9043, #9047, #9446, #9448, #9529 and #9571 share this change's new `core/libs/prx/libSceLibreSsl/CMakeLists.txt` (all but #9571) and the count line of `docs/dev/debt/libSceLibreSsl.md` (all nine). There is no dependency in either direction: none of them needs `SSLeay`, and this change needs nothing from them. Whichever of them lands first, this pull request rebases on it, keeps its `add_test` blocks and source list, and lowers the count from the new value; it does not ask any of them to wait. The conflict is text only, and none of them changes `SSLeay`. #9535 and #9536 also edit `Export.cpp` and the debt file, in other functions and other lines, and do not create this `CMakeLists.txt`; the same applies to them. Unblocks: none. No title is known to call `SSLeay`. The measurement was taken inside Gran Turismo 7 (PPSA01317), but that only means the module loads there, not that the game calls this export. ### 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. --> Linux x86-64 (GitHub Codespace, 4 cores, AMD EPYC 7763), this branch `deff17579` rebased on `main` `cbcb08308`, built with `BUILD_TESTING=ON`. No title. - `guest_libressl_version_tests`: passed 5 times out of 5. - Negative control: with `core/libs/prx/libSceLibreSsl/Export.cpp` restored from `main` and rebuilt, the test aborts with `what(): SSLeay_nid_postfix not implemented`. With the change back, it passes 5 times out of 5. - `tools/progress.py` of `main` `cbcb08308` against this branch: +1 implemented function (`SSLeay_nid_postfix`), 4835/11180 to 4836/11180. - `python3 tools/check_conventions.py --base origin/main`: all checks passed. `git diff --check`: clean. ### Duplicate and overlap check `python3 tools/pr_overlap.py --branch feat/libressl-ssleay-version` lists #9025, #9033, #9041, #9043, #9047, #9446, #9448 and #9529 (each creates `core/libs/prx/libSceLibreSsl/CMakeLists.txt` and edits the count line of `docs/dev/debt/libSceLibreSsl.md`) and #9571 (count line only). No shared exports. These are the text conflicts described above; none of them touches `SSLeay`. Searches of open and closed pull requests for `SSLeay` (title, body, and the diffs of the 12 open libSceLibreSsl and libSceLibreSsl3 pull requests: #8956, #9025, #9033, #9041, #9043, #9047, #9446, #9448, #9529, #9535, #9536, #9571) find none that implements it. Searched again on 2026-10-22 up to #9732. ### 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 (no order needed in either direction with the open LibreSSL pull requests; see the merge order note above) - [x] Fixes: none - [x] Unblocks: none (no title is known to call `SSLeay`) - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-22 11:58:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:58:08Z.

Review: CHANGES_REQUESTED


The constant is supported by the firmware 13.40 measurement cited here, and I found no competing implementation of SSLeay. The PR also identifies shared CMake/debt-file edits with the other open LibreSSL PRs; record the agreed merge order/dependency as required by the repository overlap rule before merge.

I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5613763537 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9745#pullrequestreview-5613763537). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T11:58:08Z. **Review:** CHANGES_REQUESTED --- The constant is supported by the firmware 13.40 measurement cited here, and I found no competing implementation of `SSLeay`. The PR also identifies shared CMake/debt-file edits with the other open LibreSSL PRs; record the agreed merge order/dependency as required by the repository overlap rule before merge. I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.
MarcZX10 commented 2026-10-22 14:33:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T14:33:24Z.

Review: DISMISSED


The reported SSLeay() value is supported by the firmware measurement and LibreSSL source cited in the description, and the constant-return implementation and repeat-call assertion are appropriately scoped. I checked the current PR head f3c4ebe33e789b72b5cc921ea88f61849862fd76 against current main b7d1d47a5f: merge-tree and git diff --check are clean, and python3 tools/check_conventions.py --base upstream/main --head upstream/pr/9745 passes.

Please update this branch from current main and refresh the focused test result before merge. The report's test run is on main 4777caca3 / PR commit f3c4ebe33, while the PR is now 54 commits behind current main. I could not rerun guest_libressl_version locally: this checkout has no configured CMake/CTest build, and the filesystem has only about 760 MB free. Current hosted product-test jobs are skipped; the green hosted checks are eligibility, conventions, intake, labels and report.

There is also an overlap-rule item to resolve. The current open LibreSSL work includes #9025, #9033, #9041, #9043, #9047, #9446, #9448, #9529, #9535, #9536 and #9571; the newer #9535/#9536/#9571 stacks also edit Export.cpp and the debt inventory. Please coordinate an order with the affected authors and update Depends on as required by CONTRIBUTING.md. The description currently lists only some of these overlaps and says Depends on: none without documenting the ordering agreement. No duplicate SSLeay implementation was found in the reviewed PR bodies/diffs.

I did not run the project test locally. The PR's reported 5/5 focused runs and negative control are author-reported, not results from this review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5615910888 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9745#pullrequestreview-5615910888). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T14:33:24Z. **Review:** DISMISSED --- The reported `SSLeay()` value is supported by the firmware measurement and LibreSSL source cited in the description, and the constant-return implementation and repeat-call assertion are appropriately scoped. I checked the current PR head `f3c4ebe33e789b72b5cc921ea88f61849862fd76` against current `main` `b7d1d47a5f`: merge-tree and `git diff --check` are clean, and `python3 tools/check_conventions.py --base upstream/main --head upstream/pr/9745` passes. Please update this branch from current `main` and refresh the focused test result before merge. The report's test run is on `main` `4777caca3` / PR commit `f3c4ebe33`, while the PR is now 54 commits behind current `main`. I could not rerun `guest_libressl_version` locally: this checkout has no configured CMake/CTest build, and the filesystem has only about 760 MB free. Current hosted product-test jobs are skipped; the green hosted checks are eligibility, conventions, intake, labels and report. There is also an overlap-rule item to resolve. The current open LibreSSL work includes #9025, #9033, #9041, #9043, #9047, #9446, #9448, #9529, #9535, #9536 and #9571; the newer #9535/#9536/#9571 stacks also edit `Export.cpp` and the debt inventory. Please coordinate an order with the affected authors and update `Depends on` as required by `CONTRIBUTING.md`. The description currently lists only some of these overlaps and says `Depends on: none` without documenting the ordering agreement. No duplicate `SSLeay` implementation was found in the reviewed PR bodies/diffs. I did not run the project test locally. The PR's reported 5/5 focused runs and negative control are author-reported, not results from this review.
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!9745
No description provided.