Skip to content

feat(libSceLibreSsl): implement numeric ERR formatting and newest peeking - #9535

Merged
oneandonlydean merged 13 commits into
boykopovar:mainfrom
Felipebmaitan:feat/libressl-error-queues
Nov 2, 2026
Merged

oneandonlydean merged 13 commits into
boykopovar:mainfrom
Felipebmaitan:feat/libressl-error-queues

Conversation

@Felipebmaitan

@Felipebmaitan Felipebmaitan commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Numeric ERR formatting, queue peeking and test-only names fixture. Refreshed onto fetched main 4ac683fe026c3368e508ace9745d3017e12a1207 without rewriting published history. Pending exports independently recounted after integration: 287 in libSceLibreSsl/Export.cpp (literal calls and direct exported stub bodies agree). Published ERR numeric-before/after-load/free behavior, test-only generation/Python/submodule scope, shared queue and registrations are preserved. All main implementation sources and the old/main public-definition/NID union are retained.

Tested

Exact head b8dc89c0f887e725b97ad2ea112fb6eded347e27, main integration base 4ac683fe026c3368e508ace9745d3017e12a1207. Ubuntu 24.04.5 amd64 Docker container on Apple Silicon, GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1, Python 3.12.3, Release.

  • 41/41 native + 1/1 patched focused CTests pass on this head, covering ERR queue/numeric/load/free, available BIO/CMAC/BN cases and main's LibreSSL/LibreSSL3 regressions. Source-built actual libc/libkernel/LibreSSL/LibreSSL3 and repository NID patcher; separate native/patched loader paths. Each layer was reconfigured and rebuilt in the external component harness.
  • Generated ERR fixture deleted: runtime libraries build with it absent; the formatter target regenerates the same SHA256 (44af6828fdc064ca16f94aeb07ac913651d2bfce0f5ecbeee6b9b476e6be24e3); all three lifecycle cases pass again. Runtime Ninja graphs exclude the generator and compile src/Error.cpp once.
  • Public headers: 399 libraries / 26,750 exports, unique declarations and umbrella coverage; strict standalone compilation with Clang targeting x86-64 macOS (compile-only). All 35 scoped executable registrations pass. Full main/old implementation/NID preservation audit passes.
  • python3 tools/check_conventions.py --base origin/main and whitespace pass in an isolated Git context pinning origin/main to the integration base above, without changing shared tracking refs.
  • Overlap scan ran for this head and returned exit 2, reporting adjacent conflicts, inherited stack functions and incomplete comparisons. Shared-file/function inventories were reviewed: owned downstreams inherit ERR/BIO, feat(libSceLibreSsl): implement file and socket BIO adapters #12928 explicitly depends on feat(libSceLibreSsl): implement memory BIOs #9536 and reuses it, and feat(libSceLibreSsl): implement the BN_ BIGNUM, BN_CTX, conversion, word, BN_mul and BN_mod_inverse functions #9446's BN work is preserved in CMAC. Remaining external comparisons and mechanical conflicts are recorded in the validation reply; no clean-overlap or external-order agreement is claimed.

The harness imports actual repository library/test fragments, source-building pinned dependencies; it is not the full root/product suite. Docker denies userfaultfd, invoking libc's existing comparison fallback. No new local Windows/macOS runtime, sanitizer, title or physical-console run was performed; no skipped/pending hosted job is counted as passed. Firmware-module evidence remains PC execution with stand-in imports. Earlier no-Python fragment and bounded BIO negative-control evidence is historical; those settled checks were not rerun, and neither production BIO nor the wipe assertions changed. Hosted CI for b8dc89c0f887e725b97ad2ea112fb6eded347e27: windows, conventions, library-portability, eligibility, labels and report succeeded. linux, relinker, relinker-asan, register-context and write-watch were skipped; an earlier conventions run was cancelled. GitHub reports CLEAN / MERGEABLE. Skipped jobs are not counted as executed. Current-head maintainer re-review remains pending. Exact logs, harness, audits and overlap limitations are in the latest validation reply.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Progress report (66e1f7f → b8dc89c)

📈 System libraries: 26.3% (+0.01%, +4 implemented functions)

✅ 4 implemented
Library Name
libSceLibreSsl ERR_error_string_nid_postfix
libSceLibreSsl ERR_free_strings_nid_postfix
libSceLibreSsl3 ERR_load_crypto_strings_nid_postfix
libSceLibreSsl3 ERR_peek_last_error_nid_postfix
⚪ 2 behaviourally empty (constant return or throw)
Library Name
libSceLibreSsl ERR_free_strings_nid_postfix
libSceLibreSsl3 ERR_load_crypto_strings_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libSceLibreSsl 103/401 (25.69%) 105/401 (26.18%) +0.50%
libSceLibreSsl3 15/270 (5.56%) 17/270 (6.30%) +0.74%

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

There is a concrete error-string lifecycle regression in ErrorQueue.cpp: ERR_free_strings stores StringState::Freed, but LibreSslLoadErrorStrings_nid_no_patch only transitions Uninitialized to Loaded. Therefore, after the supported sequence ERR_free_strings(); ERR_load_crypto_strings();, string loading is still disabled and later format calls continue to return numeric lib()/func()/reason() fallbacks for known errors. The free-first test currently asserts that fallback, so it hides the failed reload.

Please make the explicit load operation restore the loaded state after freeing (with a thread-safe transition), or make free a no-op for the compiled-in static tables, and add a regression assertion that a known error string is available after free then load. This behavior is separate from whether applications need to call these legacy APIs during normal operation; both exports are implemented here and the upstream API documents loading after removal as registration.

The ancestry and declared Depends on: #9529 are consistent. Hosted eligibility, conventions, intake, labels and report checks pass. All product/relinker platform jobs are skipped; the PR reports Windows builds/tests and a full-suite run with disclosed baseline failures, which I did not rerun locally. I’m requesting changes for the lifecycle issue only.

@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

I checked the requested reload against the exact historical contract pinned here. LibreSSL 3.4.1 does not restore strings after this sequence:

  • ERR_load_crypto_strings uses a function-local pthread_once guard.
  • ERR_free_strings deletes the registered table without resetting that guard. Its initial OPENSSL_init_crypto also makes free-first follow this lifecycle.
  • The manual at the same revision says: “If the error strings were already loaded before, no action occurs.”

I also built the official LibreSSL 3.4.1 release's static libcrypto outside the repository using WinLibs GCC 15.2. The relevant three source files (err.c, err_all.c, crypto_init.c) match this pin after line-ending normalization. This reproduction exits successfully:

#include <openssl/err.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char **argv) {
    char buffer[256];
    if (argc == 1) {
        ERR_load_crypto_strings();
        ERR_error_string_n(0x20fff043UL, buffer, sizeof(buffer));
        puts(buffer);
    }
    ERR_free_strings();
    ERR_load_crypto_strings();
    ERR_error_string_n(0x20fff043UL, buffer, sizeof(buffer));
    puts(buffer);
    return strcmp(buffer, "error:20FFF043:lib(32):func(4095):reason(67)") != 0;
}

Running without arguments prints the named BIO error followed by the numeric fallback. Running with free-first prints the numeric fallback. Repeated free/load calls give the same result.

Pushed 3f66ff0 to make the deliberate contract clearer: both lifecycle tests now check formatting immediately after free, after one explicit load, and after a repeated free/load cycle, with queue preservation checked too. The debt file and PR description now state the one-time loading behavior. All five focused LibreSSL/patched-library tests passed (0.23 s), as did strict compiler and convention checks.

The runtime implementation continues to match the pinned upstream behavior; PS5 equivalence remains unverified. Could you reconsider the lifecycle change request against this historical source and reproduction?

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

Correction to my earlier review: I rechecked the pinned LibreSSL 3.4.1 source and the updated release-source reproduction. The one-time loader uses pthread_once, and ERR_free_strings deletes the table without resetting that guard, so retaining numeric fallbacks after free followed by explicit load is consistent with this compatibility target. The new head documents and tests this historical behavior. I withdraw my earlier request for a lifecycle change; sorry for the incorrect finding. The PR remains dependent on #9529 as declared.

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

Correction: the newly pushed LibreSSL-based test and documentation confirm the one-time loading behavior against the pinned source; the earlier concern is resolved. The dependent #9536 now also has a complete parent implementation and its declared Depends on chain is consistent. I have no additional code finding on the updated ERR change.

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

