VERY experimental Nintendo Switch 2 emulator
C++
[ports] Remove ENABLE_OPENSSL and mbedtls nixos remnants (#3638)
lizzie281d7a468e3c
diff --git a/shell.nix b/shell.nixindex d835b43ed1..d8257b88d9 100644--- a/shell.nix+++ b/shell.nix@@ -9,7 +9,7 @@ pkgs.mkShellNoCC {# librariesopenssl boost fmt nlohmann_json lz4 zlib zstdenet libopus vulkan-headers vulkan-utility-libraries- spirv-tools spirv-headers vulkan-loader unzip mbedtls+ spirv-tools spirv-headers vulkan-loader unzipglslang python3 httplib cpp-jwt ffmpeg-headlesslibusb1 cubeb# edendiff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.ktsindex 622ae53a77..3279a2202f 100644--- a/src/android/app/build.gradle.kts+++ b/src/android/app/build.gradle.kts@@ -80,7 +80,6 @@ android {listOf("-DENABLE_QT=0", // Don't use QT"-DENABLE_WEB_SERVICE=1", // Enable web service- "-DENABLE_OPENSSL=ON","-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work"-DYUZU_USE_CPM=ON","-DCPMUTIL_FORCE_BUNDLED=ON",diff --git a/src/android/app/src/main/jni/CMakeLists.txt b/src/android/app/src/main/jni/CMakeLists.txtindex 6cdacea320..c68e206d24 100644--- a/src/android/app/src/main/jni/CMakeLists.txt+++ b/src/android/app/src/main/jni/CMakeLists.txt@@ -1,4 +1,4 @@-# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project+# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project# SPDX-License-Identifier: GPL-3.0-or-later# SPDX-FileCopyrightText: 2023 yuzu Emulator Project@@ -27,10 +27,7 @@ if (ARCHITECTURE_arm64)target_link_libraries(yuzu-android PRIVATE adrenotools)endif()-if (ENABLE_OPENSSL OR ENABLE_WEB_SERVICE)- target_link_libraries(yuzu-android PRIVATE OpenSSL::SSL cpp-jwt::cpp-jwt)-endif()-+target_link_libraries(yuzu-android PRIVATE OpenSSL::SSL cpp-jwt::cpp-jwt)if (ENABLE_UPDATE_CHECKER)target_compile_definitions(yuzu-android PUBLIC ENABLE_UPDATE_CHECKER)endif()diff --git a/src/core/crypto/aes_util.cpp b/src/core/crypto/aes_util.cppindex 1189e45bd8..55f436f532 100644--- a/src/core/crypto/aes_util.cpp+++ b/src/core/crypto/aes_util.cpp@@ -38,7 +38,6 @@ struct CipherContext {static inline const std::string GetCipherName(Mode mode, u32 key_size) {std::string cipher;std::size_t effective_bits = key_size * 8;-switch (mode) {case Mode::CTR:cipher = "CTR";@@ -53,7 +52,6 @@ static inline const std::string GetCipherName(Mode mode, u32 key_size) {default:UNREACHABLE();}-return fmt::format("AES-{}-{}", effective_bits, cipher);};@@ -87,8 +85,7 @@ static EVP_CIPHER *GetCipher(Mode mode, u32 key_size) {// TODO: WHY TEMPLATE???????template <typename Key, std::size_t KeySize>-Crypto::AESCipher<Key, KeySize>::AESCipher(Key key, Mode mode)- : ctx(std::make_unique<CipherContext>()) {+Crypto::AESCipher<Key, KeySize>::AESCipher(Key key, Mode mode) : ctx(std::make_unique<CipherContext>()) {ctx->encryption_context = EVP_CIPHER_CTX_new();ctx->decryption_context = EVP_CIPHER_CTX_new();@@ -99,9 +96,7 @@ Crypto::AESCipher<Key, KeySize>::AESCipher(Key key, Mode mode)UNIMPLEMENTED();}- ASSERT_MSG(ctx->encryption_context && ctx->decryption_context && ctx->cipher,- "OpenSSL cipher context failed init!");-+ ASSERT(ctx->encryption_context && ctx->decryption_context && ctx->cipher && "OpenSSL cipher context failed init!");// now init ciphersASSERT(EVP_CipherInit_ex2(ctx->encryption_context, ctx->cipher, key.data(), NULL, 1, NULL));ASSERT(EVP_CipherInit_ex2(ctx->decryption_context, ctx->cipher, key.data(), NULL, 0, NULL));@@ -165,8 +160,7 @@ void AESCipher<Key, KeySize>::Transcode(const u8* src, std::size_t size, u8* destemplate <typename Key, std::size_t KeySize>void AESCipher<Key, KeySize>::XTSTranscode(const u8* src, std::size_t size, u8* dest,std::size_t sector_id, std::size_t sector_size, Op op) {- ASSERT_MSG(size % sector_size == 0, "XTS decryption size must be a multiple of sector size.");-+ ASSERT(size % sector_size == 0 && "XTS decryption size must be a multiple of sector size.");for (std::size_t i = 0; i < size; i += sector_size) {SetIV(CalculateNintendoTweak(sector_id++));Transcode(src + i, sector_size, dest + i, op);@@ -177,8 +171,7 @@ template <typename Key, std::size_t KeySize>void AESCipher<Key, KeySize>::SetIV(std::span<const u8> data) {const int ret_enc = EVP_CipherInit_ex(ctx->encryption_context, nullptr, nullptr, nullptr, data.data(), -1);const int ret_dec = EVP_CipherInit_ex(ctx->decryption_context, nullptr, nullptr, nullptr, data.data(), -1);-- ASSERT_MSG(ret_enc == 1 && ret_dec == 1, "Failed to set IV on OpenSSL contexts");+ ASSERT(ret_enc == 1 && ret_dec == 1 && "Failed to set IV on OpenSSL contexts");}template class AESCipher<Key128>;diff --git a/src/core/crypto/sha_util.cpp b/src/core/crypto/sha_util.cppdeleted file mode 100644index 7a2c048389..0000000000--- a/src/core/crypto/sha_util.cpp+++ /dev/null@@ -1,4 +0,0 @@-// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--namespace Crypto {} // namespace Cryptodiff --git a/src/core/crypto/sha_util.h b/src/core/crypto/sha_util.hdeleted file mode 100644index 5c2c43dbdb..0000000000--- a/src/core/crypto/sha_util.h+++ /dev/null@@ -1,19 +0,0 @@-// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--#pragma once--#include "common/assert.h"-#include "core/file_sys/vfs.h"-#include "key_manager.h"-#include "mbedtls/cipher.h"--namespace Crypto {-typedef std::array<u8, 0x20> SHA256Hash;--inline SHA256Hash operator"" _HASH(const char* data, size_t len) {- if (len != 0x40)- return {};-}--} // namespace Crypto