feat(libSceLibreSsl): implement EVP_PKEY_id #10418

Merged
MarcZX10 merged 5 commits from upstream-pr/10418 into main 2026-11-06 04:35:11 +00:00
MarcZX10 commented 2026-10-23 23:23:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T23:23:41Z.


What

Implement the missing EVP_PKEY_id export in libSceLibreSsl. The function returns the stored key type unchanged. The implementation follows LibreSSL 2.5.4: EVP_PKEY begins with an int type, and EVP_PKEY_id returns that field (implementation, structure). The cited firmware discussion identifies LibreSSL 2.5.4, but this layout has not been independently verified on a PS5.

The regression test covers unchanged return values across representative identifiers and the null-input throw required by this repository's unimplemented-path convention. Null is dereferenced in the reference implementation.

Tested

Linux host, GCC, C++20: manually compiled the implementation and focused test source with -Wall -Wextra -Werror, using a small local shim for the repository's throw helper; the test passed. python3 tools/check_conventions.py --base upstream/main and git diff upstream/main...HEAD --check pass. The full CMake target, Windows, a title, and console behavior were not tested.

The exact symbol was searched in the open PR queue and no PR implementing EVP_PKEY_id was found. The full-queue overlap scan could not finish, so I ran the repository overlap comparison against the active LibreSSL PR refs affecting these files. It found line conflicts at CMakeLists.txt:1 and debt/libSceLibreSsl.md:5 with #10398, #10395, #10373, #10376, and #9529; and at the debt count with #10071. It found no duplicate export. #10005 shares the relevant files but could not be compared because that branch conflicts with current main. I proposed that #10398, #10395, and #10005 land first, with this branch rebased afterward, and asked those authors to confirm. This draft remains pending their sequencing responses.

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: #10395, #10398, #10005 (proposed sequencing; confirmation pending)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4990495096 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10418). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T23:23:41Z. --- ### What Implement the missing `EVP_PKEY_id` export in `libSceLibreSsl`. The function returns the stored key type unchanged. The implementation follows LibreSSL 2.5.4: `EVP_PKEY` begins with an `int type`, and `EVP_PKEY_id` returns that field ([implementation](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/evp/p_lib.c), [structure](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/evp/evp_local.h)). The cited firmware discussion identifies LibreSSL 2.5.4, but this layout has not been independently verified on a PS5. The regression test covers unchanged return values across representative identifiers and the null-input throw required by this repository's unimplemented-path convention. Null is dereferenced in the reference implementation. ### Tested Linux host, GCC, C++20: manually compiled the implementation and focused test source with `-Wall -Wextra -Werror`, using a small local shim for the repository's throw helper; the test passed. `python3 tools/check_conventions.py --base upstream/main` and `git diff upstream/main...HEAD --check` pass. The full CMake target, Windows, a title, and console behavior were not tested. The exact symbol was searched in the open PR queue and no PR implementing `EVP_PKEY_id` was found. The full-queue overlap scan could not finish, so I ran the repository overlap comparison against the active LibreSSL PR refs affecting these files. It found line conflicts at `CMakeLists.txt:1` and `debt/libSceLibreSsl.md:5` with #10398, #10395, #10373, #10376, and #9529; and at the debt count with #10071. It found no duplicate export. #10005 shares the relevant files but could not be compared because that branch conflicts with current `main`. I proposed that #10398, #10395, and #10005 land first, with this branch rebased afterward, and asked those authors to confirm. This draft remains pending their sequencing responses. ### 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: #10395, #10398, #10005 (proposed sequencing; confirmation pending) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
jotitadev commented 2026-10-27 01:21:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T01:21:08Z.

Review: COMMENTED


Linux run of the full build, since the description reports a standalone compile with a shim.

Machine: Linux x86_64, i7-8700 (6 cores / 12 threads, AVX2), Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON. Head 15ea8e9e2 merged onto main e2d457be3 (clean).

  • Build ok. All 19 libressl tests pass, guest_libressl_pkey_id among them (20 of 20 repeated runs), plus patched_libraries.
  • Restoring the throwing stub and keeping the test aborts guest_libressl_pkey_id with EVP_PKEY_id_nid_postfix not implemented.
  • Moving the export to src/PkeyId.cpp keeps it patched. In the patched libSceLibreSsl.prx, it is exported as yPuxTL2GJO0, at the same address as EVP_PKEY_id_nid_postfix in the unpatched build.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5661168488 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10418#pullrequestreview-5661168488). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T01:21:08Z. **Review:** COMMENTED --- Linux run of the full build, since the description reports a standalone compile with a shim. Machine: Linux x86_64, i7-8700 (6 cores / 12 threads, AVX2), Ubuntu 26.04, GCC 15.2, Release, `BUILD_TESTING=ON`. Head `15ea8e9e2` merged onto `main` `e2d457be3` (clean). - Build ok. All 19 `libressl` tests pass, `guest_libressl_pkey_id` among them (20 of 20 repeated runs), plus `patched_libraries`. - Restoring the throwing stub and keeping the test aborts `guest_libressl_pkey_id` with `EVP_PKEY_id_nid_postfix not implemented`. - Moving the export to `src/PkeyId.cpp` keeps it patched. In the patched `libSceLibreSsl.prx`, it is exported as `yPuxTL2GJO0`, at the same address as `EVP_PKEY_id_nid_postfix` in the unpatched build. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-11-02 04:57:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:57:27Z.

