feat(libSceLibreSsl3): name and implement four inventory NIDs #15831

Merged
fishingpvalues merged 1 commit from upstream-pr/15831 into main 2026-11-10 12:34:30 +00:00
fishingpvalues commented 2026-11-04 18:32:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fishingpvalues on 2026-11-04T18:32:16Z.


What

The 13.60 inventory names four NIDs that libSceLibreSsl3 still exported only as Unknown_* placeholders. This names and implements them:

  • RSA_bits (3KZ-L4y1gak) returns the bit length of the RSA modulus through libSceLibreSsl's BN_num_bits, or 0 when the key has no modulus. A null key throws.
  • BN_is_negative (AiNud8LR8B4) returns the BIGNUM sign bit. A null value throws.
  • EVP_CIPHER_nid (aLdgrI2jAF0) returns the nid at offset 0 of the 80-byte EVP_CIPHER. A null cipher throws.
  • ERR_load_ERR_strings (pdxCm9+CCc4) is a no-op, matching the existing ERR_load_crypto_strings in this library: the error-string table is not modelled.

The Unknown_* stubs and their APS5_EXPORT aliases leave AdditionalExports.cpp; the names and real signatures are declared once in include/Api.hpp; the code is in new src/InventoryNames.cpp with a new tests/InventoryNames.cpp registered as guest_libressl3_inventory_names.

docs/dev/debt/libSceLibreSsl3.md loses the four NID-only rows (125 to 121 callable exports, 116 named and 9 to 5 NID-only) and gains one Functional entry for the unverified PS5 ABI: null keys and ciphers throw where LibreSSL dereferences them, a null RSA modulus returns 0, and the error-string loader does not populate a table. The branch is merged with current main 364ceeba2f; the inventory counts were recalculated on the merged tree (107 unimplemented callable exports = 102 named and 5 NID-only).

Tested

Linux x86-64 (CachyOS, GCC 16.2.1), Release, BUILD_TESTING=ON, merged tree 0a131c2c9d:

  • guest_libressl3_inventory_names covers the modulus bit length (64 for 0x8000000000000001), a missing modulus, both sign values, the cipher nid and the four null/loader paths.
  • ctest --test-dir build -R '^guest_libressl3_inventory_names$' --output-on-failure: 1/1 passed.
  • python3 tools/check_conventions.py --base origin/main: passed.
  • python3 tools/pr_overlap.py --branch pr-15831 --jobs 4: exit 2 only because it cannot confirm shared AdditionalExports.cpp/Api.hpp/debt files from conflicting PR heads; it reports no same exports.
  • Not run: Windows, a console, or a title.

Checklist

  • Based on current main; no other open PR implements these exports
  • 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)
  • No notes, investigation .md files or images added to the repository
  • 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:5159527188 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15831). Originally posted by [fishingpvalues](https://github.com/fishingpvalues) on 2026-11-04T18:32:16Z. --- ### What The 13.60 inventory names four NIDs that `libSceLibreSsl3` still exported only as `Unknown_*` placeholders. This names and implements them: - `RSA_bits` (`3KZ-L4y1gak`) returns the bit length of the RSA modulus through libSceLibreSsl's `BN_num_bits`, or 0 when the key has no modulus. A null key throws. - `BN_is_negative` (`AiNud8LR8B4`) returns the BIGNUM sign bit. A null value throws. - `EVP_CIPHER_nid` (`aLdgrI2jAF0`) returns the `nid` at offset 0 of the 80-byte `EVP_CIPHER`. A null cipher throws. - `ERR_load_ERR_strings` (`pdxCm9+CCc4`) is a no-op, matching the existing `ERR_load_crypto_strings` in this library: the error-string table is not modelled. The `Unknown_*` stubs and their `APS5_EXPORT` aliases leave `AdditionalExports.cpp`; the names and real signatures are declared once in `include/Api.hpp`; the code is in new `src/InventoryNames.cpp` with a new `tests/InventoryNames.cpp` registered as `guest_libressl3_inventory_names`. `docs/dev/debt/libSceLibreSsl3.md` loses the four NID-only rows (125 to 121 callable exports, 116 named and 9 to 5 NID-only) and gains one Functional entry for the unverified PS5 ABI: null keys and ciphers throw where LibreSSL dereferences them, a null RSA modulus returns 0, and the error-string loader does not populate a table. The branch is merged with current `main` `364ceeba2f`; the inventory counts were recalculated on the merged tree (107 unimplemented callable exports = 102 named and 5 NID-only). ### Tested Linux x86-64 (CachyOS, GCC 16.2.1), Release, `BUILD_TESTING=ON`, merged tree `0a131c2c9d`: - `guest_libressl3_inventory_names` covers the modulus bit length (64 for `0x8000000000000001`), a missing modulus, both sign values, the cipher nid and the four null/loader paths. - `ctest --test-dir build -R '^guest_libressl3_inventory_names$' --output-on-failure`: 1/1 passed. - `python3 tools/check_conventions.py --base origin/main`: passed. - `python3 tools/pr_overlap.py --branch pr-15831 --jobs 4`: exit 2 only because it cannot confirm shared `AdditionalExports.cpp`/`Api.hpp`/debt files from conflicting PR heads; it reports no same exports. - Not run: Windows, a console, or a title. ### Checklist - [x] Based on current `main`; no other open PR implements these exports - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`) - [x] No notes, investigation `.md` files or images added to the repository - [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
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!15831
No description provided.