feat(libSceLibreSsl): implement SSL_get0_param #15278

Open
alvaroelpob wants to merge 3 commits from upstream-pr/15278 into main
alvaroelpob commented 2026-11-02 22:37:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alvaroelpob on 2026-11-02T22:37:36Z.


What

Implements SSL_get0_param(SSL*) in libSceLibreSsl, which threw and was declared without parameters.

LibreSSL 2.5.4, whose version string the module holds, has no SSL_get0_param. It first appears in the LibreSSL 2.7.0 ssl_lib.c, which returns ssl->param; 2.6.0 still lacks it.

This reads that pointer at offset 64 of the 2.5.4 232-byte SSL layout that #10481 models. That a module exporting a later function keeps that layout is unverified, and the debt entry says so.

The function is added to #10481's src/Ssl.cpp and its test to GuestLibreSslSsl.cpp, so this builds on it. A null connection, which LibreSSL dereferences, throws. The pending count drops by one.

Tested

Linux: suite.py feat/libscelibressl-ssl-get0-param at 91bf6f3883: CTest 6574/6574 passed; conventions passed.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5128550393 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15278). Originally posted by [alvaroelpob](https://github.com/alvaroelpob) on 2026-11-02T22:37:36Z. --- ### What Implements `SSL_get0_param(SSL*)` in libSceLibreSsl, which threw and was declared without parameters. LibreSSL 2.5.4, whose version string the module holds, has no `SSL_get0_param`. It first appears in the [LibreSSL 2.7.0](https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.0.tar.gz) `ssl_lib.c`, which returns `ssl->param`; 2.6.0 still lacks it. This reads that pointer at offset 64 of the 2.5.4 232-byte `SSL` layout that #10481 models. That a module exporting a later function keeps that layout is unverified, and the debt entry says so. The function is added to #10481's `src/Ssl.cpp` and its test to `GuestLibreSslSsl.cpp`, so this builds on it. A null connection, which LibreSSL dereferences, throws. The pending count drops by one. ### 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: `suite.py feat/libscelibressl-ssl-get0-param` at 91bf6f3883: CTest 6574/6574 passed; conventions passed. ### 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
BunnyFl commented 2026-11-04 00:37:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-04T00:37:40Z.

Review: APPROVED


@alvaroelpob approved at c0aafd5b60. I only looked at the new SSL_get0_param; the code from #10481 is theirs to review.

What I ran: this head merged onto main (merge 28b0847b0d), Windows 11, WinLibs GCC, Release.

  • guest_libressl_ssl and public_headers pass (2 of 2). That covers the Windows run your description lists as not tested.
  • tools/check_conventions.py --base upstream/main --head on this head: all checks pass.
  • Mutation: with SSL_get0_param returning nullptr first, guest_libressl_ssl fails at line 144 (1 of 1).

Firmware: this answers what the layout compile left open. In 13.42 system/common/lib/libSceLibreSsl.sprx (sha256 57de57100cdeecdf8db74d6914b0c50ac9a9113fead232d03dce2df227cd9032), SSL_get0_param (OjlHVH8jjsw) is, read from disassembly and not run:

d8c90: mov    0x40(%rdi),%rax
d8c94: ret

That is your param at 64 (static_assert(offsetof(LibreSslSsl, param) == 64)).

So the offsets you got from compiling LibreSSL 2.5.4 match the console module.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5761540571 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15278#pullrequestreview-5761540571). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-04T00:37:40Z. **Review:** APPROVED --- @alvaroelpob approved at `c0aafd5b60`. I only looked at the new `SSL_get0_param`; the code from #10481 is theirs to review. **What I ran:** this head merged onto `main` (merge `28b0847b0d`), Windows 11, WinLibs GCC, Release. - `guest_libressl_ssl` and `public_headers` pass (2 of 2). That covers the Windows run your description lists as not tested. - `tools/check_conventions.py --base upstream/main --head` on this head: all checks pass. - **Mutation:** with `SSL_get0_param` returning `nullptr` first, `guest_libressl_ssl` fails at line 144 (1 of 1). **Firmware:** this answers what the layout compile left open. In 13.42 `system/common/lib/libSceLibreSsl.sprx` (sha256 `57de57100cdeecdf8db74d6914b0c50ac9a9113fead232d03dce2df227cd9032`), `SSL_get0_param` (`OjlHVH8jjsw`) is, read from disassembly and not run: ``` d8c90: mov 0x40(%rdi),%rax d8c94: ret ``` That is your `param` at 64 (`static_assert(offsetof(LibreSslSsl, param) == 64)`). So the offsets you got from compiling LibreSSL 2.5.4 match the console module.
MarcZX10 commented 2026-11-20 21:21:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:21:51Z.

Review: APPROVED


Reviewed — looks good

The implementation reads the param field and rejects a null connection; all five changed files listed in the manifest were read, and the reported test results are author supplied.

What I ran

Inspected head a8f24d40163206e7ea730414c3ee717073f2f6f1 using repo_read.py for the prepared diff and targeted source ranges. No build or tests were run.

Results

Check Result Note
Diff and changed files passed All five manifest files read
Build and tests not run Results in the description are author reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

Windows and console behavior were not tested. I did not independently verify the claimed LibreSSL version history or the PR description's reported build and test results. The prepared bundle included all changed files; no exclusions were provided in the manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5999587867 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15278#pullrequestreview-5999587867). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T21:21:51Z. **Review:** APPROVED --- # Reviewed — looks good The implementation reads the `param` field and rejects a null connection; all five changed files listed in the manifest were read, and the reported test results are author supplied. ## What I ran Inspected head `a8f24d40163206e7ea730414c3ee717073f2f6f1` using `repo_read.py` for the prepared diff and targeted source ranges. No build or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and changed files | passed | All five manifest files read | | Build and tests | not run | Results in the description are author reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Windows and console behavior were not tested. I did not independently verify the claimed LibreSSL version history or the PR description's reported build and test results. The prepared bundle included all changed files; no exclusions were provided in the manifest. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-22 06:49:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T06:49:30Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the pointer getter and null-connection behavior are consistent with the stated implementation, and no blocking defect was verified.

What I ran

Reviewed head 91bf6f3883efccc4313a8bee721b581680e2b940. Read the prepared PR description, commits, manifest, diff, and all changed-file contents, plus targeted SslInternal.hpp layout context and export/test references. No commands or tests were run; the suite result below is author-reported.

Results

Check Result Note
Changed-code review passed Getter reads the modeled parameter pointer
Null handling and test passed Null connection throws; null and non-null values checked
PR-reported suite not run Author reports 6574/6574 CTest and conventions passed

Findings

Blocking

None.

Non-blocking

None.

Not verified

The behavior of the console module’s SSL layout at offset 64 remains unverified, as the PR description and debt entry state. No independent build or test run was performed. Files read: core/libs/prx/libSceLibreSsl/Export.cpp, core/libs/prx/libSceLibreSsl/include/Api.hpp, core/libs/prx/libSceLibreSsl/src/Ssl.cpp, core/libs/tests/GuestLibreSslSsl.cpp, docs/dev/debt/changes/feat-libscelibressl-ssl-get0-param.md, and targeted context from core/libs/prx/libSceLibreSsl/include/SslInternal.hpp. No changed files were excluded; review/files.json was not available as a review-folder document, and the listing confirmed all changed files were included.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6010855417 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15278#pullrequestreview-6010855417). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T06:49:30Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the pointer getter and null-connection behavior are consistent with the stated implementation, and no blocking defect was verified. ## What I ran Reviewed head `91bf6f3883efccc4313a8bee721b581680e2b940`. Read the prepared PR description, commits, manifest, diff, and all changed-file contents, plus targeted `SslInternal.hpp` layout context and export/test references. No commands or tests were run; the suite result below is author-reported. ## Results | Check | Result | Note | |---|---|---| | Changed-code review | passed | Getter reads the modeled parameter pointer | | Null handling and test | passed | Null connection throws; null and non-null values checked | | PR-reported suite | not run | Author reports 6574/6574 CTest and conventions passed | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The behavior of the console module’s `SSL` layout at offset 64 remains unverified, as the PR description and debt entry state. No independent build or test run was performed. Files read: `core/libs/prx/libSceLibreSsl/Export.cpp`, `core/libs/prx/libSceLibreSsl/include/Api.hpp`, `core/libs/prx/libSceLibreSsl/src/Ssl.cpp`, `core/libs/tests/GuestLibreSslSsl.cpp`, `docs/dev/debt/changes/feat-libscelibressl-ssl-get0-param.md`, and targeted context from `core/libs/prx/libSceLibreSsl/include/SslInternal.hpp`. No changed files were excluded; `review/files.json` was not available as a review-folder document, and the listing confirmed all changed files were included. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 13:16:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:16:23Z.

Review: COMMENTED


Checked the branch sources and built the focused tests against the existing Linux runtime. GuestLibreSslSsl passed, including the SSL parameter accessor checks.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6170525365 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15278#pullrequestreview-6170525365). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T13:16:23Z. **Review:** COMMENTED --- Checked the branch sources and built the focused tests against the existing Linux runtime. `GuestLibreSslSsl` passed, including the SSL parameter accessor checks. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/15278:upstream-pr/15278'
git switch 'upstream-pr/15278'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/15278'
git switch 'upstream-pr/15278'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/15278'
git switch 'upstream-pr/15278'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/15278'
git switch 'main'
git merge --squash 'upstream-pr/15278'
git switch 'main'
git merge --ff-only 'upstream-pr/15278'
git switch 'main'
git merge 'upstream-pr/15278'
git push origin 'main'
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!15278
No description provided.