2014-04-30 12:35:08 +02:00
/**
* \ file check_config . h
*
* \ brief Consistency checks for configuration options
2018-01-05 16:33:17 +01:00
*/
/*
2020-08-07 13:07:28 +02:00
* Copyright The Mbed TLS Contributors
2015-09-04 14:21:07 +02:00
* SPDX - License - Identifier : Apache - 2.0
2014-04-30 12:35:08 +02:00
*
2015-09-04 14:21:07 +02:00
* Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may
* not use this file except in compliance with the License .
* You may obtain a copy of the License at
2014-04-30 12:35:08 +02:00
*
2015-09-04 14:21:07 +02:00
* http : //www.apache.org/licenses/LICENSE-2.0
2014-04-30 12:35:08 +02:00
*
2015-09-04 14:21:07 +02:00
* Unless required by applicable law or agreed to in writing , software
* distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
* See the License for the specific language governing permissions and
* limitations under the License .
2014-04-30 12:35:08 +02:00
*/
2015-04-08 12:49:31 +02:00
# ifndef MBEDTLS_CHECK_CONFIG_H
# define MBEDTLS_CHECK_CONFIG_H
2014-04-30 12:35:08 +02:00
2015-05-29 11:26:37 +02:00
/*
* We assume CHAR_BIT is 8 in many places . In practice , this is true on our
* target platforms , so not an issue , but let ' s just be extra sure .
*/
# include <limits.h>
# if CHAR_BIT != 8
# error "mbed TLS requires a platform with 8-bit chars"
# endif
2015-06-26 10:52:01 +02:00
# if defined(_WIN32)
# if !defined(MBEDTLS_PLATFORM_C)
2015-06-22 10:23:34 +02:00
# error "MBEDTLS_PLATFORM_C is required on Windows"
# endif
2021-05-28 09:42:25 +02:00
/* Fix the config here. Not convenient to put an #ifdef _WIN32 in mbedtls_config.h as
2019-07-27 23:52:53 +02:00
* it would confuse config . py . */
2015-06-26 10:52:01 +02:00
# if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
! defined ( MBEDTLS_PLATFORM_SNPRINTF_MACRO )
# define MBEDTLS_PLATFORM_SNPRINTF_ALT
# endif
2019-01-07 16:53:29 +01:00
# if !defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) && \
! defined ( MBEDTLS_PLATFORM_VSNPRINTF_MACRO )
# define MBEDTLS_PLATFORM_VSNPRINTF_ALT
# endif
2015-06-26 10:52:01 +02:00
# endif /* _WIN32 */
2021-06-08 19:31:27 +02:00
# if defined(TARGET_LIKE_MBED) && defined(MBEDTLS_NET_C)
# error "The NET module is not available for mbed OS - please use the network functions provided by Mbed OS"
2015-07-28 14:17:48 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_DEPRECATED_WARNING) && \
2015-03-23 15:24:07 +01:00
! defined ( __GNUC__ ) & & ! defined ( __clang__ )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang"
2015-03-23 13:58:27 +01:00
# endif
2015-06-18 20:52:58 +02:00
# if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME)
# error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM)
# error "MBEDTLS_AESNI_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C)
# error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C)
# error "MBEDTLS_DHM_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2016-09-13 23:00:15 +02:00
# if defined(MBEDTLS_CMAC_C) && \
2022-05-02 10:30:03 +02:00
( ! defined ( MBEDTLS_CIPHER_C ) | | ( ! defined ( MBEDTLS_AES_C ) & & ! defined ( MBEDTLS_DES_C ) ) )
2016-09-13 23:00:15 +02:00
# error "MBEDTLS_CMAC_C defined, but not all prerequisites"
# endif
2018-05-03 15:54:28 +02:00
# if defined(MBEDTLS_NIST_KW_C) && \
( ! defined ( MBEDTLS_AES_C ) | | ! defined ( MBEDTLS_CIPHER_C ) )
2022-05-12 09:34:28 +02:00
# error "MBEDTLS_NIST_KW_C defined, but not all prerequisites"
2018-05-03 15:54:28 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C)
# error "MBEDTLS_ECDH_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_ECDSA_C) && \
( ! defined ( MBEDTLS_ECP_C ) | | \
2018-09-14 17:34:00 +02:00
! ( defined ( MBEDTLS_ECP_DP_SECP192R1_ENABLED ) | | \
defined ( MBEDTLS_ECP_DP_SECP224R1_ENABLED ) | | \
defined ( MBEDTLS_ECP_DP_SECP256R1_ENABLED ) | | \
defined ( MBEDTLS_ECP_DP_SECP384R1_ENABLED ) | | \
defined ( MBEDTLS_ECP_DP_SECP521R1_ENABLED ) | | \
defined ( MBEDTLS_ECP_DP_SECP192K1_ENABLED ) | | \
defined ( MBEDTLS_ECP_DP_SECP224K1_ENABLED ) | | \
defined ( MBEDTLS_ECP_DP_SECP256K1_ENABLED ) | | \
defined ( MBEDTLS_ECP_DP_BP256R1_ENABLED ) | | \
defined ( MBEDTLS_ECP_DP_BP384R1_ENABLED ) | | \
defined ( MBEDTLS_ECP_DP_BP512R1_ENABLED ) ) | | \
2015-04-08 12:49:31 +02:00
! defined ( MBEDTLS_ASN1_PARSE_C ) | | \
! defined ( MBEDTLS_ASN1_WRITE_C ) )
# error "MBEDTLS_ECDSA_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-08-05 15:44:42 +02:00
# if defined(MBEDTLS_ECJPAKE_C) && \
2022-08-11 10:47:08 +02:00
( ! defined ( MBEDTLS_ECP_C ) | | \
! ( defined ( MBEDTLS_MD_C ) | | defined ( MBEDTLS_PSA_CRYPTO_C ) ) )
2015-08-05 15:44:42 +02:00
# error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites"
# endif
2018-11-05 13:04:26 +01:00
# if defined(MBEDTLS_ECP_RESTARTABLE) && \
2019-02-22 13:50:35 +01:00
( defined ( MBEDTLS_USE_PSA_CRYPTO ) | | \
2019-02-22 11:25:47 +01:00
defined ( MBEDTLS_ECDH_COMPUTE_SHARED_ALT ) | | \
2018-11-05 13:04:26 +01:00
defined ( MBEDTLS_ECDH_GEN_PUBLIC_ALT ) | | \
defined ( MBEDTLS_ECDSA_SIGN_ALT ) | | \
defined ( MBEDTLS_ECDSA_VERIFY_ALT ) | | \
defined ( MBEDTLS_ECDSA_GENKEY_ALT ) | | \
2019-01-31 14:20:20 +01:00
defined ( MBEDTLS_ECP_INTERNAL_ALT ) | | \
2018-11-05 13:04:26 +01:00
defined ( MBEDTLS_ECP_ALT ) )
2019-02-22 11:25:47 +01:00
# error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative or PSA-based ECP implementation"
2018-11-05 13:04:26 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C)
# error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2019-05-31 20:13:58 +02:00
# if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \
2015-04-08 12:49:31 +02:00
! defined ( MBEDTLS_ECP_DP_SECP192R1_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_SECP224R1_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_SECP256R1_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_SECP384R1_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_SECP521R1_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_BP256R1_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_BP384R1_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_BP512R1_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_SECP192K1_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_SECP224K1_ENABLED ) & & \
2019-05-31 20:13:58 +02:00
! defined ( MBEDTLS_ECP_DP_SECP256K1_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_CURVE25519_ENABLED ) & & \
! defined ( MBEDTLS_ECP_DP_CURVE448_ENABLED ) ) )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_ECP_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2019-01-31 14:20:20 +01:00
# if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C)
2021-12-21 06:14:10 +01:00
# error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites"
2019-01-31 14:20:20 +01:00
# endif
2014-04-30 12:35:08 +02:00
2022-05-02 10:30:03 +02:00
# if defined(MBEDTLS_PKCS12_C) && !defined(MBEDTLS_CIPHER_C)
2022-05-18 01:30:44 +02:00
# error "MBEDTLS_PKCS12_C defined, but not all prerequisites"
2022-05-02 10:30:03 +02:00
# endif
2022-08-31 21:00:31 +02:00
# if defined(MBEDTLS_PKCS5_C) && \
( ! ( defined ( MBEDTLS_MD_C ) | | defined ( MBEDTLS_PSA_CRYPTO_C ) ) | | \
! defined ( MBEDTLS_CIPHER_C ) )
2022-05-18 01:30:44 +02:00
# error "MBEDTLS_PKCS5_C defined, but not all prerequisites"
2022-01-19 12:04:35 +01:00
# endif
2022-08-24 16:47:10 +02:00
# if defined(MBEDTLS_PKCS12_C) && \
! ( defined ( MBEDTLS_MD_C ) | | defined ( MBEDTLS_PSA_CRYPTO_C ) )
2022-05-18 01:30:44 +02:00
# error "MBEDTLS_PKCS12_C defined, but not all prerequisites"
2022-04-27 14:19:19 +02:00
# endif
2022-07-27 10:42:31 +02:00
# if defined(MBEDTLS_PKCS1_V21) && \
! ( defined ( MBEDTLS_MD_C ) | | defined ( MBEDTLS_PSA_CRYPTO_C ) )
2022-05-18 01:30:44 +02:00
# error "MBEDTLS_PKCS1_V21 defined, but not all prerequisites"
2022-04-27 14:19:19 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \
! defined ( MBEDTLS_SHA256_C ) )
# error "MBEDTLS_ENTROPY_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \
defined ( MBEDTLS_CTR_DRBG_ENTROPY_LEN ) & & ( MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64 )
# error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_ENTROPY_C) && \
( ! defined ( MBEDTLS_SHA512_C ) | | defined ( MBEDTLS_ENTROPY_FORCE_SHA256 ) ) \
& & defined ( MBEDTLS_CTR_DRBG_ENTROPY_LEN ) & & ( MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32 )
# error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_ENTROPY_C) && \
defined ( MBEDTLS_ENTROPY_FORCE_SHA256 ) & & ! defined ( MBEDTLS_SHA256_C )
# error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2020-07-10 09:35:54 +02:00
# if defined(__has_feature)
# if __has_feature(memory_sanitizer)
# define MBEDTLS_HAS_MEMSAN
# endif
# endif
# if defined(MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN) && !defined(MBEDTLS_HAS_MEMSAN)
# error "MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN requires building with MemorySanitizer"
# endif
# undef MBEDTLS_HAS_MEMSAN
2021-09-02 10:33:57 +02:00
# if defined(MBEDTLS_CCM_C) && ( \
2021-09-09 20:39:47 +02:00
! defined ( MBEDTLS_AES_C ) & & ! defined ( MBEDTLS_CAMELLIA_C ) & & ! defined ( MBEDTLS_ARIA_C ) )
2021-09-02 10:33:57 +02:00
# error "MBEDTLS_CCM_C defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_CCM_C) && !defined(MBEDTLS_CIPHER_C)
2022-05-12 09:34:28 +02:00
# error "MBEDTLS_CCM_C defined, but not all prerequisites"
2021-09-02 10:33:57 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_GCM_C) && ( \
2021-09-09 20:39:47 +02:00
! defined ( MBEDTLS_AES_C ) & & ! defined ( MBEDTLS_CAMELLIA_C ) & & ! defined ( MBEDTLS_ARIA_C ) )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_GCM_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2021-09-02 10:33:57 +02:00
# if defined(MBEDTLS_GCM_C) && !defined(MBEDTLS_CIPHER_C)
2022-05-12 09:34:28 +02:00
# error "MBEDTLS_GCM_C defined, but not all prerequisites"
2021-09-02 10:33:57 +02:00
# endif
# if defined(MBEDTLS_CHACHAPOLY_C) && !defined(MBEDTLS_CHACHA20_C)
# error "MBEDTLS_CHACHAPOLY_C defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_CHACHAPOLY_C) && !defined(MBEDTLS_POLY1305_C)
# error "MBEDTLS_CHACHAPOLY_C defined, but not all prerequisites"
# endif
2016-11-18 17:38:23 +01:00
# if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
2016-08-18 13:38:46 +02:00
# error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites"
# endif
2016-11-18 17:38:23 +01:00
# if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
2016-08-18 13:38:46 +02:00
# error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites"
# endif
2016-11-18 17:38:23 +01:00
# if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
2016-08-18 13:38:46 +02:00
# error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites"
# endif
2016-11-18 17:38:23 +01:00
# if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
2016-08-18 13:38:46 +02:00
# error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites"
# endif
2016-11-18 17:38:23 +01:00
# if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
2016-08-18 13:38:46 +02:00
# error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites"
# endif
2016-11-18 17:38:23 +01:00
# if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
2016-08-18 13:38:46 +02:00
# error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites"
# endif
2016-11-18 17:38:23 +01:00
# if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
2016-08-18 13:38:46 +02:00
# error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites"
# endif
2016-11-18 17:38:23 +01:00
# if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
2016-08-18 13:38:46 +02:00
# error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites"
# endif
2021-01-21 13:59:17 +01:00
# if defined(MBEDTLS_ECP_NO_FALLBACK) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
# error "MBEDTLS_ECP_NO_FALLBACK defined, but no alternative implementation enabled"
# endif
2022-09-06 07:44:12 +02:00
# if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C)
2016-07-17 09:51:22 +02:00
# error "MBEDTLS_HKDF_C defined, but not all prerequisites"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C)
# error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \
2018-09-14 17:47:41 +02:00
( ! defined ( MBEDTLS_ECDH_C ) | | ! defined ( MBEDTLS_ECDSA_C ) | | \
! defined ( MBEDTLS_X509_CRT_PARSE_C ) )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \
2018-09-14 17:47:41 +02:00
( ! defined ( MBEDTLS_ECDH_C ) | | ! defined ( MBEDTLS_RSA_C ) | | \
! defined ( MBEDTLS_X509_CRT_PARSE_C ) )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C)
# error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \
! defined ( MBEDTLS_ECDH_C )
# error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
( ! defined ( MBEDTLS_DHM_C ) | | ! defined ( MBEDTLS_RSA_C ) | | \
! defined ( MBEDTLS_X509_CRT_PARSE_C ) | | ! defined ( MBEDTLS_PKCS1_V15 ) )
# error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
( ! defined ( MBEDTLS_ECDH_C ) | | ! defined ( MBEDTLS_RSA_C ) | | \
! defined ( MBEDTLS_X509_CRT_PARSE_C ) | | ! defined ( MBEDTLS_PKCS1_V15 ) )
# error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
( ! defined ( MBEDTLS_ECDH_C ) | | ! defined ( MBEDTLS_ECDSA_C ) | | \
! defined ( MBEDTLS_X509_CRT_PARSE_C ) )
# error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
( ! defined ( MBEDTLS_RSA_C ) | | ! defined ( MBEDTLS_X509_CRT_PARSE_C ) | | \
! defined ( MBEDTLS_PKCS1_V15 ) )
# error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \
( ! defined ( MBEDTLS_RSA_C ) | | ! defined ( MBEDTLS_X509_CRT_PARSE_C ) | | \
! defined ( MBEDTLS_PKCS1_V15 ) )
# error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-09-15 17:53:32 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \
2022-09-19 10:44:42 +02:00
( ! defined ( MBEDTLS_ECJPAKE_C ) | | \
2015-09-15 17:53:32 +02:00
! defined ( MBEDTLS_ECP_DP_SECP256R1_ENABLED ) )
# error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites"
# endif
2022-09-19 10:44:42 +02:00
/* Use of EC J-PAKE in TLS requires SHA-256.
2022-09-19 11:55:00 +02:00
* This will be taken from MD if it is present , or from PSA if MD is absent .
2022-09-19 10:44:42 +02:00
* Note : ECJPAKE_C depends on MD_C | | PSA_CRYPTO_C . */
# if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \
! ( defined ( MBEDTLS_MD_C ) & & defined ( MBEDTLS_SHA256_C ) ) & & \
! ( ! defined ( MBEDTLS_MD_C ) & & defined ( PSA_WANT_ALG_SHA_256 ) )
# error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites"
# endif
2020-03-10 12:19:08 +01:00
# if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) && \
2019-02-26 12:43:09 +01:00
! defined ( MBEDTLS_SSL_KEEP_PEER_CERTIFICATE ) & & \
( ! defined ( MBEDTLS_SHA256_C ) & & \
! defined ( MBEDTLS_SHA512_C ) & & \
! defined ( MBEDTLS_SHA1_C ) )
# error "!MBEDTLS_SSL_KEEP_PEER_CERTIFICATE requires MBEDTLS_SHA512_C, MBEDTLS_SHA256_C or MBEDTLS_SHA1_C"
# endif
2022-07-18 12:04:05 +02:00
# if defined(MBEDTLS_MD_C) && !( \
defined ( MBEDTLS_MD5_C ) | | \
defined ( MBEDTLS_RIPEMD160_C ) | | \
defined ( MBEDTLS_SHA1_C ) | | \
defined ( MBEDTLS_SHA224_C ) | | \
defined ( MBEDTLS_SHA256_C ) | | \
defined ( MBEDTLS_SHA384_C ) | | \
defined ( MBEDTLS_SHA512_C ) )
# error "MBEDTLS_MD_C defined, but not all prerequisites"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \
( ! defined ( MBEDTLS_PLATFORM_C ) | | ! defined ( MBEDTLS_PLATFORM_MEMORY ) )
# error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2019-02-26 14:50:21 +01:00
# if defined(MBEDTLS_MEMORY_BACKTRACE) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
2021-12-21 06:14:10 +01:00
# error "MBEDTLS_MEMORY_BACKTRACE defined, but not all prerequisites"
2019-02-26 14:50:21 +01:00
# endif
2019-06-03 17:31:32 +02:00
# if defined(MBEDTLS_MEMORY_DEBUG) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
2021-12-21 06:14:10 +01:00
# error "MBEDTLS_MEMORY_DEBUG defined, but not all prerequisites"
2019-06-03 17:31:32 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM)
# error "MBEDTLS_PADLOCK_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C)
# error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C)
# error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PK_C) && \
2022-07-05 12:11:05 +02:00
! defined ( MBEDTLS_RSA_C ) & & ! defined ( MBEDTLS_ECP_C )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_PK_C defined, but not all prerequisites"
2015-01-28 17:32:36 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C)
# error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C)
# error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites"
2015-02-03 12:26:31 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\
( defined ( MBEDTLS_PLATFORM_STD_EXIT ) | | \
defined ( MBEDTLS_PLATFORM_EXIT_ALT ) )
# error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT / MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously"
2015-02-03 12:26:31 +01:00
# endif
2022-06-30 17:01:40 +02:00
# if defined(MBEDTLS_PLATFORM_SETBUF_ALT) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_SETBUF_ALT defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_PLATFORM_SETBUF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_SETBUF_MACRO defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_PLATFORM_SETBUF_MACRO) &&\
( defined ( MBEDTLS_PLATFORM_STD_SETBUF ) | | \
defined ( MBEDTLS_PLATFORM_SETBUF_ALT ) )
# error "MBEDTLS_PLATFORM_SETBUF_MACRO and MBEDTLS_PLATFORM_STD_SETBUF / MBEDTLS_PLATFORM_SETBUF_ALT cannot be defined simultaneously"
# endif
2016-07-20 11:16:25 +02:00
# if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\
( ! defined ( MBEDTLS_PLATFORM_C ) | | \
! defined ( MBEDTLS_HAVE_TIME ) )
# error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\
( ! defined ( MBEDTLS_PLATFORM_C ) | | \
! defined ( MBEDTLS_HAVE_TIME ) )
# error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\
( ! defined ( MBEDTLS_PLATFORM_C ) | | \
! defined ( MBEDTLS_HAVE_TIME ) )
# error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\
( defined ( MBEDTLS_PLATFORM_STD_TIME ) | | \
defined ( MBEDTLS_PLATFORM_TIME_ALT ) )
# error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME / MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously"
# endif
# if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\
( defined ( MBEDTLS_PLATFORM_STD_TIME ) | | \
defined ( MBEDTLS_PLATFORM_TIME_ALT ) )
# error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME / MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites"
2015-02-03 12:26:31 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\
( defined ( MBEDTLS_PLATFORM_STD_FPRINTF ) | | \
defined ( MBEDTLS_PLATFORM_FPRINTF_ALT ) )
# error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF / MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously"
2015-02-03 12:26:31 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
( ! defined ( MBEDTLS_PLATFORM_C ) | | ! defined ( MBEDTLS_PLATFORM_MEMORY ) )
# error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites"
2015-02-03 12:26:31 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
defined ( MBEDTLS_PLATFORM_STD_FREE )
# error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously"
2015-02-03 12:26:31 +01:00
# endif
2015-05-27 20:26:40 +02:00
# if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO)
# error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is"
2015-02-06 17:14:34 +01:00
# endif
2015-05-27 20:26:40 +02:00
# if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
2015-04-08 12:49:31 +02:00
( ! defined ( MBEDTLS_PLATFORM_C ) | | ! defined ( MBEDTLS_PLATFORM_MEMORY ) )
2015-05-27 20:26:40 +02:00
# error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites"
2015-02-03 12:26:31 +01:00
# endif
2015-05-27 20:26:40 +02:00
# if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
defined ( MBEDTLS_PLATFORM_STD_CALLOC )
# error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously"
2015-02-03 12:26:31 +01:00
# endif
2015-05-27 20:26:40 +02:00
# if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO)
# error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is"
2015-02-06 17:14:34 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites"
2015-02-03 12:26:31 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\
( defined ( MBEDTLS_PLATFORM_STD_PRINTF ) | | \
defined ( MBEDTLS_PLATFORM_PRINTF_ALT ) )
# error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF / MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously"
2015-02-03 12:26:31 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
# error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites"
2015-02-03 12:26:31 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\
( defined ( MBEDTLS_PLATFORM_STD_SNPRINTF ) | | \
defined ( MBEDTLS_PLATFORM_SNPRINTF_ALT ) )
# error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF / MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously"
2015-02-03 12:26:31 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\
! defined ( MBEDTLS_PLATFORM_NO_STD_FUNCTIONS )
# error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2015-05-27 20:26:40 +02:00
# if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY)
# error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY)
# error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\
! defined ( MBEDTLS_PLATFORM_EXIT_ALT )
# error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2016-07-20 11:16:25 +02:00
# if defined(MBEDTLS_PLATFORM_STD_TIME) &&\
( ! defined ( MBEDTLS_PLATFORM_TIME_ALT ) | | \
! defined ( MBEDTLS_HAVE_TIME ) )
# error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\
! defined ( MBEDTLS_PLATFORM_FPRINTF_ALT )
# error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\
! defined ( MBEDTLS_PLATFORM_PRINTF_ALT )
# error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\
! defined ( MBEDTLS_PLATFORM_SNPRINTF_ALT )
# error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites"
2015-02-03 11:58:06 +01:00
# endif
2016-06-01 12:25:44 +02:00
# if defined(MBEDTLS_ENTROPY_NV_SEED) &&\
( ! defined ( MBEDTLS_PLATFORM_C ) | | ! defined ( MBEDTLS_ENTROPY_C ) )
# error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\
! defined ( MBEDTLS_ENTROPY_NV_SEED )
# error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\
! defined ( MBEDTLS_PLATFORM_NV_SEED_ALT )
# error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\
! defined ( MBEDTLS_PLATFORM_NV_SEED_ALT )
# error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\
( defined ( MBEDTLS_PLATFORM_STD_NV_SEED_READ ) | | \
defined ( MBEDTLS_PLATFORM_NV_SEED_ALT ) )
# error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously"
# endif
# if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\
( defined ( MBEDTLS_PLATFORM_STD_NV_SEED_WRITE ) | | \
defined ( MBEDTLS_PLATFORM_NV_SEED_ALT ) )
# error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously"
# endif
2020-11-13 17:36:48 +01:00
# if defined(MBEDTLS_PSA_CRYPTO_C) && \
2020-11-13 21:31:17 +01:00
! ( ( ( defined ( MBEDTLS_CTR_DRBG_C ) | | defined ( MBEDTLS_HMAC_DRBG_C ) ) & & \
2020-11-13 17:36:48 +01:00
defined ( MBEDTLS_ENTROPY_C ) ) | | \
defined ( MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG ) )
# error "MBEDTLS_PSA_CRYPTO_C defined, but not all prerequisites (missing RNG)"
2018-10-25 18:38:05 +02:00
# endif
2022-05-02 10:30:03 +02:00
# if defined(MBEDTLS_PSA_CRYPTO_C) && !defined(MBEDTLS_CIPHER_C )
2022-05-12 09:34:28 +02:00
# error "MBEDTLS_PSA_CRYPTO_C defined, but not all prerequisites"
2022-05-02 10:30:03 +02:00
# endif
2019-02-05 11:23:41 +01:00
# if defined(MBEDTLS_PSA_CRYPTO_SPM) && !defined(MBEDTLS_PSA_CRYPTO_C)
# error "MBEDTLS_PSA_CRYPTO_SPM defined, but not all prerequisites"
# endif
2019-06-26 11:24:49 +02:00
# if defined(MBEDTLS_PSA_CRYPTO_SE_C) && \
! ( defined ( MBEDTLS_PSA_CRYPTO_C ) & & \
defined ( MBEDTLS_PSA_CRYPTO_STORAGE_C ) )
# error "MBEDTLS_PSA_CRYPTO_SE_C defined, but not all prerequisites"
# endif
2022-06-20 18:46:22 +02:00
# if defined(MBEDTLS_PSA_CRYPTO_SE_C)
# if defined(MBEDTLS_DEPRECATED_REMOVED)
# error "MBEDTLS_PSA_CRYPTO_SE_C is deprecated and will be removed in a future version of Mbed TLS"
# elif defined(MBEDTLS_DEPRECATED_WARNING)
# warning "MBEDTLS_PSA_CRYPTO_SE_C is deprecated and will be removed in a future version of Mbed TLS"
# endif
# endif /* MBEDTLS_PSA_CRYPTO_SE_C */
2019-02-05 11:23:41 +01:00
# if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \
2019-03-15 17:14:19 +01:00
! defined ( MBEDTLS_PSA_CRYPTO_C )
2019-02-05 11:23:41 +01:00
# error "MBEDTLS_PSA_CRYPTO_STORAGE_C defined, but not all prerequisites"
# endif
2019-03-15 17:14:19 +01:00
# if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \
! ( defined ( MBEDTLS_PSA_CRYPTO_STORAGE_C ) & & \
defined ( MBEDTLS_ENTROPY_NV_SEED ) )
# error "MBEDTLS_PSA_INJECT_ENTROPY defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \
! defined ( MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES )
# error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with actual entropy sources"
2019-02-05 11:23:41 +01:00
# endif
2020-11-13 18:47:18 +01:00
# if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \
2020-11-18 15:23:08 +01:00
defined ( MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG )
2020-11-13 18:47:18 +01:00
# error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG"
# endif
2019-03-15 17:14:19 +01:00
# if defined(MBEDTLS_PSA_ITS_FILE_C) && \
! defined ( MBEDTLS_FS_IO )
# error "MBEDTLS_PSA_ITS_FILE_C defined, but not all prerequisites"
2019-02-05 11:23:41 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
! defined ( MBEDTLS_OID_C ) )
# error "MBEDTLS_RSA_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2016-05-09 16:13:04 +02:00
# if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \
2016-05-09 15:36:33 +02:00
! defined ( MBEDTLS_PKCS1_V15 ) )
# error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \
( ! defined ( MBEDTLS_RSA_C ) | | ! defined ( MBEDTLS_PKCS1_V21 ) )
# error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites"
2014-01-24 14:37:29 +01:00
# endif
2021-04-06 14:28:22 +02:00
# if defined(MBEDTLS_SHA384_C) && !defined(MBEDTLS_SHA512_C)
# error "MBEDTLS_SHA384_C defined without MBEDTLS_SHA512_C"
2020-01-07 11:00:34 +01:00
# endif
2022-03-15 11:51:52 +01:00
# if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT) && \
defined ( MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY )
# error "Must only define one of MBEDTLS_SHA512_USE_A64_CRYPTO_*"
# endif
# if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT) || \
defined ( MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY )
# if !defined(MBEDTLS_SHA512_C)
# error "MBEDTLS_SHA512_USE_A64_CRYPTO_* defined without MBEDTLS_SHA512_C"
# endif
# if defined(MBEDTLS_SHA512_ALT) || defined(MBEDTLS_SHA512_PROCESS_ALT)
# error "MBEDTLS_SHA512_*ALT can't be used with MBEDTLS_SHA512_USE_A64_CRYPTO_*"
# endif
/*
* Best performance comes from most recent compilers , with intrinsics and - O3 .
* Must compile with - march = armv8 .2 - a + sha3 , but we can ' t detect armv8 .2 - a , and
* can ' t always detect __ARM_FEATURE_SHA512 ( notably clang 7 - 12 ) .
*
* GCC < 8 won ' t work at all ( lacks the sha512 instructions )
* GCC > = 8 uses intrinsics , sets __ARM_FEATURE_SHA512
*
* Clang < 7 won ' t work at all ( lacks the sha512 instructions )
* Clang 7 - 12 don ' t have intrinsics ( but we work around that with inline
* assembler ) or __ARM_FEATURE_SHA512
* Clang = = 13.0 .0 same as clang 12 ( only seen on macOS )
* Clang > = 13.0 .1 has __ARM_FEATURE_SHA512 and intrinsics
*/
# if defined(__aarch64__) && !defined(__ARM_FEATURE_SHA512)
/* Test Clang first, as it defines __GNUC__ */
# if defined(__clang__)
# if __clang_major__ < 7
# error "A more recent Clang is required for MBEDTLS_SHA512_USE_A64_CRYPTO_*"
# elif __clang_major__ < 13 || \
( __clang_major__ = = 13 & & __clang_minor__ = = 0 & & __clang_patchlevel__ = = 0 )
/* We implement the intrinsics with inline assembler, so don't error */
# else
# error "Must use minimum -march=armv8.2-a+sha3 for MBEDTLS_SHA512_USE_A64_CRYPTO_*"
# endif
# elif defined(__GNUC__)
# if __GNUC__ < 8
# error "A more recent GCC is required for MBEDTLS_SHA512_USE_A64_CRYPTO_*"
# else
# error "Must use minimum -march=armv8.2-a+sha3 for MBEDTLS_SHA512_USE_A64_CRYPTO_*"
# endif
# else
# error "Only GCC and Clang supported for MBEDTLS_SHA512_USE_A64_CRYPTO_*"
# endif
# endif
# endif /* MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT || MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY */
# if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY) && !defined(__aarch64__)
# error "MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY defined on non-Aarch64 system"
# endif
2021-04-19 16:46:28 +02:00
# if defined(MBEDTLS_SHA224_C) && !defined(MBEDTLS_SHA256_C)
# error "MBEDTLS_SHA224_C defined without MBEDTLS_SHA256_C"
# endif
# if defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA224_C)
# error "MBEDTLS_SHA256_C defined without MBEDTLS_SHA224_C"
# endif
2022-02-20 23:25:31 +01:00
# if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT) && \
defined ( MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY )
# error "Must only define one of MBEDTLS_SHA256_USE_A64_CRYPTO_*"
# endif
# if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT) || \
defined ( MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY )
# if !defined(MBEDTLS_SHA256_C)
# error "MBEDTLS_SHA256_USE_A64_CRYPTO_* defined without MBEDTLS_SHA256_C"
# endif
# if defined(MBEDTLS_SHA256_ALT) || defined(MBEDTLS_SHA256_PROCESS_ALT)
# error "MBEDTLS_SHA256_*ALT can't be used with MBEDTLS_SHA256_USE_A64_CRYPTO_*"
# endif
# if defined(__aarch64__) && !defined(__ARM_FEATURE_CRYPTO)
# error "Must use minimum -march=armv8-a+crypto for MBEDTLS_SHA256_USE_A64_CRYPTO_*"
# endif
# endif
2022-02-21 13:26:11 +01:00
# if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY) && \
! defined ( __aarch64__ ) & & ! defined ( _M_ARM64 )
2022-02-20 23:25:31 +01:00
# error "MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY defined on non-Aarch64 system"
# endif
2022-08-19 09:42:11 +02:00
# if defined(MBEDTLS_SSL_PROTO_TLS1_2) && !defined(MBEDTLS_USE_PSA_CRYPTO) && \
! ( defined ( MBEDTLS_SHA1_C ) | | defined ( MBEDTLS_SHA256_C ) | | defined ( MBEDTLS_SHA512_C ) )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2022-09-06 08:07:43 +02:00
/* TLS 1.3 requires separate HKDF parts from PSA */
# if defined(MBEDTLS_SSL_PROTO_TLS1_3) && \
! ( defined ( MBEDTLS_PSA_CRYPTO_C ) & & defined ( PSA_WANT_ALG_HKDF_EXTRACT ) & & defined ( PSA_WANT_ALG_HKDF_EXPAND ) )
# error "MBEDTLS_SSL_PROTO_TLS1_3 defined, but not all prerequisites"
# endif
/* TLS 1.3 requires at least one ciphersuite, so at least SHA-256 or SHA-384 */
2022-09-12 13:24:25 +02:00
# if defined(MBEDTLS_SSL_PROTO_TLS1_3)
/* We always need at least one of the hashes via PSA (for use with HKDF) */
# if !( defined(PSA_WANT_ALG_SHA_256) || defined(PSA_WANT_ALG_SHA_384) )
2021-12-08 16:57:54 +01:00
# error "MBEDTLS_SSL_PROTO_TLS1_3 defined, but not all prerequisites"
2022-09-12 13:24:25 +02:00
# endif /* !(PSA_WANT_ALG_SHA_256 || PSA_WANT_ALG_SHA_384) */
# if !defined(MBEDTLS_USE_PSA_CRYPTO)
/* When USE_PSA_CRYPTO is not defined, we also need SHA-256 or SHA-384 via the
* legacy interface , including via the MD layer , for the parts of the code
* that are shared with TLS 1.2 ( running handshake hash ) . */
# if !defined(MBEDTLS_MD_C) || \
! ( defined ( MBEDTLS_SHA256_C ) | | defined ( MBEDTLS_SHA384_C ) )
# error "MBEDTLS_SSL_PROTO_TLS1_3 defined, but not all prerequisites"
# endif /* !MBEDTLS_MD_C || !(MBEDTLS_SHA256_C || MBEDTLS_SHA384_C) */
# endif /* !MBEDTLS_USE_PSA_CRYPTO */
# endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
2020-06-02 07:20:23 +02:00
2022-06-29 17:36:12 +02:00
/*
* The current implementation of TLS 1.3 requires MBEDTLS_SSL_KEEP_PEER_CERTIFICATE .
*/
# if defined(MBEDTLS_SSL_PROTO_TLS1_3) && !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE)
# error "MBEDTLS_SSL_PROTO_TLS1_3 defined without MBEDTLS_SSL_KEEP_PEER_CERTIFICATE"
# endif
2021-05-12 17:49:18 +02:00
# if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
2019-04-11 19:56:18 +02:00
! ( defined ( MBEDTLS_KEY_EXCHANGE_RSA_ENABLED ) | | \
defined ( MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED ) | | \
defined ( MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED ) | | \
defined ( MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ) | | \
defined ( MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED ) | | \
defined ( MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED ) | | \
defined ( MBEDTLS_KEY_EXCHANGE_PSK_ENABLED ) | | \
defined ( MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED ) | | \
defined ( MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED ) | | \
defined ( MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED ) | | \
defined ( MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED ) )
# error "One or more versions of the TLS protocol are enabled " \
" but no key exchange methods defined with MBEDTLS_KEY_EXCHANGE_xxxx "
# endif
2015-05-13 10:10:00 +02:00
# if defined(MBEDTLS_SSL_PROTO_DTLS) && \
! defined ( MBEDTLS_SSL_PROTO_TLS1_2 )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites"
2014-02-06 13:04:16 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C)
# error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \
2022-08-17 22:19:39 +02:00
( ! defined ( MBEDTLS_MD_C ) & & ! defined ( MBEDTLS_USE_PSA_CRYPTO ) ) )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C)
# error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2021-12-23 04:06:26 +01:00
# if defined(MBEDTLS_SSL_TLS_C) && \
! ( defined ( MBEDTLS_SSL_PROTO_TLS1_2 ) | | defined ( MBEDTLS_SSL_PROTO_TLS1_3 ) )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_SSL_TLS_C defined, but no protocols are active"
2014-04-30 12:35:08 +02:00
# endif
2015-05-20 10:59:43 +02:00
# if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS)
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites"
2014-07-23 00:28:58 +02:00
# endif
2015-09-08 17:50:29 +02:00
# if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \
2015-09-09 12:46:16 +02:00
! defined ( MBEDTLS_SSL_DTLS_HELLO_VERIFY )
2015-09-08 17:50:29 +02:00
# error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \
( ! defined ( MBEDTLS_SSL_TLS_C ) | | ! defined ( MBEDTLS_SSL_PROTO_DTLS ) )
# error "MBEDTLS_SSL_DTLS_ANTI_REPLAY defined, but not all prerequisites"
2014-09-24 14:05:32 +02:00
# endif
2020-03-04 21:35:27 +01:00
# if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \
( ! defined ( MBEDTLS_SSL_TLS_C ) | | ! defined ( MBEDTLS_SSL_PROTO_DTLS ) )
# error "MBEDTLS_SSL_DTLS_CONNECTION_ID defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \
defined ( MBEDTLS_SSL_CID_IN_LEN_MAX ) & & \
MBEDTLS_SSL_CID_IN_LEN_MAX > 255
# error "MBEDTLS_SSL_CID_IN_LEN_MAX too large (max 255)"
# endif
# if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \
defined ( MBEDTLS_SSL_CID_OUT_LEN_MAX ) & & \
MBEDTLS_SSL_CID_OUT_LEN_MAX > 255
# error "MBEDTLS_SSL_CID_OUT_LEN_MAX too large (max 255)"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \
! defined ( MBEDTLS_SSL_PROTO_TLS1_2 )
2021-12-21 06:14:10 +01:00
# error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequisites"
2014-10-27 13:57:03 +01:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \
! defined ( MBEDTLS_SSL_PROTO_TLS1_2 )
2021-12-21 06:14:10 +01:00
# error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequisites"
2014-10-28 14:13:55 +01:00
# endif
2022-05-12 09:34:28 +02:00
# if defined(MBEDTLS_SSL_TICKET_C) && ( !defined(MBEDTLS_CIPHER_C) && \
! defined ( MBEDTLS_USE_PSA_CRYPTO ) )
# error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2022-07-20 05:04:50 +02:00
# if defined(MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH) && \
MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH > = 256
# error "MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH must be less than 256"
2022-07-20 04:36:12 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \
! defined ( MBEDTLS_X509_CRT_PARSE_C )
# error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_THREADING_PTHREAD)
# if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
# error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# define MBEDTLS_THREADING_IMPL
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_THREADING_ALT)
# if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
# error "MBEDTLS_THREADING_ALT defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# define MBEDTLS_THREADING_IMPL
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL)
# error "MBEDTLS_THREADING_C defined, single threading implementation required"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# undef MBEDTLS_THREADING_IMPL
2014-04-30 12:35:08 +02:00
2018-10-22 12:14:52 +02:00
# if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_PSA_CRYPTO_C)
# error "MBEDTLS_USE_PSA_CRYPTO defined, but not all prerequisites"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C)
# error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
2022-08-19 08:45:34 +02:00
! defined ( MBEDTLS_OID_C ) | | ! defined ( MBEDTLS_ASN1_PARSE_C ) | | \
! defined ( MBEDTLS_PK_PARSE_C ) | | \
2022-08-03 09:50:38 +02:00
( ! defined ( MBEDTLS_MD_C ) & & ! defined ( MBEDTLS_USE_PSA_CRYPTO ) ) )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_X509_USE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
! defined ( MBEDTLS_OID_C ) | | ! defined ( MBEDTLS_ASN1_WRITE_C ) | | \
2022-08-19 08:45:34 +02:00
! defined ( MBEDTLS_PK_PARSE_C ) | | \
2022-08-03 09:50:38 +02:00
( ! defined ( MBEDTLS_MD_C ) & & ! defined ( MBEDTLS_USE_PSA_CRYPTO ) ) )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
# error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
# error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
# error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
# error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
# error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2017-07-20 12:49:32 +02:00
# if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64)
# error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously"
# endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */
2017-07-20 13:11:19 +02:00
# if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \
defined ( MBEDTLS_HAVE_ASM )
2017-07-20 14:21:15 +02:00
# error "MBEDTLS_HAVE_INT32 / MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously"
2017-07-20 12:49:32 +02:00
# endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */
2017-12-21 09:15:08 +01:00
# if defined(MBEDTLS_SSL_DTLS_SRTP) && ( !defined(MBEDTLS_SSL_PROTO_DTLS) )
# error "MBEDTLS_SSL_DTLS_SRTP defined, but not all prerequisites"
# endif
2020-10-21 15:12:39 +02:00
# if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH) && ( !defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) )
# error "MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH defined, but not all prerequisites"
# endif
2022-10-03 08:55:29 +02:00
# if defined(MBEDTLS_SSL_SESSION_TICKETS) && \
! ( defined ( MBEDTLS_GCM_C ) | | defined ( MBEDTLS_CCM_C ) | | defined ( MBEDTLS_CHACHAPOLY_C ) | | defined ( MBEDTLS_NIST_KW_C ) )
# error "MBEDTLS_SSL_SESSION_TICKETS defined, but not all prerequisites"
# endif
2022-09-28 09:44:58 +02:00
# if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) && !( defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) )
2022-09-28 07:59:01 +02:00
# error "MBEDTLS_SSL_CONTEXT_SERIALIZATION defined, but not all prerequisites"
# endif
2021-04-21 18:45:41 +02:00
/* Reject attempts to enable options that have been removed and that could
* cause a build to succeed but with features removed . */
# if defined(MBEDTLS_HAVEGE_C) //no-check-names
2022-03-31 15:07:01 +02:00
# error "MBEDTLS_HAVEGE_C was removed in Mbed TLS 3.0. See https: //github.com/Mbed-TLS/mbedtls/issues/2599"
2021-04-21 18:45:41 +02:00
# endif
# if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) //no-check-names
2022-03-31 15:07:01 +02:00
# error "MBEDTLS_SSL_HW_RECORD_ACCEL was removed in Mbed TLS 3.0. See https: //github.com/Mbed-TLS/mbedtls/issues/4031"
2021-04-21 18:45:41 +02:00
# endif
# if defined(MBEDTLS_SSL_PROTO_SSL3) //no-check-names
2022-03-31 15:07:01 +02:00
# error "MBEDTLS_SSL_PROTO_SSL3 (SSL v3.0 support) was removed in Mbed TLS 3.0. See https: //github.com/Mbed-TLS/mbedtls/issues/4031"
2021-04-21 18:45:41 +02:00
# endif
# if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO) //no-check-names
2022-03-31 15:07:01 +02:00
# error "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO (SSL v2 ClientHello support) was removed in Mbed TLS 3.0. See https: //github.com/Mbed-TLS/mbedtls/issues/4031"
2021-04-21 18:45:41 +02:00
# endif
# if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) //no-check-names
2022-03-31 15:07:01 +02:00
# error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT (compatibility with the buggy implementation of truncated HMAC in Mbed TLS up to 2.7) was removed in Mbed TLS 3.0. See https: //github.com/Mbed-TLS/mbedtls/issues/4031"
2021-04-21 18:45:41 +02:00
# endif
# if defined(MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES) //no-check-names
2021-04-21 19:01:59 +02:00
# error "MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES was removed in Mbed TLS 3.0. See the ChangeLog entry if you really need SHA-1-signed certificates."
2021-04-21 18:45:41 +02:00
# endif
# if defined(MBEDTLS_ZLIB_SUPPORT) //no-check-names
2022-03-31 15:07:01 +02:00
# error "MBEDTLS_ZLIB_SUPPORT was removed in Mbed TLS 3.0. See https: //github.com/Mbed-TLS/mbedtls/issues/4031"
2021-04-21 18:45:41 +02:00
# endif
2021-05-14 15:08:04 +02:00
# if defined(MBEDTLS_CHECK_PARAMS) //no-check-names
2022-03-31 15:07:01 +02:00
# error "MBEDTLS_CHECK_PARAMS was removed in Mbed TLS 3.0. See https: //github.com/Mbed-TLS/mbedtls/issues/4313"
2021-05-14 15:08:04 +02:00
# endif
2021-05-31 12:58:25 +02:00
# if defined(MBEDTLS_SSL_CID_PADDING_GRANULARITY) //no-check-names
2022-03-31 15:07:01 +02:00
# error "MBEDTLS_SSL_CID_PADDING_GRANULARITY was removed in Mbed TLS 3.0. See https: //github.com/Mbed-TLS/mbedtls/issues/4335"
2021-05-31 12:58:25 +02:00
# endif
# if defined(MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY) //no-check-names
2022-03-31 15:07:01 +02:00
# error "MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY was removed in Mbed TLS 3.0. See https: //github.com/Mbed-TLS/mbedtls/issues/4335"
2021-05-31 12:58:25 +02:00
# endif
2021-06-15 13:54:14 +02:00
# if defined(MBEDTLS_SSL_TRUNCATED_HMAC) //no-check-names
2022-03-31 15:07:01 +02:00
# error "MBEDTLS_SSL_TRUNCATED_HMAC was removed in Mbed TLS 3.0. See https: //github.com/Mbed-TLS/mbedtls/issues/4341"
2021-06-15 13:54:14 +02:00
# endif
2015-05-29 10:52:14 +02:00
/*
* Avoid warning from - pedantic . This is a convenient place for this
* workaround since this is included by every single file before the
2019-01-23 15:24:37 +01:00
* # if defined ( MBEDTLS_xxx_C ) that results in empty translation units .
2015-05-29 10:52:14 +02:00
*/
typedef int mbedtls_iso_c_forbids_empty_translation_units ;
2015-04-08 12:49:31 +02:00
# endif /* MBEDTLS_CHECK_CONFIG_H */