diff --git a/shell.nix b/shell.nix index d835b43ed1..d8257b88d9 100644 --- a/shell.nix +++ b/shell.nix @@ -9,7 +9,7 @@ pkgs.mkShellNoCC { # libraries openssl boost fmt nlohmann_json lz4 zlib zstd enet libopus vulkan-headers vulkan-utility-libraries - spirv-tools spirv-headers vulkan-loader unzip mbedtls + spirv-tools spirv-headers vulkan-loader unzip glslang python3 httplib cpp-jwt ffmpeg-headless libusb1 cubeb # eden diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index 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.txt index 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.cpp index 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 -Crypto::AESCipher::AESCipher(Key key, Mode mode) - : ctx(std::make_unique()) { +Crypto::AESCipher::AESCipher(Key key, Mode mode) : ctx(std::make_unique()) { ctx->encryption_context = EVP_CIPHER_CTX_new(); ctx->decryption_context = EVP_CIPHER_CTX_new(); @@ -99,9 +96,7 @@ Crypto::AESCipher::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 ciphers ASSERT(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::Transcode(const u8* src, std::size_t size, u8* des template void AESCipher::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 void AESCipher::SetIV(std::span 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; diff --git a/src/core/crypto/sha_util.cpp b/src/core/crypto/sha_util.cpp deleted file mode 100644 index 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 Crypto diff --git a/src/core/crypto/sha_util.h b/src/core/crypto/sha_util.h deleted file mode 100644 index 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 SHA256Hash; - -inline SHA256Hash operator"" _HASH(const char* data, size_t len) { - if (len != 0x40) - return {}; -} - -} // namespace Crypto