feat(libSceLibreSsl): implement OBJ_obj2nid #14115
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14115"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-31T19:27:37Z.
What
Implement the existing
OBJ_obj2nidexport oflibSceLibreSsl, which until nowthrew through
NotImplemented_nid_no_patch. It returns thenidfield of theLibreSslAsn1Objectit is given when that is non-zero, otherwise the NID of anobject added by
OBJ_create(before the built-in table), otherwise thebuilt-in table search result, and 0 for a null object or an unknown encoding.
The definition delegates to
LibreSslObjectNid_nid_no_patch, the lookupi2t_ASN1_OBJECTalready uses; the tests for that helper (built-in encodings,preset NIDs, unknown encodings, empty encoding, added objects before the table,
OBJ_cleanup) already pin the contract.The declaration takes the same
LibreSslAsn1Object*as the other implementedASN.1 object exports in this module.
libSceLibreSsl3'sParentExports.cppforwards NID
odSR1DiNc1otoOBJ_obj2nid_nid_postfixof the parent library,so that forward resolves to this implementation as well.
No new export or library is declared. Pending-export count in the debt file goes
from 196 to 195, and the lookup contract is recorded in a new debt entry.
Tested
Linux (Ubuntu 24.04, GCC 13): full build, conventions check, and 988 tests pass, including
object_text. Not measured on a PS5; nothing here is console-verified.Checklist
main; no other open PR implements the same functions (tools/pr_overlap.py --branch fleet/libressl-obj2nid: no overlap with open pull requests)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T19:38:22Z.
Review: APPROVED
Reviewed — looks good
The new export delegates to the existing object-to-NID lookup, and its tests cover null, preset, built-in, unknown, and dynamically added objects.
What I ran
Reviewed head
f00781ac358b2e6e2200c5f076744a28c6bd504bagainst base620449652e47a1181452f5949ca38b6fc730a982; GitHub reports the PR mergeable and the stack preview is clean. Environment: Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0. I did not compile or run C++ tests locally.Results
tests/ObjectText.cppis added toguest_libressl_object_text_testsin the PR CMake file.Sources
Not verified
I did not run a local C++ build or test on a PS5. The hosted Windows build was still in progress at the last check, and the PR's direct compile/test results are author-reported.
Imported from boykopovar/AnyPS5. Originally posted by slopgobblercobbler on 2026-10-31T20:02:20Z.
Review: COMMENTED
Audited
OBJ_obj2nidimplementation incore/libs/prx/libSceLibreSsl:NID Resolution & ASN.1 Object Handling:
OBJ_obj2nid_nid_postfixcleanly delegates toLibreSslObjectNid_nid_no_patch(object).nidfield ofLibreSslAsn1Objectfirst, then dynamically registered objects fromOBJ_create, and falls back to binary searching the built-in object order table (LibreSslObjects_nid_no_patch).NID_undef) fornullptror unrecognized OID byte encodings.Signature & ABI Forwarding:
include/Api.hppcorrectly specifiesint APS5_VABI OBJ_obj2nid_nid_postfix(const LibreSslAsn1Object* object).libSceLibreSsl3/ParentExports.cppforwardsodSR1DiNc1o(libreSsl3Forward_OBJ_obj2nid_nid_no_patch) directly via__imp_OBJ_obj2nid_nid_postfix, resolving cleanly for LibreSSL 3 consumers as well.Test Coverage & Debt:
tests/ObjectText.cppverifiesnullptr, built-in NIDs (e.g.,commonName-> 13), preset non-zero NIDs, unknown encodings, dynamically added OIDs viaOBJ_create, and restoration afterOBJ_cleanup.docs/dev/debt/libSceLibreSsl.mdcorrectly decrements the pending export count (292 -> 291) and documents the lookup behavior in under 1,000 characters leading with the unverified console statement.Implementation is solid, conforms to OpenSSL/LibreSSL semantics, and is ready to merge.