feat(libSceLibreSsl): implement X509_VERIFY_PARAM_set1_host #11189
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11189"
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 JaceTheBlu on 2026-10-25T21:10:06Z.
What
Implements
X509_VERIFY_PARAM_set1_hostin libSceLibreSsl, which threw and was declared without parameters. It stacks on #11105, which carries #11100 and #11089; the commits before this PR's own are theirs.int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM*, const char* name, size_t namelen)followsint_x509_param_set_hostswithSET_HOSTfrom LibreSSL 2.7 (OPENBSD_6_3), the first release with this export; 2.5.4, the version the debt file names, lacks it, and its layouts are the same as 2.7's:namelen0 is measured withstrlen;namelenbytes returns 0 and leaves the host list alone;strndup, as the module would through libc, and pushed on a new plain stack (4 slots, no comparator); a failed copy or stack allocation frees what it allocated and returns 0 with no list.LibreSSL 2.8 also sets a
poisonedfield when the call fails; that field is not in the 2.5.4 to 2.7 parameter identity used here, so a failed call leaves no mark. The debt entry records this. Null verify parameters or identity throw where LibreSSL faults. The pending-export count indocs/dev/debt/libSceLibreSsl.mddrops by one.This branch stacks on #11105, which carries #11100 and #11089 (#11089, #11100, #11105, then this one). Each branch merges the previous one, so the files they share are resolved once along the chain.
Tested
Debian trixie container, GCC 14.2, full Release build of this branch.
ctest -R 'libressl|crypto_memcmp': all pass (18 of 18 on the stacked head).guest_libressl_x509_storenow also covers this export: terminated and counted names, a counted name without a terminator, an embedded NUL refused with the list kept, null and empty names clearing the list, a name the store frees, and the throwing cases;guest_libressl_x509_store_allocatorcounts the copy, stack and array allocations, the frees when a name replaces another, and a failed copy and a failed stack allocation.python3 tools/check_conventions.py --base upstream/mainpasses. Not tested on Windows, on a title or on a console.tools/pr_overlap.pywas not run (no authenticatedgh).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-25T21:27:27Z.
Review: COMMENTED
Reviewed exact head
005afcac1035f73e3b1c6231379d1dee31564204. I compared the callback types,X509_VERIFY_PARAMlayout, ex_data pointer, and associated declarations with the pinned LibreSSL OPENBSD_6_3 headers; the PR’s static assertions match those definitions. Thenamelen == 0C-string behavior is documented, and I found no implementation defect in the diff. Local convention and whitespace checks pass. I attempted a local configure, but it stopped before compilation because this environment lacksSDL2Config.cmake; therefore I could not independently run the product tests. Hosted eligibility/conventions/intake/labels pass, while product build jobs are not present in this PR’s checks.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T21:30:40Z.
Review: COMMENTED
Re-reviewed exact current head
25079c78a3f4211089aa70e46e5a0af49d2e76a0after its merge withupstream/mainand #11089. The parent stack matches #11089’s current head445853269af723060362472e83be8865711fb355; the X509 store implementation is the same code reviewed in that PR, while the newset1_hostpath still matches the pinned 2.7 host-list behavior and preserves the prior list for embedded-NUL rejection. The debt count was reconciled after the merge. I found no new code issue. The PR reports a Debian trixie Release build and 13/13 focused tests; hosted eligibility, conventions, labels, and report pass, while product jobs are skipped. I did not rerun the runtime suite locally.Imported from boykopovar/AnyPS5. Originally posted by thepoppfish on 2026-10-25T21:41:27Z.
Review: COMMENTED
Independent native Windows runtime validation of refreshed head
25079c78a3f4211089aa70e46e5a0af49d2e76a0, supplementing the source/layout review above. I found no mismatch in the exercised hostname-setter paths.Windows 11 build 26200, MSYS2 UCRT64 GCC 16.2.0, C++20
-O1 -g -fno-inline -fno-lto, static C++ runtime. Built the complete production X509Store.cpp, AllocatingStrings.cpp and ApplicationHeap.cpp against this commit's actual headers. The setter, guest strndup, stack cleanup, application-heap registration and callback dispatch are unmodified production code. MinGW unwind sections are renamed after linking as shown below.External CTest: 4/4 passed, no skips, 0.26 s:
hosts, and zero tracked guest blocks after actual store destruction. These check storage semantics, not hostname matching or certificate verification.hostsnull and releases all partial allocations. This includes the third allocation not injected by the committed allocator fixture.I first obtained the same 4/4 result at
005afcac1035f73e3b1c6231379d1dee31564204. After your refresh, I verified that all four production/test source files used here are byte-identical and rebuilt/reran against the refreshed checkout and headers, rather than treating the old binary as a current-head test. Conventions against main snapshot366dd4e6b704b048e05eee65e0edead78352811aand whitespace checks pass; the checkout is clean.The exercised return/state ordering matches int_x509_param_set_hosts at OPENBSD_6_3: embedded-NUL rejection precedes clearing; SET_HOST clears before copying; allocation failure leaves no new list. I resolved the tag to that commit and verified the pinned source matches the tag. This is a source comparison, not execution of a complete upstream LibreSSL binary or a new console measurement.
Scope/boundaries: the external malloc/calloc/realloc/free wrappers forward to real ApplicationHeap functions and translate allocation exceptions to errno 12/null as the custom-heap path does. The registered test callbacks allocate/free real CRT memory; unused default-heap, process-parameter and formatting paths throw if reached. I did not run the default-heap mode of the full fixture, the full 13-test product/shared-library build, Linux/macOS, a title, or PS5 hardware. No target parser, strndup, registration or cleanup function is mocked.
Comment-only supporting runtime evidence. A canonical overlap scan was started at the old
005afcahead before the refresh and is still in progress; it does not establish the current head's overlap status. The declared #11089 dependency and shared-file integration with #11100/#11105 retain their separate coordination requirements. AI-assisted: yes.Complete external harness and replay
Place
review-11189andnative-host11189beside each other and save the three files below under native-host11189. With Git, MinGW GCC, CMake and Ninja on PATH:Only allocator mode of the author fixture is registered; the default GuestHeap adapters deliberately throw. Each test has an eight-second timeout. Probe output from the refreshed-head run:
CMakeLists.txtSupport.cppProbe.cpp