mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Merge pull request #1230 from lioncash/ssl
ssl: Move SSL class to cpp file
This commit is contained in:
commit
c156ee8eb8
2 changed files with 39 additions and 37 deletions
|
@ -3,6 +3,9 @@
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include "core/hle/ipc_helpers.h"
|
#include "core/hle/ipc_helpers.h"
|
||||||
|
#include "core/hle/kernel/hle_ipc.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
#include "core/hle/service/sm/sm.h"
|
||||||
#include "core/hle/service/ssl/ssl.h"
|
#include "core/hle/service/ssl/ssl.h"
|
||||||
|
|
||||||
namespace Service::SSL {
|
namespace Service::SSL {
|
||||||
|
@ -81,36 +84,43 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void SSL::CreateContext(Kernel::HLERequestContext& ctx) {
|
class SSL final : public ServiceFramework<SSL> {
|
||||||
LOG_WARNING(Service_SSL, "(STUBBED) called");
|
public:
|
||||||
|
explicit SSL() : ServiceFramework{"ssl"} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, &SSL::CreateContext, "CreateContext"},
|
||||||
|
{1, nullptr, "GetContextCount"},
|
||||||
|
{2, nullptr, "GetCertificates"},
|
||||||
|
{3, nullptr, "GetCertificateBufSize"},
|
||||||
|
{4, nullptr, "DebugIoctl"},
|
||||||
|
{5, &SSL::SetInterfaceVersion, "SetInterfaceVersion"},
|
||||||
|
{6, nullptr, "FlushSessionCache"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
RegisterHandlers(functions);
|
||||||
rb.Push(RESULT_SUCCESS);
|
}
|
||||||
rb.PushIpcInterface<ISslContext>();
|
|
||||||
}
|
|
||||||
|
|
||||||
SSL::SSL() : ServiceFramework("ssl") {
|
private:
|
||||||
static const FunctionInfo functions[] = {
|
void CreateContext(Kernel::HLERequestContext& ctx) {
|
||||||
{0, &SSL::CreateContext, "CreateContext"},
|
LOG_WARNING(Service_SSL, "(STUBBED) called");
|
||||||
{1, nullptr, "GetContextCount"},
|
|
||||||
{2, nullptr, "GetCertificates"},
|
|
||||||
{3, nullptr, "GetCertificateBufSize"},
|
|
||||||
{4, nullptr, "DebugIoctl"},
|
|
||||||
{5, &SSL::SetInterfaceVersion, "SetInterfaceVersion"},
|
|
||||||
{6, nullptr, "FlushSessionCache"},
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SSL::SetInterfaceVersion(Kernel::HLERequestContext& ctx) {
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||||
LOG_WARNING(Service_SSL, "(STUBBED) called");
|
rb.Push(RESULT_SUCCESS);
|
||||||
IPC::RequestParser rp{ctx};
|
rb.PushIpcInterface<ISslContext>();
|
||||||
u32 unk1 = rp.Pop<u32>(); // Probably minor/major?
|
}
|
||||||
u32 unk2 = rp.Pop<u32>(); // TODO(ogniK): Figure out what this does
|
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
void SetInterfaceVersion(Kernel::HLERequestContext& ctx) {
|
||||||
rb.Push(RESULT_SUCCESS);
|
LOG_WARNING(Service_SSL, "(STUBBED) called");
|
||||||
}
|
IPC::RequestParser rp{ctx};
|
||||||
|
u32 unk1 = rp.Pop<u32>(); // Probably minor/major?
|
||||||
|
u32 unk2 = rp.Pop<u32>(); // TODO(ogniK): Figure out what this does
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||||
std::make_shared<SSL>()->InstallAsService(service_manager);
|
std::make_shared<SSL>()->InstallAsService(service_manager);
|
||||||
|
|
|
@ -4,20 +4,12 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "core/hle/service/service.h"
|
namespace Service::SM {
|
||||||
|
class ServiceManager;
|
||||||
|
}
|
||||||
|
|
||||||
namespace Service::SSL {
|
namespace Service::SSL {
|
||||||
|
|
||||||
class SSL final : public ServiceFramework<SSL> {
|
|
||||||
public:
|
|
||||||
explicit SSL();
|
|
||||||
~SSL() = default;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void CreateContext(Kernel::HLERequestContext& ctx);
|
|
||||||
void SetInterfaceVersion(Kernel::HLERequestContext& ctx);
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Registers all SSL services with the specified service manager.
|
/// Registers all SSL services with the specified service manager.
|
||||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue