Repository navigation
feat(libSceLibreSsl3): implement ASN1_STRING_get0_data and ASN1_INTEGER_free - #10452
alvaroelpob wants to merge 4 commits into
Conversation
Progress report (b1b5353 → 74d4470)📈 System libraries: 27.24% (+0.0078%, +2 implemented functions) ✅ 2 implemented
Changed libraries (implemented exports)
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the exact head and its two commits. The claimed LibreSSL 4.0.0 layout is consistent with the cited public header, and returns the data member directly. The path follows the cited item-free/string-free sequence: preserve NDEF data, otherwise zero and free the payload, then free the object through the guest allocator. The 24-byte layout assertions and focused tests cover ordinary, empty, NDEF, other-type, null, and negative-length cases. The PR identifies #9970 as a dependency, which is relevant because both changes touch the LibreSSL3 export/build/debt files. Hosted eligibility, conventions, intake, labels and report checks pass. The author reports 2003/2004 full CTest cases passing with the same multisample failure on base; I did not independently run that suite, and hosted product builds are skipped here. No blocking issue found in this scope.
|
I opened #10461 for the separate |
|
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.
|
b66b86f to
75ed618
Compare
|
Rebased on |
|
Windows run of
Not run: a title. AI-assisted: yes (Claude Code) |
75ed618 to
bf3ab34
Compare
|
The layout matches firmware 13.42's It reads +0x8 of the |
bf3ab34 to
cac850c
Compare
|
Rebased on |
cac850c to
931f69d
Compare
931f69d to
74d4470
Compare
|
Rebased on |
What
Implements
ASN1_STRING_get0_dataandASN1_INTEGER_freein libSceLibreSsl3, which threw and were declared without parameters.The module is LibreSSL 4.0.0 (
OpenSSL_version(0)and the image string in the firmware 13.40 measurements in #8981). Signatures, theASN1_STRINGlayout and the results follow that release'sasn1.h,a_string.c,a_int.candtasn_fre.c.asn1_string_stis still public there.const unsigned char* ASN1_STRING_get0_data(const ASN1_STRING*)datavoid ASN1_INTEGER_free(ASN1_INTEGER*)ASN1_item_freewithASN1_INTEGER_itreachesASN1_STRING_free, it zeroes and freesdata(freezero) unlessASN1_STRING_FLAG_NDEF(0x10) is set, then frees the stringThe layout is
main's 24-byteAsn1String(length,type,dataat 8,flagsat 16), which libSceLibreSsl declares and asserts and the libSceLibreSsl3 header includes since #10948. Memory is released through the guestfree, as the module would through libc. The item free path takes the type fromASN1_INTEGER_it, not from the object, so a string of any type is freed the same way.These throw:
ASN1_STRING_get0_data, which LibreSSL dereferences;lengthwith non-null data inASN1_INTEGER_free, whichfreezerowould take as a hugesize_t.No export of this module creates a string yet, so for now only strings built by the caller reach these functions.
The debt entry records the source and what is unverified. The pending-export count drops from 84 to 82, and both names join the list of exclusions.
Tested
Ubuntu 26.04 (WSL2, kernel 6.18), GCC 15.2.0, Release, full build with
BUILD_TESTING=ONonmaine2b9700. There is one commit per function, and each adds that function with its test block and debt update. Each was built and itsguest_libressl3_asn1test andcheck_conventions.pyrun on its own.guest_libressl3_asn1_stringtest.ASN1_STRING_get0_datareturns the stored pointer, including null data and the NDEF flag, and a null string throws.ASN1_INTEGER_freeis checked on null and on positive, negative, empty and other-typed strings from the guest heap. An NDEF string leaves its data intact, and that data can then be freed by the caller. A negative length with data throws and frees nothing, and the same string is freed once the length is corrected. A negative length with null data frees only the string. Onmainthe first call throws.ctest -j16at the last commit: 2003/2004 pass.agc_driver_multisample_retirementfails the same way onmainon this machine.maine7e3e9c, head 75ed618. The branch still merged cleanly, but after refactor(libs): add full export headers for libs #10706public_headersfails on the merge: the exports kept their(void)stubs ininclude/Api.hppand the test redeclared them. 75ed618 (refactor(libSceLibreSsl3): declare the ASN.1 string exports in the public header) puts the real signatures and their structs inlibSceLibreSsl3/include/Api.hppand drops the test's redeclarations. Full build andctest -j16: 2202/2203 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.main6e775f4, head bf3ab34, to resolve the conflicts withmainon the sharedCMakeLists.txtand debt-file lines; both sides are kept and the count is 84 minus this PR's exports. Full build andctest -j16: 2268/2269 pass;agc_driver_multisample_retirementfails the same way on thatmain.check_conventions.py --base upstream/mainpasses.main74acfad (after feat(libSceLibreSsl3): implement ASN.1 integer decoding #10948), head cac850c, to resolve the conflicts withmainon the sharedCMakeLists.txtand debt-file lines; both sides are kept and the count is 83 minus this PR's exports. feat(libSceLibreSsl3): implement ASN.1 integer decoding #10948 added aguest_libressl3_asn1test of its own, so this PR's test is nowguest_libressl3_asn1_string, renamed in the commit that adds it. New commit cac850c dropsLibreSslAsn1Stringand usesmain'sAsn1String, which the libSceLibreSsl3 header now includes; the duplicatestatic_asserts inAsn1.cppgo with it. Full build andctest -j16: 2431/2432 pass;agc_driver_multisample_retirementfails the same way on thatmain.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)