feat(libSceLibreSsl): implement file and socket BIO adapters #12928

Merged
xdCloudy merged 13 commits from upstream-pr/12928 into main 2026-11-06 02:48:07 +00:00
xdCloudy commented 2026-10-29 15:03:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xdCloudy on 2026-10-29T15:03:16Z.


What

Implement three LibreSSL BIO exports:

  • BIO_s_file
  • BIO_new_fp
  • BIO_new_socket

The implementation uses AnyPS5's guest-compatible BIO framework, guest libc FileStream and libSceNet socket descriptors.

File reads distinguish clean EOF from I/O errors. File reset preserves the guest seek result. File and socket ownership follows the caller's close flag.

Upstream reconciliation

Commit dba71fc5f79be270ca4e8604cb4ac80b079cb213 reconciled this PR against upstream main at 495162fcb3e4a93879c23e117ad0772da47b96cb.

Both prerequisites are merged:

  • #9535 — ERR prerequisite
  • #9536 — memory BIO implementation

The reconciled PR changes six files. It:

  • Preserves existing upstream implementations.
  • Removes the three superseded throwing stubs.
  • Restores the typed API declarations.
  • Includes the file/socket BIO adapter implementation.
  • Retains the upstream BIO test coverage and adds file/socket regression cases.
  • Documents remaining limitations in docs/dev/debt/libSceLibreSsl.md.

A subsequent merge of main by @oneandonlydean, at commit 18538446777d653c7eac91715049611e2a2327de, incorporated upstream changes including #11553.

That upstream change removed the historical LibreSSL pending-exports count line. The merge correctly preserves its removal rather than reintroducing the obsolete count.

No previously removed cryptographic implementation families have been restored. No unrelated implementation changes are intended by this PR.

Limitations

  • No physical-console or title-level validation.
  • No live network transfer validation.
  • Socket retry flags, pending-byte queries and extended BIO controls remain incomplete.
  • Firmware-equivalence claims remain limited to the documented evidence.

The implementation and its limitations are recorded in docs/dev/debt/libSceLibreSsl.md.

Tested

Earlier Windows x86_64 / WinLibs GCC / CMake-Ninja Release testing passed:

  • guest_libressl_bio
  • guest_libressl_bio_patched
  • guest_libressl_errors

Result: 3/3 passed on the previously reconciled tree.

Coverage includes:

  • File data reads
  • Clean EOF handling
  • Read-error handling
  • Successful and failed file resets
  • Error-queue reporting
  • Resource ownership and close flags
  • BIO lifecycle behavior

The initial upstream reconciliation was validated by comparing proposed changes with the merged upstream sources and preserving existing test coverage.

The subsequent merge by @oneandonlydean resolved the documentation conflict without requiring additional adapter changes.

Hosted CI for the latest head is still queued. Previous runtime results are not claimed as fresh test results for that commit.

No console, title-level or live-network validation is claimed.

Checklist

  • Based on updated 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 documented technical debt
  • Unimplemented paths retain explicit unsupported behavior
  • No investigation files or proprietary firmware artifacts added
  • No new third-party dependency introduced
  • Generic behavior, not title-specific
  • Depends on: none (prerequisites merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5070434390 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12928). Originally posted by [xdCloudy](https://github.com/xdCloudy) on 2026-10-29T15:03:16Z. --- ### What Implement three LibreSSL BIO exports: - `BIO_s_file` - `BIO_new_fp` - `BIO_new_socket` The implementation uses AnyPS5's guest-compatible BIO framework, guest libc `FileStream` and `libSceNet` socket descriptors. File reads distinguish clean EOF from I/O errors. File reset preserves the guest seek result. File and socket ownership follows the caller's close flag. ### Upstream reconciliation Commit `dba71fc5f79be270ca4e8604cb4ac80b079cb213` reconciled this PR against upstream `main` at `495162fcb3e4a93879c23e117ad0772da47b96cb`. Both prerequisites are merged: - #9535 — ERR prerequisite - #9536 — memory BIO implementation The reconciled PR changes six files. It: - Preserves existing upstream implementations. - Removes the three superseded throwing stubs. - Restores the typed API declarations. - Includes the file/socket BIO adapter implementation. - Retains the upstream BIO test coverage and adds file/socket regression cases. - Documents remaining limitations in `docs/dev/debt/libSceLibreSsl.md`. A subsequent merge of `main` by @oneandonlydean, at commit `18538446777d653c7eac91715049611e2a2327de`, incorporated upstream changes including #11553. That upstream change removed the historical LibreSSL pending-exports count line. The merge correctly preserves its removal rather than reintroducing the obsolete count. No previously removed cryptographic implementation families have been restored. No unrelated implementation changes are intended by this PR. ### Limitations - No physical-console or title-level validation. - No live network transfer validation. - Socket retry flags, pending-byte queries and extended BIO controls remain incomplete. - Firmware-equivalence claims remain limited to the documented evidence. The implementation and its limitations are recorded in `docs/dev/debt/libSceLibreSsl.md`. ### Tested Earlier Windows x86_64 / WinLibs GCC / CMake-Ninja Release testing passed: - `guest_libressl_bio` - `guest_libressl_bio_patched` - `guest_libressl_errors` **Result: 3/3 passed on the previously reconciled tree.** Coverage includes: - File data reads - Clean EOF handling - Read-error handling - Successful and failed file resets - Error-queue reporting - Resource ownership and close flags - BIO lifecycle behavior The initial upstream reconciliation was validated by comparing proposed changes with the merged upstream sources and preserving existing test coverage. The subsequent merge by @oneandonlydean resolved the documentation conflict without requiring additional adapter changes. **Hosted CI for the latest head is still queued.** Previous runtime results are not claimed as fresh test results for that commit. No console, title-level or live-network validation is claimed. ### Checklist - [x] Based on updated `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 documented technical debt - [x] Unimplemented paths retain explicit unsupported behavior - [x] No investigation files or proprietary firmware artifacts added - [x] No new third-party dependency introduced - [x] Generic behavior, not title-specific - [x] Depends on: none (prerequisites merged) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
CnRJay commented 2026-11-01 19:54:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:54:16Z.

Review: COMMENTED


+1.6k lines for LibreSSL file and socket BIO adapters. The socket adapter in particular is hard to trust without a real title run.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729937750 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12928#pullrequestreview-5729937750). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:54:16Z. **Review:** COMMENTED --- +1.6k lines for LibreSSL file and socket BIO adapters. The socket adapter in particular is hard to trust without a real title run.
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!12928
No description provided.