feat(libSceLibreSsl): answer the ENGINE calls with an empty engine list #10878

Merged
EagleBearerYS merged 31 commits from upstream-pr/10878 into main 2026-11-06 04:56:34 +00:00
EagleBearerYS commented 2026-10-25 07:10:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-25T07:10:26Z.


What

Implements the 11 libSceLibreSsl ENGINE exports from LibreSSL 2.5.4, the version the module's other calls follow (firmware 13.40 measurements):

  • The 11 ENGINE calls answer for an empty engine list: both portable 2.5.4 builds define OPENSSL_NO_HW_PADLOCK, which removes the only built-in engine, and the module exports no call that adds one. ENGINE_get_first returns null, ENGINE_by_id pushes ENGINE_R_NO_SUCH_ENGINE, and a null engine (or command name) pushes ERR_R_PASSED_NULL_PARAMETER with function code 0xfff onto the existing error queue. A non-null engine throws.

UI_OpenSSL still throws. main now implements the other calls this paragraph named: SSL_library_init in LordVersA's #11662, UI_set_result, SSL_load_error_strings, OBJ_cleanup and PKCS12_PBE_add in #12601, and CRYPTO_cleanup_all_ex_data in #8826. This PR doesn't change them.

Related: #10475 (the configuration and algorithm registration calls, where the review asks for the same as the init calls here: throws until their 2.5.4 work is implemented), #10376 and #10486 (the UI objects UI_OpenSSL waits on), #9535, #9536 and #9571 (ERR_error_string, which would give the codes the ENGINE calls push their text).