The updated head and pinned LibreSSL 3.4.1 source/reproduction resolve my earlier concern: the historical one-time loader is not reset by ERR_free_strings, and the new lifecycle assertions and debt note accurately document that behavior. I found no remaining blocking issue in the reviewed diff. The PR declares Depends on #9529; hosted eligibility, conventions, labels and report checks pass, while product builds are skipped. The author reports focused Windows tests and compiler/convention checks, but no PS5/title, Linux or macOS run.

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

One review-state note: GitHub still records my original CHANGES_REQUESTED review because the repository endpoint did not permit dismissing it, although my later review comments and approval explicitly withdraw that finding. The latest review is APPROVED after source verification; no further action is requested on the lifecycle point.

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

The pinned LibreSSL 3.4.1 source and the updated release-source reproduction resolve my earlier concern. The one-time loader is not reset by ERR_free_strings, and the new lifecycle tests/documentation match that contract. I found no remaining blocking issue. Depends on #9529 is declared. Current eligibility, conventions, labels and report checks pass; product checks are skipped, and the author reports focused Windows tests and compiler/convention checks.

@github-actions

github-actions Bot commented Oct 22, 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 9448 docs/dev/debt/libSceLibreSsl.md L10
PR 10395 docs/dev/debt/libSceLibreSsl.md L10
PR 10570 docs/dev/debt/libSceLibreSsl.md L10
PR 10878 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 10915 docs/dev/debt/libSceLibreSsl.md L10
PR 11003 docs/dev/debt/libSceLibreSsl.md L10
PR 11128 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 11146 docs/dev/debt/libSceLibreSsl.md L10
PR 11151 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 11174 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 11175 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 11553 docs/dev/debt/libSceLibreSsl.md L10
PR 14115 docs/dev/debt/libSceLibreSsl.md L10-11

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 1835 .gitmodules
PR 5021 .gitmodules
core/libs/CMakeLists.txt
PR 7275 core/libs/CMakeLists.txt
PR 8650 core/libs/CMakeLists.txt
PR 9019 core/libs/CMakeLists.txt
PR 9156 core/libs/CMakeLists.txt
PR 9162 core/libs/CMakeLists.txt
PR 9293 core/libs/CMakeLists.txt
PR 9297 core/libs/CMakeLists.txt
PR 9302 core/libs/CMakeLists.txt
PR 9383 core/libs/CMakeLists.txt
PR 9446 core/libs/prx/libSceLibreSsl/Export.cpp
docs/dev/debt/libSceLibreSsl.md
PR 9855 .gitmodules
PR 9970 core/libs/prx/libSceLibreSsl3/Export.cpp
docs/dev/debt/libSceLibreSsl3.md
PR 10418 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10461 core/libs/prx/libSceLibreSsl3/Export.cpp
core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 10508 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11466 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11662 core/libs/prx/libSceLibreSsl/Export.cpp
docs/dev/debt/libSceLibreSsl.md
PR 12642 core/libs/CMakeLists.txt
PR 12754 core/libs/prx/libSceLibreSsl3/Export.cpp
core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 13253 core/libs/CMakeLists.txt
PR 13256 core/libs/CMakeLists.txt
PR 13578 .gitmodules
PR 13860 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
core/libs/tests/GuestLibreSslError.cpp
docs/dev/debt/libSceLibreSsl.md
PR 14212 docs/dev/debt/libSceLibreSsl.md
docs/dev/debt/libSceLibreSsl3.md
PR 14299 core/libs/CMakeLists.txt

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

Rechecked the current ERR string lifecycle change against the pinned LibreSSL 3.4.1 source. The added loaded-first/free-first process tests correctly cover the pthread_once behavior and preserve numeric fallbacks after free/reload; the prior concern is resolved. #9529 remains open as the declared predecessor. Eligibility, conventions, intake, labels and report checks pass; product/relinker builds were skipped. I did not run local tests.

@jotitadev jotitadev 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.

Linux run, since the description says only Windows was used. The full build and the ERR tests pass, and they run clean under ASan and UBSan.

Machine: Linux, Ubuntu 26.04, GCC 15.2.0, Python 3.14, x86-64. Head 3f66ff0de merged with git merge --no-commit onto current main d6eafa54d (clean), 3rdparty/libressl-openbsd initialized at 078b3d1df.

  • Release (Ninja, BUILD_TESTING=ON, ANYPS5_RELINKER_ONLY=OFF): the full build passes, including GenerateErrorStrings.py producing ErrorStrings.inc with Python 3.14. guest_libressl_error, guest_libressl_errors, guest_libressl_free_strings, guest_libressl_free_strings_first and patched_libraries pass (5/5).
  • ASan + UBSan (-fsanitize=address,undefined -fno-sanitize-recover=undefined -O1 -g, ANYPS5_ENABLE_ASAN=ON, leak detection off): guest_libressl_error_string_tests with no argument, free and free-first, and guest_libressl_error_tests, all exit 0 with no reports.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@MarcZX10

Copy link
Copy Markdown
Contributor

I rechecked the current head against today’s upstream main: the merge is clean, diff-check passes, and conventions reports 0 errors (one inherited 1,038-character debt-entry warning). The reported Windows and independent Linux focused tests cover the error-string lifecycle and ASan/UBSan; those were run on older base d6eafa54d. This head is now 4 ahead / 119 behind current main (merge base a6dcea927), so please refresh it and rerun the focused ERR tests and checks before merge. Keep the declared #9529 dependency; #9536 depends on this ERR layer.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@Felipebmaitan, a full CI run with this head (3f66ff0dea, run 40071245671) fails to build on both Linux and Windows:

core/libs/prx/libSceLibreSsl/ErrorQueue.cpp:17:10: fatal error: ErrorStrings.inc: No such file or directory

ErrorQueue.cmake is included from core/libs/CMakeLists.txt, so its add_custom_command(OUTPUT .../ErrorStrings.inc) belongs to the core/libs directory, while libSceLibreSsl is defined in core/libs/prx/libSceLibreSsl. CMake attaches a custom command's build rule only to targets in the directory that calls add_custom_command, so listing the file in target_sources from another directory doesn't make ninja generate it. Your local build probably has the file from an earlier configure; a clean build tree should show it.

Could you move the generation next to the target, or wrap it in an add_custom_target that libSceLibreSsl depends on, and confirm a clean cmake --build builds ErrorQueue.cpp? We'll rerun full CI after that.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 27, 2026
@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

Refreshed existing stack head dc81f08abdfdd79e2d3ceb39c71c8decd76b945c on main facac6a4c52fa6e4bfb2b77ba98cab5e449555d4. Published old heads remain ancestors and original authorship is preserved. The branch bodies now use the complete current PR template and describe the new-head results separately from historical Windows reports. No merge or replacement PR; #9465/#9399 branches and scope untouched.

Owned order: #9535 → #9536 → #9571. #9529/#11165 are merged. For #9571, #9446 remains an external prerequisite; its author has not confirmed the proposed order. Its inherited BN integration is preserved, not treated as new agreement or validation of the firmware differences reported on #9446.

Ubuntu 24.04 amd64 container through Docker on Apple Silicon; GCC 13.3.0, CMake 3.28.3, Ninja, Python 3.12.3, Release. Actual source-built libc/libkernel/LibreSSL/LibreSSL3 and pinned bundled dependencies, using the component harness below. This is not full root configuration or native Windows/macOS/console evidence. The initial CMAC build was clean; final stack heads were reconfigured/rebuilt incrementally. Docker logs userfaultfd unavailable (Operation not permitted), using libc's existing memory-comparison fallback.

Native commands set LD_LIBRARY_PATH=<build>:<build>/kernel:<build>/libressl:<build>/libressl3; patched commands set only <build>/patched. An initial mixed loader path failed patched loading, and an initial invocation began before all test executables finished linking; neither is counted as a pass. Final commands ran after the complete build and passed. No product workaround was added.

Native focused CTest output
Internal ctest changing into directory: /validation/build-cmac
Test project /validation/build-cmac
      Start  1: guest_libressl_errors
 1/28 Test  #1: guest_libressl_errors ...............   Passed    0.04 sec
      Start  2: guest_libressl_free_strings
 2/28 Test  #2: guest_libressl_free_strings .........   Passed    0.03 sec
      Start  3: guest_libressl_free_strings_first
 3/28 Test  #3: guest_libressl_free_strings_first ...   Passed    0.04 sec
      Start  4: guest_libressl_x509_errors
 4/28 Test  #4: guest_libressl_x509_errors ..........   Passed    0.02 sec
      Start  5: guest_libressl_digest
 5/28 Test  #5: guest_libressl_digest ...............   Passed    0.17 sec
      Start  6: guest_libressl_asn1
 6/28 Test  #6: guest_libressl_asn1 .................   Passed    0.03 sec
      Start  7: guest_libressl_asn1_allocator
 7/28 Test  #7: guest_libressl_asn1_allocator .......   Passed    0.03 sec
      Start  8: guest_libressl_ex_data
 8/28 Test  #8: guest_libressl_ex_data ..............   Passed    0.03 sec
      Start  9: guest_libressl_des
 9/28 Test  #9: guest_libressl_des ..................   Passed    0.03 sec
      Start 10: guest_libressl_runtime
10/28 Test #10: guest_libressl_runtime ..............   Passed    0.03 sec
      Start 11: guest_libressl_aes
11/28 Test #11: guest_libressl_aes ..................   Passed    0.03 sec
      Start 12: guest_libressl_error
12/28 Test #12: guest_libressl_error ................   Passed    0.02 sec
      Start 13: guest_libressl_ocsp
13/28 Test #13: guest_libressl_ocsp .................   Passed    0.02 sec
      Start 14: guest_libressl_stack
14/28 Test #14: guest_libressl_stack ................   Passed    0.03 sec
      Start 15: guest_libressl_ui
15/28 Test #15: guest_libressl_ui ...................   Passed    0.03 sec
      Start 16: guest_libressl_rsa
16/28 Test #16: guest_libressl_rsa ..................   Passed    0.03 sec
      Start 17: guest_libressl_x509_store_context
17/28 Test #17: guest_libressl_x509_store_context ...   Passed    0.02 sec
      Start 18: guest_libressl_pkey_type
18/28 Test #18: guest_libressl_pkey_type ............   Passed    0.02 sec
      Start 19: guest_libressl_cipher
19/28 Test #19: guest_libressl_cipher ...............   Passed    0.02 sec
      Start 20: guest_libressl_alert
20/28 Test #20: guest_libressl_alert ................   Passed    0.02 sec
      Start 21: guest_libressl_version
21/28 Test #21: guest_libressl_version ..............   Passed    0.02 sec
      Start 22: guest_libressl_crypto_locks
22/28 Test #22: guest_libressl_crypto_locks .........   Passed    0.02 sec
      Start 23: guest_libressl_object_text
23/28 Test #23: guest_libressl_object_text ..........   Passed    0.03 sec
      Start 24: guest_libressl_object_allocation
24/28 Test #24: guest_libressl_object_allocation ....   Passed    0.02 sec
      Start 25: guest_crypto_memcmp
25/28 Test #25: guest_crypto_memcmp .................   Passed    0.03 sec
      Start 26: guest_libressl3_digest
26/28 Test #26: guest_libressl3_digest ..............   Passed    0.04 sec
      Start 27: guest_libressl3_asn1
27/28 Test #27: guest_libressl3_asn1 ................   Passed    0.04 sec
      Start 28: guest_libressl3_key_reference
28/28 Test #28: guest_libressl3_key_reference .......   Passed    0.03 sec

100% tests passed, 0 tests failed out of 28

Total Test time (real) =   0.98 sec

Conventions
Base origin/main: facac6a4c52fa6e4bfb2b77ba98cab5e449555d4
Head: dc81f08abdfdd79e2d3ceb39c71c8decd76b945c
All conventions checks passed.

Whitespace
Whitespace check passed

Standalone public headers
368 libraries, 12990 exports: unique declarations and umbrella coverage verified
Standalone headers verified

Generator recovery
[0/2] Re-checking globbed directories...
[1/3] Generating prx/libSceLibreSsl/ErrorStrings.inc
[2/3] Building CXX object CMakeFiles/guest_libressl_error_string_tests.dir/src/core/libs/tests/GuestLibreSslErrors.cpp.o
[3/3] Linking CXX executable tests/guest_libressl_error_string_tests

Generator SHA256 before
44af6828fdc064ca16f94aeb07ac913651d2bfce0f5ecbeee6b9b476e6be24e3  /validation/build-cmac/prx/libSceLibreSsl/ErrorStrings.inc

Generator SHA256 after
44af6828fdc064ca16f94aeb07ac913651d2bfce0f5ecbeee6b9b476e6be24e3  /validation/build-cmac/prx/libSceLibreSsl/ErrorStrings.inc

Public definitions and NIDs
err dc81f08abdfdd79e2d3ceb39c71c8decd76b945c
libSceLibreSsl: 399 public definitions; exact old/main union and NIDs preserved
libSceLibreSsl3: 87 public definitions; exact old/main union and NIDs preserved
All main implementation sources byte-identical except preserved extended Error.cpp
bio 07516032a788a3a3d294b00342ea7b51f502b9ff
libSceLibreSsl: 399 public definitions; exact old/main union and NIDs preserved
libSceLibreSsl3: 87 public definitions; exact old/main union and NIDs preserved
All main implementation sources byte-identical except preserved extended Error.cpp
cmac 4d9fb8befe3a9d68bdb6619eff68f91d23f3d7e0
libSceLibreSsl: 399 public definitions; exact old/main union and NIDs preserved
libSceLibreSsl3: 87 public definitions; exact old/main union and NIDs preserved
All main implementation sources byte-identical except preserved extended Error.cpp

Scoped registration audit
run  guest_crypto_memcmp_tests
run  guest_libressl3_asn1_tests
run  guest_libressl3_digest_tests
run  guest_libressl3_key_reference_tests
run  guest_libressl_aes_tests
run  guest_libressl_alert_tests
run  guest_libressl_asn1_tests
run  guest_libressl_cipher_tests
run  guest_libressl_crypto_locks_tests
run  guest_libressl_des_tests
run  guest_libressl_digest_tests
run  guest_libressl_error_string_tests
run  guest_libressl_error_tests
run  guest_libressl_ex_data_tests
run  guest_libressl_object_allocation_tests
run  guest_libressl_object_text_tests
run  guest_libressl_ocsp_tests
run  guest_libressl_pkey_type_tests
run  guest_libressl_rsa_tests
run  guest_libressl_runtime_tests
run  guest_libressl_stack_tests
run  guest_libressl_ui_tests
run  guest_libressl_version_tests
run  guest_libressl_x509_errors_tests
run  guest_libressl_x509_store_context_tests

All scoped executables are registered. This is not a full-root registration pass: the component harness omits the root registrations of nine unrelated libc fixtures, which the global checker reports as unrun (application_heap_tests, guest_allocations_oom_tests, guest_collate_tests, guest_heap_trace_info_tests, guest_libc_cnd_init_default_name_tests, guest_libc_cnd_timed_wait_tests, guest_libc_mutex_init_with_name_tests, guest_locale_tests, guest_rune_locale_tests).

External reproduction harness

Save this outside the repository; mount the exact head at /src and this directory at /validation. Put the CMake file in /validation/harness, symlink /validation/harness/3rdparty to /src/3rdparty, and initialize the repository-pinned mbedTLS (including framework), libressl-openbsd, ZArchive and zstd submodules. Configure with cmake -S /validation/harness -B /validation/build-cmac -G Ninja -DCMAKE_BUILD_TYPE=Release -DBIO_CONTROL=OFF, build with cmake --build /validation/build-cmac -j4. The reusable build-directory name does not identify the source head; pin the checkout to the SHA above.

cmake_minimum_required(VERSION 3.20)
project(LibreSslStackValidation LANGUAGES C CXX)
enable_testing()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(LIBS_INCLUDE_DIR /src/core/libs)
set(ANYPS5_TEST_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
set(PATCHED_DIR ${CMAKE_BINARY_DIR}/patched)
function(add_test_executable target)
 add_executable(${target} ${ARGN})
 set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ANYPS5_TEST_OUTPUT_DIRECTORY})
endfunction()
function(configure_windows_unwind target)
endfunction()
function(add_asan_test_options)
endfunction()
add_compile_options(-ffunction-sections -fdata-sections)
add_link_options(-Wl,--gc-sections)
include(/src/cmake/ZArchive.cmake)
set(BUILD_TESTING OFF)
add_library(libc SHARED)
add_subdirectory(/src/core/libs/prx/libc libc)
target_include_directories(libc PRIVATE ${LIBS_INCLUDE_DIR})
target_link_options(libc PRIVATE LINKER:-z,now)
target_link_options(libc INTERFACE LINKER:--no-as-needed)
add_subdirectory(/src/core/libs/prx/libkernel kernel)
add_subdirectory(/src/core/libs/prx/libSceSsl ssl)
set(BUILD_TESTING ON)
add_subdirectory(/src/core/libs/prx/libSceLibreSsl libressl)
add_subdirectory(/src/core/libs/prx/libSceLibreSsl3 libressl3)
foreach(target libSceLibreSsl libSceLibreSsl3)
 target_link_libraries(${target} PUBLIC libc PRIVATE libkernel)
endforeach()
include(/src/core/libs/prx/libSceLibreSsl/ErrorQueue.cmake)
if(EXISTS /src/core/libs/prx/libSceLibreSsl/MemoryBio.cmake)
 include(/src/core/libs/prx/libSceLibreSsl/MemoryBio.cmake)
endif()
if(EXISTS /src/core/libs/prx/libSceLibreSsl/Cmac.cmake)
 include(/src/core/libs/prx/libSceLibreSsl/Cmac.cmake)
endif()
file(GLOB patcherSources /src/core/libs/nid/src/*.cpp)
add_executable(nid_patcher ${patcherSources})
target_include_directories(nid_patcher PRIVATE /src/core/libs/nid/include)
foreach(target libc libkernel libSceLibreSsl libSceLibreSsl3)
 set_target_properties(${target} PROPERTIES PREFIX "" SUFFIX .prx BUILD_RPATH "$ORIGIN" BUILD_WITH_INSTALL_RPATH ON INSTALL_RPATH "$ORIGIN")
 add_custom_command(OUTPUT ${PATCHED_DIR}/${target}.prx
  COMMAND ${CMAKE_COMMAND} -E make_directory ${PATCHED_DIR}
  COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${target}> ${PATCHED_DIR}/${target}.prx
  COMMAND $<TARGET_FILE:nid_patcher> ${target} ${PATCHED_DIR}/${target}.prx
  DEPENDS ${target} nid_patcher)
 list(APPEND patched ${PATCHED_DIR}/${target}.prx)
endforeach()
add_custom_target(focused_patched ALL DEPENDS ${patched})
if(BIO_CONTROL)
 get_target_property(sslSources libSceLibreSsl SOURCES)
 list(REMOVE_ITEM sslSources /src/core/libs/prx/libSceLibreSsl/src/Bio.cpp)
 set_property(TARGET libSceLibreSsl PROPERTY SOURCES ${sslSources})
 target_sources(libSceLibreSsl PRIVATE /validation/BioNoGrowthWipe.cpp)
endif()

The optional control replaces only the single clearBuffer(buffer); immediately preceding free_nid_postfix(buffer.data); in a copy at /validation/BioNoGrowthWipe.cpp. It uses the same test executable sources. Generator recovery deletes only <build>/prx/libSceLibreSsl/ErrorStrings.inc then builds libSceLibreSsl libSceLibreSsl3 guest_libressl_error_string_tests. Native selection is ctest --test-dir <build> -R "^(guest_libressl|guest_crypto_memcmp)" -E "_patched$" --output-on-failure --no-tests=error; patched selection is the applicable ^guest_libressl_(bio|cmac)_patched$. The ERR head has no native/patched BIO/CMAC selection.

Complete overlap output (limitations retained)

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 9536 ERR_error_string
ERR_error_string_n
ERR_free_strings
ERR_load_crypto_strings
ERR_peek_last_error
3rdparty/libressl-openbsd
core/libs/prx/libSceLibreSsl/ErrorQueue.cmake
core/libs/prx/libSceLibreSsl/ErrorQueue.cpp
core/libs/prx/libSceLibreSsl/ErrorQueue.hpp
core/libs/prx/libSceLibreSsl/GenerateErrorStrings.py
core/libs/tests/GuestLibreSslErrors.cpp
PR 9571 ERR_error_string
ERR_error_string_n
ERR_free_strings
ERR_load_crypto_strings
ERR_peek_last_error
3rdparty/libressl-openbsd
core/libs/prx/libSceLibreSsl/ErrorQueue.cmake
core/libs/prx/libSceLibreSsl/ErrorQueue.cpp
core/libs/prx/libSceLibreSsl/ErrorQueue.hpp
core/libs/prx/libSceLibreSsl/GenerateErrorStrings.py
core/libs/tests/GuestLibreSslErrors.cpp
PR 10490 core/libs/prx/libSceLibreSsl3/Export.cpp L44-66
PR 10557 docs/dev/debt/libSceLibreSsl3.md L2
PR 10631 docs/dev/debt/libSceLibreSsl3.md L2

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 674 .gitmodules
PR 1835 .gitmodules
PR 5021 .gitmodules
core/libs/CMakeLists.txt
PR 7275 core/libs/CMakeLists.txt
PR 8650 core/libs/CMakeLists.txt
PR 9156 core/libs/CMakeLists.txt
PR 9161 core/libs/CMakeLists.txt
PR 9284 core/libs/CMakeLists.txt
PR 9293 core/libs/CMakeLists.txt
PR 9297 core/libs/CMakeLists.txt
PR 9302 core/libs/CMakeLists.txt
PR 9383 core/libs/CMakeLists.txt
PR 9446 core/libs/prx/libSceLibreSsl/Export.cpp
docs/dev/debt/libSceLibreSsl.md
PR 9448 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 9536 .gitmodules
3rdparty/libressl-openbsd
core/libs/CMakeLists.txt
core/libs/prx/libSceLibreSsl/ErrorQueue.cmake
core/libs/prx/libSceLibreSsl/ErrorQueue.cpp
core/libs/prx/libSceLibreSsl/ErrorQueue.hpp
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/GenerateErrorStrings.py
core/libs/prx/libSceLibreSsl/include/Api.hpp
core/libs/prx/libSceLibreSsl/include/Error.hpp
core/libs/prx/libSceLibreSsl/src/Error.cpp
core/libs/prx/libSceLibreSsl3/Export.cpp
core/libs/prx/libSceLibreSsl3/include/Api.hpp
core/libs/tests/GuestLibreSslError.cpp
core/libs/tests/GuestLibreSslErrors.cpp
docs/dev/debt/libSceLibreSsl.md
docs/dev/debt/libSceLibreSsl3.md
PR 9571 .gitmodules
3rdparty/libressl-openbsd
core/libs/CMakeLists.txt
core/libs/prx/libSceLibreSsl/ErrorQueue.cmake
core/libs/prx/libSceLibreSsl/ErrorQueue.cpp
core/libs/prx/libSceLibreSsl/ErrorQueue.hpp
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/GenerateErrorStrings.py
core/libs/prx/libSceLibreSsl/include/Api.hpp
core/libs/prx/libSceLibreSsl/include/Error.hpp
core/libs/prx/libSceLibreSsl/src/Error.cpp
core/libs/prx/libSceLibreSsl3/Export.cpp
core/libs/prx/libSceLibreSsl3/include/Api.hpp
core/libs/tests/GuestLibreSslError.cpp
core/libs/tests/GuestLibreSslErrors.cpp
docs/dev/debt/libSceLibreSsl.md
docs/dev/debt/libSceLibreSsl3.md
PR 9970 core/libs/prx/libSceLibreSsl3/Export.cpp
docs/dev/debt/libSceLibreSsl3.md
PR 10395 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10418 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10427 core/libs/CMakeLists.txt
PR 10448 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10450 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10475 core/libs/prx/libSceLibreSsl/Export.cpp
docs/dev/debt/libSceLibreSsl.md
PR 10477 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10478 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10481 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10482 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10483 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10485 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10486 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10488 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10508 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10570 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10571 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10834 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10878 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
core/libs/tests/GuestLibreSslError.cpp
docs/dev/debt/libSceLibreSsl.md
PR 10915 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11003 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11089 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11100 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11105 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11128 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11129 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11138 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11143 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11146 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11151 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/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11176 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11189 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11359 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11466 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 11662 core/libs/prx/libSceLibreSsl/Export.cpp
docs/dev/debt/libSceLibreSsl.md

No full-product/whole-suite, new Windows, sanitizer, title, PS5, or hosted product-CI pass is claimed. Maintainer-dispatched full Linux/Windows CI and current-head review remain outstanding. AI-assisted: yes.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 28, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@Felipebmaitan the ERR formatting and queue changes read right to me against the pinned 3.4.1 source. One build-scope request: the generated ErrorStrings.inc is only used by tests/GuestLibreSslErrors.cpp, but ErrorQueue.cmake runs for every full configure. It makes Python3 REQUIRED (the rest of the tree finds it QUIET), stops with FATAL_ERROR unless 3rdparty/libressl-openbsd is initialized, globs all of libcrypto with CONFIGURE_DEPENDS, and makes libSceLibreSsl itself depend on libressl_error_strings.

Could you put the submodule check, the generator and that dependency under BUILD_TESTING (or make them optional and skip the string test when the submodule isn't there), so a build of the library alone needs neither Python nor the new submodule? Whether a new third-party submodule is acceptable at all is the maintainers' call.

@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

@oneandonlydean The build-scope request in #9535 (comment) is present in published head 4d85ca5b8b85a043c520034d38d8fff6d09728ee and remains unchanged in the current-main composition #9571 1dcad0a85980490ed6705d664fdcbe0f3e5e2bf2, tested against main de824c2919ca65086c6324a1e0388866a7327eea.

Runtime ErrorQueue.cpp registration and LibreSSL3 linkage are unconditional. Python discovery, the fixture-submodule check, globbing and generation are testing-only; the generated file belongs only to the formatter test. Ninja confirms neither runtime library invokes the generator. I deleted ErrorStrings.inc, built both runtime libraries with it still absent, then built the formatter test: it regenerated the fixture with identical SHA256 44af6828fdc064ca16f94aeb07ac913651d2bfce0f5ecbeee6b9b476e6be24e3; the three numeric lifecycle tests pass again (3/3). A separate BUILD_TESTING=OFF fragment harness also configured and compiled with Python discovery disabled and no fixture submodule at its source root.

The combined source-built Linux component suite passes 39 native + 3 patched cases, including ERR queue/lifecycle, BIO/CMAC and current main regressions. Canonical audit (393 libraries/24,536 exports), standalone headers, conventions and scoped registrations pass. This is an amd64 Docker run on Apple Silicon, not native Windows/macOS runtime, full root CI or console evidence. This unchanged lower head was not independently rebuilt in this refresh; exact commands, harness, scope limits and combined-head evidence are in the current-main validation response. The PR template now distinguishes that evidence from historical prerequisite runs. Acceptance of the test-input submodule remains a maintainer decision. AI-assisted: yes.

@Felipebmaitan

Felipebmaitan commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

@oneandonlydean Addressed the remaining maintainer request on the existing stack, refreshed bottom-up without force-pushing or dropping maintainer ancestry:

This PR: b8dc89c0f887e725b97ad2ea112fb6eded347e27, integrated main 4ac683fe026c3368e508ace9745d3017e12a1207. Pending exports were independently counted on each resulting branch: ERR 287, BIO 280, CMAC 257. Two counts agree on every head: literal NotImplemented_nid_no_patch(__func__) calls and exported function bodies beginning with that call. The debt numbers match; the older observed 296/289 values were not blindly applied. CMAC's combined count remains 257.

The BIO test change removes exactly the ex-data assignment, RequireUnsupported(BIO_free) call, following reference assertion, and reset. It is present on both BIO and CMAC. Production BIO_free refusal is byte-identical, and supported null/zero dispatch/callback, retry/error/accounting, nonzero-slack full-capacity growth wiping and destruction wiping remain covered by passing native/patched tests. The ERR implementation/generator fragments and CMAC/BN implementations and supported fixtures are otherwise unchanged; main's newer sources and ERR lifecycle assertions are retained. ENGINE refusal assertion remains absent from CMAC tests.

Exact head b8dc89c0f887e725b97ad2ea112fb6eded347e27, main integration base 4ac683fe026c3368e508ace9745d3017e12a1207. Ubuntu 24.04.5 amd64 Docker container on Apple Silicon, GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1, Python 3.12.3, Release.

  • 41/41 native + 1/1 patched focused CTests pass on this head, covering ERR queue/numeric/load/free, available BIO/CMAC/BN cases and main's LibreSSL/LibreSSL3 regressions. Source-built actual libc/libkernel/LibreSSL/LibreSSL3 and repository NID patcher; separate native/patched loader paths. Each layer was reconfigured and rebuilt in the external component harness.
  • Generated ERR fixture deleted: runtime libraries build with it absent; the formatter target regenerates the same SHA256 (44af6828fdc064ca16f94aeb07ac913651d2bfce0f5ecbeee6b9b476e6be24e3); all three lifecycle cases pass again. Runtime Ninja graphs exclude the generator and compile src/Error.cpp once.
  • Public headers: 399 libraries / 26,750 exports, unique declarations and umbrella coverage; strict standalone compilation with Clang targeting x86-64 macOS (compile-only). All 35 scoped executable registrations pass. Full main/old implementation/NID preservation audit passes.
  • python3 tools/check_conventions.py --base origin/main and whitespace pass in an isolated Git context pinning origin/main to the integration base above, without changing shared tracking refs.
  • Overlap scan ran for this head and returned exit 2, reporting adjacent conflicts, inherited stack functions and incomplete comparisons. Shared-file/function inventories were reviewed: owned downstreams inherit ERR/BIO, feat(libSceLibreSsl): implement file and socket BIO adapters #12928 explicitly depends on feat(libSceLibreSsl): implement memory BIOs #9536 and reuses it, and feat(libSceLibreSsl): implement the BN_ BIGNUM, BN_CTX, conversion, word, BN_mul and BN_mod_inverse functions #9446's BN work is preserved in CMAC. Remaining external comparisons and mechanical conflicts are recorded in the validation reply; no clean-overlap or external-order agreement is claimed.

The harness imports actual repository library/test fragments, source-building pinned dependencies; it is not the full root/product suite. Docker denies userfaultfd, invoking libc's existing comparison fallback. No new local Windows/macOS runtime, sanitizer, title or physical-console run was performed; no skipped/pending hosted job is counted as passed. Firmware-module evidence remains PC execution with stand-in imports. Earlier no-Python fragment and bounded BIO negative-control evidence is historical; those settled checks were not rerun, and neither production BIO nor the wipe assertions changed. Hosted CI for b8dc89c0f887e725b97ad2ea112fb6eded347e27: windows, conventions, library-portability, eligibility, labels and report succeeded. linux, relinker, relinker-asan, register-context and write-watch were skipped; an earlier conventions run was cancelled. GitHub reports CLEAN / MERGEABLE. Skipped jobs are not counted as executed. Current-head maintainer re-review remains pending. Exact logs, harness, audits and overlap limitations are in the latest validation reply.

Owned order remains #9535 → #9536 → #9571. External blocker only for CMAC: the #9446 author has not confirmed the proposed #9446-before-#9571 order in the linked request; no change or agreement is attributed to that branch. Its independent BN firmware/rebase work is not claimed fixed. No merge or replacement PR. AI-assisted: yes.

Native focused tests
Internal ctest changing into directory: /validation/build
Test project /validation/build
      Start  1: guest_libressl_errors
 1/41 Test  #1: guest_libressl_errors ........................   Passed    0.05 sec
      Start  2: guest_libressl_free_strings
 2/41 Test  #2: guest_libressl_free_strings ..................   Passed    0.04 sec
      Start  3: guest_libressl_free_strings_first
 3/41 Test  #3: guest_libressl_free_strings_first ............   Passed    0.04 sec
      Start  4: guest_libressl_protocol
 4/41 Test  #4: guest_libressl_protocol ......................   Passed    0.04 sec
      Start  6: guest_libressl_x509_errors
 5/41 Test  #6: guest_libressl_x509_errors ...................   Passed    0.03 sec
      Start  7: guest_libressl_digest
 6/41 Test  #7: guest_libressl_digest ........................   Passed    0.22 sec
      Start  8: guest_libressl_asn1
 7/41 Test  #8: guest_libressl_asn1 ..........................   Passed    0.06 sec
      Start  9: guest_libressl_asn1_allocator
 8/41 Test  #9: guest_libressl_asn1_allocator ................   Passed    0.06 sec
      Start 10: guest_libressl_ex_data
 9/41 Test #10: guest_libressl_ex_data .......................   Passed    0.05 sec
      Start 11: guest_libressl_des
10/41 Test #11: guest_libressl_des ...........................   Passed    0.04 sec
      Start 12: guest_libressl_runtime
11/41 Test #12: guest_libressl_runtime .......................   Passed    0.04 sec
      Start 13: guest_libressl_aes
12/41 Test #13: guest_libressl_aes ...........................   Passed    0.04 sec
      Start 14: guest_libressl_error
13/41 Test #14: guest_libressl_error .........................   Passed    0.04 sec
      Start 15: guest_libressl_ocsp
14/41 Test #15: guest_libressl_ocsp ..........................   Passed    0.04 sec
      Start 16: guest_libressl_stack
15/41 Test #16: guest_libressl_stack .........................   Passed    0.05 sec
      Start 17: guest_libressl_general_name
16/41 Test #17: guest_libressl_general_name ..................   Passed    0.04 sec
      Start 18: guest_libressl_ui
17/41 Test #18: guest_libressl_ui ............................   Passed    0.04 sec
      Start 19: guest_libressl_rsa
18/41 Test #19: guest_libressl_rsa ...........................   Passed    0.03 sec
      Start 20: guest_libressl_x509_store_context
19/41 Test #20: guest_libressl_x509_store_context ............   Passed    0.05 sec
      Start 21: guest_libressl_pkey_type
20/41 Test #21: guest_libressl_pkey_type .....................   Passed    0.04 sec
      Start 22: guest_libressl_cipher
21/41 Test #22: guest_libressl_cipher ........................   Passed    0.03 sec
      Start 23: guest_libressl_alert
22/41 Test #23: guest_libressl_alert .........................   Passed    0.04 sec
      Start 24: guest_libressl_version
23/41 Test #24: guest_libressl_version .......................   Passed    0.04 sec
      Start 25: guest_libressl_crypto_locks
24/41 Test #25: guest_libressl_crypto_locks ..................   Passed    0.04 sec
      Start 26: guest_libressl_object_text
25/41 Test #26: guest_libressl_object_text ...................   Passed    0.04 sec
      Start 27: guest_libressl_object_allocation
26/41 Test #27: guest_libressl_object_allocation .............   Passed    0.04 sec
      Start 28: guest_libressl_x509_store
27/41 Test #28: guest_libressl_x509_store ....................   Passed    0.04 sec
      Start 29: guest_libressl_x509_store_allocator
28/41 Test #29: guest_libressl_x509_store_allocator ..........   Passed    0.04 sec
      Start 30: guest_libressl_x509_verify_param
29/41 Test #30: guest_libressl_x509_verify_param .............   Passed    0.04 sec
      Start 31: guest_libressl_x509_verify_param_allocator
30/41 Test #31: guest_libressl_x509_verify_param_allocator ...   Passed    0.04 sec
      Start 32: guest_libressl_x509_lookup
31/41 Test #32: guest_libressl_x509_lookup ...................   Passed    0.04 sec
      Start 33: guest_libressl_x509_lookup_allocator
32/41 Test #33: guest_libressl_x509_lookup_allocator .........   Passed    0.04 sec
      Start 34: guest_libressl3_pkey_getters
33/41 Test #34: guest_libressl3_pkey_getters .................   Passed    0.03 sec
      Start 35: guest_crypto_memcmp
34/41 Test #35: guest_crypto_memcmp ..........................   Passed    0.05 sec
      Start 36: guest_libressl3_digest
35/41 Test #36: guest_libressl3_digest .......................   Passed    0.05 sec
      Start 37: guest_libressl3_digest_context
36/41 Test #37: guest_libressl3_digest_context ...............   Passed    0.03 sec
      Start 38: guest_libressl3_asn1
37/41 Test #38: guest_libressl3_asn1 .........................   Passed    0.06 sec
      Start 39: guest_libressl3_x509_verify_param
38/41 Test #39: guest_libressl3_x509_verify_param ............   Passed    0.05 sec
      Start 40: guest_libressl3_stack
39/41 Test #40: guest_libressl3_stack ........................   Passed    0.04 sec
      Start 41: guest_libressl3_cipher
40/41 Test #41: guest_libressl3_cipher .......................   Passed    0.05 sec
      Start 42: guest_libressl3_key_reference
41/41 Test #42: guest_libressl3_key_reference ................   Passed    0.06 sec

100% tests passed, 0 tests failed out of 41

Total Test time (real) =   2.03 sec
Patched focused tests
Internal ctest changing into directory: /validation/build
Test project /validation/build
    Start 5: guest_libressl_protocol_nid
1/1 Test #5: guest_libressl_protocol_nid ......   Passed    0.05 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.09 sec
ERR fixture recovery
44af6828fdc064ca16f94aeb07ac913651d2bfce0f5ecbeee6b9b476e6be24e3  /validation/build/prx/libSceLibreSsl/ErrorStrings.inc
[0/2] Re-checking globbed directories...
ninja: no work to do.
[0/2] Re-checking globbed directories...
[1/3] Generating prx/libSceLibreSsl/ErrorStrings.inc
[2/3] Building CXX object CMakeFiles/guest_libressl_error_string_tests.dir/src/core/libs/tests/GuestLibreSslErrors.cpp.o
[3/3] Linking CXX executable tests/guest_libressl_error_string_tests
44af6828fdc064ca16f94aeb07ac913651d2bfce0f5ecbeee6b9b476e6be24e3  /validation/build/prx/libSceLibreSsl/ErrorStrings.inc
Internal ctest changing into directory: /validation/build
Test project /validation/build
    Start 1: guest_libressl_errors
1/3 Test #1: guest_libressl_errors ...............   Passed    0.07 sec
    Start 2: guest_libressl_free_strings
2/3 Test #2: guest_libressl_free_strings .........   Passed    0.12 sec
    Start 3: guest_libressl_free_strings_first
3/3 Test #3: guest_libressl_free_strings_first ...   Passed    0.07 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   0.33 sec
Preservation/count/NID audit
head b8dc89c0f887e725b97ad2ea112fb6eded347e27
main 4ac683fe026c3368e508ace9745d3017e12a1207
ancestor retained 4d85ca5b8b85a043c520034d38d8fff6d09728ee
ancestor retained 4ac683fe026c3368e508ace9745d3017e12a1207
Published runtime implementations, generator and fragments byte-identical
All main implementation sources/inventories retained except preserved extended ERR queue
Pending exports: 287 literal calls = 287 direct public stub bodies = debt count
libSceLibreSsl: 399 public definitions; exact old/main union and NIDs retained
libSceLibreSsl3: 260 public definitions; exact old/main union and NIDs retained
One ERR runtime source/test registration; runtime queue unconditional; generator/Python/submodule test-only
Headers
399 libraries, 26750 exports: unique declarations and umbrella coverage verified
Standalone headers verified
Scoped registrations
run  guest_crypto_memcmp_tests
run  guest_libressl3_asn1_tests
run  guest_libressl3_cipher_tests
run  guest_libressl3_digest_context_tests
run  guest_libressl3_digest_tests
run  guest_libressl3_key_reference_tests
run  guest_libressl3_pkey_getters_tests
run  guest_libressl3_stack_tests
run  guest_libressl3_x509_verify_param_tests
run  guest_libressl_aes_tests
run  guest_libressl_alert_tests
run  guest_libressl_asn1_tests
run  guest_libressl_cipher_tests
run  guest_libressl_crypto_locks_tests
run  guest_libressl_des_tests
run  guest_libressl_digest_tests
run  guest_libressl_error_string_tests
run  guest_libressl_error_tests
run  guest_libressl_ex_data_tests
run  guest_libressl_general_name_tests
run  guest_libressl_object_allocation_tests
run  guest_libressl_object_text_tests
run  guest_libressl_ocsp_tests
run  guest_libressl_pkey_type_tests
run  guest_libressl_protocol_tests
run  guest_libressl_rsa_tests
run  guest_libressl_runtime_tests
run  guest_libressl_stack_tests
run  guest_libressl_ui_tests
run  guest_libressl_version_tests
run  guest_libressl_x509_errors_tests
run  guest_libressl_x509_lookup_tests
run  guest_libressl_x509_store_context_tests
run  guest_libressl_x509_store_tests
run  guest_libressl_x509_verify_param_tests
Conventions
All conventions checks passed.
Overlap output: exit 2, including incomplete comparisons

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 9448 docs/dev/debt/libSceLibreSsl.md L10
PR 9536 core/libs/CMakeLists.txt L301
docs/dev/debt/libSceLibreSsl.md L17, L31
ERR_error_string
ERR_error_string_n
ERR_free_strings
ERR_load_crypto_strings
ERR_peek_last_error
3rdparty/libressl-openbsd
core/libs/prx/libSceLibreSsl/ErrorQueue.cmake
core/libs/prx/libSceLibreSsl/ErrorQueue.cpp
core/libs/prx/libSceLibreSsl/ErrorQueue.hpp
core/libs/prx/libSceLibreSsl/GenerateErrorStrings.py
core/libs/tests/GuestLibreSslErrors.cpp
PR 9571 core/libs/CMakeLists.txt L301
core/libs/prx/libSceLibreSsl/include/Api.hpp L344-350
docs/dev/debt/libSceLibreSsl.md L10, L17, L31
ERR_error_string
ERR_error_string_n
ERR_free_strings
ERR_load_crypto_strings
ERR_peek_last_error
3rdparty/libressl-openbsd
core/libs/prx/libSceLibreSsl/ErrorQueue.cmake
core/libs/prx/libSceLibreSsl/ErrorQueue.cpp
core/libs/prx/libSceLibreSsl/ErrorQueue.hpp
core/libs/prx/libSceLibreSsl/GenerateErrorStrings.py
core/libs/tests/GuestLibreSslErrors.cpp
PR 10395 docs/dev/debt/libSceLibreSsl.md L10
PR 10448 docs/dev/debt/libSceLibreSsl.md L10
PR 10450 docs/dev/debt/libSceLibreSsl.md L10
PR 10477 docs/dev/debt/libSceLibreSsl.md L10
PR 10481 docs/dev/debt/libSceLibreSsl.md L10
PR 10482 docs/dev/debt/libSceLibreSsl.md L10
PR 10483 docs/dev/debt/libSceLibreSsl.md L10
PR 10485 docs/dev/debt/libSceLibreSsl.md L10
PR 10490 core/libs/prx/libSceLibreSsl3/Export.cpp L44-66
PR 10557 docs/dev/debt/libSceLibreSsl3.md L2
PR 10570 docs/dev/debt/libSceLibreSsl.md L10
PR 10834 core/libs/prx/libSceLibreSsl/Export.cpp L452-496
docs/dev/debt/libSceLibreSsl.md L10
PR 10878 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 10915 docs/dev/debt/libSceLibreSsl.md L10
PR 11003 docs/dev/debt/libSceLibreSsl.md L10
PR 11128 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 11129 docs/dev/debt/libSceLibreSsl.md L10
PR 11138 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 11143 docs/dev/debt/libSceLibreSsl.md L10
PR 11146 docs/dev/debt/libSceLibreSsl.md L10
PR 11151 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 11174 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 11175 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 11176 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 11553 docs/dev/debt/libSceLibreSsl.md L10
PR 12730 docs/dev/debt/libSceLibreSsl.md L10, L17
PR 12928 core/libs/CMakeLists.txt L301
docs/dev/debt/libSceLibreSsl.md L17, L31
ERR_error_string
ERR_error_string_n
ERR_free_strings
ERR_load_crypto_strings
ERR_peek_last_error
3rdparty/libressl-openbsd
core/libs/prx/libSceLibreSsl/ErrorQueue.cmake
core/libs/prx/libSceLibreSsl/ErrorQueue.cpp
core/libs/prx/libSceLibreSsl/ErrorQueue.hpp
core/libs/prx/libSceLibreSsl/GenerateErrorStrings.py
core/libs/tests/GuestLibreSslErrors.cpp
PR 14115 docs/dev/debt/libSceLibreSsl.md L10-11

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 1835 .gitmodules
PR 5021 .gitmodules
core/libs/CMakeLists.txt
PR 7275 core/libs/CMakeLists.txt
PR 8650 core/libs/CMakeLists.txt
PR 9019 core/libs/CMakeLists.txt
PR 9156 core/libs/CMakeLists.txt
PR 9162 core/libs/CMakeLists.txt
PR 9293 core/libs/CMakeLists.txt
PR 9297 core/libs/CMakeLists.txt
PR 9302 core/libs/CMakeLists.txt
PR 9383 core/libs/CMakeLists.txt
PR 9446 core/libs/prx/libSceLibreSsl/Export.cpp
docs/dev/debt/libSceLibreSsl.md
PR 9855 .gitmodules
PR 9970 core/libs/prx/libSceLibreSsl3/Export.cpp
docs/dev/debt/libSceLibreSsl3.md
PR 10418 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10461 core/libs/prx/libSceLibreSsl3/Export.cpp
core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 10508 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10631 core/libs/prx/libSceLibreSsl3/Export.cpp
core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 11359 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11466 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11662 core/libs/prx/libSceLibreSsl/Export.cpp
docs/dev/debt/libSceLibreSsl.md
PR 12642 core/libs/CMakeLists.txt
PR 12729 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 12754 core/libs/prx/libSceLibreSsl3/Export.cpp
core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 13253 core/libs/CMakeLists.txt
PR 13256 core/libs/CMakeLists.txt
PR 13266 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 13285 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 13546 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 13547 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 13578 .gitmodules
PR 13860 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
core/libs/tests/GuestLibreSslError.cpp
docs/dev/debt/libSceLibreSsl.md
PR 13877 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
docs/dev/debt/libSceLibreSsl3.md
PR 14299 core/libs/CMakeLists.txt
Reproduction harness and test commands

Configure: cmake -S /validation/harness -B /validation/build -G Ninja -DCMAKE_BUILD_TYPE=Release; build: cmake --build /validation/build -j4. Mount the exact checkout read-only at /src, source-initialized pinned mbedTLS (including framework), libressl-openbsd, ZArchive and zstd submodules; the external harness's 3rdparty symlink points to /src/3rdparty, tests to /src/core/libs/tests.

cmake_minimum_required(VERSION 3.20)
project(LibreSslStackValidation LANGUAGES C CXX)
enable_testing()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
option(LIBRESSL_TESTING "Build focused tests" ON)
set(LIBS_INCLUDE_DIR /src/core/libs)
set(ANYPS5_TEST_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
set(PATCHED_DIR ${CMAKE_BINARY_DIR}/patched)
function(add_test_executable target)
 add_executable(${target} ${ARGN})
 set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ANYPS5_TEST_OUTPUT_DIRECTORY})
endfunction()
function(configure_windows_unwind target)
endfunction()
function(configure_host_test_executable target)
endfunction()
function(add_asan_test_options)
endfunction()
add_compile_options(-ffunction-sections -fdata-sections)
add_link_options(-Wl,--gc-sections)
include(/src/cmake/ZArchive.cmake)
set(BUILD_TESTING OFF)
add_library(libc SHARED)
add_subdirectory(/src/core/libs/prx/libc libc)
target_include_directories(libc PRIVATE ${LIBS_INCLUDE_DIR})
target_link_options(libc PRIVATE LINKER:-z,now)
target_link_options(libc INTERFACE LINKER:--no-as-needed)
add_subdirectory(/src/core/libs/prx/libkernel kernel)
add_subdirectory(/src/core/libs/prx/libSceSsl ssl)
set(BUILD_TESTING ${LIBRESSL_TESTING})
add_subdirectory(/src/core/libs/prx/libSceLibreSsl libressl)
add_subdirectory(/src/core/libs/prx/libSceLibreSsl3 libressl3)
foreach(target libSceLibreSsl libSceLibreSsl3)
 target_link_libraries(${target} PUBLIC libc PRIVATE libkernel)
endforeach()
include(/src/core/libs/prx/libSceLibreSsl/ErrorQueue.cmake)
if(EXISTS /src/core/libs/prx/libSceLibreSsl/MemoryBio.cmake)
 include(/src/core/libs/prx/libSceLibreSsl/MemoryBio.cmake)
endif()
if(EXISTS /src/core/libs/prx/libSceLibreSsl/Cmac.cmake)
 include(/src/core/libs/prx/libSceLibreSsl/Cmac.cmake)
endif()
add_custom_target(libs)
include(/src/core/libs/prx/libSceLibreSsl/ProtocolSelection.cmake)
file(GLOB patcherSources /src/core/libs/nid/src/*.cpp)
add_executable(nid_patcher ${patcherSources})
target_include_directories(nid_patcher PRIVATE /src/core/libs/nid/include)
foreach(target libc libkernel libSceLibreSsl libSceLibreSsl3)
 set_target_properties(${target} PROPERTIES PREFIX "" SUFFIX .prx BUILD_RPATH "$ORIGIN" BUILD_WITH_INSTALL_RPATH ON INSTALL_RPATH "$ORIGIN")
 add_custom_command(OUTPUT ${PATCHED_DIR}/${target}.prx
  COMMAND ${CMAKE_COMMAND} -E make_directory ${PATCHED_DIR}
  COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${target}> ${PATCHED_DIR}/${target}.prx
  COMMAND $<TARGET_FILE:nid_patcher> ${target} ${PATCHED_DIR}/${target}.prx
  DEPENDS ${target} nid_patcher)
 list(APPEND patched ${PATCHED_DIR}/${target}.prx)
endforeach()
add_custom_target(focused_patched ALL DEPENDS ${patched})

add_dependencies(libs focused_patched)
set -eu
layer=$1
LD_LIBRARY_PATH=/validation/build:/validation/build/kernel:/validation/build/libressl:/validation/build/libressl3 ctest --test-dir /validation/build -R '^(guest_libressl|guest_crypto_memcmp)' -E '(_patched|_nid)$' --output-on-failure --no-tests=error > /evidence/$layer-native.log 2>&1
LD_LIBRARY_PATH=/validation/build/patched ctest --test-dir /validation/build -R '^guest_libressl_((bio|cmac)_patched|protocol_nid)$' --output-on-failure --no-tests=error > /evidence/$layer-patched.log 2>&1
python3 /src/tools/check_test_registration.py --list /validation/build > /evidence/$layer-registrations.txt
ninja -C /validation/build -t commands libressl/libSceLibreSsl.prx libressl3/libSceLibreSsl3.prx > /evidence/$layer-runtime-commands.txt
! grep -q GenerateErrorStrings.py /evidence/$layer-runtime-commands.txt
test "$(grep -c -- '-c /src/core/libs/prx/libSceLibreSsl/src/Error.cpp' /evidence/$layer-runtime-commands.txt)" = 1
sha256sum /validation/build/prx/libSceLibreSsl/ErrorStrings.inc > /evidence/$layer-fixture.log
rm /validation/build/prx/libSceLibreSsl/ErrorStrings.inc
cmake --build /validation/build --target libSceLibreSsl libSceLibreSsl3 >> /evidence/$layer-fixture.log 2>&1
test ! -e /validation/build/prx/libSceLibreSsl/ErrorStrings.inc
cmake --build /validation/build --target guest_libressl_error_string_tests >> /evidence/$layer-fixture.log 2>&1
sha256sum /validation/build/prx/libSceLibreSsl/ErrorStrings.inc >> /evidence/$layer-fixture.log
LD_LIBRARY_PATH=/validation/build:/validation/build/kernel:/validation/build/libressl:/validation/build/libressl3 ctest --test-dir /validation/build -R '^guest_libressl_(errors|free_strings|free_strings_first)$' --output-on-failure --no-tests=error >> /evidence/$layer-fixture.log 2>&1
tail -5 /evidence/$layer-native.log
tail -5 /evidence/$layer-patched.log

@B-Howell

B-Howell commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

@BunnyFl, your 13.42 native module check found that the three direct ERR string lookups returned NULL for all 917 codes. If you still have that harness, could you check whether the direct ERR_load_X509_strings and ERR_load_PEM_strings exports change those results? The two loader offsets or a before/after lookup for a known X509 and PEM reason would help establish their behavior.

AI-assisted: yes (Codex).

@BunnyFl

BunnyFl commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

@B-Howell Thanks for asking with the exact shape of the answer you needed. Neither loader changes those results: in firmware 13.42 the body of each one is a single ret, at 0xc37b0 and 0x989d0.

They are not in this pull request's library. libSceLibreSsl.sprx exports neither ERR_load_X509_strings (A0lZtFjhcTw) nor ERR_load_PEM_strings (M7ze0mz2jQM), and it exports none of the three direct lookups either. All of them are exports of libSceLibreSsl3.sprx, firmware 13.42, sha256 ee2c529c87fe21b7ef1e5f13d10c47ee90944f52a1f848fe0995e031817c2c3a. The offsets you asked for, from that module's dynamic symbol table:

Export NID Offset
ERR_load_X509_strings A0lZtFjhcTw 0xc37b0
ERR_load_PEM_strings M7ze0mz2jQM 0x989d0
ERR_lib_error_string F7jknWesBTY 0x32170
ERR_func_error_string VXuysR7ySzw 0x32230
ERR_reason_error_string rJZ-aiNIYCA 0x322d0
ERR_error_string_n g2Dgo0zmHL8 0x31e00

Both loader bodies, in full. The byte at 0xc37b0 and at 0x989d0 is c3, followed by int3 padding up to the next function, so neither reads an argument, writes anything, nor calls anything:

c37b0: c3    ret        ; ERR_load_X509_strings
c37b1: cc    int3       ; padding, to 0xc37c0
989d0: c3    ret        ; ERR_load_PEM_strings
989d1: cc    int3       ; padding, to 0x989e0

The three lookups are by contrast real functions — 0x32170, 0x32230 and 0x322d0 each start push %rbp; mov %rsp,%rbp — so their NULL is their own answer and not a missing body.

Measured, not only read. I still had the harness, so I ran the exports of libSceLibreSsl3.sprx (sha256 ee2c529c87fe21b7ef1e5f13d10c47ee90944f52a1f848fe0995e031817c2c3a) natively on a PC, not a console, under Unicorn with imports stubbed, entering at 0x32170, 0x32230, 0x322d0 and 0x31e00. For each of the 917 entries of the error-string table generated from the pinned LibreSSL 078b3d1df8 — the same 917 codes as the earlier check — it calls all three lookups, then calls ERR_load_X509_strings (0xc37b0) and ERR_load_PEM_strings (0x989d0), then calls all three again and diffs:

  • phase A, cold: 917 codes x 3 lookups, 0 non-NULL returns, 0 calls that failed to complete;
  • phase B: both loaders called;
  • phase C, after: 0 non-NULL returns, and 0 of the 917 codes changed in any of the three lookups.

Three identical runs, same result each time.

The before/after you asked for, on real table rows. ERR_error_string_n (0x31e00) is the visible signal, because it prints the numeric form of whatever the three lookups do not supply:

Code Table entry at 078b3d1df8 Before the loaders After
0x0B000064 "bn dec2bn error", x509_err.c:118 error:0B000064:lib(11):func(0):reason(100) identical
0x09000064 "bad base64 decode", pem_err.c:80 error:09000064:lib(9):func(0):reason(100) identical
0x0B000000 "x509 certificate routines", err.c:143 error:0B000000:lib(11):func(0):reason(0) identical
0x09000000 "PEM routines", err.c:141 error:09000000:lib(9):func(0):reason(0) identical
0x0BFFF000 "CRYPTO_internal" (X509 function 4095) error:0BFFF000:lib(11):func(4095):reason(0) identical
0x09FFF000 "CRYPTO_internal" (PEM function 4095) error:09FFF000:lib(9):func(4095):reason(0) identical

For 0x0B000064, a loader that had populated those tables would have turned lib(11) into x509 certificate routines and reason(100) into bn dec2bn error; the module keeps printing the numbers. (That row is written with the X509V3_R_BN_DEC2BN_ERROR macro, value 100 in x509v3.h:1114, but it sits in the X509 table whose ERR_REASON packs ERR_LIB_X509 at x509_err.c:73, so the packed code is 0x0B000064.)

The other loaders, since it is the obvious next question. err_all.c:115-159 calls 27 ERR_load_<library>_strings functions at 078b3d1df8; libSceLibreSsl3 exports exactly these two of them, and both are the lone ret above. The other 25 (ASN1, BIO, BN, BUF, CMS, CONF, CRYPTO, DH, DSA, DSO, ECDH, ECDSA, EC, ENGINE, EVP, GOST, OBJ, OCSP, PKCS12, PKCS7, RAND, RSA, TS, UI, X509V3) are absent from the module's export table. OpenSSL_add_all_digests (O9Thca3enw8) is a lone ret too, at 0x10100.

Not covered:

  • Not measured on a console: this is the module's own code run natively with imports stubbed, firmware 13.42 only.
  • The stubs the run actually used were snprintf (a standard-C stand-in, which is what produces the text above), malloc/calloc (a bump allocator), free, pthread_self (a constant id), and pthread_mutex_lock/unlock, pthread_once and pthread_equal (no-ops reporting success). Nothing else was reached.
  • The ret at 0xc37b0 and 0x989d0 writes no return register, so none of this says what either loader returns — only that it has no effect. feat(libSceLibreSsl3): return from the error-string and digest loaders #17246 declaring them void is consistent with that.
  • I did not re-run the rest of the earlier comparison; this answers the loader question only.

🤖 Generated with Claude Code

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.

6 participants