feat(libSceLibreSsl3): implement X509 public key parameters #10557
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10557"
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 MarcZX10 on 2026-10-24T09:49:07Z.
What
Implements
X509_PUBKEY_get0_paraminlibSceLibreSsl3using the LibreSSL 4.0.0 implementation and structure declarations pinned atce488b78e0bd994780569df718596b9776ff681a(crypto/asn1/x_pubkey.c,x509_local.h,x509.handasn1.h). It returns the algorithm OID, encoded public-key bytes and length, and algorithm structure through optional outputs. The key length is written only when the encoded key output is requested, matching the source.The layouts are guarded by compile-time size and offset assertions. Invalid null arguments and absent nested structures throw
std::invalid_argument; these malformed-object cases are not verified on a PS5. Returned pointers are borrowed and remain owned by the input object.The pending-export count in the technical-debt record decreases from 84 to 83; the remaining PS5 ABI/hardware verification limitation is recorded there.
Tested
Debian Linux, GCC 12.2.0: compiled the implementation and focused test as C++23 translation units, linked them, and ran
guest_libressl3_x509_pubkey_param; it passed output selection, borrowed pointer identity, optional outputs, thepk == nullptrlength-preservation case, all-null outputs, and invalid argument cases.python3 tools/check_conventions.py --base upstream/main --head HEADpassed.git diff --checkpassed.The full CMake build was not run: this checkout is missing the SDL2 submodule and the host lacks XRandR development support, which prevents project configuration. No PS5 hardware or Windows run was available.
Checklist
main(379b1dca32ecc4e3570ad0a53c69f019b70dbe59); no other open PR implements this exportX509_PUBKEY_get0_param; follow-up work belongs in a separate PRNotImplemented_nid_no_patchCMakeLists.txtand technical-debt insertion points; this PR will rebase after #10493 and preserve both changes)Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T12:28:34Z.
Review: COMMENTED
Checked against main
87666fc5d6and LibreSSL 4.0.0 (libressl/openbsd ce488b78, crypto/asn1/x_pubkey.c, x509_local.h, x509.h, asn1.h):X509_PUBKEY_get0_paramat x_pubkey.c:762-774: every output is optional,*ppklenis written only inside thepkbranch, and it returns 1. The LP64 layouts in the static_asserts (X509_PUBKEY 24 bytes with public_key at 8, ASN1_STRING 24 bytes with data at 8, X509_ALGOR 16 bytes) match the pinned headers, and throwing where LibreSSL would dereference NULL looks right to me. It still merges cleanly into current main.std::invalid_argumentthrown from inside libSceLibreSsl3.prx, and the sibling with the same pattern,guest_libressl3_digest_tests, linkslibcexplicitly and callsconfigure_windows_unwind, while this target does neither. Linking should still work, since libc comes in through the library'sPUBLIC libc(core/libs/CMakeLists.txt:170). Butconfigure_windows_unwindis what renames the exe's.eh_frameto.ehfram, and on Windows libc's unwinder only searches.ehframsections (Unwind.cpp:276/376). I couldn't run this on Windows, but reading the code suggests the catch in the test exe might not be found under the DWARF toolchain. Addinglibcandconfigure_windows_unwind(guest_libressl3_x509_pubkey_param_tests)the way the digest test does would remove that risk.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:57:31Z.
Review: COMMENTED
Reviewed — rebase fix confirmed at head, Windows configure passes
The x509 pubkey test is back in the test list at this head, and the hosted Windows check passed, so the reviewer's configure failure is addressed.
What I ran
e65e0fab20(matches batch; a merge commit of maina644edf30c).Results
Findings
Sources
github.com/boykopovar/AnyPS5@e65e0fab20/core/libs/prx/libSceLibreSsl3/CMakeLists.txt (L32-L37)github.com/boykopovar/AnyPS5@e65e0fab20/core/libs/prx/libSceLibreSsl3/CMakeLists.txt (L97-L98)Not verified