feat(libSceLibreSsl): implement EVP_CIPHER_block_size #10450
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10450"
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 alvaroelpob on 2026-10-24T01:03:03Z.
What
Implements
EVP_CIPHER_block_sizein libSceLibreSsl, which threw and was declared without parameters.The module is LibreSSL 2.5.4 (firmware 13.40 measurements in #8981). The signature
int EVP_CIPHER_block_size(const EVP_CIPHER*), the layout and the result follow that release'sevp.handevp_lib.c. It returnsblock_sizeas stored, with no range check.The 2.5.4
EVP_CIPHERis 88 bytes on LP64 (nid,block_sizeat 4,key_len,iv_len,flags,initat 24,do_cipher,cleanup,ctx_sizeat 48, then the ASN.1,ctrlandapp_datapointers), checked withstatic_asserts. This is the same layout #9571 uses for itsEVP_aes_*_cbcobjects, so this export reads those correctly once both are in. LibreSSL dereferences the cipher without checking it, so a null cipher throws.The debt entry records the source and what is unverified, and the pending-export count drops from 357 to 356.
Tested
Ubuntu 26.04 (WSL2, kernel 6.18), GCC 15.2.0, Release, full build with
BUILD_TESTING=ONonmaine2b9700a9.guest_libressl_evp_ciphertest: on an 88-byte buffer filled with 0xAA, the value at offset 4 is returned for 1, 8, 16, 0 and -1. On a zeroed cipher withnidandkey_lenset, it returns 16 and leaves the buffer unchanged. A null cipher throws. Onmainthe first call throws.ctest -j16: 2003/2004 pass.agc_driver_multisample_retirementfails the same way onmainon this machine.main1e740a23a3(after #9033), head ccf2527c39: the conflicts were only theadd_librarysource list, the end of the test block, the pending-export count and the last debt entry; both sides are kept and the count is 357 minus this PR's exports. Full build andctest -j16: 2043/2044 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.maine7e3e9c198, head bd4796fe01, to resolve the conflict from #9529 on the sharedCMakeLists.txtand debt-file lines; both sides are kept and the count is 353 minus this PR's exports. bd4796fe01 (refactor(libSceLibreSsl): declare the EVP_CIPHER_block_size exports in the public header) puts the real signatures and their structs inlibSceLibreSsl/include/Api.hppand drops the test's redeclarations, whichpublic_headersrequires since #10706. Full build andctest -j16: 2202/2203 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.mainae7d59258e(after #9949), head 18dc0f2f4e, to resolve the conflicts withmainon the sharedCMakeLists.txtand debt-file lines; both sides are kept and the count is 342 minus this PR's exports. Full build andctest -j16: 2275/2276 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.main2dbe9b99f5(after #9745, #9870 and #11111), head 21776a5c4b, to resolve the conflicts withmainon the sharedCMakeLists.txtand debt-file lines; both sides are kept and the count is 340 minus this PR's exports. Full build andctest -j16: 2370/2371 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.main88795ed448(after #10248; head 33427e8eb6) to resolve the conflicts on the shared debt-file lines; both sides are kept and the count is 335 minus this PR's exports. Full build andctest -j16: 2383/2384 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.mainc7b4878fa8(after #10373, #10376 and #10449), head 6fe3d63343, to resolve the conflicts withmainon the sharedCMakeLists.txt,Api.hppand debt-file lines; both sides are kept and the count is 319 minus this PR's exports. Full build andctest -j16: 2394/2395 pass;agc_driver_multisample_retirementfails the same way on thatmain, andguest_pthread_starttimed out once at 20 s while another full suite shared the machine; run alone with--repeat until-fail:3it passes 3/3 in about 2 s.check_conventions.py --base upstream/mainpasses.maincf79276fee(after #13820), head c235797955, to resolve the conflict on the pending-export count in the debt file.mainstill says 292 although #13820 removed two stubs, leaving 290, so the count is now set to the 289 stubs left inExport.cpp. Full build andctest -j16: 3107/3107 pass (log_filefailed once on #10486 and passed on five reruns and a second full run).check_conventions.py --base upstream/mainpasses.main4939814d79(after #9970, #10078 and #10488), head 099a300c60, to resolve the conflicts on the sharedCMakeLists.txt,Export.cpp,Api.hppand debt-file lines; both sides are kept. #10488 removed the threeEVP_CIPHER_CTX_*stubs next toEVP_CIPHER_block_size, so all four are gone. The olddocs(libSceLibreSsl): correct the pending export countcommit became empty and is dropped. The count is set to the 260 stubs left inExport.cpp. Full build andctest -j16: 3538/3538 pass.check_conventions.py --base upstream/mainpasses.main4f41f4c375, head 336a167fce, to resolve the conflicts on the sharedCMakeLists.txt,Export.cppand debt-file lines; both sides are kept and the debt count is recomputed fromExport.cpp. Full build andctest -j16: 3796/3800 pass;guest_sce_net,guest_poll,guest_select_waitandguest_memoryfailed under that load, pass when run alone, andmain4f41f4c375passes all 3799 with-j16on the same machine.check_conventions.py --base upstream/mainpasses.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 copilot-pull-request-reviewer[bot] on 2026-10-24T01:03:12Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T01:18:28Z.
Review: APPROVED
Reviewed the exact head f2a113665cdd845d61875a1b33822e4a13eec4da. The cited LibreSSL 2.5.4 public
EVP_CIPHERlayout placesblock_sizeat offset 4 and the 88-byte LP64 size/layout assertions are consistent with the type. The implementation returns the stored field without imposing an extra range check, and the focused test verifies representative positive, zero, negative, and null-pointer behavior without mutating the object. The PR's dependency list reflects its relationship to the existing cipher constructors and the stacked LibreSSL accessor work. Hosted eligibility, conventions, intake, labels, and report checks pass. The author reports a 2003/2004 full CTest run with one failure also present on base; I did not independently run the suite, and hosted product builds are skipped. No blocking issue found in the reviewed scope.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:59:40Z.
Review: CHANGES_REQUESTED
Re-check — changes requested\n\nThe new report is useful: it says the implementation functions were preserved through the merge and the full test suite has the same single known failure as its tested main, with conventions passing. However, the tested integration point is
4c7d275bef; current upstream main isaaccd0ba39, and this PR head is 44 commits behind it.\n\nPlease update onto current main, preserve the implementation and debt-count changes, recount the pending exports against the resulting Export.cpp, and rerun the relevant LibreSSL tests plus conventions on the exact updated head. The earlier approval was for the prior head and does not cover this stale integration point. I did not rerun these checks locally.