feat(libSceLibreSsl3): implement d2i_RSA_PUBKEY #22845
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22845"
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 Callimann8 on 2026-11-18T12:28:12Z.
What
Implements
d2i_RSA_PUBKEYin libSceLibreSsl3, followingd2i_RSA_PUBKEYandpubkey_ex_d2iin LibreSSL 4.0.0 (x_pubkey.c) and the extern path oftasn_dec.c(both atce488b78e0bd).d2i_PUBKEY, the RSA key is taken withEVP_PKEY_get1_RSAand the temporaryEVP_PKEYis freed, as upstream does.*outand advances*inpast the SPKI; on failure both are left untouched.EVP_R_EXPECTING_AN_RSA_KEY; an RSA-PSS key is accepted, asEVP_PKEY_get1_RSAdoes.ASN1_item_ex_d2idoes. A nullin, which upstream dereferences, throws.RSA_freeandRSA_newfrom the native LibreSSL3 RSA work (merged), which is what the old debt entry waited for. The import keeps binding to libSceLibreSsl3 (guest_libressl3_import_binding).KeyComponents.cppentry that still listedd2i_RSA_PUBKEYas throwing, and drops it from the pending-exports count in the inventory fragment.Tested
Linux (Ubuntu 24.04, GCC 13.3, Release). A new case in
guest_libressl3_key_derdecodes the RSA-2048 SPKI fixture with trailing bytes and checks the cursor, the reference count, that no private exponent is set and thatnandematchd2i_PUBKEY's key. It also checks replacement of*out, a P-256 SPKI (EVP_R_EXPECTING_AN_RSA_KEY, output and cursor untouched), a truncated SPKI (ASN1_R_TOO_LONG), a negative length (no error queued) and a nullin(throws). All 87 libSceLibreSsl3 tests pass on currentmain.tools/check_conventions.pyandtools/debt_fold.py --checkpass. Not tested on a console.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 PrivacyOnion on 2026-11-18T12:30:00Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
0799fa7a0a:tools/check_conventions.pypassed.guest_libressl3_key_der_testsbuilt cleanly.guest_libressl3_key_der):core/libs/prx/libSceLibreSsl3/Export.cpp,core/libs/prx/libSceLibreSsl3/include/Api.hpp,core/libs/prx/libSceLibreSsl3/src/KeyDer.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.inputthrows via APS5_INVALID_ARG_EX and negative length immediately returns nullptr without modifying input or output.outputis freed with RSA_free and updated only on successful RSA decode, with*inputadvanced past SPKI; on failure neither*outputnor*inputis modified.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T12:41:41Z.
Review: COMMENTED
Reviewed — comments
The review bundle and pinned repository could not be inspected because the required reader command is unavailable in this session.
What I ran
No repository checks were run;
repo_read.pycould not be invoked.Results
Findings
Blocking
None verified.
Non-blocking
None verified.
Not verified
The description, commits, diff, manifest, changed files, and repository context were not read. Review completeness and merge suitability cannot be determined.
To get this to a good state
Nothing is required based on verified findings. The change needs a complete review before a formal approval or change request is justified.