feat(libSceLibreSsl): implement X509_NAME_get_index_by_NID and X509_NAME_get_text_by_NID #11129

Merged
ahmadmuj merged 44 commits from upstream-pr/11129 into main 2026-11-05 16:45:16 +00:00
ahmadmuj commented 2026-10-25 19:01:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-10-25T19:01:33Z.


What

Implements X509_NAME_get_index_by_NID and X509_NAME_get_text_by_NID on #10477's layout. Both compare OID bytes, so decoded objects with a zero NID work.

The supported subset contains NID_undef, X.520 attributes, emailAddress, domainComponent and userId. It follows LibreSSL 2.5.4 x509name.c.

Other NIDs throw. Main now supports OBJ_create, so returning -2 or -1 for every dynamic NID gives false lookup failures. This update makes that unsupported path fail explicitly. It adds no dynamic lookup support.

The branch includes current main and #10477's current head. The debt file records the subset and unsupported inputs. No new exports are added in this update.

Tested

Ubuntu 24.04 on WSL2, GCC 13.3, Release. Head bbab30d94893 merges main 6e6dae4e8b8c and #10477 6bf0609603b2.

  • Ordinary LibreSSL tests pass: 58/58. Public headers pass: 65/65. Conventions and whitespace checks pass.
  • The merge duplicated the parent's moved layout, test registration and debt entry. Removing the identical copies fixes the isolated header and CMake failures.
  • X509Name.cpp and its test remain byte-identical to the previous published head. The test retains static lookup and dynamic-object checks.
  • Earlier LibreSSL 2.5.4 differential and mutation checks are not repeated because the implementation is unchanged.
  • No console, game dump, Windows or macOS run. No full build, full ctest, patched or oracle run.

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: #10477
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5007723390 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11129). Originally posted by [ahmadmuj](https://github.com/ahmadmuj) on 2026-10-25T19:01:33Z. --- ### What Implements `X509_NAME_get_index_by_NID` and `X509_NAME_get_text_by_NID` on #10477's layout. Both compare OID bytes, so decoded objects with a zero NID work. The supported subset contains `NID_undef`, X.520 attributes, emailAddress, domainComponent and userId. It follows LibreSSL 2.5.4 [x509name.c](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/x509/x509name.c). Other NIDs throw. Main now supports `OBJ_create`, so returning -2 or -1 for every dynamic NID gives false lookup failures. This update makes that unsupported path fail explicitly. It adds no dynamic lookup support. The branch includes current main and #10477's current head. The debt file records the subset and unsupported inputs. No new exports are added in this update. ### Tested Ubuntu 24.04 on WSL2, GCC 13.3, Release. Head `bbab30d94893` merges main `6e6dae4e8b8c` and #10477 `6bf0609603b2`. - Ordinary LibreSSL tests pass: 58/58. Public headers pass: 65/65. Conventions and whitespace checks pass. - The merge duplicated the parent's moved layout, test registration and debt entry. Removing the identical copies fixes the isolated header and CMake failures. - `X509Name.cpp` and its test remain byte-identical to the previous published head. The test retains static lookup and dynamic-object checks. - Earlier LibreSSL 2.5.4 differential and mutation checks are not repeated because the implementation is unchanged. - No console, game dump, Windows or macOS run. No full build, full ctest, patched or oracle run. ### 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: #10477 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 19:03:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T19:03:24Z.

Review: APPROVED


Reviewed the change against LibreSSL 2.5.4 x509name.c: get_index_by_NID delegates to object lookup and index search, while get_text_by_NID returns the full value length for a null buffer and otherwise copies at most len - 1 bytes and terminates when the count is nonnegative. The implementation compares decoded OID length and bytes, matching OBJ_cmp behavior for DER-decoded entries. The supported attribute OID subset and the conservative unsupported-NID behavior are recorded in the debt entry; tests cover source-derived return values, buffer contents, last-position handling, and table rows. I verified the pinned source paths and the posted test report; hosted eligibility, conventions, intake, labels and progress-report checks pass. Build jobs are skipped for this library-only PR, and the PR reports targeted LibreSSL tests plus a real 2.5.4 differential run.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5644776062 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11129#pullrequestreview-5644776062). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T19:03:24Z. **Review:** APPROVED --- Reviewed the change against LibreSSL 2.5.4 `x509name.c`: `get_index_by_NID` delegates to object lookup and index search, while `get_text_by_NID` returns the full value length for a null buffer and otherwise copies at most `len - 1` bytes and terminates when the count is nonnegative. The implementation compares decoded OID length and bytes, matching `OBJ_cmp` behavior for DER-decoded entries. The supported attribute OID subset and the conservative unsupported-NID behavior are recorded in the debt entry; tests cover source-derived return values, buffer contents, last-position handling, and table rows. I verified the pinned source paths and the posted test report; hosted eligibility, conventions, intake, labels and progress-report checks pass. Build jobs are skipped for this library-only PR, and the PR reports targeted LibreSSL tests plus a real 2.5.4 differential run.
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!11129
No description provided.