diff --git a/tests/include/test/bignum_helpers.h b/tests/include/test/bignum_helpers.h index 0787c5180..49e290b92 100644 --- a/tests/include/test/bignum_helpers.h +++ b/tests/include/test/bignum_helpers.h @@ -17,7 +17,7 @@ #if defined(MBEDTLS_BIGNUM_C) -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include #else #include diff --git a/tests/include/test/drivers/cipher.h b/tests/include/test/drivers/cipher.h index 3749d81f3..b6860f95e 100644 --- a/tests/include/test/drivers/cipher.h +++ b/tests/include/test/drivers/cipher.h @@ -16,7 +16,7 @@ #include #include -#if MBEDTLS_MAJOR_VERSION >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include "mbedtls/private/cipher.h" #else #include "mbedtls/cipher.h" diff --git a/tests/include/test/helpers.h b/tests/include/test/helpers.h index 221579f64..f1700bbb8 100644 --- a/tests/include/test/helpers.h +++ b/tests/include/test/helpers.h @@ -52,7 +52,7 @@ #if defined(MBEDTLS_BIGNUM_C) -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include "mbedtls/private/bignum.h" #else #include "mbedtls/bignum.h" diff --git a/tests/include/test/psa_crypto_helpers.h b/tests/include/test/psa_crypto_helpers.h index a0d5647ed..962ca1e2f 100644 --- a/tests/include/test/psa_crypto_helpers.h +++ b/tests/include/test/psa_crypto_helpers.h @@ -18,7 +18,7 @@ #include -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include #else #include diff --git a/tests/src/bignum_helpers.c b/tests/src/bignum_helpers.c index 8f8ec9e6f..8b35e38c8 100644 --- a/tests/src/bignum_helpers.c +++ b/tests/src/bignum_helpers.c @@ -18,7 +18,7 @@ #include #include -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include #else #include diff --git a/tests/src/drivers/test_driver_asymmetric_encryption.c b/tests/src/drivers/test_driver_asymmetric_encryption.c index 38621fca7..57adb5ce9 100644 --- a/tests/src/drivers/test_driver_asymmetric_encryption.c +++ b/tests/src/drivers/test_driver_asymmetric_encryption.c @@ -10,7 +10,7 @@ #if defined(PSA_CRYPTO_DRIVER_TEST) #include "psa/crypto.h" -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include "mbedtls/private/rsa.h" #else #include "mbedtls/rsa.h" diff --git a/tests/src/drivers/test_driver_cipher.c b/tests/src/drivers/test_driver_cipher.c index 89e1cc36d..9b753cd89 100644 --- a/tests/src/drivers/test_driver_cipher.c +++ b/tests/src/drivers/test_driver_cipher.c @@ -13,7 +13,7 @@ #include "psa_crypto_cipher.h" #include "psa_crypto_core.h" -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include "mbedtls/private/cipher.h" #else #include "mbedtls/cipher.h" diff --git a/tests/src/drivers/test_driver_key_management.c b/tests/src/drivers/test_driver_key_management.c index 2d34f957a..90cdb2153 100644 --- a/tests/src/drivers/test_driver_key_management.c +++ b/tests/src/drivers/test_driver_key_management.c @@ -15,7 +15,7 @@ #include "psa_crypto_rsa.h" #include "psa_crypto_ffdh.h" -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include "mbedtls/private/ecp.h" #else #include "mbedtls/ecp.h" diff --git a/tests/src/drivers/test_driver_signature.c b/tests/src/drivers/test_driver_signature.c index cc0db54c3..2915b5426 100644 --- a/tests/src/drivers/test_driver_signature.c +++ b/tests/src/drivers/test_driver_signature.c @@ -16,7 +16,7 @@ #include "psa_crypto_hash.h" #include "psa_crypto_rsa.h" -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include "mbedtls/private/ecp.h" #else #include "mbedtls/ecp.h" @@ -26,7 +26,7 @@ #include "test/drivers/signature.h" #include "test/drivers/hash.h" -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include "mbedtls/private/ecdsa.h" #else #include "mbedtls/ecdsa.h" diff --git a/tests/src/fake_external_rng_for_test.c b/tests/src/fake_external_rng_for_test.c index d1ab67543..aedd6d3e6 100644 --- a/tests/src/fake_external_rng_for_test.c +++ b/tests/src/fake_external_rng_for_test.c @@ -59,7 +59,7 @@ psa_status_t mbedtls_psa_external_get_random( #include -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include #else #include diff --git a/tests/src/psa_crypto_helpers.c b/tests/src/psa_crypto_helpers.c index 662204398..3baf5474d 100644 --- a/tests/src/psa_crypto_helpers.c +++ b/tests/src/psa_crypto_helpers.c @@ -14,7 +14,7 @@ #include #if defined(MBEDTLS_CTR_DRBG_C) -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include #else #include @@ -253,7 +253,7 @@ exit: #if defined(MBEDTLS_PSA_INJECT_ENTROPY) -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include #else #include diff --git a/tests/src/psa_exercise_key.c b/tests/src/psa_exercise_key.c index a5108b4ec..36e22cef9 100644 --- a/tests/src/psa_exercise_key.c +++ b/tests/src/psa_exercise_key.c @@ -26,7 +26,7 @@ #endif #if defined(MBEDTLS_ECP_C) -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include #else #include diff --git a/tests/src/random.c b/tests/src/random.c index d02df7c5d..e98c36709 100644 --- a/tests/src/random.c +++ b/tests/src/random.c @@ -23,7 +23,7 @@ #include #include -#if MBEDTLS_VERSION_MAJOR >= 4 +#if !defined(MBEDTLS_VERSION_MAJOR) || MBEDTLS_VERSION_MAJOR >= 4 #include #else #include