feat(libSceLibreSsl3): implement SSL_get_version #16586

Closed
GalaxyGamingFR wants to merge 1 commit from upstream-pr/16586 into main
GalaxyGamingFR commented 2026-11-07 07:12:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by GalaxyGamingFR on 2026-11-07T07:12:45Z.


What

Implement SSL_get_version (dL2V0os4TZ4) in libSceLibreSsl3, replacing its parameterless throwing placeholder in AdditionalExports.cpp.

  • Source: LibreSSL 4.0.0 at ce488b78, the revision the library's debt file already uses: SSL_get_version and ssl_version_string.
  • It reads version at offset 0 of the existing LibreSsl3Ssl and returns TLSv1, TLSv1.1, TLSv1.2, TLSv1.3, DTLSv1 or DTLSv1.2. Any other value returns unknown. The result is a static string.
  • A null connection throws std::invalid_argument, as SSL_up_ref does in the same file. LibreSSL dereferences it and faults.

The gap is recorded in docs/dev/debt/libSceLibreSsl3.md, and the export inventory is updated (144 exports, 134 named).

No title's trace or disassembly was used, and the export was not measured on a PS5.

Tested

Windows 11, MinGW-w64 GCC 15.2 (WinLibs), Release build. No title or homebrew, and not built on Linux or macOS.

  • guest_libressl3_ssl passes. The new CheckVersionName covers the six named versions, four unknown values (0x0300, 0x0305, 0xFEFE, 0) and the null throw. It runs on a guarded LibreSsl3Ssl and checks that no byte of the connection changes.
  • One deliberate bug, TLSv1.3 returning TLSv1.2, makes the test fail.
  • python tools/check_conventions.py --base origin/main passes.

I checked the added lines of the open pull request diffs fetched earlier today for SSL_get_version, and searched open and closed pull requests for it just before opening this one. None implements it. #14890, #15289 and others only touch the neighbouring debt table lines, so the export inventory count may need a rebase.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5199401525 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16586). Originally posted by [GalaxyGamingFR](https://github.com/GalaxyGamingFR) on 2026-11-07T07:12:45Z. --- ### What Implement `SSL_get_version` (`dL2V0os4TZ4`) in `libSceLibreSsl3`, replacing its parameterless throwing placeholder in `AdditionalExports.cpp`. - Source: LibreSSL 4.0.0 at [`ce488b78`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libssl/ssl_lib.c), the revision the library's debt file already uses: `SSL_get_version` and `ssl_version_string`. - It reads `version` at offset 0 of the existing `LibreSsl3Ssl` and returns `TLSv1`, `TLSv1.1`, `TLSv1.2`, `TLSv1.3`, `DTLSv1` or `DTLSv1.2`. Any other value returns `unknown`. The result is a static string. - A null connection throws `std::invalid_argument`, as `SSL_up_ref` does in the same file. LibreSSL dereferences it and faults. The gap is recorded in `docs/dev/debt/libSceLibreSsl3.md`, and the export inventory is updated (144 exports, 134 named). No title's trace or disassembly was used, and the export was not measured on a PS5. ### Tested Windows 11, MinGW-w64 GCC 15.2 (WinLibs), Release build. No title or homebrew, and not built on Linux or macOS. - `guest_libressl3_ssl` passes. The new `CheckVersionName` covers the six named versions, four unknown values (`0x0300`, `0x0305`, `0xFEFE`, `0`) and the null throw. It runs on a guarded `LibreSsl3Ssl` and checks that no byte of the connection changes. - One deliberate bug, `TLSv1.3` returning `TLSv1.2`, makes the test fail. - `python tools/check_conventions.py --base origin/main` passes. I checked the added lines of the open pull request diffs fetched earlier today for `SSL_get_version`, and searched open and closed pull requests for it just before opening this one. None implements it. `#14890`, `#15289` and others only touch the neighbouring debt table lines, so the export inventory count may need a rebase. ### Checklist - [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 🤖 Generated with [Claude Code](https://claude.com/claude-code)

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