Browse Source
[crypto] Atomize all traces of MbedTLS, and require OpenSSL 3+ (#3606)
[crypto] Atomize all traces of MbedTLS, and require OpenSSL 3+ (#3606)
Closes #3137 Closes #3465 - Replace all mbedtls usage with OpenSSL - require OpenSSL - Up OpenSSL version to 3, cuz that's what we actually need... CAVEATS: - httplib also now required - other ssl backends for svc are unused, maybe remove later * To be fair, our CI never used them anyways. And we never tested those TESTERS PLEASE TEST: - All games and applets boot - Boot, load, exit, etc. times Co-authored-by: crueter <crueter@eden-emu.dev> Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3606 Reviewed-by: crueter <crueter@eden-emu.dev> 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/3615/head
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
24 changed files with 376 additions and 397 deletions
-
35.patch/mbedtls/0001-aesni-fix.patch
-
20.patch/mbedtls/0002-arm64-aes-fix.patch
-
55CMakeLists.txt
-
2cpmfile.json
-
24docs/Deps.md
-
7externals/CMakeLists.txt
-
17externals/cpmfile.json
-
43src/core/CMakeLists.txt
-
163src/core/crypto/aes_util.cpp
-
4src/core/crypto/aes_util.h
-
87src/core/crypto/key_manager.cpp
-
9src/core/crypto/partition_data_manager.cpp
-
41src/core/file_sys/registered_cache.cpp
-
41src/core/file_sys/xts_archive.cpp
-
4src/core/hle/service/bcat/bcat_util.h
-
9src/core/hle/service/bcat/delivery_cache_directory_service.cpp
-
110src/core/hle/service/nfc/common/amiibo_crypto.cpp
-
15src/core/hle/service/nfc/common/amiibo_crypto.h
-
11src/core/hle/service/ro/ro.cpp
-
28src/core/loader/nca.cpp
-
7src/dedicated_room/CMakeLists.txt
-
26src/dedicated_room/yuzu_room.cpp
-
7src/frontend_common/CMakeLists.txt
-
8src/yuzu/CMakeLists.txt
@ -1,35 +0,0 @@ |
|||
diff --git a/library/aesni.h b/library/aesni.h
|
|||
index 754c984c79..59e27afd3e 100644
|
|||
--- a/library/aesni.h
|
|||
+++ b/library/aesni.h
|
|||
@@ -35,7 +35,7 @@
|
|||
/* GCC-like compilers: currently, we only support intrinsics if the requisite |
|||
* target flag is enabled when building the library (e.g. `gcc -mpclmul -msse2` |
|||
* or `clang -maes -mpclmul`). */ |
|||
-#if (defined(__GNUC__) || defined(__clang__)) && defined(__AES__) && defined(__PCLMUL__)
|
|||
+#if defined(__GNUC__) || defined(__clang__)
|
|||
#define MBEDTLS_AESNI_HAVE_INTRINSICS |
|||
#endif |
|||
/* For 32-bit, we only support intrinsics */ |
|||
diff --git a/library/aesni.c b/library/aesni.c
|
|||
index 2857068..3e104ab 100644
|
|||
--- a/library/aesni.c
|
|||
+++ b/library/aesni.c
|
|||
@@ -31,16 +31,14 @@
|
|||
#include <immintrin.h> |
|||
#endif |
|||
|
|||
-#if defined(MBEDTLS_ARCH_IS_X86)
|
|||
#if defined(MBEDTLS_COMPILER_IS_GCC) |
|||
#pragma GCC push_options |
|||
#pragma GCC target ("pclmul,sse2,aes") |
|||
#define MBEDTLS_POP_TARGET_PRAGMA |
|||
-#elif defined(__clang__) && (__clang_major__ >= 5)
|
|||
+#elif defined(__clang__)
|
|||
#pragma clang attribute push (__attribute__((target("pclmul,sse2,aes"))), apply_to=function) |
|||
#define MBEDTLS_POP_TARGET_PRAGMA |
|||
#endif |
|||
-#endif
|
|||
|
|||
#if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY) |
|||
/* |
|||
@ -1,20 +0,0 @@ |
|||
diff --git a/library/common.h b/library/common.h
|
|||
index 50f2a29..c60d9dc 100644
|
|||
--- a/library/common.h
|
|||
+++ b/library/common.h
|
|||
@@ -19,11 +19,11 @@
|
|||
#include <stdint.h> |
|||
#include <stddef.h> |
|||
|
|||
-#if defined(__ARM_NEON)
|
|||
-#include <arm_neon.h>
|
|||
+#if defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64)
|
|||
+#include <arm64_neon.h>
|
|||
#define MBEDTLS_HAVE_NEON_INTRINSICS |
|||
-#elif defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64)
|
|||
-#include <arm64_neon.h>
|
|||
+#elif (defined(__ANDROID__) && defined(__ARM_FP)) || defined(__ARM_NEON)
|
|||
+#include <arm_neon.h>
|
|||
#define MBEDTLS_HAVE_NEON_INTRINSICS |
|||
#endif |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue