feat(libSceLibreSsl): implement EC groups and keys for named curves #10395

Merged
MatteoSid merged 2 commits from upstream-pr/10395 into main 2026-11-04 17:35:13 +00:00
MatteoSid commented 2026-10-23 21:06:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MatteoSid on 2026-10-23T21:06:37Z.


What

Implements nine libSceLibreSsl exports that were throwing NotImplemented: EC_GROUP_new_by_curve_name, EC_GROUP_free, EC_GROUP_get_degree, EC_KEY_new, EC_KEY_new_by_curve_name, EC_KEY_free, EC_KEY_set_group, EC_KEY_get0_group and ECDSA_size.

  • Signatures and results follow LibreSSL 2.5.4, the version identified in the 13.40 measurements the debt file already cites: ec/ec_curve.c, ec/ec_lib.c, ec/ec_key.c and ecdsa/ecs_lib.c at 2e2c612.
  • EC_GROUP and EC_KEY are opaque in LibreSSL (defined in ec_lcl.h), so they are host objects. A group holds an mbedtls_ecp_group from the mbedtls submodule (3.6.7, already linked as mbedcrypto), which the remaining EC_KEY, EC_POINT and ECDSA exports can build on. Api.hpp declares them as opaque EcGroup and EcKey with the exports' signatures; their layout is in the internal include/Ec.hpp, which only Ec.cpp and tests include, so the umbrella header does not pull in mbedtls.
  • mbedtls provides 11 of the 90 curves in LibreSSL's curve_list: NIDs 409 (prime192v1), 415 (prime256v1), 711 to 716 (secp192k1, secp224k1, secp224r1, secp256k1, secp384r1, secp521r1) and LibreSSL's brainpoolP256r1, P384r1 and P512r1 (928, 932, 934, not OpenSSL's 927, 931, 933). The other 79 members of the list (binary, WTLS, GOST, twisted brainpool and small prime curves; 2.5.4's opensslfeatures.h keeps EC2M and GOST enabled) throw. Any other NID returns null, as EC_GROUP_new_by_curve_name does.
  • EC_GROUP_get_degree returns the field size in bits (mbedtls pbits), which is BN_num_bits(p) in LibreSSL's GFp method.
  • ECDSA_size repeats LibreSSL's computation: a DER INTEGER as long as the order with its top bit assumed set, twice, inside a SEQUENCE. That is 72 for P-256 and 141 for P-521 (2.5.4's bound, not the 139 later OpenSSL versions return).
  • EC_KEY_set_group stores a copy; a null group drops the previous one and returns 0, as EC_GROUP_dup(NULL) makes it do.
  • libSceLibreSsl3 forwards EC_KEY_new, EC_KEY_new_by_curve_name and EC_KEY_free to this library, while its EC_KEY_up_ref(LibreSsl3EcKey*) increments the counter at offset 48 of LibreSSL 4.0.0's 64-byte EC_KEY (ec/ec_local.h, the source main's libSceLibreSsl3 debt entry cites). On the 8-byte key the first commit adds, that write lands past its end. The second commit, co-authored by ahmadmuj from b499692115a2 in #11146, gives EcKey that layout instead, with 2.5.4 EC_KEY_new's defaults (version 1, POINT_CONVERSION_UNCOMPRESSED): the group in its group slot and an atomic reference count at offset 48, starting at one; Ec.hpp asserts standard layout, size 64 and offset 48. EC_KEY_free decrements that count and frees the key at zero or below, as 2.5.4's ec_key.c does. libSceLibreSsl3's interface, LibreSsl3EcKey and code are unchanged; only its key-reference test changes.

Gaps, in the debt entry: no EC_R_UNKNOWN_GROUP is queued, a key holds no keys and no export reads its conversion form or flags until the other EC_KEY and EC_POINT exports exist, the lifetime shared with libSceLibreSsl3 is not checked on the console (maskym ran both tests on Windows on head 85f2f2b514), and null groups and keys throw where LibreSSL dereferences them. The pending-exports count goes from 231 to 222.

Tested

Linux (Ubuntu 24.04 container, GCC 13.3), full configure with -DBUILD_TESTING=ON, Release: built libSceLibreSsl, libSceLibreSsl3, their patched .prx files and the fifty-three LibreSSL tests; ctest -R 'libressl|crypto_memcmp|public_headers' passes 118 of 118 (the fifty-three LibreSSL tests, public_headers and its 64 compile checks) on head 9327713d3a, based on main 4f41f4c375. The new guest_libressl_ec checks the degree and ECDSA_size of all 11 curves through both constructors, null for 10 unknown NIDs, EC_KEY_set_group with a copy, a replacement, the key's own group and null, and null arguments. It fails when secp224k1 is mapped to mbedtls's secp224r1. guest_libressl3_key_reference keeps main's caller-owned layout checks, asserts that EcKey and LibreSsl3EcKey have the same size and counter offset, checks that keys from both constructors start with version 1, conversion form 4 and the method, keys, encoding flags, flags and extra data cleared (it fails when both defaults are zero), and retains them through libSceLibreSsl3's EC_KEY_up_ref, frees one reference and balances 4,000 concurrent retain and free pairs; built with AddressSanitizer and leak detection it is clean, and it reports the 64-byte keys as leaked when EC_KEY_free skips the delete. nm -D on the patched libSceLibreSsl.prx lists the nine NIDs. tools/check_conventions.py --base origin/main passes; tools/pr_overlap.py --branch feat/libressl-ec-groups-keys on 9327713d3a: the only open PRs with the same exports or new files are #11146 and #11466, which contain this PR's earlier commits and depend on it; #11146 carries the earlier lifetime fix in b499692115a2. The line overlaps are, in libSceLibreSsl, the add_library source list, the test block and the pending count, which every libSceLibreSsl PR edits; in libSceLibreSsl3, the retain debt entry, which #12754 also edits, and the end of GuestLibreSsl3KeyReference.cpp, where #14499 adds its EVP_PKEY_get0_EC_KEY test. #9448 landed first, as agreed, and #9571 since; this head keeps their sources and debt entries next to this PR's and recounts the stubs. With the others, whichever is merged later only rebases those lines. No title tested.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4989261975 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395). Originally posted by [MatteoSid](https://github.com/MatteoSid) on 2026-10-23T21:06:37Z. --- ### What Implements nine libSceLibreSsl exports that were throwing `NotImplemented`: `EC_GROUP_new_by_curve_name`, `EC_GROUP_free`, `EC_GROUP_get_degree`, `EC_KEY_new`, `EC_KEY_new_by_curve_name`, `EC_KEY_free`, `EC_KEY_set_group`, `EC_KEY_get0_group` and `ECDSA_size`. - Signatures and results follow LibreSSL 2.5.4, the version identified in the [13.40 measurements](https://github.com/boykopovar/AnyPS5/discussions/8981#discussioncomment-19111214) the debt file already cites: `ec/ec_curve.c`, `ec/ec_lib.c`, `ec/ec_key.c` and `ecdsa/ecs_lib.c` at [2e2c612](https://github.com/libressl/openbsd/tree/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto). - `EC_GROUP` and `EC_KEY` are opaque in LibreSSL (defined in `ec_lcl.h`), so they are host objects. A group holds an `mbedtls_ecp_group` from the mbedtls submodule (3.6.7, already linked as `mbedcrypto`), which the remaining `EC_KEY`, `EC_POINT` and `ECDSA` exports can build on. `Api.hpp` declares them as opaque `EcGroup` and `EcKey` with the exports' signatures; their layout is in the internal `include/Ec.hpp`, which only `Ec.cpp` and tests include, so the umbrella header does not pull in mbedtls. - mbedtls provides 11 of the 90 curves in LibreSSL's `curve_list`: NIDs 409 (prime192v1), 415 (prime256v1), 711 to 716 (secp192k1, secp224k1, secp224r1, secp256k1, secp384r1, secp521r1) and LibreSSL's brainpoolP256r1, P384r1 and P512r1 (928, 932, 934, not OpenSSL's 927, 931, 933). The other 79 members of the list (binary, WTLS, GOST, twisted brainpool and small prime curves; 2.5.4's `opensslfeatures.h` keeps EC2M and GOST enabled) throw. Any other NID returns null, as `EC_GROUP_new_by_curve_name` does. - `EC_GROUP_get_degree` returns the field size in bits (mbedtls `pbits`), which is `BN_num_bits(p)` in LibreSSL's GFp method. - `ECDSA_size` repeats LibreSSL's computation: a DER INTEGER as long as the order with its top bit assumed set, twice, inside a SEQUENCE. That is 72 for P-256 and 141 for P-521 (2.5.4's bound, not the 139 later OpenSSL versions return). - `EC_KEY_set_group` stores a copy; a null group drops the previous one and returns 0, as `EC_GROUP_dup(NULL)` makes it do. - libSceLibreSsl3 forwards `EC_KEY_new`, `EC_KEY_new_by_curve_name` and `EC_KEY_free` to this library, while its `EC_KEY_up_ref(LibreSsl3EcKey*)` increments the counter at offset 48 of LibreSSL 4.0.0's 64-byte `EC_KEY` (`ec/ec_local.h`, the source main's libSceLibreSsl3 debt entry cites). On the 8-byte key the first commit adds, that write lands past its end. The second commit, co-authored by ahmadmuj from `b499692115a2` in #11146, gives `EcKey` that layout instead, with 2.5.4 `EC_KEY_new`'s defaults (version 1, `POINT_CONVERSION_UNCOMPRESSED`): the group in its `group` slot and an atomic reference count at offset 48, starting at one; `Ec.hpp` asserts standard layout, size 64 and offset 48. `EC_KEY_free` decrements that count and frees the key at zero or below, as 2.5.4's `ec_key.c` does. libSceLibreSsl3's interface, `LibreSsl3EcKey` and code are unchanged; only its key-reference test changes. Gaps, in the debt entry: no `EC_R_UNKNOWN_GROUP` is queued, a key holds no keys and no export reads its conversion form or flags until the other `EC_KEY` and `EC_POINT` exports exist, the lifetime shared with libSceLibreSsl3 is not checked on the console (maskym ran both tests on Windows on head `85f2f2b514`), and null groups and keys throw where LibreSSL dereferences them. The pending-exports count goes from 231 to 222. ### Tested Linux (Ubuntu 24.04 container, GCC 13.3), full configure with `-DBUILD_TESTING=ON`, Release: built `libSceLibreSsl`, `libSceLibreSsl3`, their patched `.prx` files and the fifty-three LibreSSL tests; `ctest -R 'libressl|crypto_memcmp|public_headers'` passes 118 of 118 (the fifty-three LibreSSL tests, `public_headers` and its 64 compile checks) on head `9327713d3a`, based on `main` `4f41f4c375`. The new `guest_libressl_ec` checks the degree and `ECDSA_size` of all 11 curves through both constructors, null for 10 unknown NIDs, `EC_KEY_set_group` with a copy, a replacement, the key's own group and null, and null arguments. It fails when secp224k1 is mapped to mbedtls's secp224r1. `guest_libressl3_key_reference` keeps main's caller-owned layout checks, asserts that `EcKey` and `LibreSsl3EcKey` have the same size and counter offset, checks that keys from both constructors start with version 1, conversion form 4 and the method, keys, encoding flags, flags and extra data cleared (it fails when both defaults are zero), and retains them through libSceLibreSsl3's `EC_KEY_up_ref`, frees one reference and balances 4,000 concurrent retain and free pairs; built with AddressSanitizer and leak detection it is clean, and it reports the 64-byte keys as leaked when `EC_KEY_free` skips the `delete`. `nm -D` on the patched `libSceLibreSsl.prx` lists the nine NIDs. `tools/check_conventions.py --base origin/main` passes; `tools/pr_overlap.py --branch feat/libressl-ec-groups-keys` on `9327713d3a`: the only open PRs with the same exports or new files are #11146 and #11466, which contain this PR's earlier commits and depend on it; #11146 carries the earlier lifetime fix in `b499692115a2`. The line overlaps are, in libSceLibreSsl, the `add_library` source list, the test block and the pending count, which every libSceLibreSsl PR edits; in libSceLibreSsl3, the retain debt entry, which #12754 also edits, and the end of `GuestLibreSsl3KeyReference.cpp`, where #14499 adds its `EVP_PKEY_get0_EC_KEY` test. #9448 landed first, as agreed, and #9571 since; this head keeps their sources and debt entries next to this PR's and recounts the stubs. With the others, whichever is merged later only rebases those lines. No title tested. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-23 23:52:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T23:52:38Z.

