Added ISslConnection::{Get,Set}NextAlpnProto stubs

This commit is contained in:
Jarrod Norwell 2024-05-31 09:40:20 +02:00 committed by spectranator
commit ab9cdab883

View file

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