feat(libSceLibreSsl): implement OCSP_response_status and OCSP_single_get0_status #10448
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10448"
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 alvaroelpob on 2026-10-24T00:56:17Z.
What
Implements
OCSP_response_statusandOCSP_single_get0_statusin libSceLibreSsl, which threw and were declared without parameters.The module is LibreSSL 2.5.4 (firmware 13.40 measurements in #8981). Signatures, layouts and results follow that release's
ocsp.h,ocsp_cl.canda_enum.c:int OCSP_response_status(OCSP_RESPONSE*)ASN1_ENUMERATED_get(responseStatus), truncated tointint OCSP_single_get0_status(OCSP_SINGLERESP*, int* reason, ASN1_GENERALIZEDTIME** revtime, ASN1_GENERALIZEDTIME** thisupd, ASN1_GENERALIZEDTIME** nextupd)certStatus->type. For a revoked status it storesrevocationTimeand the enumerated reason, or -1 when there is no reason. It then storesthisUpdateandnextUpdate, writing only the outputs that aren't nullASN1_ENUMERATED_get, which this module doesn't export, is reproduced for both: 0 for a null value or null data, -1 for a type other thanV_ASN1_ENUMERATED(10) andV_ASN1_NEG_ENUMERATED(0x10A) or a length above 8 bytes, otherwise the big-endian bytes, negated for the negative type.The layouts (
ASN1_STRING24 bytes,OCSP_RESPONSE16,OCSP_CERTSTATUS16 with the union at 8,OCSP_REVOKEDINFO16,OCSP_SINGLERESP40) are checked withstatic_asserts. LibreSSL dereferences a null response, a nullcertStatus, and a null revoked record when the time or reason is requested without checking them, so those throw. No export of this module decodes a response yet, so for now only structures built by the caller reach these functions.The debt entry records the source and what is unverified, and the pending-export count drops by 2 (342 to 340 on current
main). The OCSP string functions in #9949 live insrc/Ocsp.cpp. This PR usessrc/OcspResponse.cpp, so the two don't add the same file.Tested
Ubuntu 26.04 (WSL2, kernel 6.18), GCC 15.2.0, Release, full build with
BUILD_TESTING=ONonmaine2b9700a9. There is one commit per function, and each adds that function with its test block and debt update. Each was built and itsguest_libressl_ocsp_responsetest andcheck_conventions.pyrun on its own.guest_libressl_ocsp_responsetest.OCSP_response_statusis checked with one- and two-byte values, a negative enumerated value, a 5-byte value truncated toint, an 8-byte value with the top bit set, a 9-byte value (-1), zero length, null data, the wrong type (-1), and a null status (0); a null response throws.OCSP_single_get0_statusreturns -1 without writing for a null single response. For good and unknown it fills onlythisupdandnextupd, leavingreasonandrevtimealone. For revoked it covers a reason, no reason (-1), a wrongly typed reason (-1) and null outputs. A revoked status with a null record throws only when the reason or time is requested, and a nullcertStatusthrows. Onmainthe first call throws.ctest -j16at the last commit: 2003/2004 pass.agc_driver_multisample_retirementfails the same way onmainon this machine.main1e740a23a3(after #9033), head ac9661e493: the conflicts were only theadd_librarysource list, the end of the test block, the pending-export count and the last debt entry; both sides are kept and the count is 357 minus this PR's exports. Full build andctest -j16: 2043/2044 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.maine7e3e9c198, head f28584b07d, to resolve the conflict from #9529 on the sharedCMakeLists.txtand debt-file lines; both sides are kept and the count is 353 minus this PR's exports. f28584b07d (refactor(libSceLibreSsl): declare the OCSP status exports in the public header) puts the real signatures and their structs inlibSceLibreSsl/include/Api.hppand drops the test's redeclarations, whichpublic_headersrequires since #10706. Full build andctest -j16: 2202/2203 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.mainae7d59258e(after #9949), head 2db12797e2, to resolve the conflicts withmainon the sharedCMakeLists.txtand debt-file lines; both sides are kept and the count is 342 minus this PR's exports. Full build andctest -j16: 2275/2276 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.LibreSslAsn1Stringand usesmain'sAsn1String(same 24-byte layout, asserted inAsn1.cpp) in the OCSP structs, signatures and test;guest_libressl_ocsp_responseandpublic_headerspass. Full build andctest -j16onmainae7d59258e: 2275/2276 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.main88795ed448(after #10248; head 5b7598547f) to resolve the conflicts on the shared debt-file lines; both sides are kept and the count is 335 minus this PR's exports. Full build andctest -j16: 2383/2384 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.mainc7b4878fa8(after #10373, #10376 and #10449), head f000377fe2, to resolve the conflicts withmainon the sharedCMakeLists.txt,Api.hppand debt-file lines; both sides are kept and the count is 319 minus this PR's exports. Full build andctest -j16: 2394/2395 pass;agc_driver_multisample_retirementfails the same way on thatmain, andguest_pthread_starttimed out once at 20 s while another full suite shared the machine; run alone with--repeat until-fail:3it passes 3/3 in about 2 s.check_conventions.py --base upstream/mainpasses.main474030e584(after #13562), head 742ed7a7c6, to resolve the conflict on the pending-export count in the debt file; the count is 292 minus this PR's exports. Full build andctest -j16: 3062/3062 pass.check_conventions.py --base upstream/mainpasses.maincf79276fee(after #13820), head 7e59cbf222, to resolve the conflict on the pending-export count in the debt file.mainstill says 292 although #13820 removed two stubs, leaving 290, so the count is now set to the 288 stubs left inExport.cpp. It also restores the PS5 3.20 export table link,b2a77c09cd71c01f34c790cfbe98c751a13262ad, which the previous rebase had written without its zeros. Full build andctest -j16: 3107/3107 pass (log_filefailed once on #10486 and passed on five reruns and a second full run).check_conventions.py --base upstream/mainpasses.main4939814d79(after #9970, #10078 and #10488), head 81f030e81d, to resolve the conflicts on the sharedCMakeLists.txt,Export.cpp,Api.hppand debt-file lines; both sides are kept. This replaces the merge ofmainpushed to the branch as d05afe006c, which only changed the pending count. The count is set to the 259 stubs left inExport.cpp. Full build andctest -j16: 3538/3538 pass.check_conventions.py --base upstream/mainpasses.main4f41f4c375, head 3013ef2759, to resolve the conflicts on the sharedCMakeLists.txt,Export.cppand debt-file lines; both sides are kept and the debt count is recomputed fromExport.cpp. Full build andctest -j16: 3796/3800 pass;guest_sce_net,guest_poll,guest_select_waitandguest_memoryfailed under that load, pass when run alone, andmain4f41f4c375passes all 3799 with-j16on the same machine.check_conventions.py --base upstream/mainpasses.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 copilot-pull-request-reviewer[bot] on 2026-10-24T00:56:26Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T01:36:27Z.
Review: APPROVED
Reviewed exact head 9f5e341f96cee180fc349f4c4be1ecbb0e2da29a. I compared both implementations and the 24/16/40-byte guest layouts with the pinned LibreSSL 2.5.4 ocsp_cl.c, ocsp.h, and a_enum.c. The null-single return, raw certificate status, optional output writes, revoked reason handling, ASN.1 enum limits and values, and null-dereference cases match those sources. The only related open PR I found is #9949, which implements status/reason text conversion rather than these two functions.\n\nI compiled the exact changed implementation and supplied test with GCC 12.2, C++20, -Wall -Wextra -Werror; libSceLibreSsl OCSP response tests passed. This focused direct build used a temporary NotImplemented_nid_no_patch shim, so it does not validate full project linkage or exception integration. The exact-head conventions check passed. Hosted eligibility, conventions, intake, labels and report checks pass; full Linux/Windows product jobs are skipped under repository policy. The PR declares its LibreSSL dependency ordering. I found no blocking behavior issue.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:59:41Z.
Review: CHANGES_REQUESTED
Re-check — changes requested\n\nThe new report is useful: it says the implementation functions were preserved through the merge and the full test suite has the same single known failure as its tested main, with conventions passing. However, the tested integration point is
4c7d275bef; current upstream main isaaccd0ba39, and this PR head is 44 commits behind it.\n\nPlease update onto current main, preserve the implementation and debt-count changes, recount the pending exports against the resulting Export.cpp, and rerun the relevant LibreSSL tests plus conventions on the exact updated head. The earlier approval was for the prior head and does not cover this stale integration point. I did not rerun these checks locally.