feat(libSceLibreSsl3): implement EVP_PKEY assignment and reference accessors #17138
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17138"
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 fishingpvalues on 2026-11-08T10:59:43Z.
What
Implements three
libSceLibreSsl3key-accessor exports that threwNotImplemented_nid_no_patch:EVP_PKEY_assign(gp5dGS14-pI) stores the type and native key pointer in the 24-byteEVP_PKEY. A null key returns 0, and replacing a non-null native key or method throws throughNotImplemented_nid_no_patchbecause the type-specific destructor is not modelled.EVP_PKEY_set1_EC_KEYassigns the EC key and takes a reference throughEC_KEY_up_ref; a null key returns 0.EVP_PKEY_get1_RSAreturns the RSA key with a reference throughRSA_up_ref, queuesEVP_R_EXPECTING_AN_RSA_KEYand returns null for another key type, and throws for a null key or a null RSA where LibreSSL dereferences it.src/PkeyAccessors.cppholds all three,tests/PkeyAccessors.cppis registered asguest_libressl3_pkey_accessors, and the stubs leaveExport.cpp/AdditionalExports.cppwhile the declarations gain their real signatures ininclude/Api.hpp.docs/dev/debt/libSceLibreSsl3.mdloses theEVP_PKEY_assignrow (125 to 124 callable exports, 116 to 115 named) and gains one Functional entry for the unverified PS5 ABI, the reference semantics and the replacement gap.Tested
Linux x86-64 (CachyOS, GCC 16.2.1), Release,
BUILD_TESTING=ON, basemain828e44310e:guest_libressl3_pkey_accessorscovers assignment, repeatedget1_RSAreferences, the wrong-type error code0x06fff07f, EC assignment and reference counting, the null-key return, replacement and null-argument throws, and an empty error queue.ctest --test-dir build -R '^guest_libressl3_pkey_accessors$' --output-on-failure: 1/1 passed.python3 tools/check_conventions.py --base origin/main: passed;tools/check_test_registration.py build: passed.Checklist
main; no other open PR implements these exportsNotImplemented_nid_no_patch); the replacement gap is in the debt entry.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by coptergui-ops on 2026-11-08T12:30:08Z.
Review: APPROVED
Reviewed at current head (rebased; per-file diffs verified byte-identical to GitHub's patches). Implements EVP_PKEY_assign (gp5dGS14-pI), set1_EC_KEY and get1_RSA in src/PkeyAccessors.cpp with the 24-byte EVP_PKEY layout, up_ref reference semantics and the documented NotImplemented throw on key replacement; stubs removed from Export.cpp, Api.hpp declarations gain real signatures, PkeyQueries test block registered. Tests pin type codes, up_ref counters, queued LibreSSL errors (EVP_R_EXPECTING_AN_RSA_KEY) and null-key returns. Overlap verdicts (39 bot-flagged old PRs, compared changed lines not file names): no old PR touches the assign/get1_RSA/set1_EC lines; PR 14499 edits the neighboring get0_EC_KEY declaration, a different function, no collision. Intra-wave: PR 17142 and this PR both insert a debt bullet at the same anchor in docs/dev/debt/libSceLibreSsl3.md - git merge-tree shows that debt bullet insertion is the ONLY conflict (Export.cpp, Api.hpp and CMakeLists auto-merge); whoever merges second should rebase its bullet. Not a duplication. Conventions checker: no new findings from this diff (debt-length warnings pre-exist on main).