|
|
|
|
@ -41,6 +41,7 @@ enum class IoMode : u32 {
|
|
|
|
|
enum class OptionType : u32 {
|
|
|
|
|
DoNotCloseSocket = 0,
|
|
|
|
|
GetServerCertChain = 1,
|
|
|
|
|
EnableAlpn = 3,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// This is nn::ssl::sf::SslVersion
|
|
|
|
|
@ -96,8 +97,8 @@ public:
|
|
|
|
|
{23, nullptr, "GetOption"},
|
|
|
|
|
{24, nullptr, "GetVerifyCertErrors"},
|
|
|
|
|
{25, nullptr, "GetCipherInfo"},
|
|
|
|
|
{26, nullptr, "SetNextAlpnProto"},
|
|
|
|
|
{27, nullptr, "GetNextAlpnProto"},
|
|
|
|
|
{26, &ISslConnection::SetNextAlpnProto, "SetNextAlpnProto"},
|
|
|
|
|
{27, &ISslConnection::GetNextAlpnProto, "GetNextAlpnProto"},
|
|
|
|
|
{28, nullptr, "SetDtlsSocketDescriptor"},
|
|
|
|
|
{29, nullptr, "GetDtlsHandshakeTimeout"},
|
|
|
|
|
{30, nullptr, "SetPrivateOption"},
|
|
|
|
|
@ -142,6 +143,7 @@ private:
|
|
|
|
|
bool get_server_cert_chain = false;
|
|
|
|
|
std::shared_ptr<Network::SocketBase> socket;
|
|
|
|
|
bool did_handshake = false;
|
|
|
|
|
bool enable_alpn = false;
|
|
|
|
|
|
|
|
|
|
Result SetSocketDescriptorImpl(s32* out_fd, s32 fd) {
|
|
|
|
|
LOG_DEBUG(Service_SSL, "called, fd={}", fd);
|
|
|
|
|
@ -381,6 +383,10 @@ private:
|
|
|
|
|
case OptionType::GetServerCertChain:
|
|
|
|
|
get_server_cert_chain = static_cast<bool>(parameters.value);
|
|
|
|
|
break;
|
|
|
|
|
case OptionType::EnableAlpn:
|
|
|
|
|
LOG_ERROR(Service_SSL, "Called with option={}, value={} (STUBBED)", parameters.option, parameters.value);
|
|
|
|
|
enable_alpn = static_cast<bool>(parameters.value);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
LOG_WARNING(Service_SSL, "Unknown option={}, value={}", parameters.option,
|
|
|
|
|
parameters.value);
|
|
|
|
|
@ -389,6 +395,20 @@ private:
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetNextAlpnProto(HLERequestContext& ctx) {
|
|
|
|
|
LOG_ERROR(Service_SSL, "(STUBBED) called.");
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GetNextAlpnProto(HLERequestContext& ctx) {
|
|
|
|
|
LOG_ERROR(Service_SSL, "(STUBBED) called.");
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
|
|
|
|
rb.Push(ResultSuccess);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ISslContext final : public ServiceFramework<ISslContext> {
|
|
|
|
|
|