feat(libSceLibreSsl3): implement RSA_get0_factors and RSA_get0_crt_params #14366

Merged
AlexWhitehouse merged 3 commits from upstream-pr/14366 into main 2026-11-05 18:46:09 +00:00
AlexWhitehouse commented 2026-11-01 10:35:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexWhitehouse on 2026-11-01T10:35:18Z.


What

Implements RSA_get0_factors (PcUZS7XHwHk) and RSA_get0_crt_params (eyrIagsax0w) in libSceLibreSsl3, which throw on main since #13831 named them. Both are ported from LibreSSL 4.0.0 rsa_lib.c, the version the debt file already targets:

  • every output pointer is optional;
  • outputs are written in upstream's order;
  • nothing is allocated or reference counted;
  • a null RSA with no outputs requested does nothing, as upstream;
  • a null RSA with an output requested, which upstream dereferences, throws without writing any output.

They read the existing 152-byte LibreSsl3Rsa. Key.hpp now pins p, q, dmp1, dmq1 and iqmp at offsets 48, 56, 64, 72 and 80. Those offsets match struct rsa_st in LibreSSL 4.0.0 rsa_local.h, checked by compiling both declarations side by side.

The debt file gets a Functional entry and drops the two inventory rows. The inventory sentence now also counts the names #13831 added: 174 callable exports, 164 named and 10 known only by NID. On main it still says 50 named and 126 unknown.

