Browse Source

[ports] Remove ENABLE_OPENSSL and mbedtls nixos remnants (#3638)

shell.nix still had references to mbedtls

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3638
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: DraVee <dravee@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
pull/3658/head
lizzie 4 days ago
committed by crueter
parent
commit
281d7a468e
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 2
      shell.nix
  2. 1
      src/android/app/build.gradle.kts
  3. 7
      src/android/app/src/main/jni/CMakeLists.txt
  4. 15
      src/core/crypto/aes_util.cpp
  5. 4
      src/core/crypto/sha_util.cpp
  6. 19
      src/core/crypto/sha_util.h

2
shell.nix

@ -9,7 +9,7 @@ pkgs.mkShellNoCC {
# libraries # libraries
openssl boost fmt nlohmann_json lz4 zlib zstd openssl boost fmt nlohmann_json lz4 zlib zstd
enet libopus vulkan-headers vulkan-utility-libraries 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 glslang python3 httplib cpp-jwt ffmpeg-headless
libusb1 cubeb libusb1 cubeb
# eden # eden

1
src/android/app/build.gradle.kts

@ -80,7 +80,6 @@ android {
listOf( listOf(
"-DENABLE_QT=0", // Don't use QT "-DENABLE_QT=0", // Don't use QT
"-DENABLE_WEB_SERVICE=1", // Enable web service "-DENABLE_WEB_SERVICE=1", // Enable web service
"-DENABLE_OPENSSL=ON",
"-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work "-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work
"-DYUZU_USE_CPM=ON", "-DYUZU_USE_CPM=ON",
"-DCPMUTIL_FORCE_BUNDLED=ON", "-DCPMUTIL_FORCE_BUNDLED=ON",

7
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-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2023 yuzu Emulator Project # SPDX-FileCopyrightText: 2023 yuzu Emulator Project
@ -27,10 +27,7 @@ if (ARCHITECTURE_arm64)
target_link_libraries(yuzu-android PRIVATE adrenotools) target_link_libraries(yuzu-android PRIVATE adrenotools)
endif() 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) if (ENABLE_UPDATE_CHECKER)
target_compile_definitions(yuzu-android PUBLIC ENABLE_UPDATE_CHECKER) target_compile_definitions(yuzu-android PUBLIC ENABLE_UPDATE_CHECKER)
endif() endif()

15
src/core/crypto/aes_util.cpp

@ -38,7 +38,6 @@ struct CipherContext {
static inline const std::string GetCipherName(Mode mode, u32 key_size) { static inline const std::string GetCipherName(Mode mode, u32 key_size) {
std::string cipher; std::string cipher;
std::size_t effective_bits = key_size * 8; std::size_t effective_bits = key_size * 8;
switch (mode) { switch (mode) {
case Mode::CTR: case Mode::CTR:
cipher = "CTR"; cipher = "CTR";
@ -53,7 +52,6 @@ static inline const std::string GetCipherName(Mode mode, u32 key_size) {
default: default:
UNREACHABLE(); UNREACHABLE();
} }
return fmt::format("AES-{}-{}", effective_bits, cipher); return fmt::format("AES-{}-{}", effective_bits, cipher);
}; };
@ -87,8 +85,7 @@ static EVP_CIPHER *GetCipher(Mode mode, u32 key_size) {
// TODO: WHY TEMPLATE??????? // TODO: WHY TEMPLATE???????
template <typename Key, std::size_t KeySize> 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->encryption_context = EVP_CIPHER_CTX_new();
ctx->decryption_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(); 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 // now init ciphers
ASSERT(EVP_CipherInit_ex2(ctx->encryption_context, ctx->cipher, key.data(), NULL, 1, NULL)); 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)); 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* des
template <typename Key, std::size_t KeySize> template <typename Key, std::size_t KeySize>
void AESCipher<Key, KeySize>::XTSTranscode(const u8* src, std::size_t size, u8* dest, 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) { 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) { for (std::size_t i = 0; i < size; i += sector_size) {
SetIV(CalculateNintendoTweak(sector_id++)); SetIV(CalculateNintendoTweak(sector_id++));
Transcode(src + i, sector_size, dest + i, op); 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) { 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_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); 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>; template class AESCipher<Key128>;

4
src/core/crypto/sha_util.cpp

@ -1,4 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
namespace Crypto {} // namespace Crypto

19
src/core/crypto/sha_util.h

@ -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
Loading…
Cancel
Save