Repository navigation
feat(libSceLibreSsl): implement OCSP_response_status and OCSP_single_get0_status - #10448
alvaroelpob wants to merge 4 commits into
Conversation
Progress report (aaccd0b → b6230f2)📈 System libraries: 45.97% (+0.01%, +2 implemented functions) ✅ 2 implemented
Changed libraries (implemented exports)
|
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 9f5e341. 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.
9f5e341 to
ac9661e
Compare
ac9661e to
f28584b
Compare
|
Rebased on |
…ponse_status and OCSP_single_get0_status Took the PR's OcspResponse.cpp and its test as is (our Ocsp.cpp only has the OCSP string tables); registered them in our CMake source and test lists and kept our debt entries. (cherry picked from commit bb3add66b566d589a4f979e84f247b29cd6dadf3)
5ab224d to
5b75985
Compare
|
Rebased on |
5b75985 to
f000377
Compare
f000377 to
635a3f6
Compare
|
Rebased on |
|
@alvaroelpob this no longer merges cleanly with current main (e52fd83): core/libs/prx/libSceLibreSsl/CMakeLists.txt, include/Api.hpp and docs/dev/debt/libSceLibreSsl.md conflict with #10447, #11340 and #11261, which landed since. The conflicts are in shared lists only, so keeping both sides should do. Could you rebase or merge main and push? Nothing else changes from the earlier review. |
635a3f6 to
5ff7f59
Compare
|
Rebased on |
5ff7f59 to
b6230f2
Compare
|
Rebased on |
MarcZX10
left a comment
There was a problem hiding this comment.
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=ONonmaine2b9700. 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.main1e740a2 (after feat(libSceLibreSsl): implement the low-level AES functions #9033), head ac9661e: 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.maine7e3e9c, head f28584b, to resolve the conflict from feat(libSceLibreSsl): implement the per-thread error queue #9529 on the sharedCMakeLists.txtand debt-file lines; both sides are kept and the count is 353 minus this PR's exports. f28584b (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 refactor(libs): add full export headers for libs #10706. Full build andctest -j16: 2202/2203 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.mainae7d592 (after feat(libSceLibreSsl): implement the OCSP status and reason strings #9949), head 2db1279, 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 -j16onmainae7d592: 2275/2276 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.main88795ed (after feat(libSceLibreSsl): implement the CRYPTO locking and thread id callbacks #10248; head 5b75985) 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.mainc7b4878 (after feat(libSceLibreSsl): implement sk_num, sk_value, sk_pop and sk_pop_free #10373, feat(libSceLibreSsl): implement UI_METHOD creation and its opener, writer, reader and closer accessors #10376 and feat(libSceLibreSsl): implement RSA_flags and RSA_size #10449), head f000377, 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.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)