fix(libSceLibreSsl): throw the documented exception for faulting store arguments #14179

Merged
rooklz merged 1 commit from upstream-pr/14179 into main 2026-11-06 22:29:00 +00:00
rooklz commented 2026-10-31 22:35:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-31T22:35:15Z.


What

X509_STORE_set_flags and X509_VERIFY_PARAM_set1_host already implement every defined input; their remaining NotImplemented_nid_no_patch calls covered only inputs where the module faults, as docs/dev/debt/libSceLibreSsl.md records. Those paths now throw std::invalid_argument, including the internal Elements and Push guards that X509_STORE_free, X509_STORE_add_lookup and X509_VERIFY_PARAM_set1_host reach; Push now rejects num_alloc <= 0 and a negative count before any growth. The debt entry for X509_STORE_add_lookup now states the stack-size throw and the leak on that path.

Tested

Linux (Ubuntu 24.04, GCC 13), full build; guest_libressl_x509_store and guest_libressl_x509_store_allocator pass. 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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5102182212 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14179). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-31T22:35:15Z. --- ### What `X509_STORE_set_flags` and `X509_VERIFY_PARAM_set1_host` already implement every defined input; their remaining `NotImplemented_nid_no_patch` calls covered only inputs where the module faults, as `docs/dev/debt/libSceLibreSsl.md` records. Those paths now throw `std::invalid_argument`, including the internal `Elements` and `Push` guards that `X509_STORE_free`, `X509_STORE_add_lookup` and `X509_VERIFY_PARAM_set1_host` reach; `Push` now rejects `num_alloc <= 0` and a negative count before any growth. The debt entry for `X509_STORE_add_lookup` now states the stack-size throw and the leak on that path. ### Tested Linux (Ubuntu 24.04, GCC 13), full build; `guest_libressl_x509_store` and `guest_libressl_x509_store_allocator` pass. No title tested. ### Checklist - [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
MarcZX10 commented 2026-10-31 23:15:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T23:15:43Z.

Review: APPROVED


Reviewed — looks good

The changed guards now raise the documented std::invalid_argument for faulting inputs, and the updated tests distinguish that exception from other failures.

What I ran

Reviewed head 224f67964a6233e03395b9cfbbe8db3bc3bba463 against PR base 1bc97b9527eaf6b56681cd3465bca67b75329161; the merge preview was clean. Environment: Linux x86_64, Python 3.11.2. No local build or CTest was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14179 --output-dir /tmp/anyps5-pr-precheck-14179
gh pr checks 14179 --repo boykopovar/AnyPS5

Results

Check Result
Diff check and conventions Passed
Dependency/merge preview Passed; clean
Hosted eligibility, conventions, intake, labels, report, library portability Passed
Hosted Windows job Passed
Linux and specialized hosted jobs Skipped by workflow
Local build and CTest Not run
ABI/test-quality helper checks Not executable: helper scripts are absent from the extracted PR head
Raw hosted check summary
conventions	pass	21s	https://github.com/boykopovar/AnyPS5/actions/runs/41248864579/job/124677939079
labels	pass	8s	https://github.com/boykopovar/AnyPS5/actions/runs/41248864554/job/124677939252
windows	pass	4m23s	https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679589833
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679590574
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679590834
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679590950
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679591055
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679590806
eligibility	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124677938349
intake	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41248864545/job/124677938961
library-portability	pass	1m59s	https://github.com/boykopovar/AnyPS5/actions/runs/41248864675/job/124677938238
report	pass	38s	https://github.com/boykopovar/AnyPS5/actions/runs/41248864725/job/124677938401

Negative control

No negative control was run; I did not alter these exception guards locally.

Sources

Not verified

  • No local build, CTest, Linux execution, or console behavior.
  • The PR reports a Linux relinker test run at the base commit, not the reviewed head; I did not reproduce it.

To get this to a good state

No blocking issue remains from this review. The existing debt record describes these arguments as faulting, and the hosted Windows job passed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5725404589 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14179#pullrequestreview-5725404589). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T23:15:43Z. **Review:** APPROVED --- # Reviewed — looks good The changed guards now raise the documented `std::invalid_argument` for faulting inputs, and the updated tests distinguish that exception from other failures. ## What I ran Reviewed head `224f67964a6233e03395b9cfbbe8db3bc3bba463` against PR base `1bc97b9527eaf6b56681cd3465bca67b75329161`; the merge preview was clean. Environment: Linux x86_64, Python 3.11.2. No local build or CTest was run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14179 --output-dir /tmp/anyps5-pr-precheck-14179 gh pr checks 14179 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Diff check and conventions | Passed | | Dependency/merge preview | Passed; clean | | Hosted eligibility, conventions, intake, labels, report, library portability | Passed | | Hosted Windows job | Passed | | Linux and specialized hosted jobs | Skipped by workflow | | Local build and CTest | Not run | | ABI/test-quality helper checks | Not executable: helper scripts are absent from the extracted PR head | <details><summary>Raw hosted check summary</summary> ```text conventions pass 21s https://github.com/boykopovar/AnyPS5/actions/runs/41248864579/job/124677939079 labels pass 8s https://github.com/boykopovar/AnyPS5/actions/runs/41248864554/job/124677939252 windows pass 4m23s https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679589833 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679590574 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679590834 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679590950 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679591055 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124679590806 eligibility pass 6s https://github.com/boykopovar/AnyPS5/actions/runs/41248864644/job/124677938349 intake pass 6s https://github.com/boykopovar/AnyPS5/actions/runs/41248864545/job/124677938961 library-portability pass 1m59s https://github.com/boykopovar/AnyPS5/actions/runs/41248864675/job/124677938238 report pass 38s https://github.com/boykopovar/AnyPS5/actions/runs/41248864725/job/124677938401 ``` </details> ## Negative control No negative control was run; I did not alter these exception guards locally. ## Sources - [Changed exception guards at this PR head](https://github.com/boykopovar/AnyPS5/blob/224f67964a6233e03395b9cfbbe8db3bc3bba463/core/libs/prx/libSceLibreSsl/src/X509Store.cpp) - [Updated exception assertions at this PR head](https://github.com/boykopovar/AnyPS5/blob/224f67964a6233e03395b9cfbbe8db3bc3bba463/core/libs/prx/libSceLibreSsl/tests/X509Store.cpp) - [Existing debt descriptions at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/1bc97b9527eaf6b56681cd3465bca67b75329161/docs/dev/debt/libSceLibreSsl.md) ## Not verified - No local build, CTest, Linux execution, or console behavior. - The PR reports a Linux relinker test run at the base commit, not the reviewed head; I did not reproduce it. ## To get this to a good state No blocking issue remains from this review. The existing debt record describes these arguments as faulting, and the hosted Windows job passed.
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!14179
No description provided.