feat(libSceLibreSsl3): implement TLS_method and TLS_server_method #16848

Merged
GalaxyGamingFR merged 2 commits from upstream-pr/16848 into main 2026-11-11 14:40:13 +00:00
GalaxyGamingFR commented 2026-11-07 18:07:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by GalaxyGamingFR on 2026-11-07T18:07:27Z.


What

Implement TLS_method and TLS_server_method in libSceLibreSsl3, replacing their parameterless throwing placeholders in AdditionalExports.cpp.

  • Source: LibreSSL 4.0.0 at ce488b78 ssl_methods.c, the revision the library's debt file already uses.
  • Both return the same static LibreSsl3SslMethod with dtls 0, server 1, version 0x0304 and the 0x0301-0x0304 range, as upstream TLS_method_data does. TLS_server_method returns TLS_method() upstream too.
  • Api.hpp now declares both as returning const LibreSsl3SslMethod*. That is the layout SSL_CTX_set_min_proto_version and SSL_CTX_set_max_proto_version in the same file already read.

The gap is recorded in docs/dev/debt/libSceLibreSsl3.md: the 16-byte struct has no handshake callbacks or enc_flags, and SSL_CTX_new and SSL_new still reach libSceLibreSsl stubs that throw, so no context can be built from this method yet. The export inventory is updated (138 exports, 128 named).

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

Tested

Windows 11, WinLibs GCC 15.2.0 UCRT r7. Not a full CMake build: I compiled GuestLibreSsl3Ssl.cpp with Ssl.cpp, X509.cpp, Key.cpp and libSceLibreSsl's Error.cpp into one executable, with APS5_VABI defined empty and a one-line NotImplementedAt_nid_no_patch that throws. No title or homebrew, and not built on Linux or macOS.

  • The whole test passes, including the new CheckTlsMethod. It checks the method's fields, that both exports return the same pointer, and that SSL_CTX_set_min_proto_version and SSL_CTX_set_max_proto_version clamp against its range.
  • One deliberate bug, a 0x0302 minimum instead of 0x0301, makes the test fail at TLS method range.
  • python tools/check_conventions.py --base origin/main passes.

I searched open and merged pull requests for TLS_method and TLS_server_method just before opening this one, and none implements them. #16586, #16588 and #16589 change the same export inventory count, so whichever lands later needs a one-line 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:5204476722 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16848). Originally posted by [GalaxyGamingFR](https://github.com/GalaxyGamingFR) on 2026-11-07T18:07:27Z. --- ### What Implement `TLS_method` and `TLS_server_method` in `libSceLibreSsl3`, replacing their parameterless throwing placeholders in `AdditionalExports.cpp`. - Source: LibreSSL 4.0.0 at [`ce488b78` `ssl_methods.c`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libssl/ssl_methods.c#L246-L264), the revision the library's debt file already uses. - Both return the same static `LibreSsl3SslMethod` with `dtls` 0, `server` 1, version `0x0304` and the `0x0301`-`0x0304` range, as upstream `TLS_method_data` does. `TLS_server_method` returns `TLS_method()` upstream too. - `Api.hpp` now declares both as returning `const LibreSsl3SslMethod*`. That is the layout `SSL_CTX_set_min_proto_version` and `SSL_CTX_set_max_proto_version` in the same file already read. The gap is recorded in `docs/dev/debt/libSceLibreSsl3.md`: the 16-byte struct has no handshake callbacks or `enc_flags`, and `SSL_CTX_new` and `SSL_new` still reach libSceLibreSsl stubs that throw, so no context can be built from this method yet. The export inventory is updated (138 exports, 128 named). No title's trace or disassembly was used, and the exports were not measured on a PS5. ### Tested Windows 11, WinLibs GCC 15.2.0 UCRT r7. Not a full CMake build: I compiled `GuestLibreSsl3Ssl.cpp` with `Ssl.cpp`, `X509.cpp`, `Key.cpp` and libSceLibreSsl's `Error.cpp` into one executable, with `APS5_VABI` defined empty and a one-line `NotImplementedAt_nid_no_patch` that throws. No title or homebrew, and not built on Linux or macOS. - The whole test passes, including the new `CheckTlsMethod`. It checks the method's fields, that both exports return the same pointer, and that `SSL_CTX_set_min_proto_version` and `SSL_CTX_set_max_proto_version` clamp against its range. - One deliberate bug, a `0x0302` minimum instead of `0x0301`, makes the test fail at `TLS method range`. - `python tools/check_conventions.py --base origin/main` passes. I searched open and merged pull requests for `TLS_method` and `TLS_server_method` just before opening this one, and none implements them. #16586, #16588 and #16589 change the same export inventory count, so whichever lands later needs a one-line 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)
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!16848
No description provided.