Tested

  • Ubuntu 26.04 x86-64, GCC 15.2, full build.
  • New test guest_libressl3_rsa_getters. It resolves both exports by NID from the patched libSceLibreSsl3.prx. It covers:
    • every combination of requested outputs (4 for factors, 8 for CRT parameters) across 32 null and non-null field patterns;
    • outputs aliasing one slot, which shows upstream's write order;
    • the RSA bytes unchanged afterwards;
    • a null RSA with no outputs;
    • a null RSA with requested outputs, which throws without writing.
  • On main (a644edf30c) the test fails with RSA_get0_factors threw: RSA_get0_factors_nid_postfix not implemented and RSA_get0_crt_params threw: RSA_get0_crt_params_nid_postfix not implemented. On this branch it passes.
  • ctest --test-dir build-full -R 'guest_libressl3|guest_crypto_memcmp|public_headers': 75/75 passed.
  • python3 tools/check_conventions.py --base origin/main: all conventions checks passed.
  • python3 tools/pr_overlap.py --branch feat/libressl3-rsa-get0-factors-crt: no PR shares these exports. #10960 and #12945 only add lines next to these in Key.hpp, Key.cpp and the debt file. The tool could not compare 11 open libSceLibreSsl3 PRs that conflict with main (#9970, #10452, #10461, #10490, #10491, #10493, #10557, #10631, #11146, #12754, #14212), so I grepped their diffs: none adds either export or NID. #10490 implements RSA_get0_key and the DH and DSA accessors.
  • Not run on Windows or macOS. The Windows test registration matches guest_libressl_protocol_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:5106534085 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14366). Originally posted by [AlexWhitehouse](https://github.com/AlexWhitehouse) on 2026-11-01T10:35:18Z. --- ### What Implements `RSA_get0_factors` (`PcUZS7XHwHk`) and `RSA_get0_crt_params` (`eyrIagsax0w`) in libSceLibreSsl3, which throw on `main` since #13831 named them. Both are ported from LibreSSL 4.0.0 [`rsa_lib.c`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/rsa/rsa_lib.c), the version the debt file already targets: - every output pointer is optional; - outputs are written in upstream's order; - nothing is allocated or reference counted; - a null RSA with no outputs requested does nothing, as upstream; - a null RSA with an output requested, which upstream dereferences, throws without writing any output. They read the existing 152-byte `LibreSsl3Rsa`. `Key.hpp` now pins `p`, `q`, `dmp1`, `dmq1` and `iqmp` at offsets 48, 56, 64, 72 and 80. Those offsets match `struct rsa_st` in LibreSSL 4.0.0 `rsa_local.h`, checked by compiling both declarations side by side. The debt file gets a Functional entry and drops the two inventory rows. The inventory sentence now also counts the names #13831 added: 174 callable exports, 164 named and 10 known only by NID. On `main` it still says 50 named and 126 unknown. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Ubuntu 26.04 x86-64, GCC 15.2, full build. - New test `guest_libressl3_rsa_getters`. It resolves both exports by NID from the patched `libSceLibreSsl3.prx`. It covers: - every combination of requested outputs (4 for factors, 8 for CRT parameters) across 32 null and non-null field patterns; - outputs aliasing one slot, which shows upstream's write order; - the RSA bytes unchanged afterwards; - a null RSA with no outputs; - a null RSA with requested outputs, which throws without writing. - On `main` (a644edf30c) the test fails with `RSA_get0_factors threw: RSA_get0_factors_nid_postfix not implemented` and `RSA_get0_crt_params threw: RSA_get0_crt_params_nid_postfix not implemented`. On this branch it passes. - `ctest --test-dir build-full -R 'guest_libressl3|guest_crypto_memcmp|public_headers'`: 75/75 passed. - `python3 tools/check_conventions.py --base origin/main`: all conventions checks passed. - `python3 tools/pr_overlap.py --branch feat/libressl3-rsa-get0-factors-crt`: no PR shares these exports. #10960 and #12945 only add lines next to these in `Key.hpp`, `Key.cpp` and the debt file. The tool could not compare 11 open libSceLibreSsl3 PRs that conflict with `main` (#9970, #10452, #10461, #10490, #10491, #10493, #10557, #10631, #11146, #12754, #14212), so I grepped their diffs: none adds either export or NID. #10490 implements `RSA_get0_key` and the DH and DSA accessors. - Not run on Windows or macOS. The Windows test registration matches `guest_libressl_protocol_nid`. ### 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-11-01 10:45:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T10:45:55Z.

Review: COMMENTED


Reviewed — no blocking findings

The two getters match the null handling and output order of LibreSSL 4.0.0 RSA_get0_factors and RSA_get0_crt_params, and the new RSA field offsets match upstream rsa_st on LP64; I did not build or run the new test, and hosted checks were still pending when I checked.

What I ran

Exact head c947e1d29833f36b204ed802763adb69ef3ba4ba, base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 (current main, the PR base). Environment: Debian 12, Linux x86-64, Python 3.11.2, GCC 12.2.0 driver (no compile).

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14366
python3 tools/pr_abi_audit.py --base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 --head c947e1d29833f36b204ed802763adb69ef3ba4ba
git archive c947e1d29833f36b204ed802763adb69ef3ba4ba | tar -x -C <new empty directory>
python3 tools/pr_test_quality.py --root <that directory> --json core/libs/prx/libSceLibreSsl3/tests/RsaGetters.cpp
gh api "repos/libressl/openbsd/contents/src/lib/libcrypto/rsa/rsa_lib.c?ref=ce488b78e0bd994780569df718596b9776ff681a"
gh api "repos/libressl/openbsd/contents/src/lib/libcrypto/rsa/rsa_local.h?ref=ce488b78e0bd994780569df718596b9776ff681a"

The precheck ran its conventions, diff and live stack checks and passed them. Its ABI audit and test-quality steps reported failure only because tools/pr_abi_audit.py and tools/pr_test_quality.py are absent from the head tree; I ran both by hand as shown above.

Results

Check Result
git diff --check (precheck) Passed.
Conventions and PR template (precheck, with the PR title and body) Passed.
Live dependency and mergeability (precheck stack check) Passed.
Export ABI audit (by hand) Passed. RSA_get0_factors (NID PcUZS7XHwHk) and RSA_get0_crt_params (NID eyrIagsax0w) each have one declaration and one definition.
Test-quality heuristic (by hand) One "possibly unregistered" finding for RsaGetters.cpp. False positive: the file is registered at core/libs/prx/libSceLibreSsl3/CMakeLists.txt line 27.
Upstream comparison (read through the GitHub API) Null handling and output write order of both getters match rsa_lib.c at ce488b78.
Struct offsets (read by hand) LibreSsl3Rsa p=48, q=56, dmp1=64, dmq1=72, iqmp=80 agree with struct rsa_st in rsa_local.h at ce488b78 on LP64: pad int at 0, version at 8, meth at 16, n at 24, e at 32, d at 40.
Inventory sentence (by hand) 174 declarations in AdditionalExports.cpp and 10 unknown rows in the debt table, so 164 named. This matches the new sentence.
Build, CTest, new test Not run.
Hosted checks Conventions, eligibility, intake, labels, library-portability and report were pending at my check.
Unedited ABI audit output (filtered to the two changed getters)
ABI audit: passed
RSA_get0_crt_params_nid_postfix: NID=eyrIagsax0w declarations=1 definitions=1 aliases=0
RSA_get0_factors_nid_postfix: NID=PcUZS7XHwHk declarations=1 definitions=1 aliases=0
limit: This lexical audit does not parse C++ fully, prove calling-convention or binary ABI correctness, verify runtime version tables, or replace compilation.

Negative control

Not exercised by me. The author reports that the new test fails on main at its first sanity call (RSA_get0_factors threw: ... not implemented).

Findings

Blocking: None.

Non-blocking: That base failure comes from the missing-implementation throw, not from an assertion about field reads or write order, so it does not show that Run would catch a wrong field. A small mutation (for example swapping dmp1 and dmq1 in Key.cpp) would show whether the assertions catch it. This is optional.

Sources

Not verified

  • The new test guest_libressl3_rsa_getters was not built or run. The author reports a 75/75 focused CTest run on Ubuntu 26.04 with GCC 15.2; I did not reproduce it.
  • Windows and macOS were not run. The console layout is unverified, as the debt entry states.
  • Hosted checks were pending at my check.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727646080 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14366#pullrequestreview-5727646080). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T10:45:55Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The two getters match the null handling and output order of LibreSSL 4.0.0 `RSA_get0_factors` and `RSA_get0_crt_params`, and the new RSA field offsets match upstream `rsa_st` on LP64; I did not build or run the new test, and hosted checks were still pending when I checked. ## What I ran Exact head `c947e1d29833f36b204ed802763adb69ef3ba4ba`, base `ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4` (current `main`, the PR base). Environment: Debian 12, Linux x86-64, Python 3.11.2, GCC 12.2.0 driver (no compile). ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14366 python3 tools/pr_abi_audit.py --base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 --head c947e1d29833f36b204ed802763adb69ef3ba4ba git archive c947e1d29833f36b204ed802763adb69ef3ba4ba | tar -x -C <new empty directory> python3 tools/pr_test_quality.py --root <that directory> --json core/libs/prx/libSceLibreSsl3/tests/RsaGetters.cpp gh api "repos/libressl/openbsd/contents/src/lib/libcrypto/rsa/rsa_lib.c?ref=ce488b78e0bd994780569df718596b9776ff681a" gh api "repos/libressl/openbsd/contents/src/lib/libcrypto/rsa/rsa_local.h?ref=ce488b78e0bd994780569df718596b9776ff681a" ``` The precheck ran its conventions, diff and live stack checks and passed them. Its ABI audit and test-quality steps reported failure only because `tools/pr_abi_audit.py` and `tools/pr_test_quality.py` are absent from the head tree; I ran both by hand as shown above. ## Results | Check | Result | |---|---| | `git diff --check` (precheck) | Passed. | | Conventions and PR template (precheck, with the PR title and body) | Passed. | | Live dependency and mergeability (precheck stack check) | Passed. | | Export ABI audit (by hand) | Passed. `RSA_get0_factors` (NID `PcUZS7XHwHk`) and `RSA_get0_crt_params` (NID `eyrIagsax0w`) each have one declaration and one definition. | | Test-quality heuristic (by hand) | One "possibly unregistered" finding for `RsaGetters.cpp`. False positive: the file is registered at `core/libs/prx/libSceLibreSsl3/CMakeLists.txt` line 27. | | Upstream comparison (read through the GitHub API) | Null handling and output write order of both getters match `rsa_lib.c` at `ce488b78`. | | Struct offsets (read by hand) | `LibreSsl3Rsa` p=48, q=56, dmp1=64, dmq1=72, iqmp=80 agree with `struct rsa_st` in `rsa_local.h` at `ce488b78` on LP64: `pad` int at 0, `version` at 8, `meth` at 16, n at 24, e at 32, d at 40. | | Inventory sentence (by hand) | 174 declarations in `AdditionalExports.cpp` and 10 `unknown` rows in the debt table, so 164 named. This matches the new sentence. | | Build, CTest, new test | Not run. | | Hosted checks | Conventions, eligibility, intake, labels, library-portability and report were pending at my check. | <details><summary>Unedited ABI audit output (filtered to the two changed getters)</summary> ```text ABI audit: passed RSA_get0_crt_params_nid_postfix: NID=eyrIagsax0w declarations=1 definitions=1 aliases=0 RSA_get0_factors_nid_postfix: NID=PcUZS7XHwHk declarations=1 definitions=1 aliases=0 limit: This lexical audit does not parse C++ fully, prove calling-convention or binary ABI correctness, verify runtime version tables, or replace compilation. ``` </details> ## Negative control Not exercised by me. The author reports that the new test fails on `main` at its first sanity call (`RSA_get0_factors threw: ... not implemented`). ## Findings **Blocking:** None. **Non-blocking:** That base failure comes from the missing-implementation throw, not from an assertion about field reads or write order, so it does not show that `Run` would catch a wrong field. A small mutation (for example swapping `dmp1` and `dmq1` in `Key.cpp`) would show whether the assertions catch it. This is optional. ## Sources - [Getters at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/c947e1d29833f36b204ed802763adb69ef3ba4ba/core/libs/prx/libSceLibreSsl3/src/Key.cpp#L44-L62) - [Field offset assertions at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/c947e1d29833f36b204ed802763adb69ef3ba4ba/core/libs/prx/libSceLibreSsl3/include/Key.hpp#L56-L60) - [Upstream `RSA_get0_factors` and `RSA_get0_crt_params`, LibreSSL 4.0.0](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/rsa/rsa_lib.c#L263-L310) - [Upstream `struct rsa_st`, LibreSSL 4.0.0](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/rsa/rsa_local.h#L100-L122) ## Not verified - The new test `guest_libressl3_rsa_getters` was not built or run. The author reports a 75/75 focused CTest run on Ubuntu 26.04 with GCC 15.2; I did not reproduce it. - Windows and macOS were not run. The console layout is unverified, as the debt entry states. - Hosted checks were pending at my check.
MarcZX10 commented 2026-11-01 11:12:08 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Re-checked — new head, no blocking findings

The new head only adds the upstream copyright and licence header to Key.cpp, and its first 58 lines match the cited rsa_lib.c at ce488b78 byte for byte.

What I ran

Exact head 1f2f909a26fbf51c5b768f021e561464caa2c62f, previously reviewed head c947e1d29833f36b204ed802763adb69ef3ba4ba, PR base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4. Environment: Debian 12, Python 3.11.2, git 2.39.5. No build, no compiler, no CTest.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14366
git diff --stat c947e1d29833f36b204ed802763adb69ef3ba4ba 1f2f909a26fbf51c5b768f021e561464caa2c62f
gh api "repos/libressl/openbsd/contents/src/lib/libcrypto/rsa/rsa_lib.c?ref=ce488b78e0bd994780569df718596b9776ff681a" --jq .content | base64 -d   # compared with the first 58 lines of Key.cpp at the head
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 --head 1f2f909a26fbf51c5b768f021e561464caa2c62f --json

The precheck's ABI and test-quality helpers could not find their scripts in its isolated head tree, so I ran the ABI audit by hand as listed.

Results

Check Result
Delta since c947e1d298 One file, core/libs/prx/libSceLibreSsl3/src/Key.cpp, 58 insertions and no deletions. No code or test change.
Header against upstream Lines 1-58 of Key.cpp are identical to lines 1-58 of rsa_lib.c at ce488b78.
Precheck diff check, conventions and PR template, live stack Passed.
pr_abi_audit.py (by hand) Passed: 270 declarations, 0 findings. RSA_get0_factors_nid_postfix and RSA_get0_crt_params_nid_postfix are declared in Api.hpp and defined in Key.cpp.
Build, CTest, guest_libressl3_rsa_getters Not run at this head. The code is unchanged from the reviewed head c947e1d298.

Findings

Blocking: None.

Non-blocking: None.

Sources

Not verified

  • The build and the guest_libressl3_rsa_getters test were not run at this head. The mutation controls in the author's comment were run on c947e1d298, and I did not re-run them.
  • The test-quality helper was not re-run at this head, since the delta touches no test file.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727775912 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14366#pullrequestreview-5727775912). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T11:12:08Z. **Review:** COMMENTED --- # Re-checked — new head, no blocking findings The new head only adds the upstream copyright and licence header to `Key.cpp`, and its first 58 lines match the cited `rsa_lib.c` at `ce488b78` byte for byte. ## What I ran Exact head `1f2f909a26fbf51c5b768f021e561464caa2c62f`, previously reviewed head `c947e1d29833f36b204ed802763adb69ef3ba4ba`, PR base `ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4`. Environment: Debian 12, Python 3.11.2, git 2.39.5. No build, no compiler, no CTest. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14366 git diff --stat c947e1d29833f36b204ed802763adb69ef3ba4ba 1f2f909a26fbf51c5b768f021e561464caa2c62f gh api "repos/libressl/openbsd/contents/src/lib/libcrypto/rsa/rsa_lib.c?ref=ce488b78e0bd994780569df718596b9776ff681a" --jq .content | base64 -d # compared with the first 58 lines of Key.cpp at the head python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 --head 1f2f909a26fbf51c5b768f021e561464caa2c62f --json ``` The precheck's ABI and test-quality helpers could not find their scripts in its isolated head tree, so I ran the ABI audit by hand as listed. ## Results | Check | Result | |---|---| | Delta since `c947e1d298` | One file, `core/libs/prx/libSceLibreSsl3/src/Key.cpp`, 58 insertions and no deletions. No code or test change. | | Header against upstream | Lines 1-58 of `Key.cpp` are identical to lines 1-58 of `rsa_lib.c` at `ce488b78`. | | Precheck diff check, conventions and PR template, live stack | Passed. | | `pr_abi_audit.py` (by hand) | Passed: 270 declarations, 0 findings. `RSA_get0_factors_nid_postfix` and `RSA_get0_crt_params_nid_postfix` are declared in `Api.hpp` and defined in `Key.cpp`. | | Build, CTest, `guest_libressl3_rsa_getters` | Not run at this head. The code is unchanged from the reviewed head `c947e1d298`. | ## Findings **Blocking:** None. **Non-blocking:** None. ## Sources - [Upstream `rsa_lib.c` at the pinned commit](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/rsa/rsa_lib.c) - [Header added to `Key.cpp` at the new head](https://github.com/boykopovar/AnyPS5/blob/1f2f909a26fbf51c5b768f021e561464caa2c62f/core/libs/prx/libSceLibreSsl3/src/Key.cpp#L1-L58) ## Not verified - The build and the `guest_libressl3_rsa_getters` test were not run at this head. The mutation controls in the author's comment were run on `c947e1d298`, and I did not re-run them. - The test-quality helper was not re-run at this head, since the delta touches no test file.
MarcZX10 commented 2026-11-01 14:22:35 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

RSA_get0_factors and RSA_get0_crt_params match LibreSSL 4.0.0's rsa_lib.c line for line, and the struct offsets they read (p 48, q 56, dmp1 64, dmq1 72, iqmp 80) match LibreSSL 4.0.0's rsa_st; the only difference is the explicit throw for a null key when an output is requested, which the PR documents.

What I ran

  • Exact head 2296f722a66def671a483d7406159f8f155337f5, base ba8dcc6ae8 (the precheck base).
  • Environment: Linux, /usr/bin/python3 3.11.2, no build.
  • Precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14366 --output-dir /dev/shm/reviewer-run/precheck/14366
  • ABI audit by hand (helper absent from the head tree): python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base ba8dcc6ae8 --head 2296f722a66def671a483d7406159f8f155337f5 --json (exit 0; passed; 0 findings; 270 symbols).
  • Test-quality helper on core/libs/prx/libSceLibreSsl3/tests/RsaGetters.cpp from a head extract: one literal-path registration heuristic.
  • Upstream compared: src/lib/libcrypto/rsa/rsa_lib.c at ce488b78e0bd994780569df718596b9776ff681a (lines 265-274 and 303-309), fetched with gh api. The port's bodies match those lines.
  • Struct offsets: src/lib/libcrypto/rsa/rsa_local.h at the same commit (struct rsa_st, lines 100-122) counted for LP64: pad 0, version 8, meth 16, n 24, e 32, d 40, p 48, q 56, dmp1 64, dmq1 72, iqmp 80. The repository's LibreSsl3Rsa (include/Key.hpp) has the same fields at the same offsets.

Results

Precheck report, checks table, unedited (/dev/shm/reviewer-run/precheck/14366/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 ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4...2296f722a66def671a483d7406159f8f155337f5
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 --head 2296f722a66def671a483d7406159f8f155337f5 --title feat(libSceLibreSsl3): implement RSA_get0_factors and RSA_get0_crt_params --body /dev/shm/reviewer-run/precheck/14366/pr-body.md
changed_export_abi_audit failed /usr/bin/python3 tools/pr_abi_audit.py --base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 --head 2296f722a66def671a483d7406159f8f155337f5 --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 14366 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14366/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/14366/head-2296f722a66d-0b7adab3/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14366/head-2296f722a66d-0b7adab3 --json core/libs/prx/libSceLibreSsl3/AdditionalExports.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/prx/libSceLibreSsl3/include/Api.hpp core/libs/prx/libSceLibreSsl3/include/Key.hpp core/libs/prx/libSceLibreSsl3/src/Key.cpp core/libs/prx/libSceLibreSsl3/tests/RsaGetters.cpp 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 test loads the patched libSceLibreSsl3.prx from PATCHED_DIR, which needs a build.

Findings

Blocking: none.

Non-blocking:

  • The new Key.cpp carries the LibreSSL/SSLeay licence block, including the advertising-clause acknowledgement. That is the same maintainer question as in #14431 about copied licence text in source files.
  • The struct offsets follow LibreSSL 4.0.0, the same revision assumption the repository's existing LibreSsl3 layouts make; the console's revision is not recorded in the debt entry.

Sources

Not verified

  • The C++ test guest_libressl3_rsa_getters was not built or run; it needs the patched library.
  • The console's LibreSSL revision and its RSA layout were not verified.
  • Hosted: at this head conventions, eligibility, labels, library-portability and report succeeded; linux, register-context, relinker, relinker-asan and write-watch were skipped.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5728565650 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14366#pullrequestreview-5728565650). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T14:22:35Z. **Review:** COMMENTED --- # Reviewed — no blocking findings `RSA_get0_factors` and `RSA_get0_crt_params` match LibreSSL 4.0.0's `rsa_lib.c` line for line, and the struct offsets they read (`p` 48, `q` 56, `dmp1` 64, `dmq1` 72, `iqmp` 80) match LibreSSL 4.0.0's `rsa_st`; the only difference is the explicit throw for a null key when an output is requested, which the PR documents. ## What I ran - Exact head `2296f722a66def671a483d7406159f8f155337f5`, base `ba8dcc6ae8` (the precheck base). - Environment: Linux, `/usr/bin/python3` 3.11.2, no build. - Precheck: `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14366 --output-dir /dev/shm/reviewer-run/precheck/14366` - ABI audit by hand (helper absent from the head tree): `python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base ba8dcc6ae8 --head 2296f722a66def671a483d7406159f8f155337f5 --json` (exit 0; `passed`; 0 findings; 270 symbols). - Test-quality helper on `core/libs/prx/libSceLibreSsl3/tests/RsaGetters.cpp` from a head extract: one literal-path registration heuristic. - Upstream compared: `src/lib/libcrypto/rsa/rsa_lib.c` at `ce488b78e0bd994780569df718596b9776ff681a` (lines 265-274 and 303-309), fetched with `gh api`. The port's bodies match those lines. - Struct offsets: `src/lib/libcrypto/rsa/rsa_local.h` at the same commit (`struct rsa_st`, lines 100-122) counted for LP64: `pad` 0, `version` 8, `meth` 16, `n` 24, `e` 32, `d` 40, `p` 48, `q` 56, `dmp1` 64, `dmq1` 72, `iqmp` 80. The repository's `LibreSsl3Rsa` (`include/Key.hpp`) has the same fields at the same offsets. ## Results Precheck report, checks table, unedited (`/dev/shm/reviewer-run/precheck/14366/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 ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4...2296f722a66def671a483d7406159f8f155337f5` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 --head 2296f722a66def671a483d7406159f8f155337f5 --title feat(libSceLibreSsl3): implement RSA_get0_factors and RSA_get0_crt_params --body /dev/shm/reviewer-run/precheck/14366/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 --head 2296f722a66def671a483d7406159f8f155337f5 --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 14366 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14366/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/14366/head-2296f722a66d-0b7adab3/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14366/head-2296f722a66d-0b7adab3 --json core/libs/prx/libSceLibreSsl3/AdditionalExports.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/prx/libSceLibreSsl3/include/Api.hpp core/libs/prx/libSceLibreSsl3/include/Key.hpp core/libs/prx/libSceLibreSsl3/src/Key.cpp core/libs/prx/libSceLibreSsl3/tests/RsaGetters.cpp 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 test loads the patched `libSceLibreSsl3.prx` from `PATCHED_DIR`, which needs a build. ## Findings **Blocking:** none. **Non-blocking:** - The new `Key.cpp` carries the LibreSSL/SSLeay licence block, including the advertising-clause acknowledgement. That is the same maintainer question as in #14431 about copied licence text in source files. - The struct offsets follow LibreSSL 4.0.0, the same revision assumption the repository's existing `LibreSsl3` layouts make; the console's revision is not recorded in the debt entry. ## Sources - Upstream getters (commit-pinned): https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/rsa/rsa_lib.c#L265-L309 - Upstream `struct rsa_st` (commit-pinned): https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/rsa/rsa_local.h#L100-L122 - Port at head: https://github.com/boykopovar/AnyPS5/blob/2296f722a66def671a483d7406159f8f155337f5/core/libs/prx/libSceLibreSsl3/src/Key.cpp ## Not verified - The C++ test `guest_libressl3_rsa_getters` was not built or run; it needs the patched library. - The console's LibreSSL revision and its RSA layout were not verified. - Hosted: at this head `conventions`, `eligibility`, `labels`, `library-portability` and `report` succeeded; `linux`, `register-context`, `relinker`, `relinker-asan` and `write-watch` were skipped.
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!14366
No description provided.