feat(libressl): implement cipher metadata queries #10071
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10071"
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:14:01Z.
What
Implement
SSL_CIPHER_get_bits,SSL_CIPHER_get_nameandSSL_CIPHER_get_versionin libSceLibreSsl. Callers can now read a cipher's effective key strength, algorithm key size, existing name pointer and protocol label instead of hitting unsupported-export exceptions.The contract and 88-byte LP64 layout follow LibreSSL 2.5.4 ssl.h and ssl_ciph.c. Published firmware 13.40 measurements identify libSceLibreSsl as 2.5.4; I have not independently verified these three calls or the cipher layout on a console. That limitation is recorded in the library's debt file.
Explicit 64-bit guest fields avoid Windows' 32-bit
longlayout. The functions preserve the upstream edge cases: null cipher leaves the bits output untouched, a null name field remains null, algorithm bits are written before strength is read when the output aliases the cipher, and protocol lookup tests the full shifted 64-bit ID. TLS 1.2 cipher suites still use the older release'sTLSv1/SSLv3label. No handshake, encryption or certificate-verification behavior is added.The unchanged progress scanner reports three additional completed exports (libSceLibreSsl: 43 to 46 of 399). This measures implemented functions, not game compatibility. The patch is independent of #10047, #10056 and #10065.
Landing order: #10071 → #10078. The prior #9529 prerequisite has merged and is included in the tested main base. This branch is now a single follow-up directly on main; it has no remaining open prerequisite. Main's ASN.1, ERR, AES, RAND/CRYPTO, digest, DES and X509 work are preserved. The source has 345 pending exports. #10078 carries this exact cipher commit and declares
Depends on: #10071.The public-header review is addressed by replacing the three unknown-signature placeholders in
include/Api.hppwith the documented getter signatures. The implementation and fixture include the public umbrella header; duplicate local declarations are removed. Getter bodies and regression assertions are unchanged.Refreshed after #10005 merged: the five ASN.1 implementations, canonical declarations, both regression modes and functional debt entries are preserved. Getter implementations, signatures and fixtures are byte-identical to the previously tested head;
Export.cppdiffers only by removal of the five ASN.1 stubs now implemented on main. The pending block is recomputed from source. The unchanged progress scanner still counts 46/399 because it marks functions with unsupported paths as incomplete; its eight entries outside the pending block are the five ASN.1 exports,ERR_remove_thread_state,SHA256andSHA512_Final.Tested
Exact tested head:
0390178ba06a360f4c4799725bf0699e3a3c4916; parent:63a863d3b07f2457ee1210f1abba1c11409cdff5; main base:63a863d3b07f2457ee1210f1abba1c11409cdff5. Recovery ref:backup/pr-10071-before-asn1-refresh-20261025-1539. Author and committer:atharvjairath <[email protected]>.guest_libressl_runtimerun timed out after a Wine/Rosetta fault while using page write watching. Its source, fixture and complete libc match main exactly. The recorded passing Windows matrix setsAPS5_NO_WRITE_WATCH=1forguest_libressl_runtimeandguest_libressl_asn1, using the repository's existing diagnostic switch. All assertions and guest allocation/RAND behavior still execute; Windows page write watching itself is not validated by this run. Other tests run without the switch.The initial Windows cipher-branch run passed 10/11 cases and timed out in
guest_libressl_asn1after fault0xc000001datGuestHeap::allocatein libc. An isolated control built from exact main ASN.1 sources/fixture and linked to the identical rebuilt libc, excluding our getter code, reproduced that same fault with default settings and passed withAPS5_NO_WRITE_WATCH=1. The final matrix applies this switch only to runtime and ASN.1 conversion; the separate ASN.1 allocator case and all other cases keep default settings. Assertions and production code were not weakened. Native/default Windows page write watching remains unvalidated.Focused builds use the complete real libraries and libc with repository-pinned dependencies. Native hardware, native Windows desktop, whole-project, title and PS5 console validation were not performed. Full upstream product CI requires maintainer dispatch.
Focused runtime build recipe
Use this CMake project outside the source tree, with the 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. In this environment the LinuxCMAKE_CROSSCOMPILING_EMULATORis QEMU 11.0.3 x86-64. Windows uses WinLibs GCC 15.2.0 UCRT r7; the actual Windows test executables run through Wine 9 under QEMU withWINELOADERNOEXEC=1, andWINEPATHincludes the build directory, both LibreSSL DLL directories and WinLibs bin. Test timeouts remain 30 s (20 s for constant-time comparison).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. Native Windows results are still needed for that path.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:37Z.
Review: DISMISSED
Reviewed exact head
d56f90f4d27a9c95ac9c78de07b0cdbb21a561fa. The cipher field reads and regression coverage are clear, and the description gives focused Linux/Windows 6/6 runs, including boundary, aliasing, and validation details. 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 #10078 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:01:56Z.
Review: DISMISSED
The current overlap report/body lists #9529 among the shared-file work, but this PR still says
Depends on: none. I tested the actual branches withgit merge-tree --write-tree upstream/pr/9529 upstream/pr/10071; the merge has a content conflict indocs/dev/debt/libSceLibreSsl.md(CMakeLists and Export.cpp auto-merge). CONTRIBUTING requires authors to agree the landing order for overlapping lines and declare the prerequisite. Please coordinate the #9529 order, update the checklist if this PR needs it first, and confirm the merged debt retains both entries and the correct pending-export count. This is a merge-order request; I found no conflict in the three cipher getters themselves.