Review: COMMENTED


Reviewed — null-key assertion request open, branch DIRTY

The null-key check in the test still pins the throw the reviewer asked to drop, and the branch conflicts with main.

What I ran

  • Live head 39568acbba295dd4a338fedad91803a7f0f3f42d (matches batch).
  • gh pr view 10418; gh api GET of comments, reviews and review comments newer than 2026-10-27T02:23:08Z.
  • git show of core/libs/tests/GuestLibreSslPkeyId.cpp and core/libs/prx/libSceLibreSsl/src/PkeyId.cpp at the head.
  • Nothing was built or run.

Results

Check Result Note
eligibility, conventions, labels, report SUCCESS hosted
windows SUCCESS hosted
relinker, relinker-asan, register-context, write-watch SKIPPED hosted
linux SKIPPED hosted
merge state DIRTY conflicts with main

Findings

  • oneandonlydean (2026-11-01T11:28:00Z) asks to drop the null-key throw assertion in GuestLibreSslPkeyId.cpp, keeping the stored-type cases.
    • The test still has the try block at lines 27-31 expecting an exception from EVP_PKEY_id_nid_postfix(nullptr), and Require(false) at line 32. The reviewer's range 26-32 is off by one.
    • PkeyId.cpp:11 calls NotImplemented_nid_no_patch for a null value, so the reviewer's reading is correct. Verified by reading.
    • Not done at this head.
  • Merge state is DIRTY per hosted status; the conflict itself was not inspected.

Sources

Not verified

  • Whether NotImplemented_nid_no_patch throws in every build (not read).
  • The conflict content and any build or test run.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732249126 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10418#pullrequestreview-5732249126). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T04:57:27Z. **Review:** COMMENTED --- # Reviewed — null-key assertion request open, branch DIRTY The null-key check in the test still pins the throw the reviewer asked to drop, and the branch conflicts with main. ## What I ran - Live head 39568acbba295dd4a338fedad91803a7f0f3f42d (matches batch). - gh pr view 10418; gh api GET of comments, reviews and review comments newer than 2026-10-27T02:23:08Z. - git show of core/libs/tests/GuestLibreSslPkeyId.cpp and core/libs/prx/libSceLibreSsl/src/PkeyId.cpp at the head. - Nothing was built or run. ## Results | Check | Result | Note | |---|---|---| | eligibility, conventions, labels, report | SUCCESS | hosted | | windows | SUCCESS | hosted | | relinker, relinker-asan, register-context, write-watch | SKIPPED | hosted | | linux | SKIPPED | hosted | | merge state | DIRTY | conflicts with main | ## Findings - oneandonlydean (2026-11-01T11:28:00Z) asks to drop the null-key throw assertion in GuestLibreSslPkeyId.cpp, keeping the stored-type cases. - The test still has the try block at lines 27-31 expecting an exception from EVP_PKEY_id_nid_postfix(nullptr), and Require(false) at line 32. The reviewer's range 26-32 is off by one. - PkeyId.cpp:11 calls NotImplemented_nid_no_patch for a null value, so the reviewer's reading is correct. Verified by reading. - Not done at this head. - Merge state is DIRTY per hosted status; the conflict itself was not inspected. ## Sources - https://github.com/boykopovar/AnyPS5/blob/39568acbba295dd4a338fedad91803a7f0f3f42d/core/libs/tests/GuestLibreSslPkeyId.cpp#L27-L33 - https://github.com/boykopovar/AnyPS5/blob/39568acbba295dd4a338fedad91803a7f0f3f42d/core/libs/prx/libSceLibreSsl/src/PkeyId.cpp#L10-L13 ## Not verified - Whether NotImplemented_nid_no_patch throws in every build (not read). - The conflict content and any build or test 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!10418
No description provided.