summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-04-11 21:15:18 -0400
committerGravatar GitHub2018-04-11 21:15:18 -0400
commit9629736625fddcd1bc6d2557e0fe80ff6e685eba (patch)
treebc8c16ab5d5891314f589d04e984dec198c15226 /src
parentMerge pull request #318 from mailwl/account (diff)
parentService/SSL: update service according switchbrew (diff)
downloadyuzu-9629736625fddcd1bc6d2557e0fe80ff6e685eba.tar.gz
yuzu-9629736625fddcd1bc6d2557e0fe80ff6e685eba.tar.xz
yuzu-9629736625fddcd1bc6d2557e0fe80ff6e685eba.zip
Merge pull request #320 from mailwl/ssl-update
Service/SSL: update service according switchbrew
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/ssl/ssl.cpp96
-rw-r--r--src/core/hle/service/ssl/ssl.h3
2 files changed, 98 insertions, 1 deletions
diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp
index afa8d5d79..01a03ec83 100644
--- a/src/core/hle/service/ssl/ssl.cpp
+++ b/src/core/hle/service/ssl/ssl.cpp
@@ -2,12 +2,106 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
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/service/ssl/ssl.h" 6#include "core/hle/service/ssl/ssl.h"
6 7
7namespace Service { 8namespace Service {
8namespace SSL { 9namespace SSL {
9 10
10SSL::SSL() : ServiceFramework("ssl") {} 11class ISslConnection final : public ServiceFramework<ISslConnection> {
12public:
13 ISslConnection() : ServiceFramework("ISslConnection") {
14 static const FunctionInfo functions[] = {
15 {0, nullptr, "SetSocketDescriptor"},
16 {1, nullptr, "SetHostName"},
17 {2, nullptr, "SetVerifyOption"},
18 {3, nullptr, "SetIoMode"},
19 {4, nullptr, "GetSocketDescriptor"},
20 {5, nullptr, "GetHostName"},
21 {6, nullptr, "GetVerifyOption"},
22 {7, nullptr, "GetIoMode"},
23 {8, nullptr, "DoHandshake"},
24 {9, nullptr, "DoHandshakeGetServerCert"},
25 {10, nullptr, "Read"},
26 {11, nullptr, "Write"},
27 {12, nullptr, "Pending"},
28 {13, nullptr, "Peek"},
29 {14, nullptr, "Poll"},
30 {15, nullptr, "GetVerifyCertError"},
31 {16, nullptr, "GetNeededServerCertBufferSize"},
32 {17, nullptr, "SetSessionCacheMode"},
33 {18, nullptr, "GetSessionCacheMode"},
34 {19, nullptr, "FlushSessionCache"},
35 {20, nullptr, "SetRenegotiationMode"},
36 {21, nullptr, "GetRenegotiationMode"},
37 {22, nullptr, "SetOption"},
38 {23, nullptr, "GetOption"},
39 {24, nullptr, "GetVerifyCertErrors"},
40 {25, nullptr, "GetCipherInfo"},
41 };
42 RegisterHandlers(functions);
43 }
44};
45
46class ISslContext final : public ServiceFramework<ISslContext> {
47public:
48 ISslContext() : ServiceFramework("ISslContext") {
49 static const FunctionInfo functions[] = {
50 {0, &ISslContext::SetOption, "SetOption"},
51 {1, nullptr, "GetOption"},
52 {2, &ISslContext::CreateConnection, "CreateConnection"},
53 {3, nullptr, "GetConnectionCount"},
54 {4, nullptr, "ImportServerPki"},
55 {5, nullptr, "ImportClientPki"},
56 {6, nullptr, "RemoveServerPki"},
57 {7, nullptr, "RemoveClientPki"},
58 {8, nullptr, "RegisterInternalPki"},
59 {9, nullptr, "AddPolicyOid"},
60 {10, nullptr, "ImportCrl"},
61 {11, nullptr, "RemoveCrl"},
62 };
63 RegisterHandlers(functions);
64 }
65 ~ISslContext() = default;
66
67private:
68 void SetOption(Kernel::HLERequestContext& ctx) {
69 LOG_WARNING(Service_SSL, "(STUBBED) called");
70 IPC::RequestParser rp{ctx};
71
72 IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
73 rb.Push(RESULT_SUCCESS);
74 }
75
76 void CreateConnection(Kernel::HLERequestContext& ctx) {
77 LOG_WARNING(Service_SSL, "(STUBBED) called");
78
79 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
80 rb.Push(RESULT_SUCCESS);
81 rb.PushIpcInterface<ISslConnection>();
82 }
83};
84
85void SSL::CreateContext(Kernel::HLERequestContext& ctx) {
86 LOG_WARNING(Service_SSL, "(STUBBED) called");
87
88 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
89 rb.Push(RESULT_SUCCESS);
90 rb.PushIpcInterface<ISslContext>();
91}
92
93SSL::SSL() : ServiceFramework("ssl") {
94 static const FunctionInfo functions[] = {
95 {0, &SSL::CreateContext, "CreateContext"},
96 {1, nullptr, "GetContextCount"},
97 {2, nullptr, "GetCertificates"},
98 {3, nullptr, "GetCertificateBufSize"},
99 {4, nullptr, "DebugIoctl"},
100 {5, nullptr, "SetInterfaceVersion"},
101 {6, nullptr, "FlushSessionCache"},
102 };
103 RegisterHandlers(functions);
104}
11 105
12void InstallInterfaces(SM::ServiceManager& service_manager) { 106void InstallInterfaces(SM::ServiceManager& service_manager) {
13 std::make_shared<SSL>()->InstallAsService(service_manager); 107 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 645dad003..7fcff5ccd 100644
--- a/src/core/hle/service/ssl/ssl.h
+++ b/src/core/hle/service/ssl/ssl.h
@@ -13,6 +13,9 @@ class SSL final : public ServiceFramework<SSL> {
13public: 13public:
14 explicit SSL(); 14 explicit SSL();
15 ~SSL() = default; 15 ~SSL() = default;
16
17private:
18 void CreateContext(Kernel::HLERequestContext& ctx);
16}; 19};
17 20
18/// Registers all SSL services with the specified service manager. 21/// Registers all SSL services with the specified service manager.