feat(libSceLibreSsl3): implement EVP_PKEY_base_id #17237

Closed
fishingpvalues wants to merge 6 commits from upstream-pr/17237 into main
fishingpvalues commented 2026-11-08 16:05:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fishingpvalues on 2026-11-08T16:05:22Z.


What

EVP_PKEY_base_id maps the 32-byte EVP_PKEY type through the parent EVP_PKEY_type: RSA2 (19) reports 6, the DSA aliases (66, 67, 70, 113) report 116, known types map to themselves and an unknown type reports 0. A null key reports 0. main already implements EVP_PKEY_get0_EC_KEY (src/Key.cpp), so this PR no longer duplicates it.

tests/PkeyBaseAndEc.cpp covers 408, 6, 19, 66, 1000000 and null. The debt entry is one line and the inventory is 116 unimplemented exports = 107 named + 9 NID-only.

Tested

Linux x86-64 (CachyOS, GCC 16.2.1), Release, BUILD_TESTING=ON:

  • guest_libressl3_pkey_base_and_ec: 1/1 passed.
  • python3 tools/check_conventions.py --base origin/main: passed.
  • Not run: Windows, a console or a title.

Checklist

  • Based on current main; no other open PR implements EVP_PKEY_base_id
  • 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)
  • No notes, investigation .md files or images added to the repository
  • 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:5212843968 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17237). Originally posted by [fishingpvalues](https://github.com/fishingpvalues) on 2026-11-08T16:05:22Z. --- ### What `EVP_PKEY_base_id` maps the 32-byte `EVP_PKEY` type through the parent `EVP_PKEY_type`: RSA2 (19) reports 6, the DSA aliases (66, 67, 70, 113) report 116, known types map to themselves and an unknown type reports 0. A null key reports 0. `main` already implements `EVP_PKEY_get0_EC_KEY` (`src/Key.cpp`), so this PR no longer duplicates it. `tests/PkeyBaseAndEc.cpp` covers 408, 6, 19, 66, 1000000 and null. The debt entry is one line and the inventory is 116 unimplemented exports = 107 named + 9 NID-only. ### Tested Linux x86-64 (CachyOS, GCC 16.2.1), Release, `BUILD_TESTING=ON`: - `guest_libressl3_pkey_base_and_ec`: 1/1 passed. - `python3 tools/check_conventions.py --base origin/main`: passed. - Not run: Windows, a console or a title. ### Checklist - [x] Based on current `main`; no other open PR implements `EVP_PKEY_base_id` - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`) - [x] No notes, investigation `.md` files or images added to the repository - [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
gabichuuuuu commented 2026-11-08 16:27:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T16:27:15Z.

Review: COMMENTED


Read against the LibreSSL in 3rdparty/libressl-openbsd (078b3d1d), which is what this module follows. I haven't built or run this branch.

  • EVP_PKEY_base_id returns key->type unchanged. LibreSSL (evp/p_lib.c:489) returns EVP_PKEY_type(pkey->type), which maps alias types through the ameth table. EVP_PKEY_RSA2 (19) gives 6 there and 19 here. The DSA aliases (66, 67, 70, 113) give 116 there. An unknown type gives 0 there and itself here. The test uses only 408 and 6, which map to themselves.
  • EVP_PKEY_get0_EC_KEY on a key that isn't EC returns null without queueing EVP_R_EXPECTING_A_EC_KEY, which LibreSSL does (evp/p_lib.c).

Debt file: compared with main, this branch's docs/dev/debt/libSceLibreSsl3.md drops a BIO_meth line that main now has (src/BioMethod.cpp, #15761), and it repeats the new bullet on two consecutive lines. It looks rebased from an older copy of the file.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5818653293 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17237#pullrequestreview-5818653293). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-08T16:27:15Z. **Review:** COMMENTED --- Read against the LibreSSL in `3rdparty/libressl-openbsd` (`078b3d1d`), which is what this module follows. I haven't built or run this branch. - **`EVP_PKEY_base_id` returns `key->type` unchanged.** LibreSSL (`evp/p_lib.c:489`) returns `EVP_PKEY_type(pkey->type)`, which maps alias types through the ameth table. `EVP_PKEY_RSA2` (19) gives 6 there and 19 here. The DSA aliases (66, 67, 70, 113) give 116 there. An unknown type gives 0 there and itself here. The test uses only 408 and 6, which map to themselves. - **`EVP_PKEY_get0_EC_KEY`** on a key that isn't EC returns null without queueing `EVP_R_EXPECTING_A_EC_KEY`, which LibreSSL does (`evp/p_lib.c`). **Debt file:** compared with `main`, this branch's `docs/dev/debt/libSceLibreSsl3.md` drops a `BIO_meth` line that `main` now has (`src/BioMethod.cpp`, #15761), and it repeats the new bullet on two consecutive lines. It looks rebased from an older copy of the file.

Pull request closed

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!17237
No description provided.