fix(libSceSsl): return the console's codes for a reset and a non-TLS reply in sceSslConnect #15848
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15848"
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 zaryabzip on 2026-11-04T19:24:15Z.
What
sceSslConnectnow returns the console's codes for two handshake failures that @hugodearaujo's PS5 payload measured in #11922. The payload ran on system software 13.59, against loopback TLS servers it ran itself; the raw lines areSSL|L3-reset-after-hello|sslconnect=80410136andSSL|L4-garbage-after-hello|sslconnect=80951d78.mainSCE_NET_ERROR_ECONNRESET(0x80410136)SSL_ERROR_SOCKET_CLOSED(0x8095170D)the console's error code is unknown)The change, in
Session::CodeforOperation::Connect:MBEDTLS_ERR_NET_CONN_RESETreturnsErrorNetReset, as it already does for reads and closes.MBEDTLS_ERR_SSL_INVALID_RECORDreturns the newErrorNotTls(0x80951D78). mbedTLS returns that error fromssl_parse_record_headerwhen the first byte isn't a TLS record type, as an ASCII reply'sH(0x48) isn't. Seessl_check_record_typeat the pinned068ff080b3,library/ssl_msg.c.MBEDTLS_ERR_SSL_CONN_EOF), which matches the console's third case in #11922.libSceHttp2's transport already passes both codes through unchanged (
Transport.cpp:44-45), sosceHttp2SendRequestnow returns them too. #11922's debt entry recorded that these two needed a libSceSsl change first.Debt.
SSL_ERROR_SOCKET_CLOSEDand wasn't measured. It now gives the three measured handshake codes. It also notes that the plain-text reply was the only refused record header measured; any header mbedTLS refuses is taken to answer the same.Test.
GuestSslTransportgains two server modes that read the whole ClientHello record first:SO_LINGER0, so the client gets an RST;HTTP/1.1 400 Bad Request.The client checks only
sceSslConnect's result, since that is all the payload recorded. Onmainthe test fails at the reset row, which returns 0x8095170D there. I leftGuestHttp2Transportalone: itsModeenum is the one line that five open PRs also extend (#11630, #11950, #12305, #15221, #15231).Overlap:
git merge-treemerges this cleanly withmainand with every open pull request that touches these four files and merges withmain. Those are #11630, #11950, #12305, #13468, #15221, #15231 and #15709. #11470, #12456, #12688, #14085, #14212 and #14308 conflict with it, but each already conflicts withmain.Tested
41ddd4d6d7(comment):mainb611e634f7.ctest -R "guest_ssl|http2"passes all 20 tests, and--repeat until-fail:3passes every round.9ab6a281ea. All 21 tests pass, and every repeat round passes.Export.cppfrommain,guest_ssl_transport_kerneland_netfail with "a reset during the handshake did not report the libSceNet reset code".Checked so far, on macOS (arm64, where no full build is possible):
GuestSslTransport.cpppasses an x86-64clang++ -fsyntax-onlyagainst mbedTLS068ff080b3's headers, and so do the changed lines oflibSceSsl/Export.cpp.tools/check_conventions.py --base 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)