feat(libSceLibreSsl): implement six sourced LibreSSL 2.5.4 exports #12601

Merged
EagleBearerYS merged 3 commits from upstream-pr/12601 into main 2026-10-30 05:31:01 +00:00
EagleBearerYS commented 2026-10-28 22:29:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-28T22:29:39Z.


What

Six exports that were bare stubs now do what LibreSSL 2.5.4 does for them. 2.5.4 is the version #8981 measured on firmware 13.40, the same basis as the library's merged rows. Sources are libressl/openbsd 2e2c612066.

function 2.5.4 here
PKCS12_PBE_add p12_crpt.c L67-70: an empty body returns
OBJ_cleanup obj_dat.c L265-280: returns when nothing was added returns: OBJ_create still throws, so nothing can be added. The debt entry says it must free added objects once OBJ_create adds them
SSL_load_error_strings ssl_err.c L483-490: loads the crypto and SSL string tables returns: no export reads the tables yet (ERR_error_string throws). The debt entry says so
X509_STORE_CTX_get_ex_data x509_vfy.c L1978-1982 → CRYPTO_get_ex_data the entry, or NULL without a stack or for an index out of range
X509_STORE_CTX_get1_chain x509_vfy.c L2013-2026 → sk_dup NULL without a chain; otherwise a copy made as sk_dup makes it, with each certificate's references raised by 1. A malformed chain throws before anything is allocated or raised
UI_set_result ui_lib.c L816-879 prompt and verify strings are copied within their bounds. Too short or too long sets UI_FLAG_REDOABLE, queues UI_R_RESULT_TOO_SMALL or _LARGE and returns -1. Boolean strings store the matching ok or cancel character. Error data text is not modelled, since no export reads it
  • Header: Api.hpp gains the 2.5.4 X509 (up to references), UI and UI_STRING layouts the functions read, and the six real signatures.
  • No title: none of the six appears in an issue or discussion.

Overlap: git merge-tree against the open LibreSSL PRs shows no function changed on both sides.

  • #9448 and #10878 each have one textual hunk with this branch, where both sides append next to the same line (HMAC declarations; ENGINE checks at the end of a test). Whichever merges second keeps both.
  • #11175 has one hunk in each of Export.cpp and Api.hpp, of the same kind. It conflicts with main already.
  • #10834 (ours): its EVP_cleanup debt sentence names OBJ_cleanup and PKCS12_PBE_add as not implemented. That sentence drops the two names once this lands.

Tested

  • Tests, in the library's existing guest tests:
    • get_ex_data: on a caller-built two-entry stack, indexes 0 and 1 give their entries. Index 2, index -1 and a null stack give NULL. Nothing else in the context changes.
    • get1_chain:
      • a null chain gives NULL;
      • a three-certificate chain gives a new stack with the same certificates, count, allocation, sort flag and comparison, each references raised by 1, and the original untouched;
      • an empty chain gives an empty copy with no reference change.
    • UI_set_result:
      • prompt strings with a minimum of 2 and a maximum of 5: results of 2, 3 and 5 characters are copied;
      • too short or too long: -1, REDOABLE, the buffer left alone, and 0x28fff065 or 0x28fff064 on ERR_get_error;
      • also covered: a null UI_STRING, the verify type, no buffer (0x28fff069), the boolean type, and the info type.
    • The three no-op exports: they return void, are called, and queue nothing.
  • Red: with each function's body put back to main's stub, its test aborts with <name>_nid_postfix not implemented (all six).
  • Green, Linux (Ubuntu 24.04, GCC 13.3, Release): ctest -R libressl --repeat until-fail:10: 32 tests, 320 of 320 runs passed, 0 skipped.
  • GitHub, ×10 on both runners (run), ^guest_libressl: 32 tests, 10 of 10 runs passed on Linux and on Windows, 0 skipped. The libc and libkernel suites, run with APS5_SKIP_TIMING_TESTS=1, run 171 and 291 tests on Linux and 199 and 314 on Windows, with 0 failed.
    • On the runners, main's code doesn't build the new tests, because its stubs take no parameters. The red above was taken with the real signatures kept and only the bodies put back.
  • check_test_registration.py and check_conventions.py pass, with no comment lines added.
  • a312114ea3: 888a3da862, a merge of main bb04a4f1ea, and a312114ea3, the pending-export count (run).
    • The merge is clean. a312114ea3 sets the pending-export count in docs/dev/debt/libSceLibreSsl.md to 293. The first commit had left it at the number before the six exports it implements. 293 is the number of NotImplemented_nid_no_patch calls left in the merged Export.cpp; the same count gives the line's 299 on main.
    • The ^guest_libressl tests and public_headers ran 10 times with no failure. Linux: 33 run, 33 pass, 0 skip, 0 fail. Windows: 33 run, 33 pass, 0 skip, 0 fail. The libc and libkernel suites run 193 and 292 tests on Linux and 223 and 315 on Windows, with 0 failed. They ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

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: #9448, #10878 (merge order only: one textual hunk each, both sides kept). Any order with our #10834 and #10915, which set the same pending-exports count line in docs/dev/debt/libSceLibreSsl.md: whichever merges later recounts it in a main merge
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5058713599 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12601). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-28T22:29:39Z. --- ### What Six exports that were bare stubs now do what LibreSSL 2.5.4 does for them. 2.5.4 is the version [#8981](https://github.com/boykopovar/AnyPS5/discussions/8981#discussioncomment-19111214) measured on firmware 13.40, the same basis as the library's merged rows. Sources are libressl/openbsd [2e2c612066](https://github.com/libressl/openbsd/tree/2e2c612066aa993717528a0249c15c51128d61cb). | function | 2.5.4 | here | |---|---|---| | `PKCS12_PBE_add` | [`p12_crpt.c` L67-70](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/pkcs12/p12_crpt.c#L67-L70): an empty body | returns | | `OBJ_cleanup` | [`obj_dat.c` L265-280](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/objects/obj_dat.c#L265-L280): returns when nothing was added | returns: `OBJ_create` still throws, so nothing can be added. The debt entry says it must free added objects once `OBJ_create` adds them | | `SSL_load_error_strings` | [`ssl_err.c` L483-490](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libssl/ssl_err.c#L483-L490): loads the crypto and SSL string tables | returns: no export reads the tables yet (`ERR_error_string` throws). The debt entry says so | | `X509_STORE_CTX_get_ex_data` | [`x509_vfy.c` L1978-1982](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/x509/x509_vfy.c#L1978-L1982) → `CRYPTO_get_ex_data` | the entry, or NULL without a stack or for an index out of range | | `X509_STORE_CTX_get1_chain` | [`x509_vfy.c` L2013-2026](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/x509/x509_vfy.c#L2013-L2026) → `sk_dup` | NULL without a chain; otherwise a copy made as `sk_dup` makes it, with each certificate's `references` raised by 1. A malformed chain throws before anything is allocated or raised | | `UI_set_result` | [`ui_lib.c` L816-879](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/ui/ui_lib.c#L816-L879) | prompt and verify strings are copied within their bounds. Too short or too long sets `UI_FLAG_REDOABLE`, queues `UI_R_RESULT_TOO_SMALL` or `_LARGE` and returns -1. Boolean strings store the matching ok or cancel character. Error data text is not modelled, since no export reads it | - **Header:** `Api.hpp` gains the 2.5.4 `X509` (up to `references`), `UI` and `UI_STRING` layouts the functions read, and the six real signatures. - **No title:** none of the six appears in an issue or discussion. **Overlap:** `git merge-tree` against the open LibreSSL PRs shows no function changed on both sides. - **#9448 and #10878** each have one textual hunk with this branch, where both sides append next to the same line (HMAC declarations; ENGINE checks at the end of a test). Whichever merges second keeps both. - **#11175** has one hunk in each of `Export.cpp` and `Api.hpp`, of the same kind. It conflicts with `main` already. - **#10834** (ours): its `EVP_cleanup` debt sentence names `OBJ_cleanup` and `PKCS12_PBE_add` as not implemented. That sentence drops the two names once this lands. ### Tested - **Tests**, in the library's existing guest tests: - **`get_ex_data`:** on a caller-built two-entry stack, indexes 0 and 1 give their entries. Index 2, index -1 and a null stack give NULL. Nothing else in the context changes. - **`get1_chain`:** - a null chain gives NULL; - a three-certificate chain gives a new stack with the same certificates, count, allocation, sort flag and comparison, each `references` raised by 1, and the original untouched; - an empty chain gives an empty copy with no reference change. - **`UI_set_result`:** - prompt strings with a minimum of 2 and a maximum of 5: results of 2, 3 and 5 characters are copied; - too short or too long: -1, `REDOABLE`, the buffer left alone, and `0x28fff065` or `0x28fff064` on `ERR_get_error`; - also covered: a null `UI_STRING`, the verify type, no buffer (`0x28fff069`), the boolean type, and the info type. - **The three no-op exports:** they return `void`, are called, and queue nothing. - **Red:** with each function's body put back to `main`'s stub, its test aborts with `<name>_nid_postfix not implemented` (all six). - **Green, Linux (Ubuntu 24.04, GCC 13.3, Release):** `ctest -R libressl --repeat until-fail:10`: 32 tests, 320 of 320 runs passed, 0 skipped. - **GitHub, ×10 on both runners** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40771403407)), `^guest_libressl`: 32 tests, 10 of 10 runs passed on Linux and on Windows, 0 skipped. The libc and libkernel suites, run with `APS5_SKIP_TIMING_TESTS=1`, run 171 and 291 tests on Linux and 199 and 314 on Windows, with 0 failed. - On the runners, `main`'s code doesn't build the new tests, because its stubs take no parameters. The red above was taken with the real signatures kept and only the bodies put back. - `check_test_registration.py` and `check_conventions.py` pass, with no comment lines added. - **a312114ea3: 888a3da862, a merge of `main` bb04a4f1ea, and a312114ea3, the pending-export count** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40895989695)). - The merge is clean. a312114ea3 sets the pending-export count in `docs/dev/debt/libSceLibreSsl.md` to 293. The first commit had left it at the number before the six exports it implements. 293 is the number of `NotImplemented_nid_no_patch` calls left in the merged `Export.cpp`; the same count gives the line's 299 on `main`. - The `^guest_libressl` tests and `public_headers` ran 10 times with no failure. Linux: 33 run, 33 pass, 0 skip, 0 fail. Windows: 33 run, 33 pass, 0 skip, 0 fail. The libc and libkernel suites run 193 and 292 tests on Linux and 223 and 315 on Windows, with 0 failed. They ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. ### 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: #9448, #10878 (merge order only: one textual hunk each, both sides kept). Any order with our #10834 and #10915, which set the same pending-exports count line in `docs/dev/debt/libSceLibreSsl.md`: whichever merges later recounts it in a `main` merge - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
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!12601
No description provided.