From 6e590cd3e72b9660193c348c019a9e1e54210ffb Mon Sep 17 00:00:00 2001 From: Devaraj Ranganna Date: Thu, 4 Jul 2019 16:44:19 +0300 Subject: [PATCH 1/2] Include mbedtls/config.h before evaluating MBEDTLS_PSA_CRYPTO_C Signed-off-by: Devaraj Ranganna --- TESTS/mbed-crypto/sanity/main.cpp | 6 ++++++ TESTS/psa/attestation/main.cpp | 6 ++++++ TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp | 6 ++++++ TESTS/psa/crypto_init/main.cpp | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/TESTS/mbed-crypto/sanity/main.cpp b/TESTS/mbed-crypto/sanity/main.cpp index d71563dbcb..b7d1c49608 100644 --- a/TESTS/mbed-crypto/sanity/main.cpp +++ b/TESTS/mbed-crypto/sanity/main.cpp @@ -15,6 +15,12 @@ * limitations under the License. */ +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C))) #error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping. #endif diff --git a/TESTS/psa/attestation/main.cpp b/TESTS/psa/attestation/main.cpp index 391c0a289f..34bc7cd712 100755 --- a/TESTS/psa/attestation/main.cpp +++ b/TESTS/psa/attestation/main.cpp @@ -16,6 +16,12 @@ * limitations under the License. */ +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C))) #error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping. #endif // TARGET_PSA diff --git a/TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp b/TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp index 41b4de5ce0..86c4a49a66 100644 --- a/TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp +++ b/TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp @@ -15,6 +15,12 @@ * limitations under the License. */ +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)) || (!defined(COMPONENT_PSA_SRV_IPC))) #error [NOT_SUPPORTED] These tests can run only on SPM-enabled targets and where Mbed Crypto is ON - skipping. #endif diff --git a/TESTS/psa/crypto_init/main.cpp b/TESTS/psa/crypto_init/main.cpp index cad0258d2a..53ad5fe139 100644 --- a/TESTS/psa/crypto_init/main.cpp +++ b/TESTS/psa/crypto_init/main.cpp @@ -16,6 +16,12 @@ * limitations under the License. */ +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C))) #error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping. #endif // TARGET_PSA From 7ead3fedb89a86c9d65cbfc2282cd9572562ae81 Mon Sep 17 00:00:00 2001 From: Devaraj Ranganna Date: Mon, 8 Jul 2019 16:28:58 +0100 Subject: [PATCH 2/2] Include psa/crypto.h instead of mbedtls/config.h. Signed-off-by: Devaraj Ranganna --- TESTS/mbed-crypto/sanity/main.cpp | 7 +------ TESTS/psa/attestation/main.cpp | 6 +----- TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp | 7 +------ TESTS/psa/crypto_init/main.cpp | 7 +------ 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/TESTS/mbed-crypto/sanity/main.cpp b/TESTS/mbed-crypto/sanity/main.cpp index b7d1c49608..73d5eb0b6f 100644 --- a/TESTS/mbed-crypto/sanity/main.cpp +++ b/TESTS/mbed-crypto/sanity/main.cpp @@ -15,11 +15,7 @@ * limitations under the License. */ -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif +#include "psa/crypto.h" #if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C))) #error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping. @@ -30,7 +26,6 @@ #include "greentea-client/test_env.h" #include "unity.h" #include "utest.h" -#include "psa/crypto.h" #include "entropy.h" #include "entropy_poll.h" diff --git a/TESTS/psa/attestation/main.cpp b/TESTS/psa/attestation/main.cpp index 34bc7cd712..90113daa1f 100755 --- a/TESTS/psa/attestation/main.cpp +++ b/TESTS/psa/attestation/main.cpp @@ -16,11 +16,7 @@ * limitations under the License. */ -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif +#include "psa/crypto.h" #if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C))) #error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping. diff --git a/TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp b/TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp index 86c4a49a66..ca848e85af 100644 --- a/TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp +++ b/TESTS/psa/crypto_access_control/COMPONENT_NSPE/main.cpp @@ -15,11 +15,7 @@ * limitations under the License. */ -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif +#include "psa/crypto.h" #if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)) || (!defined(COMPONENT_PSA_SRV_IPC))) #error [NOT_SUPPORTED] These tests can run only on SPM-enabled targets and where Mbed Crypto is ON - skipping. @@ -30,7 +26,6 @@ #include "greentea-client/test_env.h" #include "unity.h" #include "utest.h" -#include "psa/crypto.h" #include "entropy.h" #include "entropy_poll.h" #include "test_partition_proxy.h" diff --git a/TESTS/psa/crypto_init/main.cpp b/TESTS/psa/crypto_init/main.cpp index 53ad5fe139..b057cd501e 100644 --- a/TESTS/psa/crypto_init/main.cpp +++ b/TESTS/psa/crypto_init/main.cpp @@ -16,11 +16,7 @@ * limitations under the License. */ -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif +#include "psa/crypto.h" #if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C))) #error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping. @@ -29,7 +25,6 @@ #include "greentea-client/test_env.h" #include "unity/unity.h" #include "utest/utest.h" -#include "crypto.h" #include "entropy.h" #include "entropy_poll.h"