Skip to content

feat(libSceLibreSsl): implement EVP_CIPHER_block_size - #10450

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
alvaroelpob:feat/libscelibressl-evp-cipher-block-size
Nov 4, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
alvaroelpob:feat/libscelibressl-evp-cipher-block-size

Conversation

@alvaroelpob

@alvaroelpob alvaroelpob commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What

Implements EVP_CIPHER_block_size in 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's evp.h and evp_lib.c. It returns block_size as stored, with no range check.

The 2.5.4 EVP_CIPHER is 88 bytes on LP64 (nid, block_size at 4, key_len, iv_len, flags, init at 24, do_cipher, cleanup, ctx_size at 48, then the ASN.1, ctrl and app_data pointers), checked with static_asserts. This is the same layout #9571 uses for its EVP_aes_*_cbc objects, 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=ON on main e2b9700.

Checklist

Copilot AI balanced review requested due to automatic review settings October 24, 2026 01:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Progress report (9f35c93 → fc018e4)

📈 System libraries: 26.7% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceLibreSsl EVP_CIPHER_block_size_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libSceLibreSsl 172/420 (40.95%) 173/420 (41.19%) +0.24%

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 11003 docs/dev/debt/libSceLibreSsl.md L10, L32-33
PR 15827 core/libs/prx/libSceLibreSsl/CMakeLists.txt L194
docs/dev/debt/libSceLibreSsl.md L10

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.

Pull request Shared files not compared
PR 10508 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10570 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10834 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10878 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10915 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11128 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11146 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11151 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11174 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11175 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11466 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11553 docs/dev/debt/libSceLibreSsl.md
PR 12928 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 13486 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 13860 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 14212 docs/dev/debt/libSceLibreSsl.md
PR 15480 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 15481 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 15482 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 15483 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md

@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased on main 1e740a2 (head ccf2527) to resolve the conflict from #9033 on the shared CMakeLists.txt and debt-file lines. Full suite 2043/2044, with the same failure on main. Depends on drops #9033 and adds #9949.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 25, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 25, 2026
@alvaroelpob
alvaroelpob force-pushed the feat/libscelibressl-evp-cipher-block-size branch from ccf2527 to bd4796f Compare October 25, 2026 05:32
@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased on main e7e3e9c, head bd4796f, to resolve the conflict from #9529 on the shared CMakeLists.txt and debt-file lines; both sides are kept and the count is 353 minus this PR's exports. #10706 now requires each export to be declared once in include/Api.hpp, so bd4796f moves these signatures and their structs there and drops the test's redeclarations. Full suite 2202/2203, with the same failure on main. Depends on drops the merged #9529.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 25, 2026
@alvaroelpob
alvaroelpob force-pushed the feat/libscelibressl-evp-cipher-block-size branch from 79a0b2a to 38dab5f Compare October 25, 2026 18:51
@alvaroelpob
alvaroelpob force-pushed the feat/libscelibressl-evp-cipher-block-size branch from 511139f to 0a3b595 Compare October 30, 2026 14:00
@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased on main da026c7 (head 0a3b595); the implementation commits are unchanged. Pending count recounted against the resulting Export.cpp: 292 NotImplemented_nid_no_patch stubs, 292 in the debt line. Full ctest -j16 on this head 3007/3007 (main 3006/3006 on the same machine), check_conventions.py --base upstream/main passes. Depends on is unchanged.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 1, 2026
@alvaroelpob
alvaroelpob force-pushed the feat/libscelibressl-evp-cipher-block-size branch from 0a3b595 to c235797 Compare November 1, 2026 03:06
@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #13820 merged (new head c235797); the pending-export count is now 289, the stubs actually left in Export.cpp. Full suite 3107/3107.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 1, 2026
@alvaroelpob
alvaroelpob force-pushed the feat/libscelibressl-evp-cipher-block-size branch from c235797 to 9d3a20e Compare November 2, 2026 16:12
@alvaroelpob

alvaroelpob commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #9970, #10078 and #10488 merged (new head 099a300); the pending count is now 260, the stubs left in Export.cpp. Full suite 3538/3538. Merged #9448 and #10078 are dropped from Depends on.

@alvaroelpob
alvaroelpob force-pushed the feat/libscelibressl-evp-cipher-block-size branch from 9d3a20e to 099a300 Compare November 2, 2026 16:54
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 2, 2026
@alvaroelpob
alvaroelpob force-pushed the feat/libscelibressl-evp-cipher-block-size branch from 099a300 to 336a167 Compare November 3, 2026 18:26
@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased onto main 4f41f4c and recomputed the debt counter. Build, check_conventions and the full ctest pass.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 3, 2026
@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased on main 9ab6a28 to resolve the conflicts with #10395 on the shared CMakeLists.txt, Api.hpp and debt lines; the pending-export count is recomputed from Export.cpp. Head e17d4c9. Full Linux suite: 3897/3898 (guest_poll failed under load and passed on the -j1 rerun); check_conventions.py passes.

@alvaroelpob
alvaroelpob force-pushed the feat/libscelibressl-evp-cipher-block-size branch from 336a167 to e17d4c9 Compare November 4, 2026 19:43
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head fc018e4 merged onto main b611e63 · tested 2026-11-04 22:07 UTC · 20 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,284 passed · 16 failed (0 new, 10 also fail on main, 6 unstable on main) · 10 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,310 of 3,946 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (991 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.6 s, ⚠️ agc_driver_graphics_maps_fallback 120.2 s, ⚠️ agc_driver_graphics 120.2 s, ⚠️ agc_driver_bda_device 66.2 s, ⚠️ public_headers 60.0 s
Unstable on main (6, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_array_layer_target_cpu: failed in 3 of the last 10 main runs
agc_driver_dithered_alpha_to_coverage: failed in 1 of the last 10 main runs
agc_driver_graphics: failed in 3 of the last 10 main runs
agc_driver_graphics_maps_fallback: failed in 2 of the last 10 main runs
agc_driver_pipeline_journal: failed in 9 of the last 10 main runs
agc_driver_two_sample_alpha_to_coverage_sample_mask_export: failed in 4 of the last 10 main runs
Failing on main too (10, not counted against this PR)
agc_driver_alpha_to_coverage_sample_mask_export
agc_driver_guest_memory_lifetime_direct
agc_driver_image_gather_volume
agc_driver_image_table
agc_driver_job_manager_compute_capacity
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_driver_submit_progress
Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)
agc_driver_emulated_color_compare_srgb_decode: Timeout in the parallel run; also passed only on retry in 27 other runs in the last 7 days
Validation IDs already present on main (4 IDs in 748 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (748 tests): agc_compute_pipeline_replay, agc_driver_address_draw_space_reuse, agc_driver_address_draw_space_reuse_held, agc_driver_address_draw_space_reuse_off, agc_driver_address_draw_space_reuse_transitions, agc_driver_address_draw_space_reuse_verify, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, and 740 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (10)
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_copied_writer_label_order_drain: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
Reproduce
git fetch origin fc018e4614e9ead76d94b88635502ceea710ff5d b611e634f7fc024f0c13e342d96de744448ef1d9
git checkout b611e634f7fc024f0c13e342d96de744448ef1d9 && git merge --no-ff fc018e4614e9ead76d94b88635502ceea710ff5d
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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.

@oneandonlydean
oneandonlydean merged commit 891fc36 into boykopovar:main Nov 4, 2026
12 checks passed
oneandonlydean pushed a commit that referenced this pull request Nov 5, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants