diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-07-18 05:57:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-18 05:57:39 +0200 |
commit | 3fded314f22554c867a283ca3b5c79069d96fe0d (patch) | |
tree | 633beb9295b25dfca6b7b53f07842eb366d32cb6 | |
parent | Merge pull request #10934 from abouvier/cmake-vma (diff) | |
parent | ssl: Link with crypt32 for secure channel backend (diff) | |
download | yuzu-3fded314f22554c867a283ca3b5c79069d96fe0d.tar yuzu-3fded314f22554c867a283ca3b5c79069d96fe0d.tar.gz yuzu-3fded314f22554c867a283ca3b5c79069d96fe0d.tar.bz2 yuzu-3fded314f22554c867a283ca3b5c79069d96fe0d.tar.lz yuzu-3fded314f22554c867a283ca3b5c79069d96fe0d.tar.xz yuzu-3fded314f22554c867a283ca3b5c79069d96fe0d.tar.zst yuzu-3fded314f22554c867a283ca3b5c79069d96fe0d.zip |
-rw-r--r-- | src/common/socket_types.h | 5 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/core/hle/service/nifm/nifm.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/service/nifm/nifm.h | 7 | ||||
-rw-r--r-- | src/core/hle/service/ssl/ssl_backend.h | 8 | ||||
-rw-r--r-- | src/core/hle/service/ssl/ssl_backend_none.cpp | 4 | ||||
-rw-r--r-- | src/core/hle/service/ssl/ssl_backend_openssl.cpp | 16 | ||||
-rw-r--r-- | src/core/hle/service/ssl/ssl_backend_schannel.cpp | 9 | ||||
-rw-r--r-- | src/core/hle/service/ssl/ssl_backend_securetransport.cpp | 15 | ||||
-rw-r--r-- | src/core/internal_network/socket_proxy.cpp | 1 | ||||
-rw-r--r-- | src/core/internal_network/socket_proxy.h | 4 | ||||
-rw-r--r-- | src/core/internal_network/sockets.h | 3 |
12 files changed, 43 insertions, 32 deletions
diff --git a/src/common/socket_types.h b/src/common/socket_types.h index b2191c2e8..63824a5c4 100644 --- a/src/common/socket_types.h +++ b/src/common/socket_types.h @@ -3,9 +3,10 @@ #pragma once -#include "common/common_types.h" - #include <optional> +#include <string> + +#include "common/common_types.h" namespace Network { diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index c3b688c5d..4b7395be8 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -876,7 +876,7 @@ elseif (APPLE) elseif (WIN32) target_sources(core PRIVATE hle/service/ssl/ssl_backend_schannel.cpp) - target_link_libraries(core PRIVATE secur32) + target_link_libraries(core PRIVATE crypt32 secur32) else() target_sources(core PRIVATE hle/service/ssl/ssl_backend_none.cpp) diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 91d42853e..21b06d10b 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -7,6 +7,7 @@ #include "core/hle/service/kernel_helpers.h" #include "core/hle/service/nifm/nifm.h" #include "core/hle/service/server_manager.h" +#include "network/network.h" namespace { diff --git a/src/core/hle/service/nifm/nifm.h b/src/core/hle/service/nifm/nifm.h index 9b20e6823..ae99c4695 100644 --- a/src/core/hle/service/nifm/nifm.h +++ b/src/core/hle/service/nifm/nifm.h @@ -4,14 +4,15 @@ #pragma once #include "core/hle/service/service.h" -#include "network/network.h" -#include "network/room.h" -#include "network/room_member.h" namespace Core { class System; } +namespace Network { +class RoomNetwork; +} + namespace Service::NIFM { void LoopProcess(Core::System& system); diff --git a/src/core/hle/service/ssl/ssl_backend.h b/src/core/hle/service/ssl/ssl_backend.h index 25c16bcc1..409f4367c 100644 --- a/src/core/hle/service/ssl/ssl_backend.h +++ b/src/core/hle/service/ssl/ssl_backend.h @@ -3,15 +3,15 @@ #pragma once -#include "core/hle/result.h" - -#include "common/common_types.h" - #include <memory> #include <span> #include <string> #include <vector> +#include "common/common_types.h" + +#include "core/hle/result.h" + namespace Network { class SocketBase; } diff --git a/src/core/hle/service/ssl/ssl_backend_none.cpp b/src/core/hle/service/ssl/ssl_backend_none.cpp index f2f0ef706..2f4f23c42 100644 --- a/src/core/hle/service/ssl/ssl_backend_none.cpp +++ b/src/core/hle/service/ssl/ssl_backend_none.cpp @@ -1,10 +1,10 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "core/hle/service/ssl/ssl_backend.h" - #include "common/logging/log.h" +#include "core/hle/service/ssl/ssl_backend.h" + namespace Service::SSL { ResultVal<std::unique_ptr<SSLConnectionBackend>> CreateSSLConnectionBackend() { diff --git a/src/core/hle/service/ssl/ssl_backend_openssl.cpp b/src/core/hle/service/ssl/ssl_backend_openssl.cpp index f69674f77..6ca869dbf 100644 --- a/src/core/hle/service/ssl/ssl_backend_openssl.cpp +++ b/src/core/hle/service/ssl/ssl_backend_openssl.cpp @@ -1,14 +1,6 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "core/hle/service/ssl/ssl_backend.h" -#include "core/internal_network/network.h" -#include "core/internal_network/sockets.h" - -#include "common/fs/file.h" -#include "common/hex_util.h" -#include "common/string_util.h" - #include <mutex> #include <openssl/bio.h> @@ -16,6 +8,14 @@ #include <openssl/ssl.h> #include <openssl/x509.h> +#include "common/fs/file.h" +#include "common/hex_util.h" +#include "common/string_util.h" + +#include "core/hle/service/ssl/ssl_backend.h" +#include "core/internal_network/network.h" +#include "core/internal_network/sockets.h" + using namespace Common::FS; namespace Service::SSL { diff --git a/src/core/hle/service/ssl/ssl_backend_schannel.cpp b/src/core/hle/service/ssl/ssl_backend_schannel.cpp index a1d6a186e..d8074339a 100644 --- a/src/core/hle/service/ssl/ssl_backend_schannel.cpp +++ b/src/core/hle/service/ssl/ssl_backend_schannel.cpp @@ -1,16 +1,16 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "core/hle/service/ssl/ssl_backend.h" -#include "core/internal_network/network.h" -#include "core/internal_network/sockets.h" +#include <mutex> #include "common/error.h" #include "common/fs/file.h" #include "common/hex_util.h" #include "common/string_util.h" -#include <mutex> +#include "core/hle/service/ssl/ssl_backend.h" +#include "core/internal_network/network.h" +#include "core/internal_network/sockets.h" namespace { @@ -20,6 +20,7 @@ namespace { #define SECURITY_WIN32 #include <schnlsp.h> #include <security.h> +#include <wincrypt.h> std::once_flag one_time_init_flag; bool one_time_init_success = false; diff --git a/src/core/hle/service/ssl/ssl_backend_securetransport.cpp b/src/core/hle/service/ssl/ssl_backend_securetransport.cpp index be40a5aeb..b3083cbad 100644 --- a/src/core/hle/service/ssl/ssl_backend_securetransport.cpp +++ b/src/core/hle/service/ssl/ssl_backend_securetransport.cpp @@ -1,18 +1,21 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "core/hle/service/ssl/ssl_backend.h" -#include "core/internal_network/network.h" -#include "core/internal_network/sockets.h" - #include <mutex> -#include <Security/SecureTransport.h> - // SecureTransport has been deprecated in its entirety in favor of // Network.framework, but that does not allow layering TLS on top of an // arbitrary socket. +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#include <Security/SecureTransport.h> +#pragma GCC diagnostic pop +#endif + +#include "core/hle/service/ssl/ssl_backend.h" +#include "core/internal_network/network.h" +#include "core/internal_network/sockets.h" namespace { diff --git a/src/core/internal_network/socket_proxy.cpp b/src/core/internal_network/socket_proxy.cpp index 44e9e3093..ce0dee970 100644 --- a/src/core/internal_network/socket_proxy.cpp +++ b/src/core/internal_network/socket_proxy.cpp @@ -10,6 +10,7 @@ #include "core/internal_network/network.h" #include "core/internal_network/network_interface.h" #include "core/internal_network/socket_proxy.h" +#include "network/network.h" #if YUZU_UNIX #include <sys/socket.h> diff --git a/src/core/internal_network/socket_proxy.h b/src/core/internal_network/socket_proxy.h index e12c413d1..70500cf4a 100644 --- a/src/core/internal_network/socket_proxy.h +++ b/src/core/internal_network/socket_proxy.h @@ -10,10 +10,12 @@ #include "common/common_funcs.h" #include "core/internal_network/sockets.h" -#include "network/network.h" +#include "network/room_member.h" namespace Network { +class RoomNetwork; + class ProxySocket : public SocketBase { public: explicit ProxySocket(RoomNetwork& room_network_) noexcept; diff --git a/src/core/internal_network/sockets.h b/src/core/internal_network/sockets.h index 46a53ef79..4ba51f62c 100644 --- a/src/core/internal_network/sockets.h +++ b/src/core/internal_network/sockets.h @@ -15,12 +15,13 @@ #include "common/common_types.h" #include "core/internal_network/network.h" -#include "network/network.h" // TODO: C++20 Replace std::vector usages with std::span namespace Network { +struct ProxyPacket; + class SocketBase { public: #ifdef YUZU_UNIX |