feat(libSceLibreSsl): implement X509_NAME_print_ex #17961
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17961"
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 Noxy-HNR on 2026-11-10T01:08:42Z.
What
Implements
X509_NAME_print_exfor libSceLibreSsl, replacing theNotImplementedstub. The export is a typed adapter over the realX509_NAME_print_exfrom the pinned3rdparty/libressl-openbsdsubmodule:LibreSslCrypto.cmakebuilds a curated libcrypto subset (asn1/a_strex.c, the ASN.1 item codecs, object tables, BIO, stack, lhash, BIGNUM and the error tables) into a staticlibressl_cryptolibrary.X509_NAME_printandASN1_tag2strare copied fromt_x509.candasn1_par.cintolibressl/x509_name_print.cwith the upstream notice, so the rest of those files is not pulled in. The OpenBSDstrlcpy,strlcat,reallocarray,recallocarrayandfreezerocome from the submodule'ssrc/lib/libcwith their notices, andlibressl/libressl_port.cholds the remaining shims, which are our own code. The library is needed on every configuration, not only tests, because libSceLibreSsl itself links it for this export; the build stops with a message naming the submodule when3rdparty/libressl-openbsdis not initialised. The guest name, entry, object, string and stack layouts match the submodule's (checked bystatic_assert), so the adapter passes the guest name straight through, prints into a memory BIO and copies the result to the guest BIO.obj_mac.h,obj_dat.h) are generated at build time byGenerateObjects.py, a Python port of LibreSSL'sobjects.plandobj_dat.pl. Its output matches the Perl scripts apart from the "generated by" line, and both the script and the generated headers carry the upstream notice, so the build needs no Perl.do_bufreads past a BMPString or UniversalString whose length is not a whole number of characters. The adapter makes such a value fail before it prints, as newer LibreSSL does, unless the value would be hex-dumped instead.Tested
Linux (Ubuntu 24.04, GCC 13.3, Release), head
133003b34c: all 91guest_libressl*/guest_libre_ssl*tests, includingguest_libressl_x509_name_print_ex, pass 3 of 3 runs, andnm -Dshows none of the internal LibreSSL symbols exported fromlibSceLibreSsl.prx. The print test was clean under valgrind on the previous head. Before the partial-character guard, the print test crashed on Linux indo_buf(odd-length BMPString case).Windows (MinGW GCC 15.2.0), head
133003b34c:guest_libressl_x509_name_print_exand the twoguest_libressl_x509_name_onelinetests pass 3 of 3 runs. The test covers separators, ordering, field modes, alignment, escaping, UTF-8 edge cases (surrogates, odd BMPString, truncated UniversalString, >U+10FFFF, invalid UTF-8), unknown/DER dumps, write-failure accounting and compatibility mode. Not tested on a console or in a title.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)