feat(libSceLibreSsl3): implement EC_POINT_dup #17621
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17621"
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 GalaxyGamingFR on 2026-11-09T03:26:42Z.
What
Implement
EC_POINT_dupinlibSceLibreSsl3, replacing its parameterless throwing placeholder inAdditionalExports.cpp.ce488b78ec_lib.c, the revision the library's debt file already uses. Upstream returns NULL for a NULL source, makes a new point withEC_POINT_new(group)(NULL for a NULL group), copies the source into it withEC_POINT_copy, and frees it and returns NULL if the copy fails.EcPointandEcGroupbelong to libSceLibreSsl's mbedtls wrappers. The newsrc/EcPoint.cppdoes not touch their layout and does not includeEc.hpp. It only calls libSceLibreSsl's exportedEC_POINT_new,EC_POINT_point2oct,EC_POINT_oct2pointandEC_POINT_free: it queries the uncompressed size of the source, encodes it, and decodes the bytes into a new point of the group. The point at infinity goes through the same path as its one-byte encoding. If any step returns 0, the new point is freed and the export returns null.Api.hppnow declares it asEcPoint* EC_POINT_dup(const EcPoint* source, const EcGroup* group).NotImplemented_nid_no_patch) through libSceLibreSsl's same-curve check, like the other point functions. LibreSSL would copy it, since prime curves share one method. The size is queried before the new point is made, and the new point is held by aunique_ptr, so nothing leaks when that throws.The gaps are recorded in
docs/dev/debt/libSceLibreSsl3.md: the throw on another curve, and noERR_R_PASSED_NULL_PARAMETERqueued for a null group. The export inventory is updated (113 exports, 104 named).No title's trace or disassembly was used, and the export was not measured on a PS5.
Tested
Windows 11, WinLibs GCC 15.2.0 UCRT. This is not a full CMake build. I compiled the new
tests/EcPoint.cppwithsrc/EcPoint.cpp, libSceLibreSsl'sEc.cppand the3rdparty/mbedtlslibrary sources into one executable, withAPS5_VABIdefined empty, a one-lineNotImplementedAt_nid_no_patchthat throws, and a seededHostEntropy_nid_no_patchfor key generation. No title or homebrew, and not built on Linux or macOS.EC_POINT_point2oct.-Wall -Wextrais clean for the new files, andpython tools/check_conventions.py --base origin/mainpasses.I searched open and merged pull requests for
EC_POINT_dupjust before opening this one, and none implements it. #16586, #16588, #16589, #16848 and #16918 change the same export inventory count, so whichever lands later needs a one-line rebase.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)🤖 Generated with Claude Code
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T15:25:47Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and the reviewed tests support the described duplication behavior.
What I ran
Reviewed head
140e74c548224e2d9c09ec6798753ec0d981a7b9using the prepared diff and pinnedrepo_read.pysource context. I did not run commands or tests; the test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full build, CI results, Linux/macOS behavior, and PS5 behavior were not verified. I read all changed files listed as included in
manifest.json:AdditionalExports.cpp,CMakeLists.txt,include/Api.hpp,src/EcPoint.cpp,tests/EcPoint.cpp, anddocs/dev/debt/libSceLibreSsl3.md. No changed files were excluded in the manifest.files.jsonwas not available through the reader.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T08:47:20Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed implementation and focused tests show no verified blocking defect; I did not run the tests or build.
What I ran
Reviewed head
ba697eff0714fd1762739da816faf182b500a710using the prepared diff andrepo_read.pyto inspect the changed code and relevant callers. No build, test command, or merged-preview check was run by me.Results
Negative control
Not run by me. The description reports two deliberate mutations that failed the test; I did not independently verify them.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
I read the changed implementation, its tests, the debt note, and the relevant CMake and API diff ranges;
AdditionalExports.cppwas reviewed through its diff hunk only. I did not read the full CMake or API files. No tests or build were run by me, and Linux, macOS, and PS5 behavior remain unverified. The Windows test and convention-check results are author-reported.To get this to a good state
Nothing is required.