feat(libressl3): implement EVP_PKEY_bits #13941

Closed
DonRyuzaki wants to merge 1 commit from upstream-pr/13941 into main
DonRyuzaki commented 2026-10-31 13:17:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DonRyuzaki on 2026-10-31T13:17:21Z.


What

Implement EVP_PKEY_bits in the existing libSceLibreSsl3 library, replacing its throwing unknown-signature placeholder with int (const LibreSsl3EvpPkey*). Null keys, methods and callbacks return zero; otherwise dispatch through the method's pkey_bits callback with the original key and preserve its result.

The contract follows LibreSSL 4.0.0 p_lib.c. The existing key model places the method at offset 8; the callback at offset 104 follows that revision's LP64 evp_local.h. Record the unverified console ABI and constructor interoperability in the library's technical debt. This adds one function to an existing library and no third-party dependency.

Add a registered regression test covering null paths, the neighboring callback slot, original argument forwarding, exact callback count, signed return values, unchanged input objects and replacement/removal of the callback. The existing key-reference test also runs this coverage by default.

Tested

Windows, GCC 15.2 DWARF / Release: full runtime libraries and relinker build passed (initial 2,995 build steps). After rebasing onto main 26fa1212b8 the complete targets built again and all six focused tests passed: patched_libraries, strict_nid_filter, guest_libressl3_pkey_bits, guest_libressl3_key_reference, guest_libressl3_pkey_getters and guest_crypto_memcmp. Two compiler jobs throughout. Callback coverage includes null paths, exact method offset, original argument identity, signed result, call count, unchanged inputs and callback replacement/removal. No current Linux or game-compatibility claim.

check_conventions.py --base origin/main passes. Public header audit verifies unique declarations and umbrella coverage for 398 libraries / 26,175 exports. Published 14011ceca7c2084b4ad122a9e53688c85d864373 has exactly tested local tree 93a0b6131ab531e39c299c98c1d1e6b37119e657.

Official overlap checking reports adjacent hunks with #12315 (debt insertion) and #12945 (retain-helper extraction / test dispatch), and unverified shared files for #9970, #10452, #10461, #10490, #10491, #10493, #10557, #10631, #10960, #11146, #12754 and #14212. Every reported branch's actual shared patch was manually compared: none implements EVP_PKEY_bits. Their existing base conflicts remain unverified for clean merging. #12754 also extracts the helper namespace; #14212 changes debt inventory formatting. No dependency on those changes is claimed.

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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5097847047 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13941). Originally posted by [DonRyuzaki](https://github.com/DonRyuzaki) on 2026-10-31T13:17:21Z. --- ### What Implement `EVP_PKEY_bits` in the existing `libSceLibreSsl3` library, replacing its throwing unknown-signature placeholder with `int (const LibreSsl3EvpPkey*)`. Null keys, methods and callbacks return zero; otherwise dispatch through the method's `pkey_bits` callback with the original key and preserve its result. The contract follows [LibreSSL 4.0.0 p_lib.c](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/evp/p_lib.c). The existing key model places the method at offset 8; the callback at offset 104 follows that revision's LP64 `evp_local.h`. Record the unverified console ABI and constructor interoperability in the library's technical debt. This adds one function to an existing library and no third-party dependency. Add a registered regression test covering null paths, the neighboring callback slot, original argument forwarding, exact callback count, signed return values, unchanged input objects and replacement/removal of the callback. The existing key-reference test also runs this coverage by default. ### Tested Windows, GCC 15.2 DWARF / Release: full runtime libraries and relinker build passed (initial 2,995 build steps). After rebasing onto main 26fa1212b82f76dd49cf12d65e445d6ff3e0844c the complete targets built again and all six focused tests passed: patched_libraries, strict_nid_filter, guest_libressl3_pkey_bits, guest_libressl3_key_reference, guest_libressl3_pkey_getters and guest_crypto_memcmp. Two compiler jobs throughout. Callback coverage includes null paths, exact method offset, original argument identity, signed result, call count, unchanged inputs and callback replacement/removal. No current Linux or game-compatibility claim. check_conventions.py --base origin/main passes. Public header audit verifies unique declarations and umbrella coverage for 398 libraries / 26,175 exports. Published 14011ceca7c2084b4ad122a9e53688c85d864373 has exactly tested local tree 93a0b6131ab531e39c299c98c1d1e6b37119e657. Official overlap checking reports adjacent hunks with #12315 (debt insertion) and #12945 (retain-helper extraction / test dispatch), and unverified shared files for #9970, #10452, #10461, #10490, #10491, #10493, #10557, #10631, #10960, #11146, #12754 and #14212. Every reported branch's actual shared patch was manually compared: none implements EVP_PKEY_bits. Their existing base conflicts remain unverified for clean merging. #12754 also extracts the helper namespace; #14212 changes debt inventory formatting. No dependency on those changes is claimed. <!-- 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. --> ### 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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes

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