Repository navigation
feat(libSceLibreSsl3): implement TLS protocol list parsing - #15045
oneandonlydean merged 3 commits into
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
The parser and tests match the cited LibreSSL behavior on the cases reviewed, but this branch conflicts pairwise with two open LibreSSL3 PRs and has no agreed landing order recorded.
What I ran
Reviewed all six changed files at head 5f8125ab15cab7c1add289e86d46c11981e408ba against base 24238c4cb1a58e4ddb0596e68dc072e715f9bb17. The head merges cleanly onto that base by itself; pairwise previews with #14992 and #15031 conflict. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No build was run.
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15045
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 24238c4cb1a58e4ddb0596e68dc072e715f9bb17 --head 5f8125ab15cab7c1add289e86d46c11981e408ba --json
git merge-tree --write-tree --name-only --no-messages 5f8125ab15cab7c1add289e86d46c11981e408ba 376db33f6d29241aa5cfdf6cb710bc1e7f5e8683
git merge-tree --write-tree --name-only --no-messages 5f8125ab15cab7c1add289e86d46c11981e408ba 0743ac9ca7463eae4ee47957e6b0ec86903ef238Results
| Check | Result | Note |
|---|---|---|
| Diff and conventions | passed | No findings |
| Export audit | passed | No findings; lexical audit only |
| Individual merge preview | passed | Clean against current main |
| Pairwise integration | failed | Conflicts with #14992 and #15031 |
| Source and test review | passed | Parser follows cited grammar and masks |
| Local build and C++ tests | not run | Require a build |
| Hosted checks | not run | All six were queued |
| Optional precheck helpers | failed | Helpers absent from isolated checkout; ABI audit rerun passed |
Precheck summary and raw outputs
The precheck reported diff check, conventions and individual stack preview passed. Its ABI and test-quality helper scripts could not be opened from the isolated checkout. I reran the ABI audit directly:
{
"status": "passed",
"findings": []
}The convention checker printed:
All conventions checks passed.
The pairwise merge previews returned exit code 1 and listed these conflicts:
core/libs/prx/libSceLibreSsl3/CMakeLists.txt
docs/dev/debt/libSceLibreSsl3.md
They were tested against open PR #14992 at head 376db33f6d29241aa5cfdf6cb710bc1e7f5e8683 and open PR #15031 at head 0743ac9ca7463eae4ee47957e6b0ec86903ef238. Both PRs are individually clean against current main; the conflicts arise when combining them with this PR.
Negative control
| Assertion | Change to code under test | Result |
|---|---|---|
| Reject incorrect masks, output mutation on errors, and late output write | Author reports three separate source mutants | Not run by me; author reports all three made the fixture fail |
Findings
Blocking
The PR declares Depends on: none, but pairwise merge previews against open #14992 and #15031 both conflict in core/libs/prx/libSceLibreSsl3/CMakeLists.txt and docs/dev/debt/libSceLibreSsl3.md. The repository requires authors to agree which overlapping PR lands first and record the resulting dependency. Please coordinate the order across these PRs and reflect it in the applicable Depends on checklist entries; if #15045 is chosen to land first, record that order and update the dependent PRs instead. Then refresh the overlap/stack checks and resolve any resulting branch conflicts.
Non-blocking
No parser correctness defect was found in the reviewed diff. The implementation matches LibreSSL 4.0.0's leading space/tab trimming, ! exclusions, comma/colon separators, case-insensitive protocol names, default mask, and unchanged output on parse failure. The host C++ fixture is extensive and registered, but I did not run it.
Sources
- LibreSSL 4.0.0
tls_config_parse_protocolsat pinned commit and protocol masks intls.hat the same commit. - AnyPS5 overlap and dependency rule at this head.
- #14992 and #15031 are open peers whose exact heads were used in the pairwise previews.
Not verified
No local build, CTest, or mutation control was run. The PR description reports focused Linux and Windows tests and three passing negative controls; these remain author-reported. All six hosted checks were queued at the final snapshot. Console masks, protocol compatibility and TLS interoperability remain unverified, as the PR's debt note states.
To get this to a good state
Agree and record a landing order for #15045, #14992 and #15031, update applicable dependency declarations and resolve pairwise conflicts. I will rerun the no-build checks and inspect the updated heads; approval remains withheld until required hosted checks pass.
BunnyFl
left a comment
There was a problem hiding this comment.
Looks right, and the masks match the PS5 module, not only LibreSSL 4.0.0.
Against tls_config.c at ce488b78. strsep(",:") becomes find_first_of(",:"), and leading spaces and tabs are skipped. On !, an empty protos becomes TLS_PROTOCOLS_ALL before masking. An unknown or empty token returns -1 without writing. The upstream base reset happens before the name lookup and here after it, but since an invalid token returns without writing, the result is the same.
Against firmware 13.42's system/common/lib/libSceLibreSsl3.sprx (sha256 ee2c529c87fe21b7ef1e5f13d10c47ee90944f52a1f848fe0995e031817c2c3a), tls_config_parse_protocols (vu4FgwGayHY) at 0x10e8b0, disassembly only:
- A null string goes to
movl $0x18, (%r14)at0x10ea92, so the default is0x18. - The negation base and the
all/legacy/default/secure/tlsv1value aremov $0x18(0x10e945,0x10e9bc), and the explicit versions are2/4/8/0x10(0x10ea3a–0x10ea48,0x10ea22).
So the PS5 build uses the 4.0-era meaning (TLS 1.2/1.3 for all/tlsv1), not the older 3.x one where tlsv1 also set 1.0/1.1. The debt entry's "console masks unverified" could be narrowed accordingly. The module doesn't test the output pointer, so throwing on null is the documented divergence from a fault.
Tested on Windows 11, WinLibs GCC 15.2.0, Release, with head 5f8125ab15 merged onto main: guest_libressl3_tls_protocols, public_headers and check_conventions.py --base upstream/main pass.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Progress report (65ad958 → e377bbb)📈 System libraries: 28.73% (+0.01%, +1 implemented functions) ✅ 1 implemented
Changed libraries (implemented exports)
|
b67007c to
3f3eea1
Compare
3f3eea1 to
38cf274
Compare
|
Hi @atharvjairath, thanks for this PR. After the recent LibreSsl3 merges it conflicted with main, so I merged current main into the branch (a plain merge commit, no force-push). Your TLS protocol entries and CMake block sit next to the ones that landed on main, and the counts in the libSceLibreSsl3 debt notes are set for the merged tree. The libressl3 tests pass locally and the Windows build will rerun on the new head. |
What
tls_config_parse_protocolsnow parses comma- and colon-separated lists, mixed ASCII case, leading spaces and tabs, and exclusions. The default and aggregate mask is0x18. Explicit TLS 1.0, 1.1, 1.2 and 1.3 use bits 2, 4, 8 and 16. An exclusion reseeds an empty accumulator. On success the function writes the caller’s result before releasing the guest string. On invalid input or allocation failure it preserves the caller’s result. LibreSSL 4.0.0 parser · Protocol masksBunnyFl reported matching mask values from firmware 13.42 disassembly. Console execution, the full firmware grammar and TLS configuration integration remain open. Contributor’s disassembly report
The aggregate names all, legacy, default, secure and tlsv1 select the same mask. A null output pointer throws. The export identifier is vu4FgwGayHY.
The source scanner classifies 23/276 bodies as implemented on main and 24/276 on this branch. The difference is the 1 export above. The scanner classifies source bodies and does not measure firmware compatibility. The additional export inventory has 174 pending entries (164 named, 10 known only by NID).
Integration order is #14992 → #15031 → #15045 → #15119 → #15406. This branch is based directly on main
6d173c1a1978. Each branch keeps its own changes. The order allows the shared CMake registrations and debt counts to be reconciled after each merge.Tested
Validated head
38cf2740c751against main6d173c1a1978.The ownership callback fixture checks the parsed mask at release time. The earlier sequencing review still awaits re-review. Sequencing review
Both loader runs printed
TLS protocol parser: 7012 cases, 195206 checks, 6955 releases, zero live allocations.Earlier validation on 3f3eea1 and the historical commits cited below
Current refreshed head
3f3eea10c41e49d8f9e29fdd7521d895803c7d06on frozen maind1ae628bc2f62459cce1e9872ba5632c938c71f2. Only debt documentation conflicted. Every original owned production/API/CMake/fixture addition and deletion is preserved; upstream ASN1_TIME_diff and all main unions remain intact. Prior reviews and CI are pinned to older heads below.-j1), 12/12 passed in 35.82s.d1ae628integration, with full dependency-input equality and hashes retained. They were not rebuilt separately for each of these four PRs. The separate signature integration ran 44 Linux and 14 focused Windows tests; those are not this PR’s suite counts. This refresh does not rerun the separate parent/error-string/packaged protocol-NID groups.These are focused module tests, not independent native Windows, full-product, packaged-module/NID, title/homebrew or physical-console validation. Known unrelated Wine limitations remain unresolved; no assertion, timeout, gate or runtime workaround changed. The default-off oracle was not enabled. Warnings remain. No new native CI result or current approval is inferred from older heads.
Historical native Windows CI job125412612997/run41483840592 audited on main
b28bb772177768f99874ca38f6252cd0139acf2aplus OLD headb67007c7f6fb0d4f01894374dcdacefb7aca2bb3: 1,982 Passed / 954 Skipped / zero Failed across 2,936 unique rows, 118.24s; all 46 LibreSSL registrations including parser passed. Separate full-build/runtime/skip-audit/graph steps were skipped. It is pinned native CI unit/runtime evidence, not a run or approval of the refreshed head. Original local Linux 41/41 and Windows PE 11/11 at 5f8125/98346 and three rejected external mutation controls remain archived. BunnyFl’s old-head review reports firmware 13.42 mask disassembly and unspecified-main nativeWindows tests; the debt retains attribution, not independent console/native-local verification. MarcZX10’s change request is not dismissed or declared approved: sequencing and conflict handling are recorded, but re-review remains outstanding. No review request or reply was sent.Receipts:
/private/tmp/anyps5-advance-20261103-0127/conflict-refresh/15045and the sharedvalidation-evidence.tar.gz,common-input-equality.json,heads-rebased.json,manual-shared-review.txt,peers-finaland reproducible harness/scripts. Previous local/native evidence remains in the linked Nov2 receipts with its original pins.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)Overlap report before the branch refresh was pushed
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.
main)docs/dev/debt/libSceLibreSsl3.mdL35, L215docs/dev/debt/libSceLibreSsl3.mdL35docs/dev/debt/libSceLibreSsl3.mdL35core/libs/prx/libSceLibreSsl3/AdditionalExports.cppL668-672core/libs/prx/libSceLibreSsl3/include/Api.hppL293-294docs/dev/debt/libSceLibreSsl3.mdL35, L215docs/dev/debt/libSceLibreSsl3.mdL32, L35, L215tls_config_parse_protocolscore/libs/prx/libSceLibreSsl3/src/TlsProtocols.cppcore/libs/prx/libSceLibreSsl3/tests/TlsProtocols.cppdocs/dev/debt/libSceLibreSsl3.mdL35core/libs/prx/libSceLibreSsl3/include/Api.hppL294docs/dev/debt/libSceLibreSsl3.mdL35tls_config_parse_protocolsdocs/dev/debt/libSceLibreSsl3.mdL35, L215docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL35core/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/include/Api.hppL294-295docs/dev/debt/libSceLibreSsl3.mdL35, L201-202docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL31-32, L35docs/dev/debt/libSceLibreSsl3.mdL35docs/dev/debt/libSceLibreSsl3.mdL35docs/dev/debt/libSceLibreSsl3.mdL35Some 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.
core/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mddocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppcore/libs/prx/libSceLibreSsl3/src/TlsProtocols.cppcore/libs/prx/libSceLibreSsl3/tests/TlsProtocols.cppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppdocs/dev/debt/libSceLibreSsl3.mdcore/libs/prx/libSceLibreSsl3/CMakeLists.txt