summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/ssl/ssl.cpp62
-rw-r--r--src/core/hle/service/ssl/ssl.h14
2 files changed, 39 insertions, 37 deletions
diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp
index 40aea6090..63b86e099 100644
--- a/src/core/hle/service/ssl/ssl.cpp
+++ b/src/core/hle/service/ssl/ssl.cpp
@@ -3,6 +3,9 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/ipc_helpers.h" 5#include "core/hle/ipc_helpers.h"
6#include "core/hle/kernel/hle_ipc.h"
7#include "core/hle/service/service.h"
8#include "core/hle/service/sm/sm.h"
6#include "core/hle/service/ssl/ssl.h" 9#include "core/hle/service/ssl/ssl.h"
7 10
8namespace Service::SSL { 11namespace Service::SSL {
@@ -81,36 +84,43 @@ private:
81 } 84 }
82}; 85};
83 86
84void SSL::CreateContext(Kernel::HLERequestContext& ctx) { 87class SSL final : public ServiceFramework<SSL> {
85 LOG_WARNING(Service_SSL, "(STUBBED) called"); 88public:
89 explicit SSL() : ServiceFramework{"ssl"} {
90 // clang-format off
91 static const FunctionInfo functions[] = {
92 {0, &SSL::CreateContext, "CreateContext"},
93 {1, nullptr, "GetContextCount"},
94 {2, nullptr, "GetCertificates"},
95 {3, nullptr, "GetCertificateBufSize"},
96 {4, nullptr, "DebugIoctl"},
97 {5, &SSL::SetInterfaceVersion, "SetInterfaceVersion"},
98 {6, nullptr, "FlushSessionCache"},
99 };
100 // clang-format on
86 101
87 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 102 RegisterHandlers(functions);
88 rb.Push(RESULT_SUCCESS); 103 }
89 rb.PushIpcInterface<ISslContext>();
90}
91 104
92SSL::SSL() : ServiceFramework("ssl") { 105private:
93 static const FunctionInfo functions[] = { 106 void CreateContext(Kernel::HLERequestContext& ctx) {
94 {0, &SSL::CreateContext, "CreateContext"}, 107 LOG_WARNING(Service_SSL, "(STUBBED) called");
95 {1, nullptr, "GetContextCount"},
96 {2, nullptr, "GetCertificates"},
97 {3, nullptr, "GetCertificateBufSize"},
98 {4, nullptr, "DebugIoctl"},
99 {5, &SSL::SetInterfaceVersion, "SetInterfaceVersion"},
100 {6, nullptr, "FlushSessionCache"},
101 };
102 RegisterHandlers(functions);
103}
104 108
105void SSL::SetInterfaceVersion(Kernel::HLERequestContext& ctx) { 109 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
106 LOG_WARNING(Service_SSL, "(STUBBED) called"); 110 rb.Push(RESULT_SUCCESS);
107 IPC::RequestParser rp{ctx}; 111 rb.PushIpcInterface<ISslContext>();
108 u32 unk1 = rp.Pop<u32>(); // Probably minor/major? 112 }
109 u32 unk2 = rp.Pop<u32>(); // TODO(ogniK): Figure out what this does
110 113
111 IPC::ResponseBuilder rb{ctx, 2}; 114 void SetInterfaceVersion(Kernel::HLERequestContext& ctx) {
112 rb.Push(RESULT_SUCCESS); 115 LOG_WARNING(Service_SSL, "(STUBBED) called");
113} 116 IPC::RequestParser rp{ctx};
117 u32 unk1 = rp.Pop<u32>(); // Probably minor/major?
118 u32 unk2 = rp.Pop<u32>(); // TODO(ogniK): Figure out what this does
119
120 IPC::ResponseBuilder rb{ctx, 2};
121 rb.Push(RESULT_SUCCESS);
122 }
123};
114 124
115void InstallInterfaces(SM::ServiceManager& service_manager) { 125void InstallInterfaces(SM::ServiceManager& service_manager) {
116 std::make_shared<SSL>()->InstallAsService(service_manager); 126 std::make_shared<SSL>()->InstallAsService(service_manager);
diff --git a/src/core/hle/service/ssl/ssl.h b/src/core/hle/service/ssl/ssl.h
index 8fef13022..5cb04c3b9 100644
--- a/src/core/hle/service/ssl/ssl.h
+++ b/src/core/hle/service/ssl/ssl.h
@@ -4,20 +4,12 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/service/service.h" 7namespace Service::SM {
8class ServiceManager;
9}
8 10
9namespace Service::SSL { 11namespace Service::SSL {
10 12
11class SSL final : public ServiceFramework<SSL> {
12public:
13 explicit SSL();
14 ~SSL() = default;
15
16private:
17 void CreateContext(Kernel::HLERequestContext& ctx);
18 void SetInterfaceVersion(Kernel::HLERequestContext& ctx);
19};
20
21/// Registers all SSL services with the specified service manager. 13/// Registers all SSL services with the specified service manager.
22void InstallInterfaces(SM::ServiceManager& service_manager); 14void InstallInterfaces(SM::ServiceManager& service_manager);
23 15