feat(libSceLibreSsl3): implement SSL_set_alpn_protos #16980
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16980"
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 GalaxyGamingFR on 2026-11-08T03:55:28Z.
What
Implement
SSL_set_alpn_protosinlibSceLibreSsl3, replacing its parameterless throwing placeholder inAdditionalExports.cpp.ce488b78ssl_lib.c, the revision the library's debt file already uses, withtlsext_alpn_check_formatandCBS_stow. The behaviour follows them:alpn_client_proto_listis freed and the fields are cleared. A length of 0 stops there and returns 0. A non-empty list is copied into a newmallocbuffer and stored with its length, and the call returns 0. A failed allocation returns 1 with the list cleared, as upstream does.LibreSsl3Ssl, the layout #16979 extends to 320 bytes. That is why this PR depends on #16979.Api.hppnow declares it asint SSL_set_alpn_protos(LibreSsl3Ssl* ssl, const std::uint8_t* protos, std::uint32_t protosLength), matching upstream'sunsigned intlength.malloc_nid_postfixandfree_nid_postfix, asAsn1Values.cppalready does.std::invalid_argument, where upstream would dereference it.The gap is recorded in
docs/dev/debt/libSceLibreSsl3.md: no handshake runs here, so the list is never sent, an SSL whose list came from another allocator cannot be passed, and the console layout is not measured. The export inventory is updated (137 exports, 127 named).No title's trace or disassembly was used, and the export was not measured on a PS5.
Tested
Windows 11, WinLibs GCC 15.2.0 UCRT. This is not a full CMake build. I compiled
tests/GuestLibreSsl3Ssl.cppwith libSceLibreSsl3'sSsl.cpp,Key.cpp,X509.cpp,Asn1Values.cppandIntegerDecoder.cppand libSceLibreSsl'sError.cppinto one executable, withAPS5_VABIdefined empty, a one-lineNotImplementedAt_nid_no_patchthat throws, andmalloc/calloc/freeshims over the C runtime. No title or homebrew, and not built on Linux or macOS.CheckAlpnProtosfills a guarded SSL with0x5A(list pointer null) and checks, after each call, that only the 16 bytes at offsets 264 and 272 changed:h2+http/1.1is copied (a new buffer with the same bytes) and returns 0, and a second list replaces it.-Wall -Wextrais clean for the changed files, andpython tools/check_conventions.py --base origin/mainpasses.I searched open and merged pull requests for
alpn_protosjust before opening this one, and none implements it.SSL_CTX_set_alpn_protosis forwarded to libSceLibreSsl and is not changed here. #16586, #16588, #16589, #16848, #16918 and #16977 change the same export inventory count, so whichever lands later needs a one-line rebase.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