Repository navigation
feat(libSceLibreSsl3): implement the X509 public key, signature NID and extension lookup accessors - #16708
Merged
oneandonlydean merged 10 commits intoNov 9, 2026
Conversation
…nd extension lookup accessors Implement X509_get_X509_PUBKEY, X509_get_signature_nid and X509_get_ext_by_NID after LibreSSL 4.0.0 x509_set.c, x_x509.c, x509_ext.c and x509_v3.c. The object lookups follow 4.0.0 OBJ_obj2nid and OBJ_nid2obj over libSceLibreSsl's 2.5.4 object table plus the 100 objects 4.0.0 adds, searched with a BSD bsearch, and consult the objects added through the forwarded OBJ_create first, as 4.0.0 does. libSceLibreSsl gains two helpers that expose its added-object table. Record the unverified console behaviour and the NID overlap of added objects as debt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Contributor
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Progress report (f6ed718 → 9d9353e)📈 System libraries: 35.11% (+0.01%, +3 implemented functions) ✅ 3 implemented
Changed libraries (implemented exports)
|
…/libressl3-x509-accessors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/libressl3-x509-accessors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/libressl3-x509-accessors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/libressl3-x509-accessors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/libressl3-x509-accessors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/libressl3-x509-accessors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/libressl3-x509-accessors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 tasks done
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implement three certificate accessors in
libSceLibreSsl3, replacing their parameterless throwing placeholders inAdditionalExports.cpp:X509_get_X509_PUBKEY(yLm956jsJpc),X509_get_signature_nid(QnjD8S6Rgk4) andX509_get_ext_by_NID(BRjfzlGULmU). Source: LibreSSL 4.0.0 atce488b78, the revision the library's debt file already uses:x509/x509_set.c,asn1/x_x509.c,x509/x509_ext.c,x509/x509_v3.c,objects/obj_dat.candobjects/obj_lib.c.X509_get_X509_PUBKEYreturnscert_info->key. The newLibreSsl3CertificateInfoandLibreSsl3Certificatestructs followx509_local.hon LP64 (keyat 48,extensionsat 72,sig_algat 8, 104 and 216 bytes), the same layout the existingX509Extensions.cppandX509Validity.cppuse.X509_get_signature_nidisOBJ_obj2nid(sig_alg->algorithm)with 4.0.0'sOBJ_obj2nid:NID_undef, even when itsnidfield is set;nidfield is returned;OBJ_createare searched first, then the built-in table.X509_get_ext_by_NIDisX509v3_get_ext_by_NIDwith 4.0.0'sOBJ_nid2objandOBJ_cmp:OBJ_R_UNKNOWN_NID;lastposbelow -1 starts from 0;src/Objects.cppadds the 100 objects (NIDs 956 to 1055) that 4.0.0'sobjects.txtandobj_mac.numdefine after 2.5.4. Examples areacmeIdentifierandRSA-SHA3-256; 13 of them have no OID.obj_objs: the parent's 2.5.4 order with the 87 new OIDs merged in by length and bytes, ties by NID.bsearchloop. OID 1.3 is shared by NIDs 379 and 676, and for it the search gives 676.objects.plandobj_dat.pl. Run on 2.5.4'sobjects.txtandobj_mac.num, the same script reproduces libSceLibreSsl's existingObjectTable.cppexactly: all 949 entries, their encodings and the 890-entry order.LibreSslAddedObjectsExist_nid_no_patchandLibreSslAddedObjectByNid_nid_no_patch. They let the lookup follow 4.0.0'saddedchecks.lastposofINT_MAX;added_obj_hash'slength << 20.lastposis incremented, soINT_MAXwith an unknown NID still returns -2.The forwarded 2.5.4
OBJ_createnumbers added objects from 956, where 4.0.0 starts at 1056. Those NIDs belong to 4.0.0 built-in objects, soX509_get_ext_by_NIDfinds an added object by NID only from 1056. This is recorded indocs/dev/debt/libSceLibreSsl3.md, and the export inventory is updated (108 exports, 99 named).OBJ_obj2nid,OBJ_nid2snandOBJ_sn2nidstay forwarded to libSceLibreSsl's 2.5.4 versions;OBJ_obj2nidstill throws there (#14115 implements it). SoX509_get_signature_nidcan return 1050 for an OID that the forwarded functions do not know. Moving those exports to the 4.0.0 table belongs in its own pull request.No title's trace or disassembly was used, and nothing was measured on a PS5.
pr_overlapreports no pull request with the same exports or new files. It could not compare 40 pull requests that conflict withmainand shareAdditionalExports.cpp,CMakeLists.txt,include/Api.hppor the debt file. I checked their diffs by hand: none adds these three exports,OBJ_nid2obj, an object lookup or the parent helpers. Line conflicts to expect:CMakeLists.txtandApi.hpp.I will merge
maininto this one as needed.Tested
Windows 11, MinGW-w64 GCC (WinLibs), Release build. No title or homebrew, and not built on Linux or macOS.
guest_libressl3_x509_accessors(new) passes:nidfield set, negative lengths, null data and lengths that overflow the comparison.sha256WithRSAEncryptionwins over the built-in one;OBJ_cleanuprestores the built-in results.lastposfromINT_MINto past the end, duplicates, NID 0 and name-only NIDs on an empty object, comparison by data only, and negative, zero and short counts.INT_MIN,INT_MAX, every hole in the table and 1056 return -2 and queue exactly oneOBJ_R_UNKNOWN_NIDeach.OBJ_cleanup.guest_libressl*andguest_crypto_memcmptests pass.mainf6ed718 into this branch, all 107guest_libressl*andguest_crypto_memcmptests pass,guest_libressl3_x509_accessorsamong them. The conflicts were the export inventory count and its table in the debt file, and the neighbouring test registration inCMakeLists.txt.tools/check_test_registration.pypasses.objdump -ponlibSceLibreSsl3.prxlists the three exports and nombedtls_*symbol.python3 tools/check_conventions.py --base upstream/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_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)🤖 Generated with Claude Code