Review: APPROVED


Reviewed the full diff at 0ea7483291f4699d77ed683409da182df4f9d096 against the pinned LibreSSL 2.5.4 EC and ECDSA sources cited in the PR. The curve mappings, copy semantics for EC_KEY_set_group, field-degree result, and DER size calculation match the reference for the implemented subset. The behavior is explicit for curves not supplied by mbedtls versus unrecognized NIDs, and the tests cover known, unsupported, and unknown values plus null/group replacement cases.

I independently built the PR's mbedtls submodule's mbedcrypto, compiled the exact Ec.cpp and GuestLibreSslEc.cpp with a throwing NotImplemented_nid_no_patch test stub, and ran the harness successfully. This checks the implementation and its direct test harness, not the packaged .prx/NID path or full AnyPS5 build. Current hosted checks pass conventions, intake and labels; the PR reports its full Linux build and seven focused tests. I found no blocking issue.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5635639069 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5635639069). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T23:52:38Z. **Review:** APPROVED --- Reviewed the full diff at `0ea7483291f4699d77ed683409da182df4f9d096` against the pinned LibreSSL 2.5.4 EC and ECDSA sources cited in the PR. The curve mappings, copy semantics for `EC_KEY_set_group`, field-degree result, and DER size calculation match the reference for the implemented subset. The behavior is explicit for curves not supplied by mbedtls versus unrecognized NIDs, and the tests cover known, unsupported, and unknown values plus null/group replacement cases. I independently built the PR's mbedtls submodule's `mbedcrypto`, compiled the exact `Ec.cpp` and `GuestLibreSslEc.cpp` with a throwing `NotImplemented_nid_no_patch` test stub, and ran the harness successfully. This checks the implementation and its direct test harness, not the packaged `.prx`/NID path or full AnyPS5 build. Current hosted checks pass conventions, intake and labels; the PR reports its full Linux build and seven focused tests. I found no blocking issue.
ahmadmuj commented 2026-10-25 18:08:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-10-25T18:08:38Z.

Review: APPROVED


Reviewed head fdf6acfc47cec37ab48c7cb10aede877c5e13c41 merged onto main 7a25f87620a9b862dc194dd0f659686b0f6cc8b0 (clean merge). Linux, GCC 13.3, Release.

What I ran:

  • ctest -R 'libressl|crypto_memcmp|public_headers' on the merged tree: 77/77 pass. guest_libressl_ec 3/3 with --repeat until-fail:3.
  • Red checks: mapping 712 to MBEDTLS_ECP_DP_SECP224R1, or dropping the top-bit pad byte in ECDSA_size, makes guest_libressl_ec fail on ECDSA_size.
  • tools/check_conventions.py --base origin/main passes. The 9 symbols come from Ec.cpp.o, and only those 9 stubs left Export.cpp.
  • A differential against a real LibreSSL 2.5.4 libcrypto, built from the release tarball (SHA256 matches the OpenBSD SHA256 file). It calls EC_GROUP_new_by_curve_name, EC_KEY_new_by_curve_name, EC_GROUP_get_degree and ECDSA_size for NIDs -1, 0 to 1200 and 100000.
    • 2.5.4 returns a group for exactly 90 NIDs, the same set as EC_get_builtin_curves. Your 11 mapped NIDs plus the CurvesMissingFromMbedtls ranges equal that set exactly. No curve NID falls through to null, and no NID outside the list throws.
    • Degree and ECDSA_size match your test table for all 11 curves (712 gives 66, 716 gives 141, 934 gives 137). The brainpool r1 NIDs are 928, 932 and 934 (OBJ_sn2nid).
    • All 10 UnknownNids return null in 2.5.4.
    • EC_KEY_new has no group and ECDSA_size 0. EC_KEY_set_group copies, replaces, and with null returns 0 and leaves no group. ECDSA_size(NULL) is 0. All match.

The CurvesMissingFromMbedtls test loop oneandonlydean asked about is gone on this head. The production throw and its debt entry stay.

One non-blocking suggestion, fine as a follow-up: main now has the error queue (LibreSslPutError_nid_no_patch in include/Error.hpp). So the EC_R_UNKNOWN_GROUP gap in the debt entry can be closed with one call. In 2.5.4, EC_GROUP_new_by_curve_name(406) followed by ERR_get_error() gives 0x10fff081 (ECerror(EC_R_UNKNOWN_GROUP), library 16, function 0xfff, reason 129). NIDs <= 0 queue nothing. With this PR the queue stays empty. Something like if (nid > 0) LibreSslPutError_nid_no_patch(16, 0xfff, 129); before return nullptr; in NewGroup would match. Then the debt line and the "no export of this library adds an error yet" line in the ERR entry would need updating.

LGTM. Not checked on a console.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5644563696 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5644563696). Originally posted by [ahmadmuj](https://github.com/ahmadmuj) on 2026-10-25T18:08:38Z. **Review:** APPROVED --- Reviewed head `fdf6acfc47cec37ab48c7cb10aede877c5e13c41` merged onto main `7a25f87620a9b862dc194dd0f659686b0f6cc8b0` (clean merge). Linux, GCC 13.3, Release. What I ran: - `ctest -R 'libressl|crypto_memcmp|public_headers'` on the merged tree: 77/77 pass. `guest_libressl_ec` 3/3 with `--repeat until-fail:3`. - Red checks: mapping 712 to `MBEDTLS_ECP_DP_SECP224R1`, or dropping the top-bit pad byte in `ECDSA_size`, makes `guest_libressl_ec` fail on `ECDSA_size`. - `tools/check_conventions.py --base origin/main` passes. The 9 symbols come from `Ec.cpp.o`, and only those 9 stubs left `Export.cpp`. - A differential against a real LibreSSL 2.5.4 libcrypto, built from the release tarball (SHA256 matches the OpenBSD `SHA256` file). It calls `EC_GROUP_new_by_curve_name`, `EC_KEY_new_by_curve_name`, `EC_GROUP_get_degree` and `ECDSA_size` for NIDs -1, 0 to 1200 and 100000. - 2.5.4 returns a group for exactly 90 NIDs, the same set as `EC_get_builtin_curves`. Your 11 mapped NIDs plus the `CurvesMissingFromMbedtls` ranges equal that set exactly. No curve NID falls through to null, and no NID outside the list throws. - Degree and `ECDSA_size` match your test table for all 11 curves (712 gives 66, 716 gives 141, 934 gives 137). The brainpool r1 NIDs are 928, 932 and 934 (`OBJ_sn2nid`). - All 10 `UnknownNids` return null in 2.5.4. - `EC_KEY_new` has no group and `ECDSA_size` 0. `EC_KEY_set_group` copies, replaces, and with null returns 0 and leaves no group. `ECDSA_size(NULL)` is 0. All match. The `CurvesMissingFromMbedtls` test loop oneandonlydean asked about is gone on this head. The production throw and its debt entry stay. One non-blocking suggestion, fine as a follow-up: main now has the error queue (`LibreSslPutError_nid_no_patch` in `include/Error.hpp`). So the `EC_R_UNKNOWN_GROUP` gap in the debt entry can be closed with one call. In 2.5.4, `EC_GROUP_new_by_curve_name(406)` followed by `ERR_get_error()` gives `0x10fff081` (`ECerror(EC_R_UNKNOWN_GROUP)`, library 16, function 0xfff, reason 129). NIDs <= 0 queue nothing. With this PR the queue stays empty. Something like `if (nid > 0) LibreSslPutError_nid_no_patch(16, 0xfff, 129);` before `return nullptr;` in `NewGroup` would match. Then the debt line and the "no export of this library adds an error yet" line in the ERR entry would need updating. LGTM. Not checked on a console.
MarcZX10 commented 2026-10-28 22:13:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T22:13:08Z.

Review: CHANGES_REQUESTED


Reviewing exact head b2e992430900f6812e6d7ef48321cf9af3227a88.

What I ran

  • Inspected the implementation, curve mapping and regression, prior LibreSSL 2.5.4 differential review, current PR metadata, and hosted checks.
  • Compared the PR's last documented main sync 3a40945e62 with current main 319621ba2e; main has since changed this PR's CMakeLists.txt, Export.cpp, Api.hpp, and debt file.
  • Hosted conventions and labels pass. No hosted build or test job ran for this head.
  • I did not run a local build or tests.

Results

Check Result Evidence
Curve mapping and API behavior Reviewed Exact PR diff and prior independent LibreSSL differential
Linux focused LibreSSL tests Pass, author-reported Earlier tested tree
Windows focused test Pass, independent reviewer-reported Earlier tested tree
Hosted conventions and labels Pass GitHub Actions
Current-main integration Not verified Current main changed overlapping production/debt/build files after last sync
Hosted build and tests Not run Current GitHub checks
Local build and tests Not run This review

Findings

Blocking

  • Please merge current main before approval. Since the PR's last recorded integration, main changed the same build source list, export declarations/implementations, and debt file this change edits. The current review therefore lacks evidence that the exact head still builds and retains both main's landed LibreSSL changes and this implementation.
  • Recount the pending-export line after that integration. The recent main changes to Export.cpp alter the count, and the PR's current description reports the earlier count.

Non-blocking

  • The source reference is pinned to LibreSSL 2.5.4, and the independent review reports a differential across the supported curve NIDs, degrees, ECDSA size, and unknown NIDs. The remaining error-queue behavior for unsupported named curves is explicitly documented as debt and can be handled in a follow-up as the discussion proposes.
  • Preserve the textual CMake and debt-entry edits from the other open LibreSSL PRs when integrating.

Sources

Not verified

  • I did not locally build the library or run CTest.
  • The Linux and Windows test results and LibreSSL differential are from prior PR participants; current hosted CI did not run a build.

To get this to a good state

Merge current main, update the pending-export count, rerun the focused LibreSSL tests on the resulting head, and request a re-review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5690387081 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5690387081). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T22:13:08Z. **Review:** CHANGES_REQUESTED --- Reviewing exact head `b2e992430900f6812e6d7ef48321cf9af3227a88`. ## What I ran - Inspected the implementation, curve mapping and regression, prior LibreSSL 2.5.4 differential review, current PR metadata, and hosted checks. - Compared the PR's last documented main sync `3a40945e62` with current main `319621ba2e`; main has since changed this PR's `CMakeLists.txt`, `Export.cpp`, `Api.hpp`, and debt file. - Hosted conventions and labels pass. No hosted build or test job ran for this head. - I did not run a local build or tests. ## Results | Check | Result | Evidence | |---|---|---| | Curve mapping and API behavior | Reviewed | Exact PR diff and prior independent LibreSSL differential | | Linux focused LibreSSL tests | Pass, author-reported | Earlier tested tree | | Windows focused test | Pass, independent reviewer-reported | Earlier tested tree | | Hosted conventions and labels | Pass | GitHub Actions | | Current-main integration | Not verified | Current main changed overlapping production/debt/build files after last sync | | Hosted build and tests | Not run | Current GitHub checks | | Local build and tests | Not run | This review | ## Findings ### Blocking - Please merge current main before approval. Since the PR's last recorded integration, main changed the same build source list, export declarations/implementations, and debt file this change edits. The current review therefore lacks evidence that the exact head still builds and retains both main's landed LibreSSL changes and this implementation. - Recount the pending-export line after that integration. The recent main changes to `Export.cpp` alter the count, and the PR's current description reports the earlier count. ### Non-blocking - The source reference is pinned to LibreSSL 2.5.4, and the independent review reports a differential across the supported curve NIDs, degrees, ECDSA size, and unknown NIDs. The remaining error-queue behavior for unsupported named curves is explicitly documented as debt and can be handled in a follow-up as the discussion proposes. - Preserve the textual CMake and debt-entry edits from the other open LibreSSL PRs when integrating. ## Sources - [Repository build and contribution rules](https://github.com/boykopovar/AnyPS5/blob/main/AGENTS.md) - [Current pull request and independent LibreSSL differential](https://github.com/boykopovar/AnyPS5/pull/10395) ## Not verified - I did not locally build the library or run CTest. - The Linux and Windows test results and LibreSSL differential are from prior PR participants; current hosted CI did not run a build. ## To get this to a good state Merge current main, update the pending-export count, rerun the focused LibreSSL tests on the resulting head, and request a re-review.
MarcZX10 commented 2026-10-28 23:57:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T23:57:00Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested for current-main base

The prior export-count and integration findings are addressed, and the reported LibreSSL tests are strong; this branch still needs the current base required by the contribution guide.

What I ran

  • Reviewed head d450bbcc78de2c560c0a62a0f8bf80d5520c0581; current main is 3a2b91981651569163768854a1fcdc7193b6667b.
  • git merge-tree --write-tree upstream/main upstream/pr-10395 — clean preview, tree ff6c2a2b1d2b53d16739ae606adbb7d395d4159f.
  • git diff --check upstream/main...upstream/pr-10395 — passed.
  • python3 tools/check_conventions.py --base upstream/main --head upstream/pr-10395 — passed.
  • I did not rerun CTest locally. The author reports the libSceLibreSsl, libSceLibreSsl3, patched PRX builds and 99 focused tests passing on this head's earlier base 319621ba2e.

Results

Check Result
Current-main merge preview Clean
Convention and whitespace checks Passed
Pending-export count Updated to 300 on main and 291 remaining with the implementation
Author-reported focused tests 99/99 pass on the reported tree
Branch base 319621ba2e578bd053b0baba2877fe70520e0737; current main is newer

Findings

The earlier integration and count issues are resolved. Current main has not changed any of the seven files touched by this PR since 319621ba2e, and I found no new code issue in the current merge preview.

CONTRIBUTING.md requires branches to stay up to date with main. Please rebase onto 3a2b91981651569163768854a1fcdc7193b6667b and rerun the focused ctest -R 'libressl|crypto_memcmp|public_headers' checks on the resulting tree. The preview is clean, but the branch and test run are not yet on the required current base.

Sources

Not verified

I did not locally build LibreSSL, run CTest, or verify console behavior. The test results above are attributed to the author.

To get this to a good state

Rebase onto current main, rerun the focused test command above, and request a re-review with the exact head and output.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5691220531 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5691220531). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T23:57:00Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested for current-main base The prior export-count and integration findings are addressed, and the reported LibreSSL tests are strong; this branch still needs the current base required by the contribution guide. ## What I ran - Reviewed head `d450bbcc78de2c560c0a62a0f8bf80d5520c0581`; current `main` is `3a2b91981651569163768854a1fcdc7193b6667b`. - `git merge-tree --write-tree upstream/main upstream/pr-10395` — clean preview, tree `ff6c2a2b1d2b53d16739ae606adbb7d395d4159f`. - `git diff --check upstream/main...upstream/pr-10395` — passed. - `python3 tools/check_conventions.py --base upstream/main --head upstream/pr-10395` — passed. - I did not rerun CTest locally. The author reports the `libSceLibreSsl`, `libSceLibreSsl3`, patched PRX builds and 99 focused tests passing on this head's earlier base `319621ba2e`. ## Results | Check | Result | |---|---| | Current-main merge preview | Clean | | Convention and whitespace checks | Passed | | Pending-export count | Updated to 300 on main and 291 remaining with the implementation | | Author-reported focused tests | 99/99 pass on the reported tree | | Branch base | `319621ba2e578bd053b0baba2877fe70520e0737`; current `main` is newer | ## Findings The earlier integration and count issues are resolved. Current `main` has not changed any of the seven files touched by this PR since `319621ba2e`, and I found no new code issue in the current merge preview. `CONTRIBUTING.md` requires branches to stay up to date with `main`. Please rebase onto `3a2b91981651569163768854a1fcdc7193b6667b` and rerun the focused `ctest -R 'libressl|crypto_memcmp|public_headers'` checks on the resulting tree. The preview is clean, but the branch and test run are not yet on the required current base. ## Sources - [Current PR head](https://github.com/boykopovar/AnyPS5/commit/d450bbcc78de2c560c0a62a0f8bf80d5520c0581) - [Author's focused test report](https://github.com/boykopovar/AnyPS5/pull/10395#issuecomment-6482073663) - [Contribution rule on keeping branches current](https://github.com/boykopovar/AnyPS5/blob/3a2b91981651569163768854a1fcdc7193b6667b/CONTRIBUTING.md#L60) ## Not verified I did not locally build LibreSSL, run CTest, or verify console behavior. The test results above are attributed to the author. ## To get this to a good state Rebase onto current `main`, rerun the focused test command above, and request a re-review with the exact head and output.
MarcZX10 commented 2026-10-29 10:39:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T10:39:47Z.

Review: CHANGES_REQUESTED


Review of the requested head

I checked exact head 6819348ad03549f37292a3cc5ef87ce458d615aa against live main 1db077e876. The PR's current-main merge preview is clean and git diff --check passes. The author reports 99/99 focused LibreSSL, crypto and public-header tests on this exact head, plus a negative control for the curve mapping. I did not run a local build or test.

Blocking: overlap order with #9448 is not declared

The PR body notes shared CMakeLists.txt, test-registration and debt-count sections with #9448 and says whichever lands later will rebase, but its checklist still says Depends on: none. I fetched both current heads and ran a pairwise merge preview; it has content conflicts in:

  • core/libs/prx/libSceLibreSsl/CMakeLists.txt
  • core/libs/prx/libSceLibreSsl/include/Api.hpp
  • docs/dev/debt/libSceLibreSsl.md

CONTRIBUTING.md requires authors to agree on the order for shared-line overlaps and declare the dependency on the PR that must land second. Please coordinate with #9448's author and record the agreed order in the checklist. If this PR lands first, #9448 should depend on it; if #9448 lands first, this PR should depend on #9448 and be rebased after it. Preserve both implementations, tests, and the correct pending-export count.

The reported exact-head tests support the implementation, but they do not resolve this merge-order requirement. No title/console behavior is claimed by this review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696371025 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5696371025). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T10:39:47Z. **Review:** CHANGES_REQUESTED --- ## Review of the requested head I checked exact head `6819348ad03549f37292a3cc5ef87ce458d615aa` against live `main` `1db077e876`. The PR's current-main merge preview is clean and `git diff --check` passes. The author reports 99/99 focused LibreSSL, crypto and public-header tests on this exact head, plus a negative control for the curve mapping. I did not run a local build or test. ### Blocking: overlap order with #9448 is not declared The PR body notes shared `CMakeLists.txt`, test-registration and debt-count sections with #9448 and says whichever lands later will rebase, but its checklist still says `Depends on: none`. I fetched both current heads and ran a pairwise merge preview; it has content conflicts in: - `core/libs/prx/libSceLibreSsl/CMakeLists.txt` - `core/libs/prx/libSceLibreSsl/include/Api.hpp` - `docs/dev/debt/libSceLibreSsl.md` `CONTRIBUTING.md` requires authors to agree on the order for shared-line overlaps and declare the dependency on the PR that must land second. Please coordinate with #9448's author and record the agreed order in the checklist. If this PR lands first, #9448 should depend on it; if #9448 lands first, this PR should depend on #9448 and be rebased after it. Preserve both implementations, tests, and the correct pending-export count. The reported exact-head tests support the implementation, but they do not resolve this merge-order requirement. No title/console behavior is claimed by this review.
MarcZX10 commented 2026-10-29 23:09:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T23:09:58Z.

Review: APPROVED


Re-checked — new head, looks good

The earlier review’s dependency-order concern is resolved in the PR description: #9448 lands first and this PR depends on it; the implementation and focused-test evidence otherwise remain unchanged on head 6819348ad03549f37292a3cc5ef87ce458d615aa.

What I ran

Reviewed head 6819348ad03549f37292a3cc5ef87ce458d615aa against PR base 2960e9a6e7e1fc99c4ed180c71495b5eb83464c7. The branch is explicitly dependent on open #9448; I did not request an early rebase. Checks ran in the Linux workspace; no compiler or build was invoked.

git diff --check 2960e9a6e7e1fc99c4ed180c71495b5...refs/review/pr-10395-current
python3 tools/check_conventions.py --base 2960e9a6e7e1fc99c4ed180c71495b5 --head refs/review/pr-10395-current
gh pr checks 10395 --repo boykopovar/AnyPS5
gh api repos/boykopovar/AnyPS5/pulls/10395 --jq '{state:.state,head:.head.sha,base:.base.sha,mergeable:.mergeable,merge_state:.mergeable_state}'

Results

Check Result
Diff check Passed; no output
Repository conventions Passed
Hosted checks Conventions and labels passed on exact head; no product build/test job ran
Focused tests Author reports 99/99 LibreSSL/public-header tests on this exact head; the current #9448/#10395 combined merge reportedly passes all 36 LibreSSL tests on Linux. Not independently run here.
Dependency order Recorded as Depends on: #9448; #9448 remains open
Unedited local command output
All conventions checks passed.
conventions    pass    20s
labels         pass    8s

Findings

Blocking

None found in the re-check. The dependency order is now agreed and recorded, and the author’s combined test report covers the shared LibreSSL registration, declarations, tests and debt-count lines.

Non-blocking

The test runs are author-reported, not local runs. This approval does not remove the declared dependency: #9448 should land first, then this branch should be rebased and revalidated as the author describes.

Sources

Not verified

I did not run a local LibreSSL build or tests, a console test, or the post-#9448 rebase. The combined 36-test run and exact-head 99/99 run are author-reported.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5706140139 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5706140139). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T23:09:58Z. **Review:** APPROVED --- # Re-checked — new head, looks good The earlier review’s dependency-order concern is resolved in the PR description: #9448 lands first and this PR depends on it; the implementation and focused-test evidence otherwise remain unchanged on head `6819348ad03549f37292a3cc5ef87ce458d615aa`. ## What I ran Reviewed head `6819348ad03549f37292a3cc5ef87ce458d615aa` against PR base `2960e9a6e7e1fc99c4ed180c71495b5eb83464c7`. The branch is explicitly dependent on open #9448; I did not request an early rebase. Checks ran in the Linux workspace; no compiler or build was invoked. ```sh git diff --check 2960e9a6e7e1fc99c4ed180c71495b5...refs/review/pr-10395-current python3 tools/check_conventions.py --base 2960e9a6e7e1fc99c4ed180c71495b5 --head refs/review/pr-10395-current gh pr checks 10395 --repo boykopovar/AnyPS5 gh api repos/boykopovar/AnyPS5/pulls/10395 --jq '{state:.state,head:.head.sha,base:.base.sha,mergeable:.mergeable,merge_state:.mergeable_state}' ``` ## Results | Check | Result | |---|---| | Diff check | Passed; no output | | Repository conventions | Passed | | Hosted checks | Conventions and labels passed on exact head; no product build/test job ran | | Focused tests | Author reports 99/99 LibreSSL/public-header tests on this exact head; the current #9448/#10395 combined merge reportedly passes all 36 LibreSSL tests on Linux. Not independently run here. | | Dependency order | Recorded as `Depends on: #9448`; #9448 remains open | <details> <summary>Unedited local command output</summary> ```text All conventions checks passed. conventions pass 20s labels pass 8s ``` </details> ## Findings ### Blocking None found in the re-check. The dependency order is now agreed and recorded, and the author’s combined test report covers the shared LibreSSL registration, declarations, tests and debt-count lines. ### Non-blocking The test runs are author-reported, not local runs. This approval does not remove the declared dependency: #9448 should land first, then this branch should be rebased and revalidated as the author describes. ## Sources - [EC implementation at this head](https://github.com/boykopovar/AnyPS5/blob/6819348ad03549f37292a3cc5ef87ce458d615aa/core/libs/prx/libSceLibreSsl/src/Ec.cpp) - [EC tests at this head](https://github.com/boykopovar/AnyPS5/blob/6819348ad03549f37292a3cc5ef87ce458d615aa/core/libs/tests/GuestLibreSslEc.cpp) - [Author’s combined 36-test report for the current #9448 and #10395 heads](https://github.com/boykopovar/AnyPS5/pull/9448#issuecomment-6510492721) ## Not verified I did not run a local LibreSSL build or tests, a console test, or the post-#9448 rebase. The combined 36-test run and exact-head 99/99 run are author-reported.
MarcZX10 commented 2026-10-31 02:12:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T02:12:18Z.

Review: APPROVED


Reviewed — looks good

The current implementation and focused tests show no blocker; the author reports a Linux build and 100/100 focused tests passing on this exact head.

