feat(libSceLibreSsl3): decode certificateIssuer CRL entries and match them by issuer #27901
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27901"
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 MarrasFederico on 2026-11-27T19:22:49Z.
What
Builds on #27637 to decode the
certificateIssuer(NID 771) CRL entry extension and match revoked entries by issuer inlibSceLibreSsl3.SetEntryIssuersincore/libs/prx/libSceLibreSsl3/src/X509Crl.cppdecodescertificateIssuer(directoryNameelements, including BER indefinite-length and primitive outerSEQUENCEencodings) as LibreSSL 4.0.0crl_set_issuersdoes: each decodedGENERAL_NAMESstack becomes the current issuer, is pushed ontocrl->issuers(created on first use), and is inherited by subsequent entries until overridden.certificateIssuerdecodes push the matching LibreSSL 4.0.0 ASN.1 error queue, setEXFLAG_INVALID(0x80), and stop processing further entries, leaving that entry and later entries with nullissuerandreason == 0. Allocation or push failure oncrl->issuersfrees the CRL and failsd2i_X509_CRLwithASN1_R_AUX_ERROR(13/100).EnumeratedValuerange-checks CRL reason codes againstintlimits (ASN1_R_TOO_LARGE/ASN1_R_TOO_SMALL, returning-1) so values outsideintrange are never narrowed toremoveFromCRL.DecodeName,DecodeRelativeName,DecodeNameEntry,DecodeAlgor, andDecodeCrlhold guest allocations in scopedstd::unique_ptrguards;DecodeNamecatchesstd::bad_alloc(queueingMallocFailureand returningnullptr), andDecodeCrlreleasescrlat most once.FreeCrlreleasescrl->issuersand itsGENERAL_NAMESstacks once; revoked entries borrow the pointer.X509_CRL_get0_by_certmatchesdirectoryNameissuers inrevoked->issuerlike LibreSSL 4.0.0crl_revoked_issuer_match, falling back to the CRL issuer whencertificateIssueris set and the certificate has no issuer.Non-
directoryNameGeneralNameforms incertificateIssuerstill throwNotImplemented_nid_no_patch, and same-serial entries scan in CRL order rather than sortingrevoked. The technical debt fragments are updated accordingly.Tested
Ubuntu 26.04, GCC 15.2.0, Release,
BUILD_TESTING=ON: at4ce2703e5fc2e182c2c84c9ad317a638426e43b0,guest_libressl3_x509_crl3/3 (Windows host offline for this follow-up). Negative control: keepingcore/libs/prx/libSceLibreSsl3/src/X509Crl.cppfromdaf54d1564with the updated tests failsguest_libressl3_x509_crlatcore/libs/prx/libSceLibreSsl3/tests/X509Crl.cpp:2045. Test CRLs, entryissuer/reasonstates, lookup return values and matched entries, error queues, andASN1_R_AUX_ERROR/ zero-leak allocation-sweep outcomes incore/libs/prx/libSceLibreSsl3/tests/X509Crl.cppwere verified against LibreSSL 4.0.0 (ce488b78) oracle runs (d2i_X509_CRL,X509_CRL_get0_by_cert,X509_CRL_get0_by_serial, and allocation sweeps; for the same-serial multi-issuer CRL, the test asserts CRL-order index0where the oracle sortsrevokedand returns index1).Each of these breaks the test:
crl->issuersordirectoryNamecleanup;certificateIssuercheck, or continuing past an invalidcertificateIssuerorcrlReason;entry->issuerassignment/inheritance;ASN1_R_AUX_ERRORor leakingdecodedoncrl->issuersallocation/push failure;GeneralNamechoice class/tag range checks, non-directoryNamethrow, explicit constructed check, trailing-bytes check, header/nesting error counts, primitive outerSEQUENCEhandling, or indefinite/unexpected/empty EOC checks;IssuerMatches, skippingrevoked->issuermatching, or altering the null-certificate-issuer fallback to the CRL issuer.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T19:26:51Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
daf54d1564:tools/check_conventions.pypassed.guest_libressl3_x509_crl_testsbuilt cleanly.guest_libressl3_x509_crl):core/libs/prx/libSceLibreSsl3/include/Api.hpp,core/libs/prx/libSceLibreSsl3/src/X509Crl.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T19:31:48Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review is complete for the included changed files, and the inspected evidence supports merging.
What I ran
daf54d1564f9607b7400db9e685aa686805a52d0; no merged-preview check or commands were run.description.md,commits.md,manifest.json,diff.patch, and all five changed files listed in the manifest. Source context was read throughrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests reported in the PR description were not run independently. Console behavior and layout remain unverified, as documented by the project. No changed files were excluded from review.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T19:34:01Z.
Review: COMMENTED
Actionable comments posted: 5
b9ceee4c-a4e2-4768-a5ca-339ad9d87441Reviewing files that changed from the base of the PR and between
ea49f32e89anddaf54d1564.core/libs/prx/libSceLibreSsl3/include/Api.hppcore/libs/prx/libSceLibreSsl3/src/X509Crl.cppcore/libs/prx/libSceLibreSsl3/tests/X509Crl.cppdocs/dev/debt/changes/feat-libressl3-crl.mddocs/dev/debt/changes/fix-libressl3-crl-indirect-entries.mddocs/dev/debt/changes/libressl3-crl-post-decode.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-11-28T05:06:15Z.
Review: APPROVED
Checked head
daf54d1564. All on Windows 11 with WinLibs GCC 15.2 (Release), applied tomaina163d4b886together with #27930, #27929, #27926, #27925, #27924, #27923, #27922, #27828, #27771, #27755, #27748, #27682, #27765.tools/check_conventions.py --headandtools/debt_fold.py --checkpassed and the full build succeeded.guest_libressl3_x509_crlpasses. In the full CPU suite (5,120 tests) the only failures are unrelated:windows_read_trap_unknownfails onmaintoo (fixed in #28028).frame_capture_minimize,jpeg_external_toolchainandguest_pthread_mutex_contentionare timeouts under load; they pass when run on their own.guest_audio_in_capturepasses 20/20 onmainand with #27922.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T09:51:57Z.
Review: APPROVED
Reviewed — looks good
The change implements the described CRL issuer decoding and lookup behavior; I found no verified blocking defect in the inspected code, but did not run the tests.
What I ran
Reviewed head
4ce2703e5fc2e182c2c84c9ad317a638426e43b0against basemainusing the prepared diff and pinned reader. No commands or tests were run.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Not verified
Tests were not run. The author reports
guest_libressl3_x509_crlpassed on Ubuntu 26.04 with GCC 15.2.0; that result was not independently verified. Windows and physical-console behavior were not verified.Files read:
core/libs/prx/libSceLibreSsl3/include/Api.hpp,core/libs/prx/libSceLibreSsl3/src/X509Crl.cpp,core/libs/prx/libSceLibreSsl3/tests/X509Crl.cpp, and all three changed debt notes. All five files listed as reviewed in the manifest were read. No excluded changed files were listed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-28T10:35:55Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
4ce2703e5f:tools/check_conventions.pypassed.guest_libressl3_x509_crl_testsbuilt cleanly.guest_libressl3_x509_crl):core/libs/prx/libSceLibreSsl3/include/Api.hpp,core/libs/prx/libSceLibreSsl3/src/X509Crl.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T09:41:29Z.
Review: COMMENTED
The Linux
guest_libressl3_x509_crlCTest passed against the patched library. The fixture exercises certificate-issuer decoding, issuer-aware lookup and revoked-entry handling. It also checks the error queue and guest allocation cleanup.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T16:29:10Z.
Review: APPROVED
Re-verified head
ef4fdd4a27on Windows 11 with WinLibs GCC 15.2 (Release), applied alone to main484b0368d3. That covers4ce2703e5f: the CRL reason range check, the scoped cleanup and the debt note wording.guest_libressl3_x509_crlpasses. On main the test passes too.X509Crl.cppandApi.hppreverted to main, the test no longer compiles (LibreSsl3X509Crlhas noissuers).Not run: Linux and macOS.
AI-assisted: yes (Claude Code)
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.