feat(libSceLibreSsl): add the LibreSSL object table and implement i2t_ASN1_OBJECT #11261

Merged
JaceTheBlu merged 3 commits from upstream-pr/11261 into main 2026-10-27 13:07:28 +00:00
JaceTheBlu commented 2026-10-25 22:57:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JaceTheBlu on 2026-10-25T22:57:28Z.


What

Adds LibreSSL's object table to libSceLibreSsl and implements i2t_ASN1_OBJECT, which threw and was declared without parameters. This is the first step towards d2i_X509: when LibreSSL decodes an OID it knows, it hands out the static object from this table rather than a new one, so decoded certificates need the same objects.

The table (src/ObjectTable.cpp, generated) holds the 956 objects of LibreSSL 2.5.4 (short name, long name, NID, OID bytes, in the 40-byte LP64 ASN1_OBJECT layout also used by #10461, #10571 and #11129) and the 890-entry obj_objs search order. It is not typed: perl objects.pl objects.txt obj_mac.num obj_mac.h and perl obj_dat.pl obj_mac.h obj_dat.h at 2e2c612066, then a small C program that includes the generated obj_dat.h and prints nid_objs and obj_objs, from which the C++ file is written. 2.5.4 is the version string the module holds (#9745). LibreSSL 2.7 adds NIDs 956-967; of those only the three jurisdiction* names have OIDs, which would print by name in 2.7 and numerically here; the debt entry records it.

int i2t_ASN1_OBJECT(char* buf, int buf_len, const ASN1_OBJECT* a) is 2.5.4's OBJ_obj2txt(buf, buf_len, a, 0) (obj_dat.c):

  • the NID is the object's own when set, otherwise found with the same OBJ_bsearch_ loop and obj_cmp over the same order, so duplicate encodings resolve as in LibreSSL (1.3 to ORG, a non-null empty encoding to NID_ccitt);
  • the long name, else the short name, is copied as strlcpy does and its length returned; an unassigned NID makes each name lookup report OBJ_R_UNKNOWN_NID (ERR_LIB_OBJ, function 0xfff) through the error queue, then falls back to the dotted form, as does a NID past the table, without an error;
  • the dotted form is written part by part with snprintf semantics: a short buffer keeps whole leading parts and the return value counts every character; a truncated subidentifier returns 0 and leaves the parts already written; arcs past 64 bits, which LibreSSL computes with BIGNUM, are printed exactly with a small arbitrary-precision helper.

A negative buffer length, and a null buffer with a positive length, throw instead of reaching strlcpy/snprintf as a size_t. Objects added at run time are left out because no export of this module adds one. The pending-export count drops by one.

Relation to other open PRs: #10508 carries the short names and sn_objs order generated from the same inputs, and #10571 throws for the table search in OBJ_obj2nid. This table can back both (long names, encodings and obj_objs are what they lack); whichever lands later can switch to the shared table. The new functions here are internal (_nid_no_patch), so no export overlaps.

Tested

Debian trixie container, GCC 14.2, full Release build. ctest -R 'libressl|crypto_memcmp': 13 of 13 pass, including the new guest_libressl_object_text (table entries, the unassigned NIDs, search results including duplicates, names, truncation, dotted forms, the first arc rules, 64-bit and larger arcs, a truncated subidentifier, the error-queue entries, and the throwing cases). tools/check_test_registration.py build and python3 tools/check_conventions.py --base upstream/main pass. Not tested on Windows, on a title or on a console.

Outside the repository, this i2t_ASN1_OBJECT was compared with 2.5.4's own OBJ_obj2txt, OBJ_obj2nid, OBJ_nid2ln, OBJ_nid2sn and bsearch, compiled next to it on the generated obj_dat.h with OpenSSL's BIGNUM: 423,424 cases (every table object with and without its NID set, at 12 buffer sizes; 400,000 random encodings including invalid ones, random and out-of-table NIDs and null data; 1- to 40-byte arcs), comparing the return value, every byte of the buffer and the number of errors reported. No difference.

tools/pr_overlap.py was not run (no authenticated gh). git merge-tree against the open LibreSSL pull requests shows only the usual shared-file conflicts (end of CMakeLists.txt, the debt file).

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:5009551409 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11261). Originally posted by [JaceTheBlu](https://github.com/JaceTheBlu) on 2026-10-25T22:57:28Z. --- ### What Adds LibreSSL's object table to libSceLibreSsl and implements `i2t_ASN1_OBJECT`, which threw and was declared without parameters. This is the first step towards `d2i_X509`: when LibreSSL decodes an OID it knows, it hands out the static object from this table rather than a new one, so decoded certificates need the same objects. **The table** (`src/ObjectTable.cpp`, generated) holds the 956 objects of LibreSSL 2.5.4 (short name, long name, NID, OID bytes, in the 40-byte LP64 `ASN1_OBJECT` layout also used by #10461, #10571 and #11129) and the 890-entry `obj_objs` search order. It is not typed: `perl objects.pl objects.txt obj_mac.num obj_mac.h` and `perl obj_dat.pl obj_mac.h obj_dat.h` at [2e2c612066](https://github.com/libressl/openbsd/tree/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/objects), then a small C program that includes the generated `obj_dat.h` and prints `nid_objs` and `obj_objs`, from which the C++ file is written. 2.5.4 is the version string the module holds (#9745). LibreSSL 2.7 adds NIDs 956-967; of those only the three `jurisdiction*` names have OIDs, which would print by name in 2.7 and numerically here; the debt entry records it. **`int i2t_ASN1_OBJECT(char* buf, int buf_len, const ASN1_OBJECT* a)`** is 2.5.4's `OBJ_obj2txt(buf, buf_len, a, 0)` ([`obj_dat.c`](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/objects/obj_dat.c)): - the NID is the object's own when set, otherwise found with the same `OBJ_bsearch_` loop and `obj_cmp` over the same order, so duplicate encodings resolve as in LibreSSL (1.3 to `ORG`, a non-null empty encoding to `NID_ccitt`); - the long name, else the short name, is copied as `strlcpy` does and its length returned; an unassigned NID makes each name lookup report `OBJ_R_UNKNOWN_NID` (`ERR_LIB_OBJ`, function `0xfff`) through the error queue, then falls back to the dotted form, as does a NID past the table, without an error; - the dotted form is written part by part with `snprintf` semantics: a short buffer keeps whole leading parts and the return value counts every character; a truncated subidentifier returns 0 and leaves the parts already written; arcs past 64 bits, which LibreSSL computes with `BIGNUM`, are printed exactly with a small arbitrary-precision helper. A negative buffer length, and a null buffer with a positive length, throw instead of reaching `strlcpy`/`snprintf` as a `size_t`. Objects added at run time are left out because no export of this module adds one. The pending-export count drops by one. Relation to other open PRs: #10508 carries the short names and `sn_objs` order generated from the same inputs, and #10571 throws for the table search in `OBJ_obj2nid`. This table can back both (long names, encodings and `obj_objs` are what they lack); whichever lands later can switch to the shared table. The new functions here are internal (`_nid_no_patch`), so no export overlaps. ### Tested Debian trixie container, GCC 14.2, full Release build. `ctest -R 'libressl|crypto_memcmp'`: 13 of 13 pass, including the new `guest_libressl_object_text` (table entries, the unassigned NIDs, search results including duplicates, names, truncation, dotted forms, the first arc rules, 64-bit and larger arcs, a truncated subidentifier, the error-queue entries, and the throwing cases). `tools/check_test_registration.py build` and `python3 tools/check_conventions.py --base upstream/main` pass. Not tested on Windows, on a title or on a console. Outside the repository, this `i2t_ASN1_OBJECT` was compared with 2.5.4's own `OBJ_obj2txt`, `OBJ_obj2nid`, `OBJ_nid2ln`, `OBJ_nid2sn` and bsearch, compiled next to it on the generated `obj_dat.h` with OpenSSL's `BIGNUM`: 423,424 cases (every table object with and without its NID set, at 12 buffer sizes; 400,000 random encodings including invalid ones, random and out-of-table NIDs and null data; 1- to 40-byte arcs), comparing the return value, every byte of the buffer and the number of errors reported. No difference. `tools/pr_overlap.py` was not run (no authenticated `gh`). `git merge-tree` against the open LibreSSL pull requests shows only the usual shared-file conflicts (end of `CMakeLists.txt`, the debt file). ### 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
MarcZX10 commented 2026-10-25 23:01:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T23:01:32Z.

Review: APPROVED


Reviewed exact head 8e4e770b349cb41f9835ed926f9819a3443ae8a9 against LibreSSL 2.5.4 obj_dat.c, including OBJ_obj2txt name fallback, unassigned/out-of-range NIDs, short-buffer termination, truncated arcs, and large first/subsequent subidentifiers. The object-order lookup and emitted data are consistent with the pinned source. git diff --check upstream/main...upstream/pr/11261 and the local conventions check pass. Hosted eligibility, conventions, intake, labels, and report checks pass; product build jobs were skipped by path policy. I did not rerun the author’s full Release/13-test suite or 423,424-case native comparison locally; those remain author-reported evidence. No concrete blocking defect found.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5645791086 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11261#pullrequestreview-5645791086). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T23:01:32Z. **Review:** APPROVED --- Reviewed exact head `8e4e770b349cb41f9835ed926f9819a3443ae8a9` against LibreSSL 2.5.4 `obj_dat.c`, including OBJ_obj2txt name fallback, unassigned/out-of-range NIDs, short-buffer termination, truncated arcs, and large first/subsequent subidentifiers. The object-order lookup and emitted data are consistent with the pinned source. `git diff --check upstream/main...upstream/pr/11261` and the local conventions check pass. Hosted eligibility, conventions, intake, labels, and report checks pass; product build jobs were skipped by path policy. I did not rerun the author’s full Release/13-test suite or 423,424-case native comparison locally; those remain author-reported evidence. No concrete blocking defect found.
thepoppfish commented 2026-10-25 23:59:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thepoppfish on 2026-10-25T23:59:41Z.

Review: DISMISSED


Found an allocation-failure contract issue on exact head 8e4e770b349cb41f9835ed926f9819a3443ae8a9.

Even the ordinary unknown OID 1.2.3.4 constructs a heap-backed BigNumber(0) for each arc. Failing the first host operator new lets std::bad_alloc escape from i2t_ASN1_OBJECT instead of returning an integer failure. Large-arc scratch allocations also escape without a BN error queued.

The pinned OBJ_obj2txt source creates a BIGNUM only when a subidentifier exceeds an LP64 word. Its error path returns 0. BN_new/expansion report allocation failures with BNerror; err.h fixes that to library 3/function 0xfff/reason 65.

Tested repair: 20f51c5e63d1, branch codex/review-object-text-allocation. It:

  • creates the arbitrary-precision helper lazily, and formats word-sized values into a stack buffer with to_chars;
  • translates numeric scratch bad_alloc to 0 plus the BN allocation error, preserving already-written output and earlier error-queue entries;
  • adds a registered fault-injection regression. It compiles the three production object/error sources directly into the test executable so the host allocation override works on Windows as well.

The support commit changes three files (production code, regression, CMake). Its parent is a clean local merge 3d00e4699d1547ae459e68a5f4ccb0c980b3b5d9 of this PR and main snapshot 2b5225605bd58c91fff82a7dafcb8c6e9a33d569. The LibreSSL subtree was unchanged by that main merge before the repair. This is a cherry-pick aid, not another PR or a choice of landing order.

Independent native Windows / GCC 16.2.0-6 UCRT, C++20, -O1 -g -fno-inline -fno-lto, static C++ runtime:

Check Published head Repair
Numeric outputs/lengths/truncation vs Python integer oracle 1536/1536 pass 1536/1536 pass
18 word/malformed cases with host allocation failure armed 18 escaped exceptions 0 allocations; expected results
Every observed large-arc allocation point, across the same six encodings/four buffer sizes 192 escaped exceptions 144 failures handled with return 0 + BN error
Existing queued error plus a failing large arc exception; no BN error appended original error retained, BN error appended

The allocation-point counts differ because the repair makes fewer temporary allocations; they are not 192 identical points matched against 144. All tracked scratch allocations are released on both versions. The oracle corpus has 128 inputs at 12 buffer sizes, including nonminimal/truncated encodings, 64-bit boundaries and arcs up to 280 bits; numeric-only cases force an out-of-table NID to isolate formatting. The failure regression uses ordinary unknown objects with NID 0.

  • The complete existing tests/ObjectText.cpp passes against both versions. The four-test standalone CTest fixture passes on the repair in 0.23 s, zero skips.
  • The new regression source itself reports 421 failed checks/211 escapes against the unchanged head, then 740 checks/0 failures on the repair. This is one failure-contract finding exercised at multiple points.
  • Built and ran the actual new guest_libressl_object_allocation_tests target through the module's real CMake and original test/unwind helpers: 1/1 pass. This module fixture supplies only a narrow libc support boundary and an unused mbedcrypto interface; it is not the full product. Its registration audit finds all 11 configured test executables registered (only the focused target was built/run).
  • Current-main conventions, whitespace, and public-header audit pass: 368 libraries/12202 exports, unique declarations and umbrella coverage. Successful focused builds have no warnings; candidate checkout is clean.

The new full-build target can be replayed with cmake --build build --target guest_libressl_object_allocation_tests and ctest --test-dir build -R '^guest_libressl_object_allocation$' --output-on-failure after configuring the support checkout with testing enabled. The standalone replay below requires no crypto dependency build.

I did not run the full libc/LibreSSL product build or 13-test suite, the author's 423424-case native LibreSSL comparison, Linux/macOS, a console/title, or a canonical PR-overlap scan. The object table and lookup data are unchanged. AI-assisted implementation/replay: Codex.

Standalone regression replay against the head and repair

Save this as replay.py outside the checkouts, set the two paths, and run with GCC/MinGW and objcopy on PATH. The only support definition is the throwing NotImplemented boundary; valid numeric/fault cases do not call it. It compiles the complete production object text/table/error files and the linked commit's actual regression source. Head must exit 1 and the repair 0; exact allocation counts can vary with the host C++ library.

import os
from pathlib import Path
import subprocess

head = Path("C:/path/to/published-head")
repair = Path("C:/path/to/support-commit")
work = Path(__file__).resolve().parent
support = work / "Support.cpp"
support.write_text('#include "prx/libc/include/General.hpp"\n#include <stdexcept>\nextern "C" [[noreturn]] void NotImplemented_nid_no_patch(const char* name) { throw std::runtime_error(name); }\n')
relative = Path("core/libs/prx/libSceLibreSsl")
test = repair / relative / "tests/ObjectTextAllocation.cpp"
for label, tree in (("head", head), ("repair", repair)):
    output = work / (label + (".exe" if os.name == "nt" else ""))
    args = ["g++", "-std=c++20", "-O1", "-g", "-fno-inline", "-fno-lto", "-static-libstdc++", "-static-libgcc",
            "-I" + str(tree / "core/libs"), str(test), str(tree / relative / "src/ObjectText.cpp"),
            str(tree / relative / "src/ObjectTable.cpp"), str(tree / relative / "src/Error.cpp"),
            str(support), "-o", str(output)]
    subprocess.run(args, check=True)
    if os.name == "nt":
        subprocess.run(["objcopy", "--rename-section", ".eh_frame=.ehfram", "--rename-section", ".eh_fram=.ehfram", str(output)], check=True)
    result = subprocess.run([str(output)], timeout=8)
    assert result.returncode == (1 if label == "head" else 0)
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5646064985 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11261#pullrequestreview-5646064985). Originally posted by [thepoppfish](https://github.com/thepoppfish) on 2026-10-25T23:59:41Z. **Review:** DISMISSED --- Found an allocation-failure contract issue on exact head `8e4e770b349cb41f9835ed926f9819a3443ae8a9`. Even the ordinary unknown OID `1.2.3.4` constructs a heap-backed `BigNumber(0)` for each arc. Failing the first host `operator new` lets `std::bad_alloc` escape from `i2t_ASN1_OBJECT` instead of returning an integer failure. Large-arc scratch allocations also escape without a BN error queued. The pinned [OBJ_obj2txt source](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/objects/obj_dat.c) creates a BIGNUM only when a subidentifier exceeds an LP64 word. Its error path returns 0. [BN_new/expansion](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/bn/bn_lib.c) report allocation failures with BNerror; [err.h](https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/err/err.h) fixes that to library 3/function 0xfff/reason 65. Tested repair: [20f51c5e63d1](https://github.com/thepoppfish/AnyPS5/commit/20f51c5e63d11cc19d15a0a43eeb5a48a82c9e61), branch [codex/review-object-text-allocation](https://github.com/thepoppfish/AnyPS5/tree/codex/review-object-text-allocation). It: - creates the arbitrary-precision helper lazily, and formats word-sized values into a stack buffer with `to_chars`; - translates numeric scratch `bad_alloc` to 0 plus the BN allocation error, preserving already-written output and earlier error-queue entries; - adds a registered fault-injection regression. It compiles the three production object/error sources directly into the test executable so the host allocation override works on Windows as well. The support commit changes three files (production code, regression, CMake). Its parent is a clean local merge `3d00e4699d1547ae459e68a5f4ccb0c980b3b5d9` of this PR and main snapshot `2b5225605bd58c91fff82a7dafcb8c6e9a33d569`. The LibreSSL subtree was unchanged by that main merge before the repair. This is a cherry-pick aid, not another PR or a choice of landing order. Independent native Windows / GCC 16.2.0-6 UCRT, C++20, `-O1 -g -fno-inline -fno-lto`, static C++ runtime: | Check | Published head | Repair | | --- | --- | --- | | Numeric outputs/lengths/truncation vs Python integer oracle | 1536/1536 pass | 1536/1536 pass | | 18 word/malformed cases with host allocation failure armed | 18 escaped exceptions | 0 allocations; expected results | | Every observed large-arc allocation point, across the same six encodings/four buffer sizes | 192 escaped exceptions | 144 failures handled with return 0 + BN error | | Existing queued error plus a failing large arc | exception; no BN error appended | original error retained, BN error appended | The allocation-point counts differ because the repair makes fewer temporary allocations; they are not 192 identical points matched against 144. All tracked scratch allocations are released on both versions. The oracle corpus has 128 inputs at 12 buffer sizes, including nonminimal/truncated encodings, 64-bit boundaries and arcs up to 280 bits; numeric-only cases force an out-of-table NID to isolate formatting. The failure regression uses ordinary unknown objects with NID 0. - The complete existing `tests/ObjectText.cpp` passes against both versions. The four-test standalone CTest fixture passes on the repair in 0.23 s, zero skips. - The **new regression source itself** reports 421 failed checks/211 escapes against the unchanged head, then 740 checks/0 failures on the repair. This is one failure-contract finding exercised at multiple points. - Built and ran the actual new `guest_libressl_object_allocation_tests` target through the module's real CMake and original test/unwind helpers: 1/1 pass. This module fixture supplies only a narrow libc support boundary and an unused mbedcrypto interface; it is not the full product. Its registration audit finds all 11 configured test executables registered (only the focused target was built/run). - Current-main conventions, whitespace, and public-header audit pass: 368 libraries/12202 exports, unique declarations and umbrella coverage. Successful focused builds have no warnings; candidate checkout is clean. The new full-build target can be replayed with `cmake --build build --target guest_libressl_object_allocation_tests` and `ctest --test-dir build -R '^guest_libressl_object_allocation$' --output-on-failure` after configuring the support checkout with testing enabled. The standalone replay below requires no crypto dependency build. I did not run the full libc/LibreSSL product build or 13-test suite, the author's 423424-case native LibreSSL comparison, Linux/macOS, a console/title, or a canonical PR-overlap scan. The object table and lookup data are unchanged. AI-assisted implementation/replay: Codex. <details> <summary>Standalone regression replay against the head and repair</summary> Save this as `replay.py` outside the checkouts, set the two paths, and run with GCC/MinGW and objcopy on PATH. The only support definition is the throwing NotImplemented boundary; valid numeric/fault cases do not call it. It compiles the complete production object text/table/error files and the linked commit's actual regression source. Head must exit 1 and the repair 0; exact allocation counts can vary with the host C++ library. ```python import os from pathlib import Path import subprocess head = Path("C:/path/to/published-head") repair = Path("C:/path/to/support-commit") work = Path(__file__).resolve().parent support = work / "Support.cpp" support.write_text('#include "prx/libc/include/General.hpp"\n#include <stdexcept>\nextern "C" [[noreturn]] void NotImplemented_nid_no_patch(const char* name) { throw std::runtime_error(name); }\n') relative = Path("core/libs/prx/libSceLibreSsl") test = repair / relative / "tests/ObjectTextAllocation.cpp" for label, tree in (("head", head), ("repair", repair)): output = work / (label + (".exe" if os.name == "nt" else "")) args = ["g++", "-std=c++20", "-O1", "-g", "-fno-inline", "-fno-lto", "-static-libstdc++", "-static-libgcc", "-I" + str(tree / "core/libs"), str(test), str(tree / relative / "src/ObjectText.cpp"), str(tree / relative / "src/ObjectTable.cpp"), str(tree / relative / "src/Error.cpp"), str(support), "-o", str(output)] subprocess.run(args, check=True) if os.name == "nt": subprocess.run(["objcopy", "--rename-section", ".eh_frame=.ehfram", "--rename-section", ".eh_fram=.ehfram", str(output)], check=True) result = subprocess.run([str(output)], timeout=8) assert result.returncode == (1 if label == "head" else 0) ``` </details>
MarcZX10 commented 2026-10-26 00:07:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T00:07:38Z.

Review: DISMISSED


I need to supersede my earlier approval after a new allocation-failure case was identified. I independently compiled the exact-head ObjectText.cpp, ObjectTable.cpp and Error.cpp with a one-shot failing global operator new, then called i2t_ASN1_OBJECT_nid_postfix on the ordinary unknown OID 1.2.3.4. std::bad_alloc escaped the C ABI function on its first BigNumber construction. BigNumber initializes a heap-backed two-limb vector for every encoded arc, including word-sized values that need no arbitrary precision; the decimal conversion also allocates for large arcs.

Please avoid allocating for ordinary word-sized subidentifiers and handle allocation failure in the large-arc path using the LibreSSL 2.5.4 failure contract (return 0 and queue the BN allocation error), preserving any already-written output and earlier errors. Add a registered fault-injection regression for both an ordinary OID and an arc that requires arbitrary precision. The current ObjectText.cpp tests do not exercise allocation failure. My exact-head reproduction printed std::bad_alloc escaped i2t_ASN1_OBJECT.

The table/search and normal formatting checks I reviewed earlier remain sound; this is a distinct blocking failure-path issue. Hosted conventions, eligibility, intake, labels and report checks pass; product jobs are skipped by path policy. I did not rerun the author's full build or 423,424-case comparison.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5646095222 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11261#pullrequestreview-5646095222). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T00:07:38Z. **Review:** DISMISSED --- I need to supersede my earlier approval after a new allocation-failure case was identified. I independently compiled the exact-head `ObjectText.cpp`, `ObjectTable.cpp` and `Error.cpp` with a one-shot failing global `operator new`, then called `i2t_ASN1_OBJECT_nid_postfix` on the ordinary unknown OID `1.2.3.4`. `std::bad_alloc` escaped the C ABI function on its first `BigNumber` construction. `BigNumber` initializes a heap-backed two-limb vector for every encoded arc, including word-sized values that need no arbitrary precision; the decimal conversion also allocates for large arcs. Please avoid allocating for ordinary word-sized subidentifiers and handle allocation failure in the large-arc path using the LibreSSL 2.5.4 failure contract (return 0 and queue the BN allocation error), preserving any already-written output and earlier errors. Add a registered fault-injection regression for both an ordinary OID and an arc that requires arbitrary precision. The current `ObjectText.cpp` tests do not exercise allocation failure. My exact-head reproduction printed `std::bad_alloc escaped i2t_ASN1_OBJECT`. The table/search and normal formatting checks I reviewed earlier remain sound; this is a distinct blocking failure-path issue. Hosted conventions, eligibility, intake, labels and report checks pass; product jobs are skipped by path policy. I did not rerun the author's full build or 423,424-case comparison.
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!11261
No description provided.