What I ran

  • Reviewed head f7c37da4d7de31dccb6400b5d39cf64bc327a796 against PR base c12e7e61a185261d837b6fb2ff1c92a07a00e5ff; current main matches the base, and the merge preview is clean.
  • Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build locally.
  • Commands:
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395
git diff --check c12e7e61a185261d837b6fb2ff1c92a07a00e5ff...f7c37da4d7de31dccb6400b5d39cf64bc327a796
python3 tools/pr_abi_audit.py --base c12e7e61a185261d837b6fb2ff1c92a07a00e5ff --head f7c37da4d7de31dccb6400b5d39cf64bc327a796 --json

The diff, conventions, current-main merge preview, and independent ABI audit passed. The precheck's test-quality helper was unavailable in its isolated checkout; manual inspection confirmed the new C++ test is registered in CMake. The author's report says Linux/Ubuntu 24.04, GCC 13.3, Release, BUILD_TESTING=ON; ctest -j8 -R 'libressl|crypto_memcmp|public_headers' passed 100/100, including guest_libressl_ec.

Sources

Not verified

I did not run a local build or tests; the Linux build and tests above are author-reported. Windows/macOS product tests and console behavior were not verified here. The declared #9448 dependency remains open, so the stated landing order still applies.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5720528261 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5720528261). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T02:12:18Z. **Review:** APPROVED --- # Reviewed — looks good The current implementation and focused tests show no blocker; the author reports a Linux build and 100/100 focused tests passing on this exact head. ## What I ran - Reviewed head `f7c37da4d7de31dccb6400b5d39cf64bc327a796` against PR base `c12e7e61a185261d837b6fb2ff1c92a07a00e5ff`; current `main` matches the base, and the merge preview is clean. - Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build locally. - Commands: ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 git diff --check c12e7e61a185261d837b6fb2ff1c92a07a00e5ff...f7c37da4d7de31dccb6400b5d39cf64bc327a796 python3 tools/pr_abi_audit.py --base c12e7e61a185261d837b6fb2ff1c92a07a00e5ff --head f7c37da4d7de31dccb6400b5d39cf64bc327a796 --json ``` The diff, conventions, current-main merge preview, and independent ABI audit passed. The precheck's test-quality helper was unavailable in its isolated checkout; manual inspection confirmed the new C++ test is registered in CMake. The author's report says Linux/Ubuntu 24.04, GCC 13.3, Release, `BUILD_TESTING=ON`; `ctest -j8 -R 'libressl|crypto_memcmp|public_headers'` passed 100/100, including `guest_libressl_ec`. ## Sources - [Reviewed EC implementation at this head](https://github.com/boykopovar/AnyPS5/blob/f7c37da4d7de31dccb6400b5d39cf64bc327a796/core/libs/prx/libSceLibreSsl/src/Ec.cpp) ## Not verified I did not run a local build or tests; the Linux build and tests above are author-reported. Windows/macOS product tests and console behavior were not verified here. The declared #9448 dependency remains open, so the stated landing order still applies.
MarcZX10 commented 2026-11-01 00:18:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T00:18:38Z.

Review: APPROVED


Re-checked — new head, looks good

The second commit now makes EC_KEY_up_ref and EC_KEY_free share the same reference count, and I found no blocker in the updated implementation or test report.

What I ran

Reviewed exact head 7836a888cf93078eb993b862ba78c7018ea528ba against PR base 8a4fc62318a4b73b6895bf20a024c625efeb7c3b. The PR's merge preview against that base is clean. The declared dependency #9448 is still open, its head is not included here, and its own preview conflicts with current main; the PR description specifies that #9448 lands first. Environment: Debian Linux x86-64, Python 3.11.2; no local C++ compiler or build was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 --output-dir /tmp/anyps5-precheck-10395
gh api repos/boykopovar/AnyPS5/commits/7836a888cf93078eb993b862ba78c7018ea528ba
gh api repos/boykopovar/AnyPS5/commits/7836a888cf93078eb993b862ba78c7018ea528ba/check-runs

Results

Check Result
Diff check Passed on the exact head.
Repository conventions and PR template Passed locally on the exact head.
Source review The shared key type carries the reference counter; the parent library's free path decrements it, and the libSceLibreSsl3 retain path increments it. The test covers keys from both constructors and concurrent retain/release while keeping a live reference.
Author-reported tests Linux Release build and 104/104 focused tests pass on this head; the author also reports the key-reference test under ASan and a leak-producing negative control. I did not run these locally.
Hosted checks The exact-head conventions rerun and labels check were queued at the last refresh; no product build/test job was present.
Optional local ABI/test-quality helpers Could not run because those helper scripts are absent from the isolated PR checkout. This is a tooling limitation, not a reported source finding.

Findings

Blocking

None found in the reviewed update.

Non-blocking

The declared #9448 dependency remains in effect. This approval covers the current diff; it does not change the stated order that #9448 lands first and #10395 is then rebased and revalidated. Windows and console lifetime interoperability remain unverified, as the PR records.

Sources

Not verified

I did not run a local build or CTest, Windows tests, or console behavior. The Linux build, 104-test result, ASan run, and negative control above are author-reported rather than independently reproduced.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5725586770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5725586770). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T00:18:38Z. **Review:** APPROVED --- # Re-checked — new head, looks good The second commit now makes `EC_KEY_up_ref` and `EC_KEY_free` share the same reference count, and I found no blocker in the updated implementation or test report. ## What I ran Reviewed exact head `7836a888cf93078eb993b862ba78c7018ea528ba` against PR base `8a4fc62318a4b73b6895bf20a024c625efeb7c3b`. The PR's merge preview against that base is clean. The declared dependency #9448 is still open, its head is not included here, and its own preview conflicts with current `main`; the PR description specifies that #9448 lands first. Environment: Debian Linux x86-64, Python 3.11.2; no local C++ compiler or build was run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 --output-dir /tmp/anyps5-precheck-10395 gh api repos/boykopovar/AnyPS5/commits/7836a888cf93078eb993b862ba78c7018ea528ba gh api repos/boykopovar/AnyPS5/commits/7836a888cf93078eb993b862ba78c7018ea528ba/check-runs ``` ## Results | Check | Result | |---|---| | Diff check | Passed on the exact head. | | Repository conventions and PR template | Passed locally on the exact head. | | Source review | The shared key type carries the reference counter; the parent library's free path decrements it, and the libSceLibreSsl3 retain path increments it. The test covers keys from both constructors and concurrent retain/release while keeping a live reference. | | Author-reported tests | Linux Release build and 104/104 focused tests pass on this head; the author also reports the key-reference test under ASan and a leak-producing negative control. I did not run these locally. | | Hosted checks | The exact-head conventions rerun and labels check were queued at the last refresh; no product build/test job was present. | | Optional local ABI/test-quality helpers | Could not run because those helper scripts are absent from the isolated PR checkout. This is a tooling limitation, not a reported source finding. | ## Findings ### Blocking None found in the reviewed update. ### Non-blocking The declared #9448 dependency remains in effect. This approval covers the current diff; it does not change the stated order that #9448 lands first and #10395 is then rebased and revalidated. Windows and console lifetime interoperability remain unverified, as the PR records. ## Sources - [Updated key-reference implementation and tests at this head](https://github.com/boykopovar/AnyPS5/commit/7836a888cf93078eb993b862ba78c7018ea528ba) - [Author's exact-head test report](https://github.com/boykopovar/AnyPS5/pull/10395#issuecomment-6550948620) ## Not verified I did not run a local build or CTest, Windows tests, or console behavior. The Linux build, 104-test result, ASan run, and negative control above are author-reported rather than independently reproduced.
MarcZX10 commented 2026-11-01 02:32:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T02:32:04Z.

Review: APPROVED


Re-checked — new head, looks good

The new head changes only the LibreSSL debt documentation relative to the previously approved implementation, and I found no blocker in that update.

What I ran

Reviewed head 85d8cff7e0df7705269099d8ddf1726e85fe1247 against PR base 0a148be96367e8c0aec0d0144f9d136ec7314f58; its merge preview against current main cf79276fee2f042feb6a7c71d0d6a27e9cfe2592 is clean. Relative to previously reviewed head 7836a888cf93078eb993b862ba78c7018ea528ba, the only changed file is docs/dev/debt/libSceLibreSsl.md. Environment: Debian Linux x86-64, Python 3.11.2; I did not build locally.

git diff --stat 7836a888cf93078eb993b862ba78c7018ea528ba 85d8cff7e0df7705269099d8ddf1726e85fe1247
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395

Results

Check Result
Diff and current-main merge preview Passed; only the debt-documentation edit is new since the previous approval.
Repository conventions Passed on the current head.
Author-reported focused tests The author reports 104/104 Linux tests passing on this exact head; I did not reproduce the build or tests locally.
Optional precheck helpers The isolated PR snapshot does not contain tools/pr_abi_audit.py or tools/pr_test_quality.py; those two optional checks could not run there.
Hosted checks Conventions passed. Labels were queued at the latest check refresh; no product build/test job ran in CI.

Findings

Blocking

None found in this documentation-only update.

Non-blocking

#9448 remains the declared prerequisite and is still open. This approval covers the current head; after #9448 lands, rebase and rerun the checks as planned.

Sources

Not verified

I did not run a local build or CTest, Windows tests, or console behavior. The 104-test result is author-reported.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5726066281 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5726066281). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T02:32:04Z. **Review:** APPROVED --- # Re-checked — new head, looks good The new head changes only the LibreSSL debt documentation relative to the previously approved implementation, and I found no blocker in that update. ## What I ran Reviewed head `85d8cff7e0df7705269099d8ddf1726e85fe1247` against PR base `0a148be96367e8c0aec0d0144f9d136ec7314f58`; its merge preview against current `main` `cf79276fee2f042feb6a7c71d0d6a27e9cfe2592` is clean. Relative to previously reviewed head `7836a888cf93078eb993b862ba78c7018ea528ba`, the only changed file is `docs/dev/debt/libSceLibreSsl.md`. Environment: Debian Linux x86-64, Python 3.11.2; I did not build locally. ```sh git diff --stat 7836a888cf93078eb993b862ba78c7018ea528ba 85d8cff7e0df7705269099d8ddf1726e85fe1247 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 ``` ## Results | Check | Result | |---|---| | Diff and current-main merge preview | Passed; only the debt-documentation edit is new since the previous approval. | | Repository conventions | Passed on the current head. | | Author-reported focused tests | The author reports 104/104 Linux tests passing on this exact head; I did not reproduce the build or tests locally. | | Optional precheck helpers | The isolated PR snapshot does not contain `tools/pr_abi_audit.py` or `tools/pr_test_quality.py`; those two optional checks could not run there. | | Hosted checks | Conventions passed. Labels were queued at the latest check refresh; no product build/test job ran in CI. | ## Findings ### Blocking None found in this documentation-only update. ### Non-blocking #9448 remains the declared prerequisite and is still open. This approval covers the current head; after #9448 lands, rebase and rerun the checks as planned. ## Sources - [Current PR head](https://github.com/boykopovar/AnyPS5/commit/85d8cff7e0df7705269099d8ddf1726e85fe1247) - [Author's exact-head 104-test report](https://github.com/boykopovar/AnyPS5/pull/10395#issuecomment-6552156967) ## Not verified I did not run a local build or CTest, Windows tests, or console behavior. The 104-test result is author-reported.
MarcZX10 commented 2026-11-01 14:31:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T14:31:37Z.

Review: COMMENTED


Reviewed — no blocking findings

The nine EC exports are implemented with ownership that holds up on every path I traced (copy-on-EC_KEY_set_group including self-assignment, a refcount that frees only at the last reference, and a null group that drops the previous one), and the EcKey layout matches LibreSSL 4.0.0's ec_key_st; the layout is the 4.0.0 one on purpose, which the PR body discloses, and it differs from the 2.5.4 header the signatures cite.

What I ran

  • Exact head 67708e8ceb858f5071d0716441c456fe5b52f918, base a043b048db (the precheck base).
  • Environment: Linux, /usr/bin/python3 3.11.2, no build.
  • Precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 --output-dir /dev/shm/reviewer-run/precheck/10395
  • ABI audit by hand (helper absent from the head tree): python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base a043b048db --head 67708e8ceb858f5071d0716441c456fe5b52f918 --json (exit 0; passed; 0 findings; 399 symbols).
  • Test-quality helper on core/libs/tests/GuestLibreSslEc.cpp from a head extract: one literal-path registration heuristic.
  • Layout checked against two commit-pinned LibreSSL headers, fetched with gh api: src/lib/libcrypto/ec/ec_local.h at ce488b78e0bd994780569df718596b9776ff681a (4.0.0), where ec_key_st is meth 0, version 8, group 16, pub_key 24, priv_key 32, enc_flag 40, conv_form 44, references 48, flags 52, ex_data 56 (64 bytes); and src/lib/libcrypto/ec/ec_lcl.h at 2e2c612066aa993717528a0249c15c51128d61cb (2.5.4), where version is 0, group 8, references 40, method_data 48 (56 bytes). The PR's EcKey matches 4.0.0 field for field.
  • ECDSA_size arithmetic checked by hand: P-256 gives 72 and P-384 gives 104, the values the test pins.

Results

Precheck report, checks table, unedited (/dev/shm/reviewer-run/precheck/10395/report.md):

Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check a043b048db8b33ab42ba5b70c94f852b9bd5866b...67708e8ceb858f5071d0716441c456fe5b52f918
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base a043b048db8b33ab42ba5b70c94f852b9bd5866b --head 67708e8ceb858f5071d0716441c456fe5b52f918 --title feat(libSceLibreSsl): implement EC groups and keys for named curves --body /dev/shm/reviewer-run/precheck/10395/pr-body.md
changed_export_abi_audit failed /usr/bin/python3 tools/pr_abi_audit.py --base a043b048db8b33ab42ba5b70c94f852b9bd5866b --head 67708e8ceb858f5071d0716441c456fe5b52f918 --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/10395/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /usr/bin/python3 /dev/shm/reviewer-run/precheck/10395/head-67708e8ceb85-e021d4e9/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/10395/head-67708e8ceb85-e021d4e9 --json core/libs/prx/libSceLibreSsl/CMakeLists.txt core/libs/prx/libSceLibreSsl/Export.cpp core/libs/prx/libSceLibreSsl/include/Api.hpp core/libs/prx/libSceLibreSsl/include/Ec.hpp core/libs/prx/libSceLibreSsl/src/Ec.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp docs/dev/debt/libSceLibreSsl.md docs/dev/debt/libSceLibreSsl3.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.

Negative control

Not run here. The C++ test needs a build.

Findings

Blocking: none.

Non-blocking:

  • The PR cites LibreSSL 2.5.4 for the signatures and the 4.0.0 layout for EcKey. The PR body explains that the layout follows 4.0.0 so that keys shared with libSceLibreSsl3 keep references at offset 48. If a title reads EC_KEY fields directly with the 2.5.4 header, the offsets are wrong (for example group is at 8 in 2.5.4 and at 16 here). The PR describes these objects as opaque, so this is a risk to confirm, not a defect in the code.
  • EC_KEY_set_group builds a new EcGroup from the curve identity rather than copying the group's mbedtls_ecp_group. That is correct because the group is determined by the curve, but a group whose parameters were changed by other code would not be copied.

Sources

Not verified

  • The C++ tests guest_libressl_ec and guest_libressl3_key_reference were not built or run; the PR's run (Linux, 105 of 105 tests on an earlier head) is the author's report.
  • The console's libSceLibreSsl (2.5.4) layout of EC_KEY was not verified.
  • Hosted: at this head only conventions (one run cancelled, one succeeded) and labels had reported at review time.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5728620363 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5728620363). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T14:31:37Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The nine EC exports are implemented with ownership that holds up on every path I traced (copy-on-`EC_KEY_set_group` including self-assignment, a refcount that frees only at the last reference, and a null group that drops the previous one), and the `EcKey` layout matches LibreSSL 4.0.0's `ec_key_st`; the layout is the 4.0.0 one on purpose, which the PR body discloses, and it differs from the 2.5.4 header the signatures cite. ## What I ran - Exact head `67708e8ceb858f5071d0716441c456fe5b52f918`, base `a043b048db` (the precheck base). - Environment: Linux, `/usr/bin/python3` 3.11.2, no build. - Precheck: `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 --output-dir /dev/shm/reviewer-run/precheck/10395` - ABI audit by hand (helper absent from the head tree): `python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base a043b048db --head 67708e8ceb858f5071d0716441c456fe5b52f918 --json` (exit 0; `passed`; 0 findings; 399 symbols). - Test-quality helper on `core/libs/tests/GuestLibreSslEc.cpp` from a head extract: one literal-path registration heuristic. - Layout checked against two commit-pinned LibreSSL headers, fetched with `gh api`: `src/lib/libcrypto/ec/ec_local.h` at `ce488b78e0bd994780569df718596b9776ff681a` (4.0.0), where `ec_key_st` is `meth` 0, `version` 8, `group` 16, `pub_key` 24, `priv_key` 32, `enc_flag` 40, `conv_form` 44, `references` 48, `flags` 52, `ex_data` 56 (64 bytes); and `src/lib/libcrypto/ec/ec_lcl.h` at `2e2c612066aa993717528a0249c15c51128d61cb` (2.5.4), where `version` is 0, `group` 8, `references` 40, `method_data` 48 (56 bytes). The PR's `EcKey` matches 4.0.0 field for field. - `ECDSA_size` arithmetic checked by hand: P-256 gives 72 and P-384 gives 104, the values the test pins. ## Results Precheck report, checks table, unedited (`/dev/shm/reviewer-run/precheck/10395/report.md`): | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check a043b048db8b33ab42ba5b70c94f852b9bd5866b...67708e8ceb858f5071d0716441c456fe5b52f918` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base a043b048db8b33ab42ba5b70c94f852b9bd5866b --head 67708e8ceb858f5071d0716441c456fe5b52f918 --title feat(libSceLibreSsl): implement EC groups and keys for named curves --body /dev/shm/reviewer-run/precheck/10395/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base a043b048db8b33ab42ba5b70c94f852b9bd5866b --head 67708e8ceb858f5071d0716441c456fe5b52f918 --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/10395/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /dev/shm/reviewer-run/precheck/10395/head-67708e8ceb85-e021d4e9/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/10395/head-67708e8ceb85-e021d4e9 --json core/libs/prx/libSceLibreSsl/CMakeLists.txt core/libs/prx/libSceLibreSsl/Export.cpp core/libs/prx/libSceLibreSsl/include/Api.hpp core/libs/prx/libSceLibreSsl/include/Ec.hpp core/libs/prx/libSceLibreSsl/src/Ec.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp docs/dev/debt/libSceLibreSsl.md docs/dev/debt/libSceLibreSsl3.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | ## Negative control Not run here. The C++ test needs a build. ## Findings **Blocking:** none. **Non-blocking:** - The PR cites LibreSSL 2.5.4 for the signatures and the 4.0.0 layout for `EcKey`. The PR body explains that the layout follows 4.0.0 so that keys shared with `libSceLibreSsl3` keep `references` at offset 48. If a title reads `EC_KEY` fields directly with the 2.5.4 header, the offsets are wrong (for example `group` is at 8 in 2.5.4 and at 16 here). The PR describes these objects as opaque, so this is a risk to confirm, not a defect in the code. - `EC_KEY_set_group` builds a new `EcGroup` from the curve identity rather than copying the group's `mbedtls_ecp_group`. That is correct because the group is determined by the curve, but a group whose parameters were changed by other code would not be copied. ## Sources - Export implementation at head: https://github.com/boykopovar/AnyPS5/blob/67708e8ceb858f5071d0716441c456fe5b52f918/core/libs/prx/libSceLibreSsl/src/Ec.cpp - Key layout at head: https://github.com/boykopovar/AnyPS5/blob/67708e8ceb858f5071d0716441c456fe5b52f918/core/libs/prx/libSceLibreSsl/include/Ec.hpp - LibreSSL 4.0.0 `ec_key_st` (commit-pinned): https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/ec/ec_local.h#L224-L241 - LibreSSL 2.5.4 `ec_key_st` (commit-pinned): https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/ec/ec_lcl.h#L244-L259 ## Not verified - The C++ tests `guest_libressl_ec` and `guest_libressl3_key_reference` were not built or run; the PR's run (Linux, 105 of 105 tests on an earlier head) is the author's report. - The console's `libSceLibreSsl` (2.5.4) layout of `EC_KEY` was not verified. - Hosted: at this head only `conventions` (one run cancelled, one succeeded) and `labels` had reported at review time.
MarcZX10 commented 2026-11-02 11:08:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T11:08:03Z.

Review: APPROVED


Re-checked — new head, approved

The rebased head has no blocking source finding; the author reports 110/110 focused tests on this exact SHA, and both live hosted checks pass.

What I ran

Reviewed all 10 changed files at head c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7 against base 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2. Environment: Debian 12, Linux x86_64, Python 3.11.2, Git 2.39.5, GCC 12.2.0. I did not build or run CTest locally. The author reports a Release build and 110 focused tests passing on this exact head in the latest test report.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 --output-dir /tmp/review-10395
git diff --check 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2...c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2 --head c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7 --json
python3 tools/pr_test_quality.py --root /tmp/review-10395/head-c9c453584461-a0f8f34b --json core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp
python3 tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /tmp/review-10395/stack-repeat
gh pr checks 10395 --repo boykopovar/AnyPS5

The precheck's isolated checkout lacks the ABI and test-quality helper scripts, so I reran those checks from the workspace. I also confirmed the tests are registered in CMake; the heuristic does not recognize the registration helper's generated source list.

Results

Check Result Note
Diff and conventions passed Exact base-to-head diff; conventions passed.
Public ABI audit passed 399 symbols; no findings.
Test registration heuristic failed Both warnings are false positives; CMake registers both tests.
Dependency stack check failed #10395 previews cleanly against main; declared prerequisite #9448 remains absent and conflicts with main.
Hosted checks passed Conventions and labels pass on this head.
Focused CTest passed Author-reported 110/110 on this exact head.
Local build and CTest not run No local build was performed.
Precheck summary table (unedited)
Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2...c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2 --head c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7 --title feat(libSceLibreSsl): implement EC groups and keys for named curves --body /tmp/review-10395/pr-body.md
changed_export_abi_audit failed /usr/bin/python3 tools/pr_abi_audit.py --base 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2 --head c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7 --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check failed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /tmp/review-10395/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /usr/bin/python3 /tmp/review-10395/head-c9c453584461-a0f8f34b/tools/pr_test_quality.py --root /tmp/review-10395/head-c9c453584461-a0f8f34b --json core/libs/prx/libSceLibreSsl/CMakeLists.txt core/libs/prx/libSceLibreSsl/Export.cpp core/libs/prx/libSceLibreSsl/include/Api.hpp core/libs/prx/libSceLibreSsl/include/Ec.hpp core/libs/prx/libSceLibreSsl/src/Ec.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp docs/dev/debt/libSceLibreSsl.md docs/dev/debt/libSceLibreSsl3.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.
Manual audit output (unedited)

ABI audit summary:

{
  "status": "passed",
  "symbol_count": 399,
  "findings": [],
  "limitations": [
    "This lexical audit does not parse C++ fully, prove calling-convention or binary ABI correctness, verify runtime version tables, or replace compilation.",
    "An absent source declaration or explicit alias can be intentional for assembly exports, conditional platform code, or generated interfaces; inspect findings before treating them as defects."
  ]
}

Test-quality output:

{
  "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."
    },
    {
      "path": "core/libs/tests/GuestLibreSslEc.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."
  ]
}
Hosted check output (unedited)
conventions	pass	25s	https://github.com/boykopovar/AnyPS5/actions/runs/41430313816/job/125226948899
labels	pass	9s	https://github.com/boykopovar/AnyPS5/actions/runs/41430313880/job/125229350292

Negative control

Assertion Mutation Did the new test fail?
Curve mapping, DER size and EC-key retain/release regressions are caught. None was applied by me; no local test binary was built. Not exercised by this review. The author-reported 110/110 run is a normal test run, not a negative control.

Findings

Blocking

None found in the reviewed code or tests.

Non-blocking

  • The PR declares Depends on: #9448. The stack report confirms #9448 is still open, its head conflicts with current main, and its changes are not included in this head. #10395 itself previews cleanly against its current base; preserve the declared landing order and rebase/update the pending-export count after #9448 lands.
  • The test-quality heuristic flags both changed C++ tests, but the two CMake registrations are present and the author reports both passing in the exact-head CTest run.

Sources

Not verified

I did not independently build or run CTest. The 110-test result is author-reported, not my run. No PS5 console behavior was tested. The current hosted checks contain only conventions and labels; no hosted build job ran for this head.

To get this to a good state

No code change is requested on this reviewed head. Keep #9448 as the declared prerequisite; after it lands, rebase this PR, recalculate the pending-export count, and rerun the focused LibreSSL tests on the new head. I will recheck any changed head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5735626625 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5735626625). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T11:08:03Z. **Review:** APPROVED --- # Re-checked — new head, approved The rebased head has no blocking source finding; the author reports 110/110 focused tests on this exact SHA, and both live hosted checks pass. ## What I ran Reviewed all 10 changed files at head `c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7` against base `3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2`. Environment: Debian 12, Linux x86_64, Python 3.11.2, Git 2.39.5, GCC 12.2.0. I did not build or run CTest locally. The author reports a Release build and 110 focused tests passing on this exact head in [the latest test report](https://github.com/boykopovar/AnyPS5/pull/10395#issuecomment-6575039599). ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 --output-dir /tmp/review-10395 git diff --check 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2...c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7 python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2 --head c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7 --json python3 tools/pr_test_quality.py --root /tmp/review-10395/head-c9c453584461-a0f8f34b --json core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp python3 tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /tmp/review-10395/stack-repeat gh pr checks 10395 --repo boykopovar/AnyPS5 ``` The precheck's isolated checkout lacks the ABI and test-quality helper scripts, so I reran those checks from the workspace. I also confirmed the tests are registered in CMake; the heuristic does not recognize the registration helper's generated source list. ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | Exact base-to-head diff; conventions passed. | | Public ABI audit | passed | 399 symbols; no findings. | | Test registration heuristic | failed | Both warnings are false positives; CMake registers both tests. | | Dependency stack check | failed | #10395 previews cleanly against main; declared prerequisite #9448 remains absent and conflicts with main. | | Hosted checks | passed | Conventions and labels pass on this head. | | Focused CTest | passed | Author-reported 110/110 on this exact head. | | Local build and CTest | not run | No local build was performed. | <details><summary>Precheck summary table (unedited)</summary> | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2...c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2 --head c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7 --title feat(libSceLibreSsl): implement EC groups and keys for named curves --body /tmp/review-10395/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base 3c3b3cda739f9eb00a07fae50d94a3af5f6fb8f2 --head c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7 --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | failed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /tmp/review-10395/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /tmp/review-10395/head-c9c453584461-a0f8f34b/tools/pr_test_quality.py --root /tmp/review-10395/head-c9c453584461-a0f8f34b --json core/libs/prx/libSceLibreSsl/CMakeLists.txt core/libs/prx/libSceLibreSsl/Export.cpp core/libs/prx/libSceLibreSsl/include/Api.hpp core/libs/prx/libSceLibreSsl/include/Ec.hpp core/libs/prx/libSceLibreSsl/src/Ec.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp docs/dev/debt/libSceLibreSsl.md docs/dev/debt/libSceLibreSsl3.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | </details> <details><summary>Manual audit output (unedited)</summary> ABI audit summary: ```json { "status": "passed", "symbol_count": 399, "findings": [], "limitations": [ "This lexical audit does not parse C++ fully, prove calling-convention or binary ABI correctness, verify runtime version tables, or replace compilation.", "An absent source declaration or explicit alias can be intentional for assembly exports, conditional platform code, or generated interfaces; inspect findings before treating them as defects." ] } ``` Test-quality output: ```json { "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." }, { "path": "core/libs/tests/GuestLibreSslEc.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." ] } ``` </details> <details><summary>Hosted check output (unedited)</summary> ```text conventions pass 25s https://github.com/boykopovar/AnyPS5/actions/runs/41430313816/job/125226948899 labels pass 9s https://github.com/boykopovar/AnyPS5/actions/runs/41430313880/job/125229350292 ``` </details> ## Negative control | Assertion | Mutation | Did the new test fail? | |---|---|---| | Curve mapping, DER size and EC-key retain/release regressions are caught. | None was applied by me; no local test binary was built. | Not exercised by this review. The author-reported 110/110 run is a normal test run, not a negative control. | ## Findings ### Blocking None found in the reviewed code or tests. ### Non-blocking - The PR declares `Depends on: #9448`. The stack report confirms #9448 is still open, its head conflicts with current main, and its changes are not included in this head. #10395 itself previews cleanly against its current base; preserve the declared landing order and rebase/update the pending-export count after #9448 lands. - The test-quality heuristic flags both changed C++ tests, but the two CMake registrations are present and the author reports both passing in the exact-head CTest run. ## Sources - [EC implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7/core/libs/prx/libSceLibreSsl/src/Ec.cpp#L48-L118) - [EC key layout and offset assertions at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7/core/libs/prx/libSceLibreSsl/include/Ec.hpp#L24-L45) - [Curve, size and group-set tests at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7/core/libs/tests/GuestLibreSslEc.cpp#L40-L108) - [Cross-library EC key lifetime test at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/c9c4535844610a61f02c7a15b4fc1e49ff9fe5f7/core/libs/tests/GuestLibreSsl3KeyReference.cpp#L80-L137) - [LibreSSL 2.5.4 curve lookup and unknown-group behavior](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/ec/ec_curve.c#L3255-L3271) - [LibreSSL 2.5.4 `EC_KEY_set_group`](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/ec/ec_key.c#L1952-L1961) - [LibreSSL 4.0.0 EC key layout](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/ec/ec_local.h#L224-L241) - [Author's exact-head test report](https://github.com/boykopovar/AnyPS5/pull/10395#issuecomment-6575039599) ## Not verified I did not independently build or run CTest. The 110-test result is author-reported, not my run. No PS5 console behavior was tested. The current hosted checks contain only conventions and labels; no hosted build job ran for this head. ## To get this to a good state No code change is requested on this reviewed head. Keep #9448 as the declared prerequisite; after it lands, rebase this PR, recalculate the pending-export count, and rerun the focused LibreSSL tests on the new head. I will recheck any changed head.
MarcZX10 commented 2026-11-02 18:46:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T18:46:12Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Both EC key constructors leave version and conversionForm at zero, although the referenced LibreSSL 2.5.4 constructor initializes them to version 1 and uncompressed form.

What I ran

Reviewed all ten changed files at head 241d083a37256e9fef0325b5e435295b933cf96e against PR base b28bb772177768f99874ca38f6252cd0139acf2a. The stack check previewed it cleanly against current main a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8; no dependency was declared. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not configure or build AnyPS5.

The PR reports 112 passing tests on this head, but its stated base is 8723ebf113, not the current PR base. That report is author-provided; I did not run those tests.

git diff --check b28bb772177768f99874ca38f6252cd0139acf2a...241d083a37256e9fef0325b5e435295b933cf96e
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base b28bb772177768f99874ca38f6252cd0139acf2a --head 241d083a37256e9fef0325b5e435295b933cf96e
mkdir -p /tmp/anyps5-10395-head-files
git archive 241d083a37256e9fef0325b5e435295b933cf96e core/libs/prx/libSceLibreSsl/CMakeLists.txt core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/tests/GuestLibreSslEc.cpp core/libs/tests/GuestLibreSsl3KeyReference.cpp | tar -x -C /tmp/anyps5-10395-head-files
python3 tools/pr_test_quality.py --root /tmp/anyps5-10395-head-files --json core/libs/tests/GuestLibreSslEc.cpp core/libs/tests/GuestLibreSsl3KeyReference.cpp
grep -n -E 'GuestLibreSslEc.cpp|GuestLibreSsl3KeyReference.cpp|guest_libressl_ec|guest_libressl3_key_reference' /tmp/anyps5-10395-head-files/core/libs/prx/libSceLibreSsl/CMakeLists.txt /tmp/anyps5-10395-head-files/core/libs/prx/libSceLibreSsl3/CMakeLists.txt
gh pr checks 10395 --repo boykopovar/AnyPS5

Results

Check Result Note
Diff and conventions passed No whitespace errors; conventions and template passed.
Export audit passed 399 symbols scanned; no findings.
Test registration passed Both test executables and CTest entries are present.
Stack preview passed Clean against current main; no declared dependency.
Hosted checks passed Conventions and labels only; no build job ran.
Local build and CTest not run No build was configured.
Author-reported tests not run 112/112 reported on this head, based on an older main.
Precheck wrapper failed Its isolated snapshot does not contain the optional local audit scripts.
Full precheck table and raw output
Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check b28bb772177768f99874ca38f6252cd0139acf2a...241d083a37256e9fef0325b5e435295b933cf96e
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base b28bb772177768f99874ca38f6252cd0139acf2a --head 241d083a37256e9fef0325b5e435295b933cf96e --title feat(libSceLibreSsl): implement EC groups and keys for named curves --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/pr-body.md
changed_export_abi_audit failed /usr/bin/python3 tools/pr_abi_audit.py --base b28bb772177768f99874ca38f6252cd0139acf2a --head 241d083a37256e9fef0325b5e435295b933cf96e --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/head-241d083a3725-482d5640/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/head-241d083a3725-482d5640 --json core/libs/prx/libSceLibreSsl/CMakeLists.txt core/libs/prx/libSceLibreSsl/Export.cpp core/libs/prx/libSceLibreSsl/include/Api.hpp core/libs/prx/libSceLibreSsl/include/Ec.hpp core/libs/prx/libSceLibreSsl/src/Ec.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp docs/dev/debt/libSceLibreSsl.md docs/dev/debt/libSceLibreSsl3.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.

The two precheck helper errors were:

/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/head-241d083a3725-482d5640/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/head-241d083a3725-482d5640/tools/pr_test_quality.py': [Errno 2] No such file or directory

Standalone audit output:

ABI audit: passed

The standalone test-quality heuristic flagged both C++ tests as possibly unregistered because the CMake source path is expressed through ${LIBS_INCLUDE_DIR}. The manual CMake inspection found both registrations. Hosted checks on the reviewed head:

conventions	pass
labels	pass

Negative control

Assertion Change to code under test Did the new test fail?
A newly constructed key starts with LibreSSL's default version and conversion form. No mutation was made; the constructor tests were not run because they require a build. Not exercised.

Findings

Blocking

  • EC_KEY_new and EC_KEY_new_by_curve_name construct EcKey with version == 0 and conversionForm == 0. The pinned LibreSSL 2.5.4 EC_KEY_new initializes the version to 1 and the point conversion form to POINT_CONVERSION_UNCOMPRESSED (4); the current object therefore has different initial state from the implementation this PR says it follows. Please initialize both fields to those defaults and add assertions for both constructors.

    EcKey() : version(1), conversionForm(4) {}
    

Non-blocking

  • The test-quality helper's two possible-registration warnings are false positives; manual inspection confirmed the test targets and CTest entries.
  • The author reports successful Linux tests on this head, but the report names an older base than the current PR base. I did not independently run the tests.

Sources

Not verified

I did not build or run CTest, the AddressSanitizer test, Windows tests, or console behavior. The author reports 112 passing tests and an AddressSanitizer lifetime test on this head, but those runs were against main 8723ebf113; the current PR base is b28bb772177768f99874ca38f6252cd0139acf2a. Hosted checks on the exact head ran conventions and labels only.

To get this to a good state

Initialize version to 1 and conversionForm to POINT_CONVERSION_UNCOMPRESSED, and add checks for both EC_KEY_new and EC_KEY_new_by_curve_name. On the new head, rerun python3 tools/check_conventions.py --base origin/main and ctest --test-dir build -R 'libressl|crypto_memcmp|public_headers'; I will re-check the defaults, exact head, and test results.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5741603697 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5741603697). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T18:46:12Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Both EC key constructors leave `version` and `conversionForm` at zero, although the referenced LibreSSL 2.5.4 constructor initializes them to version 1 and uncompressed form. ## What I ran Reviewed all ten changed files at head `241d083a37256e9fef0325b5e435295b933cf96e` against PR base `b28bb772177768f99874ca38f6252cd0139acf2a`. The stack check previewed it cleanly against current `main` `a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8`; no dependency was declared. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not configure or build AnyPS5. The PR reports 112 passing tests on this head, but its stated base is `8723ebf113`, not the current PR base. That report is author-provided; I did not run those tests. ```sh git diff --check b28bb772177768f99874ca38f6252cd0139acf2a...241d083a37256e9fef0325b5e435295b933cf96e python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base b28bb772177768f99874ca38f6252cd0139acf2a --head 241d083a37256e9fef0325b5e435295b933cf96e mkdir -p /tmp/anyps5-10395-head-files git archive 241d083a37256e9fef0325b5e435295b933cf96e core/libs/prx/libSceLibreSsl/CMakeLists.txt core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/tests/GuestLibreSslEc.cpp core/libs/tests/GuestLibreSsl3KeyReference.cpp | tar -x -C /tmp/anyps5-10395-head-files python3 tools/pr_test_quality.py --root /tmp/anyps5-10395-head-files --json core/libs/tests/GuestLibreSslEc.cpp core/libs/tests/GuestLibreSsl3KeyReference.cpp grep -n -E 'GuestLibreSslEc.cpp|GuestLibreSsl3KeyReference.cpp|guest_libressl_ec|guest_libressl3_key_reference' /tmp/anyps5-10395-head-files/core/libs/prx/libSceLibreSsl/CMakeLists.txt /tmp/anyps5-10395-head-files/core/libs/prx/libSceLibreSsl3/CMakeLists.txt gh pr checks 10395 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | No whitespace errors; conventions and template passed. | | Export audit | passed | 399 symbols scanned; no findings. | | Test registration | passed | Both test executables and CTest entries are present. | | Stack preview | passed | Clean against current `main`; no declared dependency. | | Hosted checks | passed | Conventions and labels only; no build job ran. | | Local build and CTest | not run | No build was configured. | | Author-reported tests | not run | 112/112 reported on this head, based on an older `main`. | | Precheck wrapper | failed | Its isolated snapshot does not contain the optional local audit scripts. | <details> <summary>Full precheck table and raw output</summary> | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check b28bb772177768f99874ca38f6252cd0139acf2a...241d083a37256e9fef0325b5e435295b933cf96e` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base b28bb772177768f99874ca38f6252cd0139acf2a --head 241d083a37256e9fef0325b5e435295b933cf96e --title feat(libSceLibreSsl): implement EC groups and keys for named curves --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base b28bb772177768f99874ca38f6252cd0139acf2a --head 241d083a37256e9fef0325b5e435295b933cf96e --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/head-241d083a3725-482d5640/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/head-241d083a3725-482d5640 --json core/libs/prx/libSceLibreSsl/CMakeLists.txt core/libs/prx/libSceLibreSsl/Export.cpp core/libs/prx/libSceLibreSsl/include/Api.hpp core/libs/prx/libSceLibreSsl/include/Ec.hpp core/libs/prx/libSceLibreSsl/src/Ec.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp docs/dev/debt/libSceLibreSsl.md docs/dev/debt/libSceLibreSsl3.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | The two precheck helper errors were: ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/head-241d083a3725-482d5640/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10395-241d083a3725/head-241d083a3725-482d5640/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` Standalone audit output: ```text ABI audit: passed ``` The standalone test-quality heuristic flagged both C++ tests as possibly unregistered because the CMake source path is expressed through `${LIBS_INCLUDE_DIR}`. The manual CMake inspection found both registrations. Hosted checks on the reviewed head: ```text conventions pass labels pass ``` </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | A newly constructed key starts with LibreSSL's default version and conversion form. | No mutation was made; the constructor tests were not run because they require a build. | Not exercised. | ## Findings ### Blocking - `EC_KEY_new` and `EC_KEY_new_by_curve_name` construct `EcKey` with `version == 0` and `conversionForm == 0`. The pinned LibreSSL 2.5.4 `EC_KEY_new` initializes the version to `1` and the point conversion form to `POINT_CONVERSION_UNCOMPRESSED` (`4`); the current object therefore has different initial state from the implementation this PR says it follows. Please initialize both fields to those defaults and add assertions for both constructors. ```suggestion EcKey() : version(1), conversionForm(4) {} ``` ### Non-blocking - The test-quality helper's two possible-registration warnings are false positives; manual inspection confirmed the test targets and CTest entries. - The author reports successful Linux tests on this head, but the report names an older base than the current PR base. I did not independently run the tests. ## Sources - [EC key defaults in the reviewed head](https://github.com/boykopovar/AnyPS5/blob/241d083a37256e9fef0325b5e435295b933cf96e/core/libs/prx/libSceLibreSsl/include/Ec.hpp#L24-L40) - [Both constructors in the reviewed head](https://github.com/boykopovar/AnyPS5/blob/241d083a37256e9fef0325b5e435295b933cf96e/core/libs/prx/libSceLibreSsl/src/Ec.cpp#L83-L93) - [LibreSSL 2.5.4 EC_KEY_new defaults](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/ec/ec_key.c#L68-L100) - [LibreSSL 2.5.4 uncompressed conversion value](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/ec/ec.h#L104-L114) - [Constructor tests in the reviewed head](https://github.com/boykopovar/AnyPS5/blob/241d083a37256e9fef0325b5e435295b933cf96e/core/libs/tests/GuestLibreSsl3KeyReference.cpp#L85-L130) ## Not verified I did not build or run CTest, the AddressSanitizer test, Windows tests, or console behavior. The author reports 112 passing tests and an AddressSanitizer lifetime test on this head, but those runs were against `main` `8723ebf113`; the current PR base is `b28bb772177768f99874ca38f6252cd0139acf2a`. Hosted checks on the exact head ran conventions and labels only. ## To get this to a good state Initialize `version` to `1` and `conversionForm` to `POINT_CONVERSION_UNCOMPRESSED`, and add checks for both `EC_KEY_new` and `EC_KEY_new_by_curve_name`. On the new head, rerun `python3 tools/check_conventions.py --base origin/main` and `ctest --test-dir build -R 'libressl|crypto_memcmp|public_headers'`; I will re-check the defaults, exact head, and test results.
MarcZX10 commented 2026-11-03 08:31:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T08:31:05Z.

Review: COMMENTED


Re-checked — new head, no blocking findings

The rebased change still matches the reviewed curve list and key layout; the current conventions and labels checks are pending, so this is a COMMENTED result.

What I ran

Reviewed all ten changed files at head 9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed against base 4f41f4c375f5abb487dbd184fbc150f31994d762. The current-base merge preview is clean. Environment: Debian 12 x86_64, Python 3.11.2, Git 2.39.5. I did not build or run CTest. The author reports an exact-head Linux build and 118/118 selected tests; I did not reproduce these.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 --output-dir /tmp/anyps5-pr-precheck/10395-20261103-rebase
git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 4f41f4c375f5abb487dbd184fbc150f31994d762 --head 9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed --json | python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps({"status":d["status"],"findings":d["findings"],"symbol_count":len(d["symbols"])}, indent=2))'
python3 tools/pr_test_quality.py --root /tmp/anyps5-pr10395-exact --json core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp
python3 tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/10395-20261103-rebase/stack
gh pr checks 10395 --repo boykopovar/AnyPS5

Results

Check Result Note
Diff and conventions passed No whitespace or convention issue found.
ABI audit passed 399 symbols checked; no findings.
Test registration passed Both CTest entries are present in CMake.
Current-base preview passed Clean against the current base.
Hosted conventions and labels not run Both current checks remain pending.
Author-reported Linux build and tests not run The author reports 118/118 selected tests on this head.
Local build and CTest not run No compilation was run in this review.
Precheck table and relevant raw output
| Check | Status | Command / reason |
|---|---|---|
| build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` |
| diff_check | passed | `git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed` |
| conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 --head 9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed --title feat(libSceLibreSsl): implement EC groups and keys for named curves --body /tmp/anyps5-pr-precheck/10395-20261103-rebase/pr-body.md` |
| changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 --head 9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed --json` |
| python_syntax | not_applicable | `No changed Python implementation files.` |
| related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` |
| python_test_registration | not_applicable | `No changed test_*.py files.` |
| live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/10395-20261103-rebase/stack` |
| build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` |
| test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/10395-20261103-rebase/head-9327713d3a0e-a8d08c30/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/10395-20261103-rebase/head-9327713d3a0e-a8d08c30 --json core/libs/prx/libSceLibreSsl/CMakeLists.txt core/libs/prx/libSceLibreSsl/Export.cpp core/libs/prx/libSceLibreSsl/include/Api.hpp core/libs/prx/libSceLibreSsl/include/Ec.hpp core/libs/prx/libSceLibreSsl/src/Ec.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp docs/dev/debt/libSceLibreSsl.md docs/dev/debt/libSceLibreSsl3.md` |
| negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` |
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/10395-20261103-rebase/head-9327713d3a0e-a8d08c30/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/10395-20261103-rebase/head-9327713d3a0e-a8d08c30/tools/pr_test_quality.py': [Errno 2] No such file or directory

Direct ABI audit summary:

{
  "status": "passed",
  "findings": [],
  "symbol_count": 399
}

Test-quality helper warnings:

{
  "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."
    },
    {
      "path": "core/libs/tests/GuestLibreSslEc.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": []
}

Both sources are registered by add_test_executable in their library CMake files. Hosted status at refresh:

conventions	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41602828197/job/125805401241
labels	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41602453737/job/125804186028

Negative control

Not run by me. The author reports that the new EC test fails when secp224k1 is mapped to secp224r1; I did not independently reproduce this control.

Findings

Blocking

None found in the ten changed files.

Non-blocking

The current conventions and labels checks have not completed. The test-quality heuristic flags both C++ tests because it does not resolve the CMake helper's generated source path; direct inspection confirms that both tests are registered.

Sources

Not verified

I did not run a local build, CTest, AddressSanitizer, console behavior, or the author's reported negative control. The current conventions and labels checks remain pending. The author-reported Linux results are not independently reproduced here.

To get this to a good state

Let the current conventions and labels checks finish. I will refresh the head and checks before deciding whether to approve.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5749110875 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5749110875). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T08:31:05Z. **Review:** COMMENTED --- # Re-checked — new head, no blocking findings The rebased change still matches the reviewed curve list and key layout; the current conventions and labels checks are pending, so this is a COMMENTED result. ## What I ran Reviewed all ten changed files at head `9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed` against base `4f41f4c375f5abb487dbd184fbc150f31994d762`. The current-base merge preview is clean. Environment: Debian 12 x86_64, Python 3.11.2, Git 2.39.5. I did not build or run CTest. The author reports an exact-head Linux build and 118/118 selected tests; I did not reproduce these. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10395 --output-dir /tmp/anyps5-pr-precheck/10395-20261103-rebase git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 4f41f4c375f5abb487dbd184fbc150f31994d762 --head 9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed --json | python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps({"status":d["status"],"findings":d["findings"],"symbol_count":len(d["symbols"])}, indent=2))' python3 tools/pr_test_quality.py --root /tmp/anyps5-pr10395-exact --json core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp python3 tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/10395-20261103-rebase/stack gh pr checks 10395 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | No whitespace or convention issue found. | | ABI audit | passed | 399 symbols checked; no findings. | | Test registration | passed | Both CTest entries are present in CMake. | | Current-base preview | passed | Clean against the current base. | | Hosted conventions and labels | not run | Both current checks remain pending. | | Author-reported Linux build and tests | not run | The author reports 118/118 selected tests on this head. | | Local build and CTest | not run | No compilation was run in this review. | <details> <summary>Precheck table and relevant raw output</summary> ```text | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 --head 9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed --title feat(libSceLibreSsl): implement EC groups and keys for named curves --body /tmp/anyps5-pr-precheck/10395-20261103-rebase/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 --head 9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 10395 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/10395-20261103-rebase/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/10395-20261103-rebase/head-9327713d3a0e-a8d08c30/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/10395-20261103-rebase/head-9327713d3a0e-a8d08c30 --json core/libs/prx/libSceLibreSsl/CMakeLists.txt core/libs/prx/libSceLibreSsl/Export.cpp core/libs/prx/libSceLibreSsl/include/Api.hpp core/libs/prx/libSceLibreSsl/include/Ec.hpp core/libs/prx/libSceLibreSsl/src/Ec.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/tests/GuestLibreSsl3KeyReference.cpp core/libs/tests/GuestLibreSslEc.cpp docs/dev/debt/libSceLibreSsl.md docs/dev/debt/libSceLibreSsl3.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | ``` ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/10395-20261103-rebase/head-9327713d3a0e-a8d08c30/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/10395-20261103-rebase/head-9327713d3a0e-a8d08c30/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` Direct ABI audit summary: ```json { "status": "passed", "findings": [], "symbol_count": 399 } ``` Test-quality helper warnings: ```json { "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." }, { "path": "core/libs/tests/GuestLibreSslEc.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": [] } ``` Both sources are registered by `add_test_executable` in their library CMake files. Hosted status at refresh: ```text conventions pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41602828197/job/125805401241 labels pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41602453737/job/125804186028 ``` </details> ## Negative control Not run by me. The author reports that the new EC test fails when secp224k1 is mapped to secp224r1; I did not independently reproduce this control. ## Findings ### Blocking None found in the ten changed files. ### Non-blocking The current conventions and labels checks have not completed. The test-quality heuristic flags both C++ tests because it does not resolve the CMake helper's generated source path; direct inspection confirms that both tests are registered. ## Sources - [EC implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed/core/libs/prx/libSceLibreSsl/src/Ec.cpp) - [EC test at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed/core/libs/tests/GuestLibreSslEc.cpp) - [Shared-key layout and lifetime test at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed/core/libs/tests/GuestLibreSsl3KeyReference.cpp) - [Pinned LibreSSL 2.5.4 curve table](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/ec/ec_curve.c) - [Pinned LibreSSL 2.5.4 key implementation](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/ec/ec_key.c) - [Pinned LibreSSL 2.5.4 ECDSA size implementation](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/ecdsa/ecs_lib.c) ## Not verified I did not run a local build, CTest, AddressSanitizer, console behavior, or the author's reported negative control. The current conventions and labels checks remain pending. The author-reported Linux results are not independently reproduced here. ## To get this to a good state Let the current conventions and labels checks finish. I will refresh the head and checks before deciding whether to approve.
XairRrR commented 2026-11-03 15:35:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T15:35:42Z.

Review: APPROVED


Reviewed — approved

The nine EC exports and the 64-byte EcKey layout shared with libSceLibreSsl3 build and pass their tests on the merged tree. Both mutation controls make the tests fail, and I found nothing blocking.

What I ran

Head 9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged with --no-ff (tree 719ba88157c01461ebf0ac44227e3aca2d34d879). Debian 13 VM (32 vCPU, Xeon Gold 6136), GCC 14.2.0, Release, Ninja, BUILD_TESTING=ON.

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_libressl_ec|guest_libressl3_key_reference|public_headers$" --repeat until-fail:3
# negative control (mutations), then restore from the merged tree
sed -i "s/{712, MBEDTLS_ECP_DP_SECP224K1}/{712, MBEDTLS_ECP_DP_SECP224R1}/" core/libs/prx/libSceLibreSsl/src/Ec.cpp
sed -i "s/version = 1;/version = 0;/; s/conversionForm = 4;/conversionForm = 0;/" core/libs/prx/libSceLibreSsl/include/Ec.hpp
ninja -C build -j32 -l32 guest_libressl_ec_tests guest_libressl3_key_reference_tests
build/tests/guest_libressl_ec_tests
build/tests/guest_libressl3_key_reference_tests ec
git show 719ba88157c01461ebf0ac44227e3aca2d34d879:<path> > <path>   # both files
ninja -C build -j32 -l32 guest_libressl_ec_tests guest_libressl3_key_reference_tests
build/tests/guest_libressl_ec_tests; build/tests/guest_libressl3_key_reference_tests   # x3
git status --porcelain

Results

Check Result
git diff --check Pass, no output
check_conventions.py Pass: "All conventions checks passed."
Configure, build, libs (script) OK
Script test run (2475 tests) No new failures and no timeouts. Known main failures: guest_interfaces, guest_socket_options_multicast, unwrap_self_..._group, vector_constant_factor_tininess. Unexpected skip guest_net_ctl also happens on main.
guest_libressl_ec Pass, 3 of 3 (0.01 s each)
guest_libressl3_key_reference Pass, 3 of 3 (0.01 s each), including the 4×1000 concurrent retain/free loop
public_headers Pass, 3 of 3. It takes about 60 s here, but main's baseline is 57.2 s, so this comes from main, not the PR
Worktree after the controls git status --porcelain is empty
Focused ctest output
1/3 Test  #503: public_headers ...................   Passed   62.12 sec
2/3 Test #2820: guest_libressl_ec ................   Passed    0.01 sec
3/3 Test #2844: guest_libressl3_key_reference ....   Passed    0.01 sec
100% tests passed, 0 tests failed out of 3

Negative control

Restoring all production files from main removes include/Ec.hpp, which both tests include, so the tests would not compile. That says nothing useful, so I tested with targeted mutations of the production code instead:

  • Curve mapping: mapping NID 712 (secp224k1) to MBEDTLS_ECP_DP_SECP224R1 makes guest_libressl_ec abort with failed: ECDSA_size (exit 134). This confirms the author's control.
  • Key defaults: setting EcKey::version and conversionForm to 0 makes guest_libressl3_key_reference_tests ec abort with new EC key version or conversion form (exit 134). This confirms the control the author reported for MarcZX10's change request.

After restoring both files from the merged tree and rebuilding, both tests pass three times and the worktree is clean.

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceLibreSsl/src/Ec.cpp:43 uses std::pair but does not include <utility>. It builds now only because another header pulls it in. Add #include <utility>.
  • core/libs/tests/GuestLibreSsl3KeyReference.cpp:87 calls EC_KEY_up_ref on an EcKey through reinterpret_cast<LibreSsl3EcKey*>. This stands in for what a guest does across the ABI, and the static_asserts on size and counter offset guard the layout. Strictly, though, it reaches references through an unrelated type, so the test depends on the two structs keeping the same layout, not on a shared type. It is fine for a test, but a shared header type for the counter prefix would make the contract explicit if more code relies on it.

On the code, I checked against the logic of the cited LibreSSL 2.5.4 sources:

  • ECDSA_size (DER integer with the top-bit pad, doubled, inside a SEQUENCE) gives 72 for P-256, 66 for secp224k1 (225-bit order) and 141 for P-521.
  • EC_KEY_free frees at a new count ≤ 0, the same as CRYPTO_add(..., -1) > 0.
  • EC_KEY_set_group makes the copy before deleting the old group, so self-assignment is safe; the debt entry records this difference.

I agree with the earlier non-blocking points from MarcZX10 and ahmadmuj (the 4.0.0 layout versus the 2.5.4 header, and the missing EC_R_UNKNOWN_GROUP). Both are disclosed in the debt entry, and I have nothing new to add on them.

Not verified

  • Console behaviour and the console's EC_KEY layout and lifetime interoperability, which the debt entry records.
  • The AddressSanitizer and leak-detection run the author reports: this build tree is not configured with sanitizers.
  • Windows (other participants report Windows runs on earlier heads).
  • That the 79 curves missing from mbedtls throw: the test was removed on request, and I only read the code (Ec.cpp:52-53).
  • No Vulkan validation comparison: the change touches no AGC driver, shader recompiler or VideoOut file.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5755010009 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10395#pullrequestreview-5755010009). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T15:35:42Z. **Review:** APPROVED --- # Reviewed — approved The nine EC exports and the 64-byte `EcKey` layout shared with libSceLibreSsl3 build and pass their tests on the merged tree. Both mutation controls make the tests fail, and I found nothing blocking. ## What I ran Head `9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged with `--no-ff` (tree `719ba88157c01461ebf0ac44227e3aca2d34d879`). Debian 13 VM (32 vCPU, Xeon Gold 6136), GCC 14.2.0, Release, Ninja, `BUILD_TESTING=ON`. ```sh git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "guest_libressl_ec|guest_libressl3_key_reference|public_headers$" --repeat until-fail:3 # negative control (mutations), then restore from the merged tree sed -i "s/{712, MBEDTLS_ECP_DP_SECP224K1}/{712, MBEDTLS_ECP_DP_SECP224R1}/" core/libs/prx/libSceLibreSsl/src/Ec.cpp sed -i "s/version = 1;/version = 0;/; s/conversionForm = 4;/conversionForm = 0;/" core/libs/prx/libSceLibreSsl/include/Ec.hpp ninja -C build -j32 -l32 guest_libressl_ec_tests guest_libressl3_key_reference_tests build/tests/guest_libressl_ec_tests build/tests/guest_libressl3_key_reference_tests ec git show 719ba88157c01461ebf0ac44227e3aca2d34d879:<path> > <path> # both files ninja -C build -j32 -l32 guest_libressl_ec_tests guest_libressl3_key_reference_tests build/tests/guest_libressl_ec_tests; build/tests/guest_libressl3_key_reference_tests # x3 git status --porcelain ``` ## Results | Check | Result | |---|---| | `git diff --check` | Pass, no output | | `check_conventions.py` | Pass: "All conventions checks passed." | | Configure, build, `libs` (script) | OK | | Script test run (2475 tests) | No new failures and no timeouts. Known `main` failures: `guest_interfaces`, `guest_socket_options_multicast`, `unwrap_self_..._group`, `vector_constant_factor_tininess`. Unexpected skip `guest_net_ctl` also happens on `main`. | | `guest_libressl_ec` | Pass, 3 of 3 (0.01 s each) | | `guest_libressl3_key_reference` | Pass, 3 of 3 (0.01 s each), including the 4×1000 concurrent retain/free loop | | `public_headers` | Pass, 3 of 3. It takes about 60 s here, but `main`'s baseline is 57.2 s, so this comes from `main`, not the PR | | Worktree after the controls | `git status --porcelain` is empty | <details><summary>Focused ctest output</summary> ```text 1/3 Test #503: public_headers ................... Passed 62.12 sec 2/3 Test #2820: guest_libressl_ec ................ Passed 0.01 sec 3/3 Test #2844: guest_libressl3_key_reference .... Passed 0.01 sec 100% tests passed, 0 tests failed out of 3 ``` </details> ## Negative control Restoring all production files from `main` removes `include/Ec.hpp`, which both tests include, so the tests would not compile. That says nothing useful, so I tested with targeted mutations of the production code instead: - **Curve mapping:** mapping NID 712 (secp224k1) to `MBEDTLS_ECP_DP_SECP224R1` makes `guest_libressl_ec` abort with `failed: ECDSA_size` (exit 134). This confirms the author's control. - **Key defaults:** setting `EcKey::version` and `conversionForm` to 0 makes `guest_libressl3_key_reference_tests ec` abort with `new EC key version or conversion form` (exit 134). This confirms the control the author reported for MarcZX10's change request. After restoring both files from the merged tree and rebuilding, both tests pass three times and the worktree is clean. ## Findings ### Blocking None. ### Non-blocking - `core/libs/prx/libSceLibreSsl/src/Ec.cpp:43` uses `std::pair` but does not include `<utility>`. It builds now only because another header pulls it in. Add `#include <utility>`. - `core/libs/tests/GuestLibreSsl3KeyReference.cpp:87` calls `EC_KEY_up_ref` on an `EcKey` through `reinterpret_cast<LibreSsl3EcKey*>`. This stands in for what a guest does across the ABI, and the `static_assert`s on size and counter offset guard the layout. Strictly, though, it reaches `references` through an unrelated type, so the test depends on the two structs keeping the same layout, not on a shared type. It is fine for a test, but a shared header type for the counter prefix would make the contract explicit if more code relies on it. On the code, I checked against the logic of the cited LibreSSL 2.5.4 sources: - `ECDSA_size` (DER integer with the top-bit pad, doubled, inside a SEQUENCE) gives 72 for P-256, 66 for secp224k1 (225-bit order) and 141 for P-521. - `EC_KEY_free` frees at a new count ≤ 0, the same as `CRYPTO_add(..., -1) > 0`. - `EC_KEY_set_group` makes the copy before deleting the old group, so self-assignment is safe; the debt entry records this difference. I agree with the earlier non-blocking points from MarcZX10 and ahmadmuj (the 4.0.0 layout versus the 2.5.4 header, and the missing `EC_R_UNKNOWN_GROUP`). Both are disclosed in the debt entry, and I have nothing new to add on them. ## Not verified - Console behaviour and the console's `EC_KEY` layout and lifetime interoperability, which the debt entry records. - The AddressSanitizer and leak-detection run the author reports: this build tree is not configured with sanitizers. - Windows (other participants report Windows runs on earlier heads). - That the 79 curves missing from mbedtls throw: the test was removed on request, and I only read the code (`Ec.cpp:52-53`). - No Vulkan validation comparison: the change touches no AGC driver, shader recompiler or VideoOut file. <!-- anyps5-bots job=2063 head=9327713d3a0e7cd23b652f6bf5b7d52bb8e7aaed -->
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!10395
No description provided.