feat(libSceLibreSsl): implement EVP_PKEY_set1_RSA, EVP_PKEY_get1_RSA and EVP_PKEY_copy_parameters #11128
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11128"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-10-25T19:00:40Z.
What
Implements legacy
EVP_PKEY_set1_RSA,EVP_PKEY_get1_RSAandEVP_PKEY_copy_parameters, including RSA payload release. Native LibreSSL3 new/free use its separate 32-byte layout; legacy PKEY stays 56 bytes.Head
b14b01250ec10f46ce6344302e38c67e7f1e3cbdmerges main3ba9ab08cc6decca2307a69b77c4efbac06badc7and preserves maintainer commitf1cbf7c835269eefd9d73906d0ad7b0adbb27542.SSL_get_privatekeyforwards to the parent library and can return its legacy PKEY. This is a documented native forwarding gap. Objects from the two modules must not be mixed. The native constructor/free correction and local set1/copy refusals remain intact. The maintainer's main merge resolves the debt-only conflict. It keeps both PKEY gap entries, main's new debt entries, and the count of 387 forwards. The prior PKEY code and tests remain unchanged.Native payload destruction remains unsupported. Final release with a method or payload restores the reference and throws. Allocation failure returns null without queuing the native allocation error. The tests do not pin unsupported throws. Native RSA producer/get1 stubs remain unchanged.
Legacy behavior follows LibreSSL 2.5.4 p_lib.c. Native layout and empty-object lifecycle follow LibreSSL 4.0.0 evp_local.h and p_lib.c.
Tested
The maintainer head passes a Linux Release rebuild (21 incremental steps), after the equivalent SSL integration passes its 408-step build. All ten focused tests pass: legacy PKEY lifecycle/RSA/SSL session; native PKEY lifecycle/getters/queries, key references, RSA setters, SSL and TLS protocols. The inherited actual-NID binding check and all 65 public headers pass. Conventions and whitespace pass. These checks run again on the maintainer head because its linked libc/NetCtl code and public-header inputs differ. Its SSL source, tests and debt match the locally verified integration exactly.
The native lifecycle test checks allocation size and fields, supported reference changes, empty-object release, zeroization and allocation failure. The maintainer removes the private-key refusal check and the method/payload throw assertions. No cross-layout safety claim follows from the passing tests.
Prior constructor regression evidence remains: the old native constructor allocates 56 bytes instead of 32, before any retain/free. Earlier differential and mutation evidence applies only to unchanged legacy code. Those runs are not repeated. No new Windows/macOS, console, game-dump, full-product or full-ctest run is claimed.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T19:04:10Z.
Review: APPROVED
Reviewed the new
EVP_PKEY_set1_RSA,EVP_PKEY_get1_RSAandEVP_PKEY_copy_parametersbehavior in commitc7928085against LibreSSL 2.5.4p_lib.c. The set/get reference-count changes and the RSA type mismatch error align with the source; RSA has no parameter-copy method, so same-type copies return 0 without changing the target, and differing types queueEVP_R_DIFFERENT_KEY_TYPES. The implementation preserves the documented unsupported cases for non-RSA methods and engines, and the focused tests cover replacement, same-pointer refcounts, null input, error queue values and final RSA release. The PR reports 14 LibreSSL guest tests, ASan differential testing, and 12 mutation checks; eligibility, conventions, intake, labels and report pass. Hosted product build jobs are skipped, and Windows/macOS plus console behavior are not reported as tested. This is stacked on #10570 and #10915, so those dependencies still need to land first.