feat(libSceLibreSsl): implement SSL_get_servername #15280
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15280"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by alvaroelpob on 2026-11-02T22:37:42Z.
What
Implements
SSL_get_servername(const SSL*, int)in libSceLibreSsl, which threw and was declared without parameters.As in LibreSSL 2.5.4
ssl_lib.c:TLSEXT_NAMETYPE_host_name(0) returns null.tlsext_hostname, or the session's when the connection has none and a session is set.The connection's hostname is at offset 184 of #10481's
SSLlayout, now checked with astatic_assert. The session's is at offset 192 of the 232-byteSSL_SESSION; it is read by offset, so as not to define a second session struct next to #10482's. Both offsets come from compiling the 2.5.4 release'sssl_locl.h.Builds on the PRs below, which extend the same file and test. A null connection with type 0, which LibreSSL dereferences, throws. The pending count drops by one.
Tested
Linux:
suite.py feat/libscelibressl-ssl-get-servernameat9e645f001a: CTest 6574/6574 passed; conventions passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-04T00:37:47Z.
Review: APPROVED
@alvaroelpob approved at
3d5881e4a1. I only looked at the newSSL_get_servername; the code from #10481, #15278 and #15279 is theirs to review.What I ran: this head merged onto
main(mergeff09222833), Windows 11, WinLibs GCC, Release.guest_libressl_sslandpublic_headerspass (2 of 2). That covers the Windows run your description lists as not tested.tools/check_conventions.py --base upstream/main --headon this head: all checks pass.SSL_get_servernamereturningnullptrfirst,guest_libressl_sslfails at line 185 (1 of 1).Firmware: this answers what the layout compile left open. In 13.42
system/common/lib/libSceLibreSsl.sprx(sha25657de57100cdeecdf8db74d6914b0c50ac9a9113fead232d03dce2df227cd9032),SSL_get_servername(BMcXei7NXB8) is, read from disassembly and not run:The type check comes first, then the session at
0x80, the connection's hostname at0xb8and the session's at+0xc0. That is your order,sessionat 128,tlsextHostnameat 184 andSessionTlsextHostnameOffset192.So the offsets you got from compiling LibreSSL 2.5.4 match the console module.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:20:35Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed code has no verified blocking defect, but the review bundle’s
files.jsonwas unavailable, so reviewed-file completeness could not be confirmed.What I ran
Reviewed head
59a665f9c643fbf792bb81d5c083dc66d6d439deusingrepo_read.pyto inspect the prepared diff and targeted source ranges. No build or test commands were run.Results
files.jsonunavailableFindings
Blocking
None verified in the inspected implementation.
Non-blocking
None.
Not verified
files.jsoncould not be read from the provided review resources, so the exact reviewed/excluded file accounting is unconfirmed. No build, tests, convention checks, Windows run, or console behavior were verified. The author reports test results indescription.md; they were not run by this review.Files read:
Export.cpp,include/Api.hpp,src/Ssl.cpp,Stack.cpp,GuestLibreSslSsl.cpp,docs/dev/debt/libSceLibreSsl.md, plus the prepared description, commits, manifest, and diff. Excluded-file list was not available; the manifest marks all five changed files as included.To get this to a good state
Nothing is required. Optional: restore access to
files.jsonso the reviewed-file accounting can be confirmed.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T06:48:39Z.
Review: COMMENTED
Reviewed — comments
The review covers all changed files at head
9e645f001a846bb5fb86894b95c10bed7d3d7f4b; no check was run, and a documented layout assumption remains unverified.What I ran
Read the prepared description, commit list, manifest, diff, and all changed lines listed in the manifest. Read the relevant declarations and implementations in
Api.hpp,Ssl.cpp, andGuestLibreSslSsl.cpp. No build or tests were run.Results
Findings
Blocking
None.
Non-blocking
SSL_SESSION, but this change does not establish that the session object provided by the target module uses the LibreSSL 2.5.4 layout. The description says the offset was compiled from that release's header, which is evidence for that layout but not for the target module's session layout. Add a verified target-layout check or document the basis for applying the 2.5.4 offset to this module. Changed line:core/libs/prx/libSceLibreSsl/src/Ssl.cpp:355.Not verified
SSL_SESSIONlayout were not verified.To get this to a good state
Nothing is required. Optional: verify or document the target module's session layout before relying on the offset.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:16:21Z.
Review: COMMENTED
Checked the branch sources and built the focused tests against the existing Linux runtime.
GuestLibreSslSslpassed, including the server-name accessor checks.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.