feat(libressl): implement X509 extension getters #10078
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10078"
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 atharvjairath on 2026-10-23T08:40:32Z.
What
Implement
X509_EXTENSION_get_critical,X509_EXTENSION_get_dataandX509_EXTENSION_get_objectin libSceLibreSsl. Callers can read an extension's critical flag and borrowed ASN.1 object/data pointers instead of hitting unsupported-export exceptions. Null extensions return zero/null; the critical flag is true only for a positive signed 32-bit value, so the upstream default-1remains false. Pointer values are returned unchanged without decoding, copying or taking ownership.The contract follows LibreSSL 2.5.4 x509_v3.c and the 24-byte LP64 layout in x509.h. The implementation reads only the requested field, using fixed-width critical storage and byte copies to avoid aliasing assumptions. Published firmware 13.40 measurements identify this module as LibreSSL 2.5.4. These getters and this layout have not been independently measured on a console; that limitation is recorded in the existing debt file.
The progress scanner counts three additional completed functions on the same main baseline (main: 103/401; this PR: 106/401), corresponding exactly to these three exported getters. Its denominator includes helper callbacks, so 401 is not an export inventory or a compatibility measure. The actual unsupported-export block contains 287 exports, recounted from source against main's 290. Main's implementations and partial implementations are not attributed to this PR.
Landing status: Based on main
ba627802e2210187d417deb64c8f2fed8e33011f, with no open prerequisites. This refresh resolves the debt-document conflict while preserving every main entry and the unchanged getter debt; actual unsupported exports are main 290, this branch 287. Every own production/API/CMake/fixture addition and deletion is unchanged from prior headfd8bf3b3911eec664d7a0ca190d353c9bb49a05c. Main's complete source, canonical APIs, registrations and expanded fixtures remain intact, including GeneralName disposal, object creation/cleanup, protocol selection and the later LibreSSL3 getters/verification-parameter changes. The earlier pending-count review remains addressed.The public-header review is addressed by replacing the three extension getter placeholders in
include/Api.hppwith their documented signatures. The fixture uses the public umbrella header without duplicate local declarations. Main now provides the canonical cipher declarations. Getter bodies and regression assertions are unchanged.Tested
Exact tested head
ca7fd1e8e58c41d543783572737609cc7c3029d0, parent/main baseba627802e2210187d417deb64c8f2fed8e33011f, tree26a224078f3a55c62b460134df6c5f7b2d9d6dda. Recovery refbackup/pr-10078-before-general-name-refresh-20261101-1750preserves prior remotefd8bf3b3911eec664d7a0ca190d353c9bb49a05c. Both author and committer areatharvjairath <[email protected]>.guest_libressl_ui:0xc000001d/liblibc.dll+0xd2f49;guest_libressl_ex_data:St12system_error/guest_libressl_ex_data_tests.exe+0x9758;guest_libressl_x509_store_context:0xc000001d/liblibc.dll+0xd2f49;guest_libressl_x509_store:0xc000001d/liblibc.dll+0xd2f49;guest_libressl_x509_verify_param:0xc000001d/liblibc.dll+0xd2f49;guest_libressl_x509_lookup:0xc000001d/liblibc.dll+0xd2f49.-Werror. Main's PRIVATEcxx_std_23requirement for object allocation is retained. No source, assertion or gate was weakened.tools/pr_overlap.py --branch feat/libressl-x509-extension-gettersCLI returned 2, requiring manual comparison of base-conflicted peers; this is not an automated pass. All 41 external report peers were independently verified OPEN/current, with complete full/shared patches and all merge bases retained. Twenty-one shared payloads match the previously reviewed baseline, fifteen more change only pending counts, and the remaining five shared changes were manually reviewed. Distinct additions cover cipher block size, algorithm/configuration setup/cleanup and object-to-NID conversion, plus debt corrections. No independent duplicate of the three getters or open prerequisite was found; no unmerged implementation was imported. Broader non-shared peer changes and firmware/runtime claims were not independently validated.JUnit, full logs, manifests, main-control results and artifact hashes are retained in
/private/tmp/anyps5-monitor-20261101-1002/extension. The external Wine manifest retainsAPS5_NO_WRITE_WATCH=1only forguest_libressl_runtimeandguest_libressl_asn1; all other cases and controls use defaults. No new runtime switch or workaround was added. Historical default-Wine runtime/ASN.1 and mutation controls were not rerun. Diagnostics from passing cases remain in the logs and are separate from failed-case signatures.Source/merge scope: The tested parent retains all earlier main unions and the new GeneralName, LibreSSL3, CES, shared libc and build/tool changes. Relevant source/API/CMake/fixture/debt and shared build/tool changes were reviewed; other main paths received path-level scope review only. Shared libc was rebuilt for this focused matrix, not an all-libc or whole-project run. The default-OFF oracle was not enabled, downloaded or run.
Historical native Windows CI: Previous head
fd8bf3b3911eec664d7a0ca190d353c9bb49a05cintegrated with main73f4f7e06e4f210a8c6570e335fd654dc0a86134passed the changed-guest runtime step in Windows job 124551771359. All 37 LibreSSL-related registrations explicitly passed, including the getter fixture and six cases that fail under local Wine. The complete result was 1,629 passed, 894 skipped, zero failed (2,523 rows, 129.37 s). This is evidence for that older pinned integration, not native Windows verification of the refreshed head or proof that the local Wine failures are fixed. Separate full-build/runtime/skip-audit steps were skipped.Both owned patches also merge cleanly with later observed main
500b0252ec8c8800d35f77219d45e8c21d32ada2, preserving all own changes. The later root CMake change adds a shader-scan tool test; progress-tool changes add shader reporting and leave library counting unchanged. Other later UserService/NKWebKit/workflow/docs/tool paths received scope-only review. These checks do not extend the pinned runtime coverage.Separate firmware report: BunnyFl reports testing firmware 13.42's library in an emulator. Offset-marker inputs produced object/data reads at 0/16, a signed critical field at 8 with
critical > 0, and null results for null extensions in two runs. This agrees with this implementation. It is attributed emulated-library evidence, not independent hardware validation here or a review approval.Separate contributor evidence: benjaminmathias reports native Windows validation of previous extension head
cb6734063f5fd3f4d7612eea44fff5749fbe4454, including cipher0390178ba06a360f4c4799725bf0699e3a3c4916, integrated with main16ff208dc32cf3927ba1bae492eee363a5ae7ae8. On Windows 11 Pro with WinLibs GCC 15.2 UCRT, the runtime, ASN.1 conversion, ASN.1 allocator, cipher and extension tests each passed three repetitions withAPS5_NO_WRITE_WATCHunset. The report also records failing main-library controls for the two getter fixtures and passing results after restoring the candidate library. This is attributed evidence for those test paths on that pinned integration, not independent reproduction here, approval, or native validation of the refreshed head above. Logs and hashes are retained by the contributor.The refreshed tree has not been run on native Windows here. Whole-project, title and PS5 console validation were not performed; console layout and ABI limitations remain. Full upstream product CI requires maintainer dispatch.
Focused runtime build recipe
Use this CMake project outside the checkout, with repository-pinned ZArchive, zstd and mbedTLS checkouts under its
3rdparty/directory (mbedTLS068ff080b369adfac81509f9b57b2afabaf82dc5, including its pinned framework submodule):Configure with
-DANYPS5_SOURCE_ROOT=<checkout> -DCMAKE_BUILD_TYPE=Release, build, then runctest --test-dir <build> --output-on-failure. Linux in this environment setsCMAKE_CROSSCOMPILING_EMULATORto the native ARM QEMU 11.0.3 x86-64 binary; omit this on native x86-64 Linux. Windows builds use WinLibs GCC 15.2.0 UCRT r7 and compile serially under Wine. The actual Windows executables run through QEMU/Wine withWINELOADERNOEXEC=1,WINEPREFIX=/build/wine, andWINEPATHcontaining the build directory, both LibreSSL DLL directories and WinLibs bin.For the reported Wine run, the external Windows CTest manifest additionally sets
ENVIRONMENT "APS5_NO_WRITE_WATCH=1"only onguest_libressl_runtimeandguest_libressl_asn1, because Wine page write watching faults in this environment. The separate contributor report above covers those default native Windows paths on its pinned earlier integration; the refreshed head has not been tested natively on Windows here.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-23T13:13:39Z.
Review: CHANGES_REQUESTED
Reviewed exact head
abc991925908a7b7fb695f21f89f0eee609d9977. The X509 getter implementation follows the cited LP64 layout using byte copies, preserves borrowed pointers, and the focused 1,100-case fixture exercises signed critical values, pointer preservation and non-mutation. The description reports exact-head Linux and Windows 6/6 runs and records that console validation is outstanding. Hosted eligibility, conventions, labels and report checks pass; hosted product jobs are path-skipped. I have not independently run the local test suite.\n\nOne contribution-rule item needs resolving before merge: a direct merge preview of this head with your open #10071 reports a content conflict indocs/dev/debt/libSceLibreSsl.md(both edit the same pending-export count and add a debt entry). Please coordinate which lands first, declare that order withDepends on, and make sure the second branch keeps both entries and the corrected count. This is a keep-both sequencing request; neither PR needs to be closed.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T20:02:25Z.
Review: APPROVED
Reviewed exact head b0c5bea6437635b385edb3ba2f519048344e2b01, comparing the feature commit against its declared prerequisite #10071. The three getters follow the cited LibreSSL 2.5.4 layout and signed critical rule, preserve borrowed object/data pointers, and leave the extension bytes untouched; the focused test covers null inputs, signed boundaries, pointer preservation, and adjacent-byte canaries. The refreshed branch merges cleanly with #10071 (
git merge-tree); the checklist now declaresDepends on: #10071, matching the recorded landing order. Author-reported Linux and Windows focused runs pass, current hosted conventions/eligibility/labels/report pass, product jobs are path-skipped. I did not run the tests locally.