correct GetOption
All checks were successful
eden-license / license-header (pull_request) Successful in 32s
All checks were successful
eden-license / license-header (pull_request) Successful in 32s
This commit is contained in:
parent
ab86ba6058
commit
9052228a43
1 changed files with 33 additions and 7 deletions
|
@ -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<ISslConnection> {
|
||||
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<OptionType>();
|
||||
|
||||
u8 value = 0;
|
||||
|
||||
switch (option) {
|
||||
case OptionType::DoNotCloseSocket:
|
||||
value = static_cast<u8>(do_not_close_socket);
|
||||
break;
|
||||
case OptionType::GetServerCertChain:
|
||||
value = static_cast<u8>(get_server_cert_chain);
|
||||
break;
|
||||
case OptionType::SkipDefaultVerify:
|
||||
value = static_cast<u8>(skip_default_verify);
|
||||
break;
|
||||
case OptionType::EnableAlpn:
|
||||
value = static_cast<u8>(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<u8>(value);
|
||||
}
|
||||
|
||||
void SetNextAlpnProto(HLERequestContext& ctx) {
|
||||
const auto data = ctx.ReadBuffer(0);
|
||||
next_alpn_proto.assign(data.begin(), data.end());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue