diff options
| author | 2018-09-02 11:36:43 -0400 | |
|---|---|---|
| committer | 2018-09-02 11:45:26 -0400 | |
| commit | 41cd766438d045bc7cacfc37246a90106fb6e89e (patch) | |
| tree | 135b3e8b12ffd53a54a4476d26929706fe720bc1 /src | |
| parent | Merge pull request #1196 from FearlessTobi/ccache-consistency (diff) | |
| download | yuzu-41cd766438d045bc7cacfc37246a90106fb6e89e.tar.gz yuzu-41cd766438d045bc7cacfc37246a90106fb6e89e.tar.xz yuzu-41cd766438d045bc7cacfc37246a90106fb6e89e.zip | |
ssl: Move SSL class to cpp file
This isn't required to be visible to anything outside of the main source
file, and will eliminate needing to rebuild anything else including the
header if the SSL class needs to be changed in the future.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/ssl/ssl.cpp | 62 | ||||
| -rw-r--r-- | src/core/hle/service/ssl/ssl.h | 14 |
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 | ||
| 8 | namespace Service::SSL { | 11 | namespace Service::SSL { |
| @@ -81,36 +84,43 @@ private: | |||
| 81 | } | 84 | } |
| 82 | }; | 85 | }; |
| 83 | 86 | ||
| 84 | void SSL::CreateContext(Kernel::HLERequestContext& ctx) { | 87 | class SSL final : public ServiceFramework<SSL> { |
| 85 | LOG_WARNING(Service_SSL, "(STUBBED) called"); | 88 | public: |
| 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 | ||
| 92 | SSL::SSL() : ServiceFramework("ssl") { | 105 | private: |
| 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 | ||
| 105 | void 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 | ||
| 115 | void InstallInterfaces(SM::ServiceManager& service_manager) { | 125 | void 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" | 7 | namespace Service::SM { |
| 8 | class ServiceManager; | ||
| 9 | } | ||
| 8 | 10 | ||
| 9 | namespace Service::SSL { | 11 | namespace Service::SSL { |
| 10 | 12 | ||
| 11 | class SSL final : public ServiceFramework<SSL> { | ||
| 12 | public: | ||
| 13 | explicit SSL(); | ||
| 14 | ~SSL() = default; | ||
| 15 | |||
| 16 | private: | ||
| 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. |
| 22 | void InstallInterfaces(SM::ServiceManager& service_manager); | 14 | void InstallInterfaces(SM::ServiceManager& service_manager); |
| 23 | 15 | ||