feat(libSceLibreSsl): implement X509_INFO_free #13547
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13547"
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 JaceTheBlu on 2026-10-30T18:01:26Z.
What
Implements
X509_INFO_freein libSceLibreSsl, on top of theX509_freefrom #13266.Review scope. This PR is stacked on #13266 and has its commits, so the diff against
mainalso contains thed2i_X509decoder, theX509layouts inApi.hppand the oracle code of #13266. Those are reviewed in #13266. The part that belongs to this PR is:X509_INFO_freeand theLibreSslX509Infolayout (src/X509.cpp,include/Api.hpp);tests/X509.cpp;CompareInfoFreesintests/Oracle.cpp;Once #13266 is merged, the diff shrinks to these.
It follows LibreSSL 2.5.4
x_info.c:X509_free, then the encrypted data and the structure from the guest heap.Api.hppgains the 72-byteX509_INFOlayout, checked withoffsetofagainst the 2.5.4 headers.There is a new entry in
docs/dev/debt/libSceLibreSsl.md.No export creates an
X509_INFOyet, sincePEM_X509_INFO_read_biostill throws. Releasing the last reference of one that holds a CRL or anX509_PKEYthrows before anything changes, as no export creates either.Tested
Debian container, GCC 14.2, Release build of head
516d98fa0e(merged withmainon Nov 21):ctest -R 'libressl|crypto_memcmp'passes 201 of 201.tools/check_test_registration.pyandpython3 tools/check_conventions.py --base upstream/mainpass.guest_libressl_x509checks:X509_INFO, which only loses a reference;guest_libressl_x509_allocatorchecks that the lastX509_INFO_freefrees the structure, its encrypted data and its only certificate, with nothing left allocated.guest_libressl_oracle(ANYPS5_LIBRESSL_ORACLE) now also builds anX509_INFOon each side. Each one has 1 to 3 references, an optional decoded certificate with 1 to 3 references, and optional encrypted data. The oracle compares the reference counts and the remaining fields afterX509_INFO_free. The 3,000 cases show no difference. Like the other certificate comparisons, it runs only on hosts whoselongis 8 bytes, since it reads the reference certificates through the guest LP64 layout. The 6AES_set_*_keycases are the existing ones described in the debt file.Not tested on Windows, on a title or 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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:50:19Z.
Review: COMMENTED
Correction (2026-11-01): the title-ID/log demand below is not a CONTRIBUTING requirement;
Unblocks: noneis allowed. The technical points below are unaffected.Two process points; I have not reviewed
X509_INFO_freeitself.Stacked on open PRs. The branch carries about 50 commits and 11 files (+3606) because it sits on #13266 (still open) and through it #11359 and #11129, so the claimed "own diff is only this function" is not what GitHub shows, and CI cannot isolate the change. #13546 and #13877 are stacked on the same chain. Please retarget or rebase after the base merges.
The PR itself says "No export creates an
X509_INFOyet, sincePEM_X509_INFO_read_biostill throws", so nothing can ever hand this function a non-null pointer on main. With "Unblocks: none" and no title tested, it has no title ID and no log line reaching it. It should wait for the creator export, or name the title that callsX509_INFO_freetoday with a null pointer.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T06:44:41Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional. The review is incomplete for the full patch, so a formal merge decision is not justified.
What I ran
Read the prepared diff and inspected the
X509_INFO_freeimplementation, its direct tests, theX509_INFOlayout, test registration, and debt entry at headf3d2bdd28864f77d6c375f45ccc2b6882b41f350. No commands or tests were run.Results
Findings
Blocking
None verified in the inspected
X509_INFO_freepath.Non-blocking
X509_INFO_free, its tests, and a debt entry, but the prepared diff also contains extensived2i_X509decoder, API layout, and oracle changes. Please clarify the intended review scope or update the description to match the diff.Not verified
The patch changes eight files, all included in the prepared review folder. I inspected portions of
X509.cpp,Api.hpp, andtests/X509.cpp, plusCMakeLists.txt,Export.cpp, and the debt entry. I did not read all changed lines in those files or inspect the changed lines intests/Oracle.cppandtests/OracleReference.cpp; therefore the decoder implementation, oracle changes, and their coverage remain unverified. No tests were run. Windows, title, and console behavior were not confirmed.To get this to a good state
Nothing is required. Optional: clarify the description’s scope relative to the full diff.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T06:33:31Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the free path and its exercised reference-count and cleanup behavior appear consistent with the stated scope.
What I ran
Reviewed head
fa53f6a94380d2a65f5aa80ab00a032e8734924busingrepo_read.pyto inspect the prepared diff and pinned source. No build or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test results were not independently verified. The author reports 38 passing tests, registration and convention checks, and 3,000 oracle cases. Windows, title, and console behavior were not tested. Read:
description.md,commits.md,manifest.json,diff.patch; changed source inspected:Api.hpp,X509.cpp, andtests/X509.cpp. All changed files in the manifest are marked included; the remaining changed-file contents and full test suite were not inspected.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T13:07:18Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
07cea365b24d0857c904b01b6cd6ffb89ad2c60cfrom the prepared diff and source reader. No commands or tests were run.Results
X509_INFO_freeimplementation and focused testsFindings
Blocking
None.
Non-blocking
None.
Not verified
The PR includes stacked decoder and support changes beyond the stated
X509_INFO_freescope. Those changes were not fully reviewed, so approval is not justified. Windows, title, and console behavior were also not tested by this review. The description reports those environments were not tested by the author.Reviewed file paths:
core/libs/prx/libSceLibreSsl/src/X509.cpp(targeted implementation range), and the relevant changed hunks inreview/diff.patch, plusreview/description.md,review/commits.md, andreview/manifest.json. Excluded from full source review: other changed paths and the remainder of the large stacked decoder/support changes.To get this to a good state
Nothing is required. Optional: submit the stacked decoder and support changes in a separately reviewable scope, or provide a complete review of those changes.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T16:00:52Z.
Review: COMMENTED
On Linux, CTest passed
guest_libressl_x509_derandguest_libressl_x509_der_allocatorwith this revision integrated. The focused run covers theX509_INFO_freeownership and release checks, including the separately invoked allocator case.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.