From cf13aecfd2270d83b0f466e8d967be95a3923e26 Mon Sep 17 00:00:00 2001 From: Vardhan Thigle Date: Fri, 25 Jan 2019 11:31:35 +0530 Subject: [PATCH 1/2] Vendor Change:- 1. Added conditional compilation flags "MBEDTLS_FORCE_AESNI" and "MBEDTLS_FORCE_PADLOCK" 2. This allows us to supress cpuid based feature detection on sgx platforms. 3. "MBEDTLS_FORCE_AESNI" gets set if "force_aesni_support" flag is enabled. 4. Please refer to the previous commit for rust side changes. (cherry picked from commit d2317b0864e313d759671068e3d3aa52c8fab234) --- mbedtls-sys/vendor/library/aesni.c | 2 ++ mbedtls-sys/vendor/library/padlock.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mbedtls-sys/vendor/library/aesni.c b/mbedtls-sys/vendor/library/aesni.c index c909f654..b8f8e071 100644 --- a/mbedtls-sys/vendor/library/aesni.c +++ b/mbedtls-sys/vendor/library/aesni.c @@ -45,6 +45,7 @@ #include #endif +#if !defined(MBEDTLS_CUSTOM_HAS_AESNI) /* * AES-NI support detection routine */ @@ -74,6 +75,7 @@ int mbedtls_aesni_has_support(unsigned int what) return (c & what) != 0; } +#endif #if MBEDTLS_AESNI_HAVE_CODE == 2 diff --git a/mbedtls-sys/vendor/library/padlock.c b/mbedtls-sys/vendor/library/padlock.c index 303f82c7..798e9b7c 100644 --- a/mbedtls-sys/vendor/library/padlock.c +++ b/mbedtls-sys/vendor/library/padlock.c @@ -39,6 +39,7 @@ #if defined(MBEDTLS_HAVE_X86) +#if !defined(MBEDTLS_CUSTOM_HAS_PADLOCK) /* * PadLock detection routine */ @@ -68,6 +69,7 @@ int mbedtls_padlock_has_support(int feature) return flags & feature; } +#endif /* * PadLock AES-ECB block en(de)cryption -- 2.25.1