Repository navigation
feat(libSceLibreSsl): implement EVP_CIPHER_block_size - #10450
oneandonlydean merged 3 commits into
Conversation
Progress report (9f35c93 → fc018e4)📈 System libraries: 26.7% (+0.01%, +1 implemented functions) ✅ 1 implemented
Changed libraries (implemented exports)
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the exact head f2a1136. The cited LibreSSL 2.5.4 public EVP_CIPHER layout places block_size at 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.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
f2a1136 to
ccf2527
Compare
ccf2527 to
bd4796f
Compare
|
Rebased on |
79a0b2a to
38dab5f
Compare
511139f to
0a3b595
Compare
|
Rebased on |
0a3b595 to
c235797
Compare
c235797 to
9d3a20e
Compare
9d3a20e to
099a300
Compare
099a300 to
336a167
Compare
|
Rebased onto main 4f41f4c and recomputed the debt counter. Build, |
|
Rebased on |
336a167 to
e17d4c9
Compare
✅ AMD GPU test: passedPR head
Unstable on main (6, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (10, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validation IDs already present on main (4 IDs in 748 tests)Skipped (10)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
alvaroelpob's #10450 implements EVP_CIPHER_block_size and adds its own LibreSslEvpCipher, with the same fields as this branch's and its function pointers as void*. The merge keeps this branch's typed definition, since EvpCipherCtx.cpp calls through those pointers, and gives EVP_CIPHER_block_size main's const LibreSslEvpCipher* signature. In docs/dev/debt/libSceLibreSsl.md the pending-exports count is now 198, the NotImplemented_nid_no_patch calls left in the merged Export.cpp. The CMAC entry drops "Of the EVP cipher exports, only EVP_CIPHER_block_size still throws", which #10450 made untrue, and the EVP_cleanup entry no longer lists SSL_library_init, which #11662 implements, among the calls that are not implemented.
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=ONonmaine2b9700.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.main1e740a2 (after feat(libSceLibreSsl): implement the low-level AES functions #9033), head ccf2527: 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.maine7e3e9c, head bd4796f, to resolve the conflict from feat(libSceLibreSsl): implement the per-thread error queue #9529 on the sharedCMakeLists.txtand debt-file lines; both sides are kept and the count is 353 minus this PR's exports. bd4796f (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 refactor(libs): add full export headers for libs #10706. Full build andctest -j16: 2202/2203 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.mainae7d592 (after feat(libSceLibreSsl): implement the OCSP status and reason strings #9949), head 18dc0f2, 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.main2dbe9b9 (after feat(libSceLibreSsl): return the measured version from SSLeay #9745, feat(libSceLibreSsl): implement TLS alert descriptions #9870 and fix(libSceLibreSsl): reject null strings in the ASN.1 accessors as invalid arguments #11111), head 21776a5, 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.main88795ed (after feat(libSceLibreSsl): implement the CRYPTO locking and thread id callbacks #10248; head 33427e8) 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.mainc7b4878 (after feat(libSceLibreSsl): implement sk_num, sk_value, sk_pop and sk_pop_free #10373, feat(libSceLibreSsl): implement UI_METHOD creation and its opener, writer, reader and closer accessors #10376 and feat(libSceLibreSsl): implement RSA_flags and RSA_size #10449), head 6fe3d63, 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.maincf79276 (after fix(libSceLibreSsl): preserve SHA-512 initialization buffers #13820), head c235797, to resolve the conflict on the pending-export count in the debt file.mainstill says 292 although fix(libSceLibreSsl): preserve SHA-512 initialization buffers #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 feat(libSceLibreSsl): implement UI_get0_user_data, UI_get_string_type and UI_get_input_flags #10486 and passed on five reruns and a second full run).check_conventions.py --base upstream/mainpasses.main4939814 (after feat(libressl3): report OpenSSL version strings #9970, feat(libressl): implement X509 extension getters #10078 and feat(libSceLibreSsl): implement EVP_CIPHER_CTX_init, EVP_CIPHER_CTX_new and EVP_CIPHER_CTX_set_padding #10488), head 099a300, to resolve the conflicts on the sharedCMakeLists.txt,Export.cpp,Api.hppand debt-file lines; both sides are kept. feat(libSceLibreSsl): implement EVP_CIPHER_CTX_init, EVP_CIPHER_CTX_new and EVP_CIPHER_CTX_set_padding #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.main4f41f4c, head 336a167, 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, andmain4f41f4c passes 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)