Repository navigation
feat(libSceLibreSsl3): implement RSA_up_ref - #13267
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
The current overlap with #10490 leaves duplicate LibreSsl3Rsa definitions unless the landing order and resulting single declaration are coordinated.
What I ran
Reviewed #13267 head dd9cf1591b3f9858084f6ab152042d186945416b; its recorded base is dd6cb90fc6bfffdf0787a4d838e2ad4d0eacc209. Current main is 20d3cd84bc5a9f4a5b1f826cc678849187573d34; the head merges cleanly onto it. I also compared the open #10490 head ad00df544b5893dbe5f5db8ac5eabf9d008e735b with this branch. Environment: Debian 12, x86-64, Python 3.11.2, Git 2.39.5. No build or C++ tests were run locally.
git diff --check 20d3cd84bc5a9f4a5b1f826cc678849187573d34...dd9cf1591b3f9858084f6ab152042d186945416b
python3 tools/pr_precheck.py --base 20d3cd84bc5a9f4a5b1f826cc678849187573d34 --head refs/review/pr-13267 --title 'feat(libSceLibreSsl3): implement RSA_up_ref' --body-file /tmp/anyps5-pr-13267-body.md
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 20d3cd84bc5a9f4a5b1f826cc678849187573d34 --head dd9cf1591b3f9858084f6ab152042d186945416b --json
python3 /marc/AnyPS5/tools/pr_test_quality.py --root /tmp/AnyPS5-pr13267-review --json core/libs/tests/GuestLibreSsl3KeyReference.cpp
git merge-tree --write-tree 20d3cd84bc5a9f4a5b1f826cc678849187573d34 refs/review/pr-13267
git merge-tree --write-tree refs/review/pr-10490 refs/review/pr-13267Results
| Check | Result |
|---|---|
| Patch whitespace and conventions | Passed. |
| No-build precheck | Diff/conventions passed, but the report concluded checks failed because the isolated checkout lacks the local-only ABI and test-quality helper scripts. I ran those two focused helpers separately against this exact head. The initial GitHub-mode precheck could not complete because the live main advanced while the PR's recorded base remained dd6cb90f; I then ran local mode against current main. |
| ABI audit | Passed with no findings; lexical audit only, not a compile or runtime ABI proof. |
| Test-quality heuristic | Flagged the changed C++ test as possibly unregistered. Inspection confirms CMakeLists.txt registers GuestLibreSsl3KeyReference.cpp; the warning is a false positive. |
| Current-main merge preview | Clean tree 0d31a3a8c8fe089e0bc252a8980a88b07f9e8054. |
| #10490 integration preview | Textual conflict in docs/dev/debt/libSceLibreSsl3.md; the headers auto-merged. Inspection of the merged tree shows LibreSsl3Rsa defined in both Api.hpp and Key.hpp. No compilation was run. |
| Hosted CI | Intake passed. Conventions and labels were pending at the final refresh. |
| Tests | The PR description reports 69/69 tests on Ubuntu 22.04, but does not identify the tested head SHA; I did not independently run them. No local build/test. |
Unedited check output
Diff check produced no output.
Conventions:
All conventions checks passed.
ABI audit summary:
{
"status": "passed",
"findings": []
}Test-quality heuristic:
{
"findings": [
{
"path": "core/libs/tests/GuestLibreSsl3KeyReference.cpp",
"line": 1,
"kind": "possible-unregistered-cpp-test",
"message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
}
],
"negative_control_candidates": [],
"limits": [
"Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
"A test that passes against base is not by itself proof that the PR test is inadequate.",
"Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
]
}Precheck output:
/tmp/anyps5-pr-precheck/local-dd9cf1591b3f/report.md
/tmp/anyps5-pr-precheck/local-dd9cf1591b3f/report.json
Conclusion: checks failed
Current-main merge preview:
0d31a3a8c8fe089e0bc252a8980a88b07f9e8054
Pairwise #10490/#13267 merge preview:
11d36c14e34b4742cfb799be2173cec1a8d97e00
100644 6607b4c8c56a85734d17bae9b2c8243d066f9e51 1 docs/dev/debt/libSceLibreSsl3.md
100644 ac168efdaf96b049aec1891098533256c6863045 2 docs/dev/debt/libSceLibreSsl3.md
100644 47310c5e30d9e8f192c1045aecc5a385fd0903dc 3 docs/dev/debt/libSceLibreSsl3.md
Auto-merging core/libs/prx/libSceLibreSsl3/CMakeLists.txt
Auto-merging core/libs/prx/libSceLibreSsl3/Export.cpp
Auto-merging core/libs/prx/libSceLibreSsl3/include/Api.hpp
Auto-merging docs/dev/debt/libSceLibreSsl3.md
CONFLICT (content): Merge conflict in docs/dev/debt/libSceLibreSsl3.md
Findings
Blocking
#10490's current Api.hpp includes Key.hpp and then defines LibreSsl3Rsa; #13267 adds another definition of the same type to Key.hpp. The two heads therefore produce a duplicate type definition when integrated, even though their individual branches are each mergeable. The PR description recognizes that whichever change lands second must retain the named fields, but neither PR currently declares the agreed order. Please coordinate the order with #10490's author, keep the type defined in one header in the resulting branch, and declare the dependency on the checklist of the PR that follows, as CONTRIBUTING.md requires.
Non-blocking
No additional confirmed findings in the RSA_up_ref implementation or its reference-count tests.
Sources
- #13267
LibreSsl3Rsadefinition at its reviewed head. - #10490
Api.hppincludesKey.hppand defines the same type at its current head. - Repository overlap and dependency rule at current
main. - CMake registration for the changed test at #13267's head.
Not verified
No local build, C++ test run, Windows or Linux runtime test, title/homebrew run, or PS5 console behavior. The hosted Windows/product checks were not present in the current check snapshot. The broad pr_overlap.py scan was interrupted; the known overlap with #10490 was inspected directly.
To get this to a good state
Coordinate and declare the landing order with #10490, remove the duplicate LibreSsl3Rsa definition from the second branch while preserving the named fields needed by RSA_up_ref, and obtain fresh CI. I will rerun the same relevant checks on the updated head.
|
Windows run of this head (
AI-assisted: yes (Claude Code). |
dd9cf15 to
f1f3ba8
Compare
|
@JJenkx thanks for the Windows run; it is linked in the description. The rebased head |
|
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.
|
|
@MarcZX10 thanks, addressed point by point on head
|
|
Checked the |
What
Implements
RSA_up_ref(NIDjmDcorQ80dY) in libSceLibreSsl3.LibreSsl3Rsaininclude/Key.hppfollows the LibreSSL 4.0.0rsa_stlayout: 152 bytes,referencesat offset 104. Unlike libSceLibreSsl'sLibreSslRsa, it has noenginefield and haspssafteriqmp.Retain_nid_no_patchhelper used byEVP_PKEY_up_refandEC_KEY_up_ref: an atomic increment that returnsprevious > 0, matching LibreSSL'sCRYPTO_add(&r->references, 1, ...) > 1in rsa_lib.c. A null key and a count already atINT32_MAXthrow without mutation.Export.cppand the declaration inApi.hpptakesLibreSsl3Rsa*.guest_libressl3_key_referencegains anrsacase, and its shared check now also covers the overflow and null throws for all three retains.EVP_PKEY_up_ref/EC_KEY_up_refdebt entry is extended to RSA: the console layout and retain/release interoperability remain unverified.Overlap: #10490 also defines
LibreSsl3RsainApi.hppwith the same 152-byte layout, collapsing the fields afteriqmpintounsigned char rest[64]. Landing order, agreed with @alvaroelpob: #10490 first. After it merges, this PR rebases, drops its ownLibreSsl3RsafromKey.hpp, and replaces #10490'sunsigned char rest[64]with the named fields afteriqmp(pss,extraData,references,flags,methodModN,methodModP,methodModQ,blinding,mtBlinding), so one definition remains.static_assert(offsetof(LibreSsl3Rsa, references) == 104)moves tosrc/Key.cpp, next to #10490's size and offset checks inKeyComponents.cpp. That version is prepared on #10490 head16858710b4(commit4ca49b48a2): conventions pass, and all libSceLibreSsl3 tests pass on it, including #10490'sguest_libressl3_key_components. The branch is updated once #10490 is inmain.Tested
Ubuntu 22.04, GCC 11.4.0, Release build with
BUILD_TESTING=ON, headf1f3ba8ed4onmain3bc58629fb(same patch-id as the earlier headdd9cf1591b). No title tested.ctest --test-dir build -R "guest_libressl3|guest_crypto_memcmp|^public_headers": 69/69 passed (guest_libressl3_key_reference0.01 s,public_headersand all 64public_headers_compile_*batches).python3 -I tools/check_conventions.py --base origin/main --head HEAD: all checks passed;git diff --checkclean.guest_libressl3_key_reference3/3 ondd9cf1591b, run by @JJenkx.RSA_up_refinsrc/Key.cppmutated,guest_libressl3_key_reference_tests rsa:flagsinstead ofreferencesretain changed bytes outside reference countretain return valueINT32_MAXcheck (fetch_add)retain at maximum count did not throwatomic_refconcurrent count or adjacent bytes changed, 20/20 runsChecklist
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)