feat(libSceLibreSsl3): implement EVP_PKEY_new_mac_key #19093

Merged
consolelogout merged 9 commits from upstream-pr/19093 into main 2026-11-16 23:31:52 +00:00
consolelogout commented 2026-11-12 18:56:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by consolelogout on 2026-11-12T18:56:59Z.


What

Implements EVP_PKEY_new_mac_key for HMAC keys on top of #17528's native PKEY method table: an HmacAsn1Method (compare, size, free from LibreSSL 4.0.0 hm_ameth.c) registered in FindNativePkeyAsn1Method_nid_no_patch and IsNativePkeyMethod_nid_no_patch, so EVP_PKEY_size, EVP_PKEY_cmp and EVP_PKEY_free work on the key. Other key types return null as in LibreSSL 4.0.0; the missing error-queue reasons and empty method slots are in the debt fragment. Agreed with the #17528 author in https://github.com/boykopovar/AnyPS5/pull/17528 that HMAC keys go in this separate PR. #17528 has since merged; this branch merges current main. Debt changes are in a fragment, following #17217

Tested

Linux (Ubuntu on WSL, GCC 15.2.0, Debug), at 2bef13fd25 (on main f6a73040e1): the full build completes, and ctest --test-dir build -R libressl3 passes 73/73, including the new guest_libressl3_pkey_mac_key (key contents, size 64, compare equal/different, all keys freed with no leaked allocations, rejected types and lengths, allocation failures). c1b3r-p3d1a also reported the test passing in a Release build with GCC 13.3.0. Windows not tested. check_conventions.py --base upstream/main reports one length warning on the pending-exports entry in the debt fragment, which was already over the limit; only its count changed. pr_overlap.py failed closed on conflicting PRs; I searched each listed PR's diff and none implements EVP_PKEY_new_mac_key or HMAC keys.

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: #17528
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5283410908 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19093). Originally posted by [consolelogout](https://github.com/consolelogout) on 2026-11-12T18:56:59Z. --- ### What Implements `EVP_PKEY_new_mac_key` for HMAC keys on top of #17528's native PKEY method table: an `HmacAsn1Method` (compare, size, free from LibreSSL 4.0.0 `hm_ameth.c`) registered in `FindNativePkeyAsn1Method_nid_no_patch` and `IsNativePkeyMethod_nid_no_patch`, so `EVP_PKEY_size`, `EVP_PKEY_cmp` and `EVP_PKEY_free` work on the key. Other key types return null as in LibreSSL 4.0.0; the missing error-queue reasons and empty method slots are in the debt fragment. Agreed with the #17528 author in https://github.com/boykopovar/AnyPS5/pull/17528 that HMAC keys go in this separate PR. #17528 has since merged; this branch merges current main. Debt changes are in a fragment, following #17217 ### Tested Linux (Ubuntu on WSL, GCC 15.2.0, Debug), at 2bef13fd25 (on main f6a73040e1): the full build completes, and `ctest --test-dir build -R libressl3` passes 73/73, including the new `guest_libressl3_pkey_mac_key` (key contents, size 64, compare equal/different, all keys freed with no leaked allocations, rejected types and lengths, allocation failures). c1b3r-p3d1a also reported the test passing in a Release build with GCC 13.3.0. Windows not tested. `check_conventions.py --base upstream/main` reports one length warning on the pending-exports entry in the debt fragment, which was already over the limit; only its count changed. `pr_overlap.py` failed closed on conflicting PRs; I searched each listed PR's diff and none implements `EVP_PKEY_new_mac_key` or HMAC keys. ### 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: #17528 - [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!19093
No description provided.