fix(libSceLibreSsl3): report mismatched key types through the error queue #15601
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15601"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-11-03T21:18:22Z.
What
A mismatched key type previously threw
std::runtime_error. LibreSSL 4.0.0 instead returns null and queues an EVP error: RSA, DSA, and DH. The adapted accessor implementation now appends that error to the calling thread's existing parent-library queue.RSA accepts types 6 and 912, DSA accepts 116, and DH accepts 28. Other types return null and queue library 6, function
0xfff, and reasons 127, 129, or 128 respectively. Matching keys return their borrowed inner pointer, including null, without changing references or clearing existing errors. The source file retains the original notices and pinned provenance.invalid_argumentexception; upstream dereferences it.Neither path was measured on a console.
Tested
Ubuntu 26.04.1, kernel 7.0.0-42-generic, GCC 15, Release, BUILD_TESTING=ON, on main
04a9eb4fa2, then again after merging main4741457fed. Windows and macOS were not compiled here. No title was run.guest_libressl3_pkey_getters_testsseparately for every control. The test covers recognized and unknown key types, the mismatch cross-product, empty matching keys, borrowed pointers, reference and field preservation, errno, and thread isolation. Ordered queue draining checks that older errors survive subsequent mismatches and successful calls.ctest --test-dir build -R 'libressl3|crypto_memcmp|libressl_errors|public_headers' -j6 --output-on-failure: 77/77 passed, including all 65 public-header tests.4741457fed: all 13 LibreSSL3 tests pass, includingguest_libressl3_pkey_getters. The only conflict was in the debt file: main's newer entries are kept, and this PR's getter entry replaces the old one.python3 tools/check_conventions.py --base origin/mainandgit diff --check origin/mainpassed after rebase. Repeated open/closed PR searches for all three symbols andPkeyGetters.cpp; the closed accessor implementations are already represented in main, and the open component accessors do not implement this mismatch fix.pr_overlap.pyexamined 1775 open PRs and exited 2. It reported debt-line overlaps with #10395 (EC keys), #10960 (digest operations), #12945 (BIO/SSL retains), and #14366 (RSA component getters). I compared their diffs: their debt edits require reconciliation, but none changes these three mismatch paths.Each comparison the tool could not complete was inspected manually:
ASN1_OBJECT_freeand its test registration; shared CMake/debt edits need reconciliation.OBJ_cmpand its test registration; shared CMake/debt edits need reconciliation.SSL_CIPHER_get_id; its shared debt entry concerns a separate export.EVP_PKEY_get0_EC_KEYinsrc/Key.cppand EC assertions intests/PkeyGetters.cpp. Its test/debt edits must be combined with this PR; it does not change RSA/DSA/DH mismatch errors.AES_unwrap_keyand its test registration; its CMake/debt edits concern a separate export.These are shared-file conflicts, not dependencies on unmerged implementations.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Pull request closed