feat(libSceLibreSsl): implement OCSP_check_validity #11174
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11174"
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 ahmadmuj on 2026-10-25T20:35:38Z.
What
Implements
OCSP_check_validity, following LibreSSL 2.5.4 ocsp_cl.c and the time parser and compare in a_time_tm.c.YYYYMMDDHHMMSSZform parses (no fractions, no UTCTime, same digit and range checks). The ASN.1 type field is ignored, like 2.5.4, which only readsdataandlength.maxsec >= 0), then nextUpdate field, expired, nextUpdate before thisUpdate. Each failure queues oneERR_PACK(39, 0xfff, reason)through the existing error queue.ASN1_time_tm_cmp, not as epoch seconds, so20000231000000Zsorts before March 1 just like 2.5.4.time, and the offsets go through guestgmtime_r. Whengmtime_rfails, the call returns 0 with no error, as in 2.5.4.t_now + nsecis signed overflow in C. The reference build is-O1 -fno-strict-overflow, and the add compiles to a plainadd, so I wrap it too. A wrapped value is always outside the gmtime range, so hugensec/maxsecvalues return 0 without an error, same as 2.5.4. A nullthisupdthrows (2.5.4 dereferences it).Heads-up: no export builds an
ASN1_GENERALIZEDTIMEyet (d2i_OCSP_RESPONSEis still a stub), same as the other OCSP getters in flight.Tested
Ubuntu 24.04 on WSL2, GCC 13.3, Release. Head
bcb832214c8dmerges main080dbd08c6f8without rewriting published history.70530ea4b847.4180951e90e6. The final main update changes only unrelated dialog, JXR, signaling and video files; no build files or LibreSSL dependencies change.Export.cpp.Earlier checks
Ubuntu 24.04 on WSL2, GCC 13.3, Release, on
main5a2744c5. Latest run: merged withmaine4501451.libcrypto.a: a host probe (not committed) ran about 45 cases: valid windows, each error, every bad-string shape (13-char UTCTime, fraction, noZ, out-of-range fields, sign chars, null data, negative and zero length), type 23 and 4, Feb 31, year 0000, andnsec/maxsecatLONG_MAX,LONG_MIN, 6e16 and 7e16. The guest test asserts the same return value and error codes, and that each call queues at most one error.nsecwhere both ends matter), so it doesn't depend on the clock.guest_libressl_ocspaborts withOCSP_check_validity_nid_postfix not implemented. Mutations that each fail it: accept second 60, accept a 16-char string, reject equal thisUpdate/nextUpdate, run the age check for negativemaxsec, check nextUpdate-before-thisUpdate ahead of expiry.ctest -R "guest_libressl|public_headers": 103/103 pass.check_conventions.py --base origin/mainpasses.NotImplemented_nid_no_patchstubs left inExport.cpp(main says 292 but has 290).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-25T20:40:06Z.
Review: COMMENTED
I reviewed the implementation at head
19e3b8cf55c9986443058424e921bb60410871bfagainst LibreSSL 2.5.4'sOCSP_check_validityflow: validation order, generalized-time field parsing/comparison, slack/max-age boundaries, and error-queue behavior. I did not find a concrete mismatch in the reviewed logic. The added guest cases cover the precedence and malformed-time boundaries called out in the PR description.Independent checks here: conventions,
git diff --check, and C++20 syntax compilation ofOcsp.cppandGuestLibreSslOcsp.cpppassed. I could not execute the guest test binary in this worktree. Hosted eligibility, conventions, intake, labels, and report checks passed; product build jobs were skipped. I’m leaving a comment-only review because I do not have an independent runtime result for this implementation.