Tested

  • GitHub's runners: run 40166519917: guest_libressl_error, guest_libressl_runtime and guest_libressl_x509_errors pass 10 of 10 on Linux and on Windows, 0 skipped.
  • Linux (Ubuntu 24.04, gcc 13.3, lavapipe), CI's flags and full ctest: 2,115 passed, 90 skipped, 5 failed, all IPv6-only socket tests that fail on that machine on main too.
  • guest_libressl_error covers every ENGINE call; against main's behaviour its 13 of 13 cases fail.
  • Not tested on a console.
  • c0c4c487b4, a merge of main 451e21f4ae (run). main's #10005 and this PR both change the pending-exports count in docs/dev/debt/libSceLibreSsl.md; the merge counts what is left, 332, which is main's 348 less this PR's 16 and the number of calls in Export.cpp that still throw. It keeps this PR's ERR and ENGINE entries beside main's new ASN1 ones. The PR's code diff is unchanged. The guest_libressl tests and public_headers pass 10 runs in a row. Linux: 10 run, 10 pass, 0 skip, 0 fail. Windows: 10 run, 10 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 6415537717, a merge of main e05ba6feeb (run). main's #10071 and this PR both change the pending-exports count in the LibreSSL debt file. The merge counts what is left: Export.cpp now has 329 NotImplemented exports, main's 345 less this PR's 16, and nothing else conflicted. The guest_libressl tests and public_headers pass 10 runs in a row. Linux: 11 run, 11 pass, 0 skip, 0 fail. Windows: 11 run, 11 pass, 0 skip, 0 fail. The before arm, main with this PR's tests, doesn't build. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • Stock LibreSSL 2.5.4, by @ahmadmuj (review): a C probe linked statically against the portable 2.5.4 libcrypto.a and libssl.a, replaying this PR's ENGINE calls with the same arguments, gives every result its tests expect. ENGINE_get_first is null before and after ENGINE_load_builtin_engines and after ENGINE_cleanup, with no error; ENGINE_by_id gives null and one 0x26fff074 for dynamic, padlock, openssl and rdrand; a null id or engine for each call returns 0 or null and pushes exactly one 0x26fff043, as does ENGINE_ctrl_cmd with a null command name. The OpenBSD tree the debt entries link also builds without padlock (-DOPENSSL_NO_HW_PADLOCK), and padlock compiles only for i386, so no 2.5.4 build has a built-in engine on amd64. Not a console measurement: an engine Sony added would not show here. On 6415537717 merged onto main a7a2eece49, ctest -R guest_libressl passed 10 of 10.
  • 0631e0cb4f and 0006af5251, merges of main 2e1c72239b and 8a29e08834 (run). main's #10484 rewrote the digest entry next to the pending-exports count, and #9949 added Ocsp.cpp to the library's sources and its OCSP entry next to this PR's ENGINE entry; both merges keep both sides, and the ERR entry keeps this PR's sentence that the ENGINE calls are the only exports that add an error. The guest_libressl tests and public_headers pass 10 runs in a row. Linux: 12 run, 12 pass, 0 skip, 0 fail. Windows: 12 run, 12 pass, 0 skip, 0 fail. The before arm, main with this PR's tests, doesn't build. Suites: libc and libkernel pass on Linux (144 and 208) and on Windows (171 and 224). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • f3af853c40, the init calls back to throws (run), after @ahmadmuj's review: it reverts ca6f5d1612, so Export.cpp has 331 NotImplemented exports and the pending-exports count says 331. The ENGINE commit is unchanged. The guest_libressl tests and public_headers pass 10 runs in a row. Linux: 12 run, 12 pass, 0 skip, 0 fail. Windows: 12 run, 12 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (144 and 208) and on Windows (171 and 224). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • Firmware 13.42's libSceLibreSsl.sprx, run by BunnyFl (comment): the decrypted module run natively on a PC, not a console. It runs the module's DT_INIT, then the sequence of ahmadmuj's probe through the module's own exports, against Engine.cpp from f3af853c40 compiled unchanged, with errors read back through the module's own ERR_get_error. Three runs gave identical results.
    • ENGINE_get_first returns null after DT_INIT, after ENGINE_load_builtin_engines and after ENGINE_cleanup, with no error.
    • ENGINE_by_id returns null and queues one 0x26fff074 for "dynamic", "padlock", "rdrand", "openssl", "aesni", "sce", "" and "x".
    • A null id or engine for by_id, get_next, init, finish, free, ctrl, ctrl_cmd and load_private_key returns 0 or null and queues one 0x26fff043.
    • All 21 results and error codes match this PR. Copies with either reason code changed, or with ENGINE_by_id(NULL) reporting no such engine, are caught.
    • From the disassembly, not run: ENGINE_load_builtin_engines only runs a one-time init and walks the existing list. The list head is stored to in only two routines, and the one that appends to the list is called only from code nothing in the module refers to. The module exports no ENGINE_add: its 13 ENGINE_ exports are this PR's 11 plus ENGINE_get_id and ENGINE_set_default.
  • 7af6326c54, a merge of main 5e90e7569d (run). main's 9a848d0b99 implements the TLS alert descriptions and lowers the pending-export count in docs/dev/debt/libSceLibreSsl.md from 342 to 341, on the line this PR sets. The merge keeps main's change and sets the count to 330, the NotImplemented_nid_no_patch exports left in the merged Export.cpp. Nothing else conflicted, and this PR's other changed lines are the same. The 12 guest_libressl tests pass 10 runs in a row. Linux: 12 run, 12 pass, 0 skip, 0 fail. Windows: 12 run, 12 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (145 and 210) and on Windows (174 and 231). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • b0266db535, a merge of main 84e91df418 (run). main's #9745 (SSLeay) lowers the pending-export count in docs/dev/debt/libSceLibreSsl.md to 340, on the line this PR sets; the merge keeps it and sets 329, the NotImplemented_nid_no_patch exports left in the merged Export.cpp. Nothing else conflicted, and this PR's other changed lines are the same. The guest_libressl tests with the tests for the files the merge changes, 22 of them, pass 10 runs in a row. Linux: 22 run, 22 pass, 0 skip, 0 fail. Windows: 22 run, 22 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (145 and 211) and on Windows (174 and 232). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 29e338af32, a merge of main 18ef6be0cd (run). alvaroelpob's #10373 (sk_*) and #10376 (UI_create_method) add src/Stack.cpp and src/Ui.cpp to the add_library line in core/libs/prx/libSceLibreSsl/CMakeLists.txt that this PR extends with src/Engine.cpp, and lower the pending-export count in docs/dev/debt/libSceLibreSsl.md to 321, on the line this PR sets. The merge lists all the sources and sets 310, the NotImplemented_nid_no_patch exports left in the merged Export.cpp. This PR's other changed lines are the same. The guest_libressl tests with the tests for the files the merge changes pass 10 runs in a row. Linux: 91 run, 91 pass, 0 skip, 0 fail. Windows: 89 run, 89 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (145 and 212) and on Windows (174 and 233). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 06c0f56888, a merge of main 0cd07dc4ab (run). alvaroelpob's #10398, #10447 and #10449 add src/Pkey.cpp, src/X509StoreContext.cpp and src/Rsa.cpp to the add_library line in core/libs/prx/libSceLibreSsl/CMakeLists.txt where this PR adds src/Engine.cpp; the merge keeps all of them. The pending-exports count in docs/dev/debt/libSceLibreSsl.md says 313 on main, where Export.cpp has 307 calls that throw; the merge sets 296, what the merged Export.cpp leaves. This PR's other changed lines are the same. guest_libressl_error, guest_libressl_runtime and guest_libressl_x509_errors pass 10 runs in a row. Linux: 3 run, 3 pass, 0 skip, 0 fail. Windows: 3 run, 3 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (166 and 264). On Windows libc passes (194), and libkernel passes 283 of 286: exec_arguments, guest_timed_join_import_libkernel_sys and guest_timed_join_import_libkernel_web fail at their setup in the verify's Windows build (FileNotFoundError starting the title, or copying the libraries they load), and pass in main's own Windows job at 1829def9bf (job). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 42de15ad86, a merge of main 04fefebe90 (run). The one conflict was the pending-exports count in docs/dev/debt/libSceLibreSsl.md: main reads 300 after JaceTheBlu's #11105 (X509 lookups), and with this PR's implementations the merged Export.cpp has 289 calls left that go through NotImplemented_nid_no_patch, so the entry now says 289. This PR's other changed lines are the same. guest_libressl_error, guest_libressl_runtime and guest_libressl_x509_errors ran 10 times with no failure. Linux: 3 run, 3 pass, 0 skip, 0 fail. Windows: 3 run, 3 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (171 and 289). On Windows libc passes (199), and libkernel passes 309 of 312: exec_arguments, guest_timed_join_import_libkernel_sys and guest_timed_join_import_libkernel_web fail at their setup in the verify's Windows build (FileNotFoundError starting the title, or copying the libraries they load), with main's code too, and pass in main's own Windows job at 1829def9bf (job). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • b43c407ea4, a merge of main 0362b1521c (run). Two conflicts, both with #12601, and each keeps both sides:
    • core/libs/tests/GuestLibreSslError.cpp: #12601's check that PKCS12_PBE_add, OBJ_cleanup and SSL_load_error_strings return and queue no error comes first, then this PR's ENGINE cases.
    • docs/dev/debt/libSceLibreSsl.md: the pending-exports count. main reads 293 after #12601 and JaceTheBlu's #11189, and the merged Export.cpp has 282 calls left that go through NotImplemented_nid_no_patch, so the entry says 282.
    • This PR's other changed lines are the same. The 32 ^guest_libressl tests ran 10 times with no failure. Linux: 32 run, 32 pass, 0 skip, 0 fail. Windows: 32 run, 32 pass, 0 skip, 0 fail. The libc and libkernel suites run 198 and 304 tests on Linux and 225 and 326 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 047990e37b, a merge of main c12e7e61a1 (run), which brings JaceTheBlu's #13562 (OBJ_create and OBJ_cleanup). The one conflict was the pending-exports count in docs/dev/debt/libSceLibreSsl.md: main reads 292 after #13562, and with this PR's implementations the merged Export.cpp has 281 calls left that go through NotImplemented_nid_no_patch, so the entry now says 281. CMakeLists.txt, Export.cpp and Api.hpp merged without conflicts, and this PR's other changed lines are the same. ^guest_libressl and public_headers ran 10 times with no failure. Linux: 34 run, 34 pass, 0 skip, 0 fail. Windows: 34 run, 34 pass, 0 skip, 0 fail. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • aebea558d3, a merge of main 0a148be963 (run), which brings Ninot1Quyi's #13820 (SHA-512 initialization buffers) and hyvvs's #13760 (GENERAL_NAME_free and GENERAL_NAMES_free).
    • The one conflict was the pending-exports count in docs/dev/debt/libSceLibreSsl.md, next to main's new and changed entries. The merge keeps those entries, and every other line comes from the side that changed it.
    • The count is the merged tree's Export.cpp total, 279 NotImplemented_nid_no_patch exports; main's line was 2 above its own total.
    • This PR's other changed lines are the same.
    • ×10: ^guest_libressl and public_headers. Linux: 38 run, 38 pass, 0 skip, 0 fail. Windows: 38 run, 38 pass, 0 skip, 0 fail. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • d5932734b4: merges of main 88e804b0a7 (0204bff5c1) and 3c3b3cda73 (68ed6529f5), each followed by a recount of the pending exports (6ea7b38ec1, d5932734b4) (run, on d5932734b4).
    • 0204bff5c1: main now has Felipebmaitan's #9535 (error queues) and atharvjairath's #10078 (X509_EXTENSION getters). Two conflicts, both resolved by keeping both sides. In include/Api.hpp, #9535's ERR_error_string declarations sit next to this PR's ENGINE signatures. In docs/dev/debt/libSceLibreSsl.md, #9535 rewrote the ERR_get_error entry; the merge keeps its text, with this PR's point that the ENGINE calls are the only exports that add an error in place of "or production error producers".
    • 68ed6529f5: main now has alvaroelpob's #10488 (EVP_CIPHER_CTX). The one conflict was the add_library line in CMakeLists.txt, which now lists #10488's src/EvpCipherCtx.cpp and this PR's src/Engine.cpp.
    • The count is the NotImplemented_nid_no_patch calls left in each merged Export.cpp: 273 after the first merge (#9535 and #10078 implement three each) and 270 after the second (#10488 implements three).
    • This PR's diff over main is otherwise unchanged. The ^guest_libressl tests, with guest_libressl_error and public_headers, pass 10 runs in a row. Linux: 44 run, 44 pass, 0 skip, 0 fail. Windows: 44 run, 44 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (214 and 316) and on Windows (241 and 337). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 2c2693c9ae, a merge of main b28bb77217 (run), which brings HQasper's #9448 (the EVP message digest and HMAC functions).
    • Two conflicting files, both resolved by keeping both sides: the add_library source list in CMakeLists.txt, where #9448 adds src/Evp.cpp and this PR src/Engine.cpp, and docs/dev/debt/libSceLibreSsl.md, which keeps #9448's new entry.
    • The count is 250, the NotImplemented_nid_no_patch calls left in the merged Export.cpp: main's 261, which its line now matches, less the 11 this PR implements.
    • This PR's other changed lines over main are the same, and it merges cleanly with main a4eca2a056.
    • ×10: the ^guest_libressl tests, with guest_libressl_error and public_headers. Linux: 46 run, 46 pass, 0 skip, 0 fail. Windows: 46 run, 46 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (217 and 319) and on Windows (244 and 340). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 4a059b2970, a merge of main 4f41f4c375 (run), which brings Felipebmaitan's #9571 (CMAC with the AES-CBC ciphers).
    • The conflicts: CMakeLists.txt's add_library source list, where both sides add sources; the resolution is the union, each once. And docs/dev/debt/libSceLibreSsl.md, in two entries:
      • the pending-exports count: the merged Export.cpp has 220 NotImplemented exports, so the entry now says 220 (this PR said 250, main 231);
      • the ERR_get_error entry: this PR said the ENGINE calls are the only exports that add an error, and main says Memory BIO and CMAC failures publish to the queue. It now reads "Memory BIO, CMAC and ENGINE failures publish to this queue".
    • No function is in both PRs, and this PR's other lines are unchanged.
    • ×10: every ^guest_libressl test. Linux: 51 run, 51 pass, 0 skip, 0 fail. Windows: 51 run, 51 pass, 0 skip, 0 fail. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 81344ff8a8, a merge of main 9ab6a281ea (run), which brings MatteoSid's #10395 (EC groups and keys).
    • The conflicts, each resolved by keeping both sides:
      • CMakeLists.txt's add_library source list: main adds src/Ec.cpp and this PR src/Engine.cpp, and the line keeps both;
      • docs/dev/debt/libSceLibreSsl.md: the merged Export.cpp has 211 NotImplemented exports, so the pending-exports entry now says 211 (this PR said 220, main 222).
    • No function is in both PRs, and this PR's other lines are unchanged.
    • ×10: every ^guest_libressl test, with public_headers. Linux: 54 run, 54 pass, 0 skip, 0 fail. Windows: 54 run, 54 pass, 0 skip, 0 fail. The libc and libkernel suites run 303 and 327 tests on Linux and 335 and 354 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 3f1b7ed872, a merge of main b611e634f7 (run), which brings LordVersA's #11662 (SSL_library_init).
    • The conflict: the pending-exports count in docs/dev/debt/libSceLibreSsl.md, which both sides changed. The merged Export.cpp had 210 NotImplemented exports, so the entry said 210 (this PR said 211, main 221). No function is in both PRs, and this PR's other lines are unchanged.
    • ×10: every ^guest_libressl test, with public_headers. Linux: 54 run, 54 pass, 0 skip, 0 fail. Windows: 54 run, 54 pass, 0 skip, 0 fail. The libc and libkernel suites run 303 and 329 tests on Linux and 335 and 360 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 61a6d5ac68, a merge of main d63781e9ce (run), which brings alvaroelpob's #10450 (EVP_CIPHER_block_size).
    • The conflicts, each resolved by keeping both sides: CMakeLists.txt's add_library source list, where main adds src/EvpCipher.cpp and this PR src/Engine.cpp, and the pending-exports count in docs/dev/debt/libSceLibreSsl.md: the merged Export.cpp had 209 NotImplemented exports, so the entry said 209 (this PR said 210, main 220). No function is in both PRs, and this PR's other lines are unchanged.
    • ×10: every ^guest_libressl test (now including #10450's guest_libressl_evp_cipher) and public_headers. Linux: 55 run, 55 pass, 0 skip, 0 fail. Windows: 55 run, 55 pass, 0 skip, 0 fail. The libc and libkernel suites run 303 and 329 tests on Linux and 335 and 360 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 97f4ac971b, a merge of main 9f9e420709 (run), which brings alvaroelpob's #10448 (OCSP_response_status, OCSP_single_get0_status).
    • The conflicts:
      • CMakeLists.txt's add_library source list, where main adds src/OcspResponse.cpp and this PR src/Engine.cpp. The line keeps both.
      • the pending-exports count in docs/dev/debt/libSceLibreSsl.md. The merged Export.cpp has 207 NotImplemented exports, so the pending-exports entry now says 207 (this PR said 209, main 218).
    • No function is in both PRs, and this PR's other lines are unchanged.
    • ×10: every ^guest_libressl test (now including #10448's guest_libressl_ocsp_response) and public_headers. Linux: 56 run, 56 pass, 0 skip, 0 fail. Windows: 56 run, 56 pass, 0 skip, 0 fail. The libc and libkernel suites run 303 and 329 tests on Linux and 335 and 360 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 0bcf9eeb47, a merge of main e772fb25cc (run), which brings our #10834 (the EVP cipher calls on the cipher context), StoneDC's #12774, #12775 and #14283 (tests of error-queue interleavings, DES ECB known answers, and SHA padding and digest extents) and rooklz's #14717 (the documented exception for faulting lookup and verify-parameter arguments).
    • The conflicts:
      • CMakeLists.txt's add_library source list, where main adds #10834's src/EvpAes.cpp and this PR src/Engine.cpp. The line keeps both.
      • the pending-exports count in docs/dev/debt/libSceLibreSsl.md. The merged Export.cpp has 185 NotImplemented exports, so the pending-exports entry now says 185 (this PR said 207, main 196).
    • No function is in both PRs, and this PR's other lines are unchanged.
    • ×10: every ^guest_libressl test and public_headers. Linux: 58 run, 58 pass, 0 skip, 0 fail. Windows: 57 run, 57 pass, 0 skip, 0 fail; guest_libressl3_mixed_evp is registered only on Linux. The libc and libkernel suites run 322 and 331 tests on Linux and 353 and 362 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • AMD Radeon RX 6300 (RADV NAVI24), from TechLevelZero's AMD bot (report): this head merged onto main e772fb2, Mesa 25.2.8. 1,329 passed, 5 failed (none new: 4 also fail on main, 1 unstable on main), 8 skipped, with no new validation IDs (642 tests on the GPU).
  • c2913c4064, after four merges of main: de9ec6af60 (main bf80054e7c), fbefb5d982 (c454d7bacb), e35a93b962 (8ad0364e81) and c2913c4064 (cd75a62356) (×10).
    • What they bring:
      • our #10915 (the RSA public-key calls);
      • ahmadmuj's #11174 (OCSP_check_validity), #11129 (the X509_NAME lookups), #11138 (the SSL_CTX settings), #11143 (SSL_set_verify, SSL_get0_alpn_selected, SSL_set_connect_state and SSL_ctrl) and #11553 (the pending-exports count taken off the debt entry);
      • alvaroelpob's #10481 (the SSL accessors), #10482 (SSL_get_session, SSL_get_current_cipher, SSL_get_certificate and SSL_get_privatekey), #10485 (the SSL_CTX callback setters) and #10486 (UI_get0_user_data, UI_get_string_type and UI_get_input_flags);
      • MarcZX10's #10570 (EVP_PKEY_new and EVP_PKEY_free) and lopdan's #11003 (OCSP_resp_count and OCSP_resp_get0).
    • The conflicts, each resolved by keeping both sides:
      • CMakeLists.txt's add_library source list, in each merge. main adds src/X509Name.cpp, src/Ssl.cpp, src/SslCtx.cpp and src/SslSession.cpp, then src/PkeyLifecycle.cpp, src/SslCtxCallbacks.cpp and src/UiString.cpp, and this PR adds src/Engine.cpp. The line keeps all of them, each once.
      • In the first merge, the ERR_get_error entry in docs/dev/debt/libSceLibreSsl.md now reads "Memory BIO, CMAC, ENGINE, SSL_CTX_ctrl, SSL_CTX_callback_ctrl and SSL_CTX_set_session_id_context failures publish to this queue", with #11138's three calls and this PR's ENGINE calls. This PR's ENGINE entry comes next, then #11174's OCSP_check_validity entry.
    • The pending-exports entry keeps main's text, since #11553 took the count off it, so this PR no longer changes that line. The merged Export.cpp has 136 NotImplemented_nid_no_patch exports: main's 147, less the 11 this PR implements.
    • No function is in both PRs, and this PR's other lines are unchanged.
    • ×10: every ^guest_libressl test and public_headers. That now includes guest_libressl_ssl, guest_libressl_ssl_ctx, guest_libressl_ssl_ctx_fields, guest_libressl_ssl_ctx_callbacks, guest_libressl_ssl_session, guest_libressl_ssl_settings, guest_libressl_ui_string, guest_libressl_pkey_lifecycle, guest_libressl_x509_name, guest_libressl_ocsp_basic_response, guest_libressl3_obj_cmp, guest_libressl3_rsa_getters, guest_libressl3_x509_extensions and guest_libressl3_asn1_string.
      • Linux: 72 run, 72 pass, 0 skip, 0 fail. Windows: 71 run, 71 pass, 0 skip, 0 fail; guest_libressl3_mixed_evp is registered only on Linux.
      • The libc and libkernel suites run 323 and 334 tests on Linux and 354 and 365 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • The earlier heads' own ×10 runs passed too: de9ec6af60 (run, Linux 68, Windows 67), fbefb5d982 (run, 70 and 69) and e35a93b962 (run, 71 and 70), each with 0 skip and 0 fail.
    • It merges cleanly with main c36ab99c74.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none; Daniil15DDD's #10475, which this PR was to follow for merge order, was closed on 10-28 without merging. Our #10834 and #10915, which set the same pending-exports count line in docs/dev/debt/libSceLibreSsl.md, have merged (5a273d9f3b and 004f2df38d), and ahmadmuj's #11553 has since taken the count off that line
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5002649550 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10878). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-25T07:10:26Z. --- ### What Implements the 11 libSceLibreSsl ENGINE exports from LibreSSL 2.5.4, the version the module's other calls follow ([firmware 13.40 measurements](https://github.com/boykopovar/AnyPS5/discussions/8981#discussioncomment-19111214)): - The 11 ENGINE calls answer for an empty engine list: both portable 2.5.4 builds define `OPENSSL_NO_HW_PADLOCK`, which removes the only built-in engine, and the module exports no call that adds one. `ENGINE_get_first` returns null, `ENGINE_by_id` pushes `ENGINE_R_NO_SUCH_ENGINE`, and a null engine (or command name) pushes `ERR_R_PASSED_NULL_PARAMETER` with function code 0xfff onto the existing error queue. A non-null engine throws. `UI_OpenSSL` still throws. `main` now implements the other calls this paragraph named: `SSL_library_init` in LordVersA's #11662, `UI_set_result`, `SSL_load_error_strings`, `OBJ_cleanup` and `PKCS12_PBE_add` in #12601, and `CRYPTO_cleanup_all_ex_data` in #8826. This PR doesn't change them. Related: #10475 (the configuration and algorithm registration calls, where the review asks for the same as the init calls here: throws until their 2.5.4 work is implemented), #10376 and #10486 (the UI objects `UI_OpenSSL` waits on), #9535, #9536 and #9571 (`ERR_error_string`, which would give the codes the ENGINE calls push their text). ### Tested - **GitHub's runners:** [run 40166519917](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40166519917): `guest_libressl_error`, `guest_libressl_runtime` and `guest_libressl_x509_errors` pass 10 of 10 on Linux and on Windows, 0 skipped. - **Linux** (Ubuntu 24.04, gcc 13.3, lavapipe), CI's flags and full ctest: 2,115 passed, 90 skipped, 5 failed, all IPv6-only socket tests that fail on that machine on main too. - `guest_libressl_error` covers every ENGINE call; against main's behaviour its 13 of 13 cases fail. - Not tested on a console. - **c0c4c487b4, a merge of `main` 451e21f4ae** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40183930914)). `main`'s #10005 and this PR both change the pending-exports count in `docs/dev/debt/libSceLibreSsl.md`; the merge counts what is left, 332, which is `main`'s 348 less this PR's 16 and the number of calls in `Export.cpp` that still throw. It keeps this PR's ERR and ENGINE entries beside `main`'s new ASN1 ones. The PR's code diff is unchanged. The `guest_libressl` tests and `public_headers` pass 10 runs in a row. Linux: 10 run, 10 pass, 0 skip, 0 fail. Windows: 10 run, 10 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **6415537717, a merge of `main` e05ba6feeb** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40198983945)). `main`'s #10071 and this PR both change the pending-exports count in the LibreSSL debt file. The merge counts what is left: `Export.cpp` now has 329 `NotImplemented` exports, `main`'s 345 less this PR's 16, and nothing else conflicted. The `guest_libressl` tests and `public_headers` pass 10 runs in a row. Linux: 11 run, 11 pass, 0 skip, 0 fail. Windows: 11 run, 11 pass, 0 skip, 0 fail. The before arm, `main` with this PR's tests, doesn't build. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Stock LibreSSL 2.5.4, by @ahmadmuj** ([review](https://github.com/boykopovar/AnyPS5/pull/10878#pullrequestreview-5644735628)): a C probe linked statically against the portable 2.5.4 `libcrypto.a` and `libssl.a`, replaying this PR's ENGINE calls with the same arguments, gives every result its tests expect. `ENGINE_get_first` is null before and after `ENGINE_load_builtin_engines` and after `ENGINE_cleanup`, with no error; `ENGINE_by_id` gives null and one `0x26fff074` for `dynamic`, `padlock`, `openssl` and `rdrand`; a null id or engine for each call returns 0 or null and pushes exactly one `0x26fff043`, as does `ENGINE_ctrl_cmd` with a null command name. The OpenBSD tree the debt entries link also builds without padlock (`-DOPENSSL_NO_HW_PADLOCK`), and padlock compiles only for i386, so no 2.5.4 build has a built-in engine on amd64. Not a console measurement: an engine Sony added would not show here. On 6415537717 merged onto `main` a7a2eece49, `ctest -R guest_libressl` passed 10 of 10. - **0631e0cb4f and 0006af5251, merges of `main` 2e1c72239b and 8a29e08834** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40223859149)). `main`'s #10484 rewrote the digest entry next to the pending-exports count, and #9949 added `Ocsp.cpp` to the library's sources and its OCSP entry next to this PR's ENGINE entry; both merges keep both sides, and the ERR entry keeps this PR's sentence that the ENGINE calls are the only exports that add an error. The `guest_libressl` tests and `public_headers` pass 10 runs in a row. Linux: 12 run, 12 pass, 0 skip, 0 fail. Windows: 12 run, 12 pass, 0 skip, 0 fail. The before arm, `main` with this PR's tests, doesn't build. Suites: libc and libkernel pass on Linux (144 and 208) and on Windows (171 and 224). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **f3af853c40, the init calls back to throws** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40226092689)), after @ahmadmuj's review: it reverts ca6f5d1612, so `Export.cpp` has 331 `NotImplemented` exports and the pending-exports count says 331. The ENGINE commit is unchanged. The `guest_libressl` tests and `public_headers` pass 10 runs in a row. Linux: 12 run, 12 pass, 0 skip, 0 fail. Windows: 12 run, 12 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (144 and 208) and on Windows (171 and 224). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Firmware 13.42's `libSceLibreSsl.sprx`, run by BunnyFl** ([comment](https://github.com/boykopovar/AnyPS5/pull/10878#issuecomment-6406759813)): the decrypted module run natively on a PC, not a console. It runs the module's `DT_INIT`, then the sequence of ahmadmuj's probe through the module's own exports, against `Engine.cpp` from f3af853c40 compiled unchanged, with errors read back through the module's own `ERR_get_error`. Three runs gave identical results. - `ENGINE_get_first` returns null after `DT_INIT`, after `ENGINE_load_builtin_engines` and after `ENGINE_cleanup`, with no error. - `ENGINE_by_id` returns null and queues one `0x26fff074` for `"dynamic"`, `"padlock"`, `"rdrand"`, `"openssl"`, `"aesni"`, `"sce"`, `""` and `"x"`. - A null id or engine for `by_id`, `get_next`, `init`, `finish`, `free`, `ctrl`, `ctrl_cmd` and `load_private_key` returns 0 or null and queues one `0x26fff043`. - All 21 results and error codes match this PR. Copies with either reason code changed, or with `ENGINE_by_id(NULL)` reporting no such engine, are caught. - From the disassembly, not run: `ENGINE_load_builtin_engines` only runs a one-time init and walks the existing list. The list head is stored to in only two routines, and the one that appends to the list is called only from code nothing in the module refers to. The module exports no `ENGINE_add`: its 13 `ENGINE_` exports are this PR's 11 plus `ENGINE_get_id` and `ENGINE_set_default`. - **7af6326c54, a merge of `main` 5e90e7569d** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40321342488)). `main`'s 9a848d0b99 implements the TLS alert descriptions and lowers the pending-export count in `docs/dev/debt/libSceLibreSsl.md` from 342 to 341, on the line this PR sets. The merge keeps `main`'s change and sets the count to 330, the `NotImplemented_nid_no_patch` exports left in the merged `Export.cpp`. Nothing else conflicted, and this PR's other changed lines are the same. The 12 `guest_libressl` tests pass 10 runs in a row. Linux: 12 run, 12 pass, 0 skip, 0 fail. Windows: 12 run, 12 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (145 and 210) and on Windows (174 and 231). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **b0266db535, a merge of `main` 84e91df418** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40336832648)). `main`'s #9745 (`SSLeay`) lowers the pending-export count in `docs/dev/debt/libSceLibreSsl.md` to 340, on the line this PR sets; the merge keeps it and sets 329, the `NotImplemented_nid_no_patch` exports left in the merged `Export.cpp`. Nothing else conflicted, and this PR's other changed lines are the same. The `guest_libressl` tests with the tests for the files the merge changes, 22 of them, pass 10 runs in a row. Linux: 22 run, 22 pass, 0 skip, 0 fail. Windows: 22 run, 22 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (145 and 211) and on Windows (174 and 232). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **29e338af32, a merge of `main` 18ef6be0cd** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40381132598)). alvaroelpob's #10373 (`sk_*`) and #10376 (`UI_create_method`) add `src/Stack.cpp` and `src/Ui.cpp` to the `add_library` line in `core/libs/prx/libSceLibreSsl/CMakeLists.txt` that this PR extends with `src/Engine.cpp`, and lower the pending-export count in `docs/dev/debt/libSceLibreSsl.md` to 321, on the line this PR sets. The merge lists all the sources and sets 310, the `NotImplemented_nid_no_patch` exports left in the merged `Export.cpp`. This PR's other changed lines are the same. The `guest_libressl` tests with the tests for the files the merge changes pass 10 runs in a row. Linux: 91 run, 91 pass, 0 skip, 0 fail. Windows: 89 run, 89 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (145 and 212) and on Windows (174 and 233). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **06c0f56888, a merge of `main` 0cd07dc4ab** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40639246214)). alvaroelpob's #10398, #10447 and #10449 add `src/Pkey.cpp`, `src/X509StoreContext.cpp` and `src/Rsa.cpp` to the `add_library` line in `core/libs/prx/libSceLibreSsl/CMakeLists.txt` where this PR adds `src/Engine.cpp`; the merge keeps all of them. The pending-exports count in `docs/dev/debt/libSceLibreSsl.md` says 313 on `main`, where `Export.cpp` has 307 calls that throw; the merge sets 296, what the merged `Export.cpp` leaves. This PR's other changed lines are the same. `guest_libressl_error`, `guest_libressl_runtime` and `guest_libressl_x509_errors` pass 10 runs in a row. Linux: 3 run, 3 pass, 0 skip, 0 fail. Windows: 3 run, 3 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (166 and 264). On Windows libc passes (194), and libkernel passes 283 of 286: `exec_arguments`, `guest_timed_join_import_libkernel_sys` and `guest_timed_join_import_libkernel_web` fail at their setup in the verify's Windows build (`FileNotFoundError` starting the title, or copying the libraries they load), and pass in `main`'s own Windows job at 1829def9bf ([job](https://github.com/boykopovar/AnyPS5/actions/runs/40627345977/job/122615375186)). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **42de15ad86, a merge of `main` 04fefebe90** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40708598646)). The one conflict was the pending-exports count in `docs/dev/debt/libSceLibreSsl.md`: `main` reads 300 after JaceTheBlu's #11105 (X509 lookups), and with this PR's implementations the merged `Export.cpp` has 289 calls left that go through `NotImplemented_nid_no_patch`, so the entry now says 289. This PR's other changed lines are the same. `guest_libressl_error`, `guest_libressl_runtime` and `guest_libressl_x509_errors` ran 10 times with no failure. Linux: 3 run, 3 pass, 0 skip, 0 fail. Windows: 3 run, 3 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (171 and 289). On Windows libc passes (199), and libkernel passes 309 of 312: `exec_arguments`, `guest_timed_join_import_libkernel_sys` and `guest_timed_join_import_libkernel_web` fail at their setup in the verify's Windows build (`FileNotFoundError` starting the title, or copying the libraries they load), with `main`'s code too, and pass in `main`'s own Windows job at 1829def9bf ([job](https://github.com/boykopovar/AnyPS5/actions/runs/40627345977/job/122615375186)). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **b43c407ea4, a merge of `main` 0362b1521c** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41018142303)). Two conflicts, both with #12601, and each keeps both sides: - `core/libs/tests/GuestLibreSslError.cpp`: #12601's check that `PKCS12_PBE_add`, `OBJ_cleanup` and `SSL_load_error_strings` return and queue no error comes first, then this PR's ENGINE cases. - `docs/dev/debt/libSceLibreSsl.md`: the pending-exports count. `main` reads 293 after #12601 and JaceTheBlu's #11189, and the merged `Export.cpp` has 282 calls left that go through `NotImplemented_nid_no_patch`, so the entry says 282. - This PR's other changed lines are the same. The 32 `^guest_libressl` tests ran 10 times with no failure. Linux: 32 run, 32 pass, 0 skip, 0 fail. Windows: 32 run, 32 pass, 0 skip, 0 fail. The libc and libkernel suites run 198 and 304 tests on Linux and 225 and 326 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **047990e37b, a merge of `main` c12e7e61a1** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41161950018)), which brings JaceTheBlu's #13562 (`OBJ_create` and `OBJ_cleanup`). The one conflict was the pending-exports count in `docs/dev/debt/libSceLibreSsl.md`: `main` reads 292 after #13562, and with this PR's implementations the merged `Export.cpp` has 281 calls left that go through `NotImplemented_nid_no_patch`, so the entry now says 281. `CMakeLists.txt`, `Export.cpp` and `Api.hpp` merged without conflicts, and this PR's other changed lines are the same. `^guest_libressl` and `public_headers` ran 10 times with no failure. Linux: 34 run, 34 pass, 0 skip, 0 fail. Windows: 34 run, 34 pass, 0 skip, 0 fail. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **aebea558d3, a merge of `main` 0a148be963** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41264459678)), which brings Ninot1Quyi's #13820 (SHA-512 initialization buffers) and hyvvs's #13760 (`GENERAL_NAME_free` and `GENERAL_NAMES_free`). - **The one conflict** was the pending-exports count in `docs/dev/debt/libSceLibreSsl.md`, next to `main`'s new and changed entries. The merge keeps those entries, and every other line comes from the side that changed it. - **The count** is the merged tree's `Export.cpp` total, 279 `NotImplemented_nid_no_patch` exports; `main`'s line was 2 above its own total. - This PR's other changed lines are the same. - **×10:** `^guest_libressl` and `public_headers`. Linux: 38 run, 38 pass, 0 skip, 0 fail. Windows: 38 run, 38 pass, 0 skip, 0 fail. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **d5932734b4: merges of `main` 88e804b0a7 (0204bff5c1) and 3c3b3cda73 (68ed6529f5), each followed by a recount of the pending exports (6ea7b38ec1, d5932734b4)** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41433926511), on d5932734b4). - **0204bff5c1:** `main` now has Felipebmaitan's #9535 (error queues) and atharvjairath's #10078 (`X509_EXTENSION` getters). Two conflicts, both resolved by keeping both sides. In `include/Api.hpp`, #9535's `ERR_error_string` declarations sit next to this PR's ENGINE signatures. In `docs/dev/debt/libSceLibreSsl.md`, #9535 rewrote the `ERR_get_error` entry; the merge keeps its text, with this PR's point that the ENGINE calls are the only exports that add an error in place of "or production error producers". - **68ed6529f5:** `main` now has alvaroelpob's #10488 (`EVP_CIPHER_CTX`). The one conflict was the `add_library` line in `CMakeLists.txt`, which now lists #10488's `src/EvpCipherCtx.cpp` and this PR's `src/Engine.cpp`. - **The count** is the `NotImplemented_nid_no_patch` calls left in each merged `Export.cpp`: 273 after the first merge (#9535 and #10078 implement three each) and 270 after the second (#10488 implements three). - This PR's diff over `main` is otherwise unchanged. The `^guest_libressl` tests, with `guest_libressl_error` and `public_headers`, pass 10 runs in a row. Linux: 44 run, 44 pass, 0 skip, 0 fail. Windows: 44 run, 44 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (214 and 316) and on Windows (241 and 337). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **2c2693c9ae, a merge of `main` b28bb77217** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41483550079)), which brings HQasper's #9448 (the EVP message digest and HMAC functions). - **Two conflicting files, both resolved by keeping both sides:** the `add_library` source list in `CMakeLists.txt`, where #9448 adds `src/Evp.cpp` and this PR `src/Engine.cpp`, and `docs/dev/debt/libSceLibreSsl.md`, which keeps #9448's new entry. - **The count** is 250, the `NotImplemented_nid_no_patch` calls left in the merged `Export.cpp`: `main`'s 261, which its line now matches, less the 11 this PR implements. - This PR's other changed lines over `main` are the same, and it merges cleanly with `main` a4eca2a056. - **×10:** the `^guest_libressl` tests, with `guest_libressl_error` and `public_headers`. Linux: 46 run, 46 pass, 0 skip, 0 fail. Windows: 46 run, 46 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (217 and 319) and on Windows (244 and 340). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **4a059b2970, a merge of `main` 4f41f4c375** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41613564274)), which brings Felipebmaitan's #9571 (CMAC with the AES-CBC ciphers). - **The conflicts:** `CMakeLists.txt`'s `add_library` source list, where both sides add sources; the resolution is the union, each once. And `docs/dev/debt/libSceLibreSsl.md`, in two entries: - the pending-exports count: the merged `Export.cpp` has 220 `NotImplemented` exports, so the entry now says 220 (this PR said 250, `main` 231); - the `ERR_get_error` entry: this PR said the ENGINE calls are the only exports that add an error, and `main` says Memory BIO and CMAC failures publish to the queue. It now reads "Memory BIO, CMAC and ENGINE failures publish to this queue". - No function is in both PRs, and this PR's other lines are unchanged. - **×10:** every `^guest_libressl` test. Linux: 51 run, 51 pass, 0 skip, 0 fail. Windows: 51 run, 51 pass, 0 skip, 0 fail. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **81344ff8a8, a merge of `main` 9ab6a281ea** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41881311746)), which brings MatteoSid's #10395 (EC groups and keys). - **The conflicts, each resolved by keeping both sides:** - `CMakeLists.txt`'s `add_library` source list: `main` adds `src/Ec.cpp` and this PR `src/Engine.cpp`, and the line keeps both; - `docs/dev/debt/libSceLibreSsl.md`: the merged `Export.cpp` has 211 `NotImplemented` exports, so the pending-exports entry now says 211 (this PR said 220, `main` 222). - No function is in both PRs, and this PR's other lines are unchanged. - **×10:** every `^guest_libressl` test, with `public_headers`. Linux: 54 run, 54 pass, 0 skip, 0 fail. Windows: 54 run, 54 pass, 0 skip, 0 fail. The libc and libkernel suites run 303 and 327 tests on Linux and 335 and 354 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **3f1b7ed872, a merge of `main` b611e634f7** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41909307684)), which brings LordVersA's #11662 (`SSL_library_init`). - **The conflict:** the pending-exports count in `docs/dev/debt/libSceLibreSsl.md`, which both sides changed. The merged `Export.cpp` had 210 `NotImplemented` exports, so the entry said 210 (this PR said 211, `main` 221). No function is in both PRs, and this PR's other lines are unchanged. - **×10:** every `^guest_libressl` test, with `public_headers`. Linux: 54 run, 54 pass, 0 skip, 0 fail. Windows: 54 run, 54 pass, 0 skip, 0 fail. The libc and libkernel suites run 303 and 329 tests on Linux and 335 and 360 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **61a6d5ac68, a merge of `main` d63781e9ce** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41928373616)), which brings alvaroelpob's #10450 (`EVP_CIPHER_block_size`). - **The conflicts, each resolved by keeping both sides:** `CMakeLists.txt`'s `add_library` source list, where `main` adds `src/EvpCipher.cpp` and this PR `src/Engine.cpp`, and the pending-exports count in `docs/dev/debt/libSceLibreSsl.md`: the merged `Export.cpp` had 209 `NotImplemented` exports, so the entry said 209 (this PR said 210, `main` 220). No function is in both PRs, and this PR's other lines are unchanged. - **×10:** every `^guest_libressl` test (now including #10450's `guest_libressl_evp_cipher`) and `public_headers`. Linux: 55 run, 55 pass, 0 skip, 0 fail. Windows: 55 run, 55 pass, 0 skip, 0 fail. The libc and libkernel suites run 303 and 329 tests on Linux and 335 and 360 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **97f4ac971b, a merge of `main` 9f9e420709** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41937696380)), which brings alvaroelpob's #10448 (`OCSP_response_status`, `OCSP_single_get0_status`). - **The conflicts:** - `CMakeLists.txt`'s `add_library` source list, where `main` adds `src/OcspResponse.cpp` and this PR `src/Engine.cpp`. The line keeps both. - the pending-exports count in `docs/dev/debt/libSceLibreSsl.md`. The merged `Export.cpp` has 207 `NotImplemented` exports, so the pending-exports entry now says 207 (this PR said 209, `main` 218). - No function is in both PRs, and this PR's other lines are unchanged. - **×10:** every `^guest_libressl` test (now including #10448's `guest_libressl_ocsp_response`) and `public_headers`. Linux: 56 run, 56 pass, 0 skip, 0 fail. Windows: 56 run, 56 pass, 0 skip, 0 fail. The libc and libkernel suites run 303 and 329 tests on Linux and 335 and 360 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **0bcf9eeb47, a merge of `main` e772fb25cc** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42019114130)), which brings our #10834 (the EVP cipher calls on the cipher context), StoneDC's #12774, #12775 and #14283 (tests of error-queue interleavings, DES ECB known answers, and SHA padding and digest extents) and rooklz's #14717 (the documented exception for faulting lookup and verify-parameter arguments). - **The conflicts:** - `CMakeLists.txt`'s `add_library` source list, where `main` adds #10834's `src/EvpAes.cpp` and this PR `src/Engine.cpp`. The line keeps both. - the pending-exports count in `docs/dev/debt/libSceLibreSsl.md`. The merged `Export.cpp` has 185 `NotImplemented` exports, so the pending-exports entry now says 185 (this PR said 207, `main` 196). - No function is in both PRs, and this PR's other lines are unchanged. - **×10:** every `^guest_libressl` test and `public_headers`. Linux: 58 run, 58 pass, 0 skip, 0 fail. Windows: 57 run, 57 pass, 0 skip, 0 fail; `guest_libressl3_mixed_evp` is registered only on Linux. The libc and libkernel suites run 322 and 331 tests on Linux and 353 and 362 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **AMD Radeon RX 6300 (RADV NAVI24)**, from TechLevelZero's AMD bot ([report](https://github.com/boykopovar/AnyPS5/pull/10878#issuecomment-6665106221)): this head merged onto `main` e772fb2, Mesa 25.2.8. 1,329 passed, 5 failed (none new: 4 also fail on `main`, 1 unstable on `main`), 8 skipped, with no new validation IDs (642 tests on the GPU). - **c2913c4064, after four merges of `main`:** de9ec6af60 (`main` bf80054e7c), fbefb5d982 (c454d7bacb), e35a93b962 (8ad0364e81) and c2913c4064 (cd75a62356) ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42137453155)). - **What they bring:** - our #10915 (the RSA public-key calls); - ahmadmuj's #11174 (`OCSP_check_validity`), #11129 (the `X509_NAME` lookups), #11138 (the `SSL_CTX` settings), #11143 (`SSL_set_verify`, `SSL_get0_alpn_selected`, `SSL_set_connect_state` and `SSL_ctrl`) and #11553 (the pending-exports count taken off the debt entry); - alvaroelpob's #10481 (the `SSL` accessors), #10482 (`SSL_get_session`, `SSL_get_current_cipher`, `SSL_get_certificate` and `SSL_get_privatekey`), #10485 (the `SSL_CTX` callback setters) and #10486 (`UI_get0_user_data`, `UI_get_string_type` and `UI_get_input_flags`); - MarcZX10's #10570 (`EVP_PKEY_new` and `EVP_PKEY_free`) and lopdan's #11003 (`OCSP_resp_count` and `OCSP_resp_get0`). - **The conflicts, each resolved by keeping both sides:** - `CMakeLists.txt`'s `add_library` source list, in each merge. `main` adds `src/X509Name.cpp`, `src/Ssl.cpp`, `src/SslCtx.cpp` and `src/SslSession.cpp`, then `src/PkeyLifecycle.cpp`, `src/SslCtxCallbacks.cpp` and `src/UiString.cpp`, and this PR adds `src/Engine.cpp`. The line keeps all of them, each once. - In the first merge, the `ERR_get_error` entry in `docs/dev/debt/libSceLibreSsl.md` now reads "Memory BIO, CMAC, ENGINE, `SSL_CTX_ctrl`, `SSL_CTX_callback_ctrl` and `SSL_CTX_set_session_id_context` failures publish to this queue", with #11138's three calls and this PR's ENGINE calls. This PR's ENGINE entry comes next, then #11174's `OCSP_check_validity` entry. - **The pending-exports entry** keeps `main`'s text, since #11553 took the count off it, so this PR no longer changes that line. The merged `Export.cpp` has 136 `NotImplemented_nid_no_patch` exports: `main`'s 147, less the 11 this PR implements. - No function is in both PRs, and this PR's other lines are unchanged. - **×10:** every `^guest_libressl` test and `public_headers`. That now includes `guest_libressl_ssl`, `guest_libressl_ssl_ctx`, `guest_libressl_ssl_ctx_fields`, `guest_libressl_ssl_ctx_callbacks`, `guest_libressl_ssl_session`, `guest_libressl_ssl_settings`, `guest_libressl_ui_string`, `guest_libressl_pkey_lifecycle`, `guest_libressl_x509_name`, `guest_libressl_ocsp_basic_response`, `guest_libressl3_obj_cmp`, `guest_libressl3_rsa_getters`, `guest_libressl3_x509_extensions` and `guest_libressl3_asn1_string`. - Linux: 72 run, 72 pass, 0 skip, 0 fail. Windows: 71 run, 71 pass, 0 skip, 0 fail; `guest_libressl3_mixed_evp` is registered only on Linux. - The libc and libkernel suites run 323 and 334 tests on Linux and 354 and 365 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **The earlier heads' own ×10 runs passed too:** de9ec6af60 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42119439654), Linux 68, Windows 67), fbefb5d982 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42127119277), 70 and 69) and e35a93b962 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42131459577), 71 and 70), each with 0 skip and 0 fail. - It merges cleanly with `main` c36ab99c74. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none; Daniil15DDD's #10475, which this PR was to follow for merge order, was closed on 10-28 without merging. Our #10834 and #10915, which set the same pending-exports count line in `docs/dev/debt/libSceLibreSsl.md`, have merged (5a273d9f3b and 004f2df38d), and ahmadmuj's #11553 has since taken the count off that line - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
ahmadmuj commented 2026-10-25 18:54:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-10-25T18:54:14Z.

Review: COMMENTED


Reviewed head 6415537717 merged locally onto main a7a2eece49 (merge 696f8b4512). The only conflict is the pending count in the debt file, next to main's Digest edit; 329 is still right after the merge. Linux, gcc. No console, so nothing here says what the PS5 module itself does.

What I ran:

  • ctest -R guest_libressl on the merge: 10/10 pass. guest_libressl_error and guest_libressl_runtime also pass 5 repeats each.
  • Your two test files on main: GuestLibreSslError.cpp doesn't compile against the old (void) declarations, and guest_libressl_runtime aborts with SSL_library_init_nid_postfix not implemented.
  • tools/check_conventions.py --base origin/main: passes.
  • A small C probe linked statically against stock LibreSSL 2.5.4 (portable tarball, libcrypto.a + libssl.a), replaying your ENGINE and init blocks with the same arguments. Every line matches your test:
    • ENGINE_get_first is NULL before and after ENGINE_load_builtin_engines and after ENGINE_cleanup, with no error.
    • ENGINE_by_id("dynamic") gives NULL and one 0x26fff074. "padlock", "openssl" and "rdrand" do the same.
    • A null id or engine for by_id, get_next, init, finish, free, ctrl, ctrl_cmd and load_private_key returns 0/NULL and pushes exactly one 0x26fff043. So does ENGINE_ctrl_cmd(e, NULL, ...), since 2.5.4 checks e and cmd_name before anything else (eng_ctrl.c:265-268).
    • SSL_library_init returns 1 both times, with no error.

On MarcZX10's engine-inventory question, one more data point. The OpenBSD in-tree build at 2e2c612066 (the commit your debt entries link) also sets -DOPENSSL_NO_HW_PADLOCK (src/lib/libcrypto/Makefile:24, # XXX enable this?). It leaves eng_padlock.c out of SRCS, and Symbols.list has no ENGINE_load_padlock. Even if padlock were compiled in, eng_padlock.c:102-107 only defines COMPILE_HW_PADLOCK for i386, so on amd64 ENGINE_load_padlock does nothing. Neither upstream 2.5.4 build has a built-in engine on amd64. That doesn't rule out Sony adding one, and I can't check that.

Findings:

  1. The five init calls hit the same question as #10475. There, the change request asks to keep OPENSSL_add_all_algorithms_noconf and friends throwing because 2.5.4 does real work in them. SSL_library_init is the same kind of call. In 2.5.4 it runs EVP_add_cipher/EVP_add_digest and ssl_load_ciphers (ssl/ssl_algs.c:66-129). In the probe, EVP_get_cipherbyname("aes-128-cbc") and EVP_get_digestbyname("sha256") go from NULL to non-NULL across it. SSL_load_error_strings changes ERR_error_string(0x26fff074) from lib(38):func(4095):reason(116) to engine routines:CRYPTO_internal:no such engine. Your point that nothing exported reads this state yet holds on the merge: ERR_error_string, SSL_CTX_new and PEM_read_bio_PrivateKey all still throw. But it's the same trade-off #10475 is blocked on, so it's probably worth settling both PRs the same way. Either way, the ENGINE half stands on its own.

  2. Small debt wording fix: "no *_get_ex_new_index is exported" isn't quite right. SSL_CTX_get_ex_new_index and SSL_get_ex_new_index are exported (Export.cpp:951 and :1176). They still throw, so the conclusion holds. Maybe "every *_get_ex_new_index export still throws".

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5644735628 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10878#pullrequestreview-5644735628). Originally posted by [ahmadmuj](https://github.com/ahmadmuj) on 2026-10-25T18:54:14Z. **Review:** COMMENTED --- Reviewed head 6415537717 merged locally onto main a7a2eece49 (merge 696f8b4512). The only conflict is the pending count in the debt file, next to main's Digest edit; 329 is still right after the merge. Linux, gcc. No console, so nothing here says what the PS5 module itself does. What I ran: - `ctest -R guest_libressl` on the merge: 10/10 pass. `guest_libressl_error` and `guest_libressl_runtime` also pass 5 repeats each. - Your two test files on main: `GuestLibreSslError.cpp` doesn't compile against the old `(void)` declarations, and `guest_libressl_runtime` aborts with `SSL_library_init_nid_postfix not implemented`. - `tools/check_conventions.py --base origin/main`: passes. - A small C probe linked statically against stock LibreSSL 2.5.4 (portable tarball, `libcrypto.a` + `libssl.a`), replaying your ENGINE and init blocks with the same arguments. Every line matches your test: - `ENGINE_get_first` is NULL before and after `ENGINE_load_builtin_engines` and after `ENGINE_cleanup`, with no error. - `ENGINE_by_id("dynamic")` gives NULL and one `0x26fff074`. `"padlock"`, `"openssl"` and `"rdrand"` do the same. - A null id or engine for `by_id`, `get_next`, `init`, `finish`, `free`, `ctrl`, `ctrl_cmd` and `load_private_key` returns 0/NULL and pushes exactly one `0x26fff043`. So does `ENGINE_ctrl_cmd(e, NULL, ...)`, since 2.5.4 checks `e` and `cmd_name` before anything else (eng_ctrl.c:265-268). - `SSL_library_init` returns 1 both times, with no error. On MarcZX10's engine-inventory question, one more data point. The OpenBSD in-tree build at 2e2c612066 (the commit your debt entries link) also sets `-DOPENSSL_NO_HW_PADLOCK` (`src/lib/libcrypto/Makefile:24`, `# XXX enable this?`). It leaves `eng_padlock.c` out of SRCS, and `Symbols.list` has no `ENGINE_load_padlock`. Even if padlock were compiled in, `eng_padlock.c:102-107` only defines `COMPILE_HW_PADLOCK` for i386, so on amd64 `ENGINE_load_padlock` does nothing. Neither upstream 2.5.4 build has a built-in engine on amd64. That doesn't rule out Sony adding one, and I can't check that. Findings: 1. The five init calls hit the same question as #10475. There, the change request asks to keep `OPENSSL_add_all_algorithms_noconf` and friends throwing because 2.5.4 does real work in them. `SSL_library_init` is the same kind of call. In 2.5.4 it runs `EVP_add_cipher`/`EVP_add_digest` and `ssl_load_ciphers` (ssl/ssl_algs.c:66-129). In the probe, `EVP_get_cipherbyname("aes-128-cbc")` and `EVP_get_digestbyname("sha256")` go from NULL to non-NULL across it. `SSL_load_error_strings` changes `ERR_error_string(0x26fff074)` from `lib(38):func(4095):reason(116)` to `engine routines:CRYPTO_internal:no such engine`. Your point that nothing exported reads this state yet holds on the merge: `ERR_error_string`, `SSL_CTX_new` and `PEM_read_bio_PrivateKey` all still throw. But it's the same trade-off #10475 is blocked on, so it's probably worth settling both PRs the same way. Either way, the ENGINE half stands on its own. 2. Small debt wording fix: "no `*_get_ex_new_index` is exported" isn't quite right. `SSL_CTX_get_ex_new_index` and `SSL_get_ex_new_index` are exported (Export.cpp:951 and :1176). They still throw, so the conclusion holds. Maybe "every `*_get_ex_new_index` export still throws".
MarcZX10 commented 2026-10-30 08:50:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T08:50:53Z.

Review: APPROVED


Reviewed — looks good

At head b43c407ea4c3df75b194ecf32d689df5fc8d2c54, the ENGINE wrappers and regression assertions agree with the pinned LibreSSL 2.5.4 null/error behavior; I found no blocking issue.

The current-main merge preview onto 98ddd9c1792bbab016ceed5db267a93d1d61f00a is clean. I ran the exact-head diff and conventions checks, export ABI audit, Export.cpp syntax check, and public-header audit (373 libraries, 14,255 exports). The precheck's isolated checkout could not launch its two local-only audit scripts; I ran the ABI audit directly, and checked the test-quality registration signal against the exact CMake registration. I did not run a full local build or a console test. The contributor-provided Linux and Windows verification run succeeded on merge commit 76e7ad86431347250838345854c179a0e2290e9b, whose parent is this PR head; its report records 32 guest_libressl tests repeated ten times with no failures. The upstream Windows job for this head remains in progress; Linux and product-specific jobs are skipped.

One non-blocking description update: Depends on: #10475 is now stale because that PR closed without merging; please change it to none or describe any remaining dependency accurately.

Sources: PR-head ENGINE implementation, PR-head regression assertions, and LibreSSL 2.5.4 ENGINE_ctrl_cmd.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5710020446 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10878#pullrequestreview-5710020446). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T08:50:53Z. **Review:** APPROVED --- # Reviewed — looks good At head `b43c407ea4c3df75b194ecf32d689df5fc8d2c54`, the ENGINE wrappers and regression assertions agree with the pinned LibreSSL 2.5.4 null/error behavior; I found no blocking issue. The current-main merge preview onto `98ddd9c1792bbab016ceed5db267a93d1d61f00a` is clean. I ran the exact-head diff and conventions checks, export ABI audit, `Export.cpp` syntax check, and public-header audit (373 libraries, 14,255 exports). The precheck's isolated checkout could not launch its two local-only audit scripts; I ran the ABI audit directly, and checked the test-quality registration signal against the exact CMake registration. I did not run a full local build or a console test. The contributor-provided [Linux and Windows verification run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41018142303) succeeded on merge commit `76e7ad86431347250838345854c179a0e2290e9b`, whose parent is this PR head; its report records 32 `guest_libressl` tests repeated ten times with no failures. The upstream Windows job for this head remains in progress; Linux and product-specific jobs are skipped. One non-blocking description update: `Depends on: #10475` is now stale because that PR closed without merging; please change it to `none` or describe any remaining dependency accurately. Sources: [PR-head ENGINE implementation](https://github.com/boykopovar/AnyPS5/blob/b43c407ea4c3df75b194ecf32d689df5fc8d2c54/core/libs/prx/libSceLibreSsl/src/Engine.cpp), [PR-head regression assertions](https://github.com/boykopovar/AnyPS5/blob/b43c407ea4c3df75b194ecf32d689df5fc8d2c54/core/libs/tests/GuestLibreSslError.cpp), and [LibreSSL 2.5.4 `ENGINE_ctrl_cmd`](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/engine/eng_ctrl.c#L265-L268).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!10878
No description provided.