diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 23eac8eeed..2d10bd04d2 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -63,12 +63,6 @@ struct SslContextSharedData { u32 connection_count = 0; }; -struct Parameters { - ContextOption option; - s32 value; -}; -static_assert(sizeof(Parameters) == 0x8, "Parameters is an invalid size"); - class ISslConnection final : public ServiceFramework { public: explicit ISslConnection(Core::System& system_in, SslVersion ssl_version_in, @@ -101,7 +95,7 @@ public: {20, nullptr, "SetRenegotiationMode"}, {21, nullptr, "GetRenegotiationMode"}, {22, &ISslConnection::SetOption, "SetOption"}, - {23, nullptr, "GetOption"}, + {23, &ISslConnection::GetOption, "GetOption"}, {24, nullptr, "GetVerifyCertErrors"}, {25, nullptr, "GetCipherInfo"}, {26, &ISslConnection::SetNextAlpnProto, "SetNextAlpnProto"}, @@ -407,6 +401,38 @@ private: rb.Push(ResultSuccess); } + void GetOption(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto option = rp.PopRaw(); + + u8 value = 0; + + switch (option) { + case OptionType::DoNotCloseSocket: + value = static_cast(do_not_close_socket); + break; + case OptionType::GetServerCertChain: + value = static_cast(get_server_cert_chain); + break; + case OptionType::SkipDefaultVerify: + value = static_cast(skip_default_verify); + break; + case OptionType::EnableAlpn: + value = static_cast(enable_alpn); + break; + default: + LOG_WARNING(Service_SSL, "Unknown option={}", option); + value = 0; + break; + } + + LOG_DEBUG(Service_SSL, "GetOption called, option={}, ret value={}", option, value); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(value); + } + void SetNextAlpnProto(HLERequestContext& ctx) { const auto data = ctx.ReadBuffer(0); next_alpn_proto.assign(data.begin(), data.end());