feat(libSceLibreSsl3): implement EVP_PKEY_base_id #15616

Merged
alvaroelpob merged 3 commits from upstream-pr/15616 into main 2026-11-10 07:17:58 +00:00
alvaroelpob commented 2026-11-03 22:03:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alvaroelpob on 2026-11-03T22:03:52Z.


What

Implements EVP_PKEY_base_id in libSceLibreSsl3 with the LibreSSL 4.0.0 asn1_methods table: aliases map to their base method (RSA2 to RSA, DSA1-4 to DSA), other listed types return themselves and unknown types return NID_undef.

Tested

Linux x86-64 (WSL2), Release: the full build passes and ctest --test-dir build -j16 passes 3829 of 3829 tests, including the new guest_libressl3_pkey_base_id. python3 tools/check_conventions.py --base upstream/main passes. Not run on a console or in a title.

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: #12945, #14366, #14889, #14890, #14992, #15031, #15045, #15119, #15289, #15303, #15472, #15514, #15544, #15591, #15599
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5145198602 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15616). Originally posted by [alvaroelpob](https://github.com/alvaroelpob) on 2026-11-03T22:03:52Z. --- ### What Implements `EVP_PKEY_base_id` in libSceLibreSsl3 with the LibreSSL 4.0.0 [`asn1_methods`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/evp/p_lib.c#L149-L164) table: aliases map to their base method (RSA2 to RSA, DSA1-4 to DSA), other listed types return themselves and unknown types return `NID_undef`. ### 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 x86-64 (WSL2), Release: the full build passes and `ctest --test-dir build -j16` passes 3829 of 3829 tests, including the new `guest_libressl3_pkey_base_id`. `python3 tools/check_conventions.py --base upstream/main` passes. Not run on a console or in a title. ### 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: #12945, #14366, #14889, #14890, #14992, #15031, #15045, #15119, #15289, #15303, #15472, #15514, #15544, #15591, #15599 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
BunnyFl commented 2026-11-04 02:18:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-04T02:18:04Z.

Review: APPROVED


@alvaroelpob thanks. I checked the mapping against the LibreSSL 4.0.0 sources at the commit you cite. The asn1_methods table in p_lib.c has the same 14 methods as BaseType (cmac, dh, dsa, dsa1 to dsa4, eckey, ed25519, hmac, rsa, rsa2, rsa_pss, x25519). The NID values you use (6, 19, 28, 66, 67, 70, 113, 116, 408, 855, 894, 912, 950, 952) match objects/obj_mac.num there.

What I ran: head 64d0f2a539 merged onto main 1c8c0efc8c, Windows 11, WinLibs GCC, Release:

  • guest_libressl3_pkey_base_id and public_headers pass (2 of 2);
  • mutation, case NidRsa: changed to case 99999: in PkeyBaseId.cpp: guest_libressl3_pkey_base_id fails;
  • tools/check_conventions.py --base upstream/main on the head: all checks passed;
  • tools/pr_overlap.py --branch: no shared exports. None of the 10 PRs it couldn't compare adds EVP_PKEY_base_id.

As on #15618: your open LibreSsl3 PRs conflict with one another on the export count line and adjacent lines in CMakeLists.txt and the debt file, so each needs a small rebase after the previous one merges.

Approving.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5762298451 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15616#pullrequestreview-5762298451). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-04T02:18:04Z. **Review:** APPROVED --- @alvaroelpob thanks. I checked the mapping against the LibreSSL 4.0.0 sources at the commit you cite. The `asn1_methods` table in `p_lib.c` has the same 14 methods as `BaseType` (cmac, dh, dsa, dsa1 to dsa4, eckey, ed25519, hmac, rsa, rsa2, rsa_pss, x25519). The NID values you use (6, 19, 28, 66, 67, 70, 113, 116, 408, 855, 894, 912, 950, 952) match `objects/obj_mac.num` there. **What I ran:** head `64d0f2a539` merged onto `main` `1c8c0efc8c`, Windows 11, WinLibs GCC, Release: - `guest_libressl3_pkey_base_id` and `public_headers` pass (2 of 2); - mutation, `case NidRsa:` changed to `case 99999:` in `PkeyBaseId.cpp`: `guest_libressl3_pkey_base_id` fails; - `tools/check_conventions.py --base upstream/main` on the head: all checks passed; - `tools/pr_overlap.py --branch`: no shared exports. None of the 10 PRs it couldn't compare adds `EVP_PKEY_base_id`. As on #15618: your open LibreSsl3 PRs conflict with one another on the export count line and adjacent lines in `CMakeLists.txt` and the debt file, so each needs a small rebase after the previous one merges. Approving.
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!15616
No description provided.