feat(libSceLibreSsl3): implement ECDSA_SIG_get0 #15449

Merged
AlexWhitehouse merged 1 commit from upstream-pr/15449 into main 2026-11-07 14:06:50 +00:00
AlexWhitehouse commented 2026-11-03 11:09:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexWhitehouse on 2026-11-03T11:09:26Z.


What

Implements the libSceLibreSsl3 export ECDSA_SIG_get0 (NID z8fsXF8JuL0), which threw through NotImplemented_nid_no_patch.

It is ported from LibreSSL 4.0.0's ecdsa.c, the revision the library already targets, into a new core/libs/prx/libSceLibreSsl3/src/EcdsaSig.cpp. The file starts with ecdsa.c's copyright and licence notice, copied byte for byte.

  • Behaviour: each output pointer is optional, and r is written before s, as upstream does.
  • Null signature: with no outputs requested, the call does nothing. With an output requested, it throws without writing, because upstream would dereference null there.
  • Layout: include/EcdsaSig.hpp holds the 16-byte ECDSA_SIG layout from ecdsa_local.h, with r at offset 0 and s at 8, pinned with static_asserts.
  • Declaration: include/Api.hpp replaces the parameterless stub declaration with the typed one.

Debt (docs/dev/debt/libSceLibreSsl3.md):

  • a new entry says the console layout and behaviour are unverified;
  • the export's table row is removed;
  • the additional-export inventory is recounted from AdditionalExports.cpp: 141 to 140 callable exports, 131 to 130 named, with 10 still known only by NID;
  • ECDSA_SIG_get0 was one of the names #13831 assigned by NID hash. Since #14889 that sentence no longer carries a count, and it stays true after this PR, so it is unchanged.

Tested

  • guest_libressl3_ecdsa_sig (core/libs/prx/libSceLibreSsl3/tests/EcdsaSig.cpp) loads the guest library and calls the export through its NID. It covers:
    • every combination of null and non-null r and s fields with every combination of requested outputs, checking that unrequested outputs keep their sentinel and the signature is untouched;
    • one pointer passed for both outputs, which must end up holding s, since r is written first;
    • a null signature with no outputs (does nothing) and with each output requested (throws without writing).
  • Linux (Ubuntu 26.04, GCC 15):
    • with this PR, all 11 LibreSSL3 tests pass;
    • the same test binary against main's library (main's AdditionalExports.cpp and Api.hpp, with EcdsaSig.cpp emptied) fails with ECDSA_SIG_get0 threw: ECDSA_SIG_get0_nid_postfix not implemented.
  • Windows 11 (MinGW GCC 15.2.0):
    • with this PR (c670edf726; the final commit only moves lines in CMakeLists.txt, Api.hpp and the debt file, and fixes the commit message), all 11 LibreSSL3 tests pass;
    • the change's test binary against main's library fails with ECDSA_SIG_get0_nid_postfix not implemented, then passes again once restored;
    • no compiler warnings in the new files.
  • Rebased onto main 3c2af82080 (after #14366, #10395, #10557, #10960, #14292, #10490, #10491, #12928, #14992, #14483, #15045, #12754, #11128, #14409, #12945, #14208, #16258, #15119, #15303, #15406, #14889 and the ASN.1 string, ASN.1 object, key query and X509 extension work merged): only the count lines changed, and the source and test registration now follow #16258's DigestNames lines. On Linux (GCC 15), all 34 LibreSSL3 tests pass, including guest_libressl3_ecdsa_sig, guest_libressl3_rsa_getters, guest_libressl3_rsa_setters, guest_libressl3_tls_protocols, guest_libressl3_mixed_evp, guest_libressl3_key_components and guest_libressl3_x509_validity.
  • Mutation check: swapping the r and s stores fails at tests/EcdsaSig.cpp:39. This was run on the first version of the branch; the implementation is unchanged.
  • python3 tools/check_conventions.py --base origin/main: all conventions checks passed.
  • python3 tools/pr_overlap.py: no other open PR implements ECDSA_SIG_get0 (searched by name and NID).

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:5136178212 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15449). Originally posted by [AlexWhitehouse](https://github.com/AlexWhitehouse) on 2026-11-03T11:09:26Z. --- ### What Implements the libSceLibreSsl3 export `ECDSA_SIG_get0` (NID `z8fsXF8JuL0`), which threw through `NotImplemented_nid_no_patch`. It is ported from LibreSSL 4.0.0's [`ecdsa.c`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/ecdsa/ecdsa.c#L126-L134), the revision the library already targets, into a new `core/libs/prx/libSceLibreSsl3/src/EcdsaSig.cpp`. The file starts with `ecdsa.c`'s copyright and licence notice, copied byte for byte. - **Behaviour:** each output pointer is optional, and `r` is written before `s`, as upstream does. - **Null signature:** with no outputs requested, the call does nothing. With an output requested, it throws without writing, because upstream would dereference null there. - **Layout:** `include/EcdsaSig.hpp` holds the 16-byte `ECDSA_SIG` layout from `ecdsa_local.h`, with `r` at offset 0 and `s` at 8, pinned with `static_assert`s. - **Declaration:** `include/Api.hpp` replaces the parameterless stub declaration with the typed one. **Debt** (`docs/dev/debt/libSceLibreSsl3.md`): - a new entry says the console layout and behaviour are unverified; - the export's table row is removed; - the additional-export inventory is recounted from `AdditionalExports.cpp`: 141 to 140 callable exports, 131 to 130 named, with 10 still known only by NID; - `ECDSA_SIG_get0` was one of the names #13831 assigned by NID hash. Since #14889 that sentence no longer carries a count, and it stays true after this PR, so it is unchanged. ### Tested - **`guest_libressl3_ecdsa_sig`** (`core/libs/prx/libSceLibreSsl3/tests/EcdsaSig.cpp`) loads the guest library and calls the export through its NID. It covers: - every combination of null and non-null `r` and `s` fields with every combination of requested outputs, checking that unrequested outputs keep their sentinel and the signature is untouched; - one pointer passed for both outputs, which must end up holding `s`, since `r` is written first; - a null signature with no outputs (does nothing) and with each output requested (throws without writing). - **Linux (Ubuntu 26.04, GCC 15):** - with this PR, all 11 LibreSSL3 tests pass; - the same test binary against `main`'s library (`main`'s `AdditionalExports.cpp` and `Api.hpp`, with `EcdsaSig.cpp` emptied) fails with `ECDSA_SIG_get0 threw: ECDSA_SIG_get0_nid_postfix not implemented`. - **Windows 11 (MinGW GCC 15.2.0):** - with this PR (c670edf726; the final commit only moves lines in `CMakeLists.txt`, `Api.hpp` and the debt file, and fixes the commit message), all 11 LibreSSL3 tests pass; - the change's test binary against `main`'s library fails with `ECDSA_SIG_get0_nid_postfix not implemented`, then passes again once restored; - no compiler warnings in the new files. - **Rebased onto `main` 3c2af82080** (after #14366, #10395, #10557, #10960, #14292, #10490, #10491, #12928, #14992, #14483, #15045, #12754, #11128, #14409, #12945, #14208, #16258, #15119, #15303, #15406, #14889 and the ASN.1 string, ASN.1 object, key query and X509 extension work merged): only the count lines changed, and the source and test registration now follow #16258's `DigestNames` lines. On Linux (GCC 15), all 34 LibreSSL3 tests pass, including `guest_libressl3_ecdsa_sig`, `guest_libressl3_rsa_getters`, `guest_libressl3_rsa_setters`, `guest_libressl3_tls_protocols`, `guest_libressl3_mixed_evp`, `guest_libressl3_key_components` and `guest_libressl3_x509_validity`. - **Mutation check:** swapping the `r` and `s` stores fails at `tests/EcdsaSig.cpp:39`. This was run on the first version of the branch; the implementation is unchanged. - `python3 tools/check_conventions.py --base origin/main`: all conventions checks passed. - **`python3 tools/pr_overlap.py`:** no other open PR implements `ECDSA_SIG_get0` (searched by name and NID). - **The inventory count and NID-hash lines** are shared with #14366, #14889, #14890, #14992, #15031, #15045, #15119, #15289, #15303 and #15406, as every LibreSSL3 implementation edits them. Whichever merges second rebases those lines. - **Moved to avoid conflicts:** the test registration, the new debt entry and the `Api.hpp` include sit where #10452, #10490, #10491, #10493 and #10960 don't insert theirs; trial merges with those five are clean. ### 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)
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!15449
No description provided.