From bbe3464f410ee3ef2ca80ad65395ed0fc352ce6c Mon Sep 17 00:00:00 2001 From: Takoroka <137927095+Takoroka@users.noreply.github.com> Date: Sat, 31 Oct 2026 03:01:23 -0400 Subject: ssl: give three ssl replies their data ISslConnection 27 GetNextAlpnProto replies with two words (the ALPN state and the size written); the handler wrote one, and copied the caller's output buffer over the protocols SetNextAlpnProto stored. No TLS negotiation happens here, so report nothing negotiated. ISslContext 8 RegisterInternalPki replies with a u64 and ssl:s 6 FlushSessionCache with a word; both replied without data. --- src/core/hle/service/ssl/ssl.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/core/hle/service/ssl/ssl.cpp') diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 999efd4295..1c14fbbd23 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -420,10 +420,14 @@ private: R_SUCCEED(); } - Result GetNextAlpnProto(OutBuffer data, Out to_write) { - *to_write = u32((std::min)(next_alpn_proto.size(), data.size())); - next_alpn_proto.assign(data.begin(), data.begin() + *to_write); - LOG_DEBUG(Service_SSL, "GetNextAlpnProto called, size={}", *to_write); + // Replies with two words, the ALPN state and the size written to the buffer. It used to reply + // with one and copy the caller's (output) buffer over the protocols SetNextAlpnProto stored. + // No TLS negotiation happens here, so report that nothing was negotiated. + Result GetNextAlpnProto(OutBuffer data, Out out_state, + Out out_size) { + LOG_DEBUG(Service_SSL, "GetNextAlpnProto called, buffer size={}", data.size()); + *out_state = 0; + *out_size = 0; R_SUCCEED(); } @@ -557,8 +561,10 @@ private: rb.Push(client_id); } - Result RegisterInternalPki() { + // Replies with a u64 (the registered certificate's id); the reply used to carry no data. + Result RegisterInternalPki(Out out_id) { LOG_WARNING(Service_SSL, "(STUBBED) called"); + *out_id = 0; R_SUCCEED(); } }; @@ -664,11 +670,9 @@ class ISslServiceForSystem final : public ServiceFramework return ResultSuccess; }; - Result GetContextCount() { + Result GetContextCount(Out out_count) { LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - + *out_count = 0; return ResultSuccess; }; @@ -704,11 +708,9 @@ class ISslServiceForSystem final : public ServiceFramework return ResultSuccess; }; - Result FlushSessionCache() { + Result FlushSessionCache(Out out_count) { LOG_DEBUG(Service_SSL, "(STUBBED) called."); - - // TODO (jarrodnorwell) - + *out_count = 0; return ResultSuccess; }; -- cgit v1.2.3