From 378e494d82da7b4a8ea3eae31470049afb49ebcc Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 9 Jul 2020 14:38:18 +0100 Subject: [PATCH] Add an empty ssl service implementation This stubs a single function that is needed for SMO's init. --- app/CMakeLists.txt | 1 + .../main/cpp/skyline/services/base_service.h | 2 ++ .../main/cpp/skyline/services/serviceman.cpp | 4 ++++ .../cpp/skyline/services/ssl/ISslService.cpp | 12 ++++++++++ .../cpp/skyline/services/ssl/ISslService.h | 22 +++++++++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 app/src/main/cpp/skyline/services/ssl/ISslService.cpp create mode 100644 app/src/main/cpp/skyline/services/ssl/ISslService.h diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index da56ac3d..54888392 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -123,6 +123,7 @@ add_library(skyline SHARED ${source_DIR}/skyline/services/nifm/IGeneralService.cpp ${source_DIR}/skyline/services/nifm/IRequest.cpp ${source_DIR}/skyline/services/socket/bsd/IClient.cpp + ${source_DIR}/skyline/services/ssl/ISslService.cpp ${source_DIR}/skyline/vfs/partition_filesystem.cpp ${source_DIR}/skyline/vfs/rom_filesystem.cpp ${source_DIR}/skyline/vfs/os_backing.cpp diff --git a/app/src/main/cpp/skyline/services/base_service.h b/app/src/main/cpp/skyline/services/base_service.h index 43ee6e60..72db83f2 100644 --- a/app/src/main/cpp/skyline/services/base_service.h +++ b/app/src/main/cpp/skyline/services/base_service.h @@ -79,6 +79,7 @@ namespace skyline::service { nifm_IGeneralService, nifm_IRequest, socket_IClient, + ssl_ISslService, }; /** @@ -117,6 +118,7 @@ namespace skyline::service { {"nfp:user", Service::nfp_IUserManager}, {"nifm:u", Service::nifm_IStaticService}, {"bsd:u", Service::socket_IClient}, + {"ssl", Service::ssl_ISslService}, }; class ServiceManager; diff --git a/app/src/main/cpp/skyline/services/serviceman.cpp b/app/src/main/cpp/skyline/services/serviceman.cpp index 30ff6cc5..d0b4cee6 100644 --- a/app/src/main/cpp/skyline/services/serviceman.cpp +++ b/app/src/main/cpp/skyline/services/serviceman.cpp @@ -25,6 +25,7 @@ #include "nfp/IUserManager.h" #include "nifm/IStaticService.h" #include "socket/bsd/IClient.h" +#include "ssl/ISslService.h" #include "serviceman.h" namespace skyline::service { @@ -106,6 +107,9 @@ namespace skyline::service { case Service::socket_IClient: serviceObj = std::make_shared(state, *this); break; + case Service::ssl_ISslService: + serviceObj = std::make_shared(state, *this); + break; default: throw exception("CreateService called on missing object, type: {}", serviceType); } diff --git a/app/src/main/cpp/skyline/services/ssl/ISslService.cpp b/app/src/main/cpp/skyline/services/ssl/ISslService.cpp new file mode 100644 index 00000000..e3e9f3c4 --- /dev/null +++ b/app/src/main/cpp/skyline/services/ssl/ISslService.cpp @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#include "ISslService.h" + +namespace skyline::service::ssl { + ISslService::ISslService(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager, Service::ssl_ISslService, "ssl:ISslService", { + {0x5, SFUNC(ISslService::SetInterfaceVersion)} + }) {} + + void ISslService::SetInterfaceVersion(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {} +} diff --git a/app/src/main/cpp/skyline/services/ssl/ISslService.h b/app/src/main/cpp/skyline/services/ssl/ISslService.h new file mode 100644 index 00000000..6ed77acd --- /dev/null +++ b/app/src/main/cpp/skyline/services/ssl/ISslService.h @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#pragma once + +#include +#include + +namespace skyline::service::ssl { + /** + * @brief ISslService or ssl is used by applications to manage SSL connections (https://switchbrew.org/wiki/SSL_services#ssl) + */ + class ISslService : public BaseService { + public: + ISslService(const DeviceState &state, ServiceManager &manager); + + /** + * @brief This sets the SSL interface version (https://switchbrew.org/wiki/SSL_services#SetInterfaceVersion) + */ + void SetInterfaceVersion(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + }; +}