feat(libSceLibreSsl): implement OCSP_resp_count and OCSP_resp_get0 #11003
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11003"
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 lopdan on 2026-10-25T14:03:22Z.
What
Implement
OCSP_resp_countandOCSP_resp_get0in libSceLibreSsl: the number of single responses in anOCSP_BASICRESPand the response at an index, read from the guest objects.The signatures, the LP64 layouts (
tbsResponseDataat offset 0 ofOCSP_BASICRESP,responsesat offset 24 ofOCSP_RESPDATA, and the 32-byte_STACKwith itsintsize at 0 and entry array at 8) and the results follow LibreSSL 2.5.4: ocsp.h, ocsp_cl.c, stack.h and stack.c. That is the version the published firmware 13.40 measurements identify and the existing libSceLibreSsl debt entries use. Nothing is verified on a console; the debt entry says so.OCSP_BASICRESPgives -1 and null; a null responses stack gives -1 and null.sk_numdoes. An index below 0 or not below the size gives null without reading the entry array; null entries are returned as stored.NotImplemented_nid_no_patch: a nulltbsResponseData(both functions, any index) and a null entry array with an index in range.Like the cipher getters of #10071, these read objects that no export of this library creates yet (
d2i_OCSP_RESPONSEandOCSP_response_get1_basicstill throw). The progress scanner still counts 46/399 for libSceLibreSsl because it marks exports with a throwing path as incomplete, as with the merged ASN.1 getters.No open or closed PR names these exports (GitHub search for each name), and
tools/pr_overlap.pyfinds no open PR with the same exports or new files. Its line conflicts are #9949, whose OCSP stub and declaration changes sit next to the removed ones, and #10078, #10248, #10395 and #10484, which change the same lines of the debt file or the end of the CMakeLists, as every LibreSSL PR does; whichever lands second needs a trivial rebase. The 30 open PRs it could not compare because they conflict withmaindo not touch these exports either. The new files do not collide with #9949'ssrc/Ocsp.cppor #10448'ssrc/OcspResponse.cpp.Tested
-DBUILD_TESTING=ON; only the LibreSSL test targets were built. Rebased onmainate05ba6feeband everything below rerun after the rebase.ctest --test-dir build -R guest_libressl_ocsp_basic_response --output-on-failure: passed. The test lays out the guest objects as raw bytes at the 2.5.4 offsets, points every field the functions must not read at decoys with other values, and covers null inputs, a null stack, sizes 3, 0, -2 andINT_MAX, indices 0 to 3, -1,INT_MINandINT_MAX, a null entry, that no byte is written, and the throwing paths.ctest --test-dir build -R guest_libressl --output-on-failure: 11/11 passed (libSceLibreSsl and libSceLibreSsl3).ctest --test-dir build -R public_headers -j 12: 65/65 passed.ctest --test-dir build -R '^(conventions_|debt_|stubgen|nid_database|pr_overlap|check_compile)' -j 12: 82/82 passed.python3 tools/check_conventions.py --base upstream/main: all checks passed.python3 tools/progress.py --module libSceLibreSsl:libraries 46/399 (11.53%)before and after.python3 tools/pr_overlap.py --branch feat/libSceLibreSsl-OCSP_resp_count: no open PR with the same exports or new files; its line conflicts are listed under What.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 MarcZX10 on 2026-10-25T14:10:05Z.
Review: APPROVED
Reviewed the LibreSSL 2.5.4 layouts and bounds behavior against the cited source. The implementation returns the stored stack count (including negative values), rejects out-of-range indexes before touching the entry array, preserves null entries, and throws only on the documented dereference cases. The raw-byte regression test uses decoy fields to check the offsets and covers the boundary/null cases described. I verified conventions and diff cleanliness, and both changed C++ translation units pass local C++20 syntax checks. The author reports the focused OCSP test and 11 LibreSSL tests passing; product tests are not run by the current hosted checks, and Windows/console behavior remains unverified as stated.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T09:05:37Z.
Review: APPROVED
The implementation and raw-byte regression test were previously reviewed, and the current head now includes current main. The debt count is 297, matching the resulting Export.cpp after this PR removes the two OCSP exports from the 299-entry base. The author reports the OCSP test and full LibreSSL suite; I did not rerun them. The current conventions and labels checks are still pending, so this review covers source correctness and does not claim those checks passed.