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
*/
/*
2016-07-17 09:51:22 +02:00
* Copyright ( C ) 2006 - 2018 , ARM Limited , All Rights Reserved
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-09-04 14:21:07 +02:00
* This file is part of mbed TLS ( https : //tls.mbed.org)
2014-04-30 12:35:08 +02:00
*/
/*
* It is recommended to include this file from your config . h
* in order to catch dependency issues early .
*/
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
2015-06-26 10:52:01 +02:00
/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as
* it would confuse config . pl . */
# if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
! defined ( MBEDTLS_PLATFORM_SNPRINTF_MACRO )
# define MBEDTLS_PLATFORM_SNPRINTF_ALT
# endif
# endif /* _WIN32 */
2015-07-28 14:17:48 +02:00
# if defined(TARGET_LIKE_MBED) && \
( defined ( MBEDTLS_NET_C ) | | defined ( MBEDTLS_TIMING_C ) )
# error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS"
# 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
2019-10-16 09:17:48 +02:00
# if defined(MBEDTLS_CTR_DRBG_C) && defined(MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH) && !defined(MBEDTLS_CTR_DRBG_USE_128_BIT_KEY)
# error "MBEDTLS_CTR_DRBG_C and MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH defined, but MBEDTLS_CTR_DRBG_USE_128_BIT_KEY is not defined"
# 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
2017-11-20 17:36:41 +01:00
# if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) && !defined(MBEDTLS_SSL_TRUNCATED_HMAC)
# error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT defined, but not all prerequisites"
# endif
2016-09-13 23:00:15 +02:00
# if defined(MBEDTLS_CMAC_C) && \
2016-10-06 13:49:58 +02:00
! 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
2019-09-02 13:39:24 +02:00
# if defined(MBEDTLS_SSL_CONF_SINGLE_EC) && \
( ! defined ( MBEDTLS_SSL_CONF_SINGLE_EC_TLS_ID ) | | \
( defined ( MBEDTLS_USE_TINYCRYPT ) & & \
! defined ( MBEDTLS_SSL_CONF_SINGLE_UECC_GRP_ID ) ) | | \
( defined ( MBEDTLS_ECP_C ) & & \
! defined ( MBEDTLS_SSL_CONF_SINGLE_EC_GRP_ID ) ) )
2019-06-19 13:30:41 +02:00
# error "MBEDTLS_SSL_CONF_SINGLE_EC defined, but not all prerequesites"
# endif
2019-06-19 17:31:38 +02:00
# if defined(MBEDTLS_SSL_CONF_SINGLE_SIG_HASH) && \
( ! defined ( MBEDTLS_SSL_CONF_SINGLE_SIG_HASH_MD_ID ) | | \
! defined ( MBEDTLS_SSL_CONF_SINGLE_SIG_HASH_TLS_ID ) )
# error "MBEDTLS_SSL_CONF_SINGLE_SIG_HASH defined, but not all prerequesites"
# endif
2019-05-09 11:24:11 +02:00
# if defined(MBEDTLS_USE_TINYCRYPT) && defined(MBEDTLS_NO_64BIT_MULTIPLICATION)
# error "MBEDTLS_USE_TINYCRYPT defined, but it cannot be defined with MBEDTLS_NO_64BIT_MULTIPLICATION"
2019-04-29 09:29:06 +02:00
# endif
2019-11-21 13:37:00 +01:00
# if defined(MBEDTLS_USE_TINYCRYPT) && !defined(MBEDTLS_SHA256_C)
# error "MBEDTLS_USE_TINYCRYPT defined, but not MBEDTLS_SHA256_C"
# endif
2019-09-02 13:39:24 +02:00
# if defined(MBEDTLS_USE_TINYCRYPT) && \
! ( defined ( MBEDTLS_SSL_CONF_SINGLE_EC ) & & \
MBEDTLS_SSL_CONF_SINGLE_EC_TLS_ID = = 23 & & \
MBEDTLS_SSL_CONF_SINGLE_UECC_GRP_ID = = MBEDTLS_UECC_DP_SECP256R1 )
# error "MBEDTLS_USE_TINYCRYPT requires the use of MBEDTLS_SSL_CONF_SINGLE_UECC_GRP_ID to hardcode the choice of Secp256r1"
2019-07-24 12:40:53 +02:00
# endif
2019-09-02 12:47:20 +02:00
# if defined(MBEDTLS_USE_TINYCRYPT) && defined(MBEDTLS_ECP_C)
# error "MBEDTLS_USE_TINYCRYPT and MBEDTLS_ECP_C cannot be used simultaneously"
# endif
2019-07-24 10:43:44 +02:00
# if defined(MBEDTLS_USE_TINYCRYPT) && \
! defined ( MBEDTLS_SSL_CONF_RNG )
# error "MBEDTLS_USE_TINYCRYPT defined, but not all prerequesites"
# endif
2018-05-03 15:54:28 +02:00
# if defined(MBEDTLS_NIST_KW_C) && \
( ! defined ( MBEDTLS_AES_C ) | | ! defined ( MBEDTLS_CIPHER_C ) )
# error "MBEDTLS_NIST_KW_C defined, but not all prerequisites"
# 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 ) | | \
! 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) && \
( ! defined ( MBEDTLS_ECP_C ) | | ! defined ( MBEDTLS_MD_C ) )
# error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites"
# endif
2018-11-05 13:04:26 +01:00
# if defined(MBEDTLS_ECP_RESTARTABLE) && \
( defined ( MBEDTLS_ECDH_COMPUTE_SHARED_ALT ) | | \
defined ( MBEDTLS_ECDH_GEN_PUBLIC_ALT ) | | \
defined ( MBEDTLS_ECDSA_SIGN_ALT ) | | \
defined ( MBEDTLS_ECDSA_VERIFY_ALT ) | | \
defined ( MBEDTLS_ECDSA_GENKEY_ALT ) | | \
2018-12-07 13:13:54 +01:00
defined ( MBEDTLS_ECP_INTERNAL_ALT ) | | \
2018-11-05 13:04:26 +01:00
defined ( MBEDTLS_ECP_ALT ) )
# error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative ECP implementation"
# 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-09-02 14:47:00 +02:00
# if ( 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 ) | | \
defined ( MBEDTLS_ECP_DP_SECP256K1_ENABLED ) ) & & \
! defined ( MBEDTLS_ECP_C )
# error "At least one ECP curve enabled, but not all prerequesites"
# endif
2018-10-12 11:44:27 +02:00
# if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C)
# error "MBEDTLS_PK_PARSE_C defined, but not all prerequesites"
# 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
2016-06-11 03:31:21 +02:00
# if defined(MBEDTLS_TEST_NULL_ENTROPY) && \
( ! defined ( MBEDTLS_ENTROPY_C ) | | ! defined ( MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES ) )
# error "MBEDTLS_TEST_NULL_ENTROPY defined, but not all prerequisites"
# endif
# if defined(MBEDTLS_TEST_NULL_ENTROPY) && \
( defined ( MBEDTLS_ENTROPY_NV_SEED ) | | defined ( MBEDTLS_ENTROPY_HARDWARE_ALT ) | | \
defined ( MBEDTLS_HAVEGE_C ) )
# error "MBEDTLS_TEST_NULL_ENTROPY defined, but entropy sources too"
2016-06-08 16:29:18 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_GCM_C) && ( \
! defined ( MBEDTLS_AES_C ) & & ! defined ( MBEDTLS_CAMELLIA_C ) )
# error "MBEDTLS_GCM_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# 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
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C)
# error "MBEDTLS_HAVEGE_C defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2016-07-17 09:51:22 +02:00
# if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C)
# 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) && \
2019-09-02 14:05:27 +02:00
( ! ( defined ( MBEDTLS_ECDH_C ) | | defined ( MBEDTLS_USE_TINYCRYPT ) ) | | \
! 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
2019-09-02 14:05:27 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \
( ! ( defined ( MBEDTLS_ECDH_C ) | | defined ( MBEDTLS_USE_TINYCRYPT ) ) | | \
! 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) && \
2019-09-02 14:05:27 +02:00
! ( defined ( MBEDTLS_ECDH_C ) | | defined ( MBEDTLS_USE_TINYCRYPT ) )
2015-04-08 12:49:31 +02:00
# 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
2019-07-24 11:08:11 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
( ! ( defined ( MBEDTLS_ECDH_C ) | | defined ( MBEDTLS_USE_TINYCRYPT ) ) | | \
! defined ( MBEDTLS_RSA_C ) | | \
! defined ( MBEDTLS_X509_CRT_PARSE_C ) | | \
! defined ( MBEDTLS_PKCS1_V15 ) )
2015-04-08 12:49:31 +02:00
# error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2019-08-23 12:51:10 +02:00
# if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
( ! ( defined ( MBEDTLS_ECDH_C ) | | defined ( MBEDTLS_USE_TINYCRYPT ) ) | | \
! ( defined ( MBEDTLS_ECDSA_C ) | | defined ( MBEDTLS_USE_TINYCRYPT ) ) | | \
2015-04-08 12:49:31 +02:00
! 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) && \
( ! defined ( MBEDTLS_ECJPAKE_C ) | | ! defined ( MBEDTLS_SHA256_C ) | | \
! defined ( MBEDTLS_ECP_DP_SECP256R1_ENABLED ) )
# error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites"
# endif
2019-02-26 12:43:09 +01:00
# if defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) && \
! defined ( MBEDTLS_SSL_KEEP_PEER_CERTIFICATE ) & & \
( ! defined ( MBEDTLS_SHA256_C ) & & \
! defined ( MBEDTLS_SHA512_C ) & & \
! defined ( MBEDTLS_SHA1_C ) )
2019-06-18 13:41:15 +02:00
# error "MBEDTLS_SSL_KEEP_PEER_CERTIFICATE defined, but not all prerequesites"
2019-02-26 12:43:09 +01:00
# 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)
# error "MBEDTLS_MEMORY_BACKTRACE defined, but not all prerequesites"
# endif
2019-06-03 17:31:32 +02:00
# if defined(MBEDTLS_MEMORY_DEBUG) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
# error "MBEDTLS_MEMORY_DEBUG defined, but not all prerequesites"
# 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
2019-08-23 12:51:10 +02:00
# if defined(MBEDTLS_PK_C) && \
( ! defined ( MBEDTLS_RSA_C ) & & \
! defined ( MBEDTLS_ECP_C ) & & \
! defined ( MBEDTLS_USE_TINYCRYPT ) )
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_PKCS11_C) && !defined(MBEDTLS_PK_C)
# error "MBEDTLS_PKCS11_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
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-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
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
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) || \
! defined ( MBEDTLS_SHA1_C ) )
# error "MBEDTLS_SSL_PROTO_SSL3 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_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) || \
! defined ( MBEDTLS_SHA1_C ) )
# error "MBEDTLS_SSL_PROTO_TLS1 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_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) || \
! defined ( MBEDTLS_SHA1_C ) )
# error "MBEDTLS_SSL_PROTO_TLS1_1 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_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \
! defined ( MBEDTLS_SHA256_C ) & & ! defined ( MBEDTLS_SHA512_C ) )
# error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
2014-04-30 12:35:08 +02:00
# endif
2015-05-13 10:10:00 +02:00
# if defined(MBEDTLS_SSL_PROTO_DTLS) && \
! defined ( MBEDTLS_SSL_PROTO_TLS1_1 ) & & \
! 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) || \
! defined ( MBEDTLS_MD_C ) )
# 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
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \
! defined ( MBEDTLS_SSL_PROTO_TLS1 ) & & ! defined ( MBEDTLS_SSL_PROTO_TLS1_1 ) & & \
! defined ( MBEDTLS_SSL_PROTO_TLS1_2 ) )
2019-03-18 10:18:37 +01:00
# error "MBEDTLS_SSL_TLS_C defined, but no protocol version is active"
# endif
2019-06-18 10:32:25 +02:00
/* PROTO_TLS is not a documented option so far, but still check for conflicts
* involving it , in preparation for making it the documented option later */
# if defined(MBEDTLS_SSL_PROTO_TLS) && defined(MBEDTLS_SSL_PROTO_NO_TLS)
# error "MBEDTLS_SSL_PROTO_TLS and MBEDTLS_SSL_PROTO_NO_TLS both defined"
# endif
2019-03-18 10:18:37 +01:00
# if defined(MBEDTLS_SSL_TLS_C) && \
2019-06-17 15:21:07 +02:00
( defined ( MBEDTLS_SSL_PROTO_NO_TLS ) & & ! defined ( MBEDTLS_SSL_PROTO_DTLS ) )
2019-03-18 10:18:37 +01:00
# error "MBEDTLS_SSL_TLS_C defined, but neither TLS or DTLS is active"
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_SSL_PROTO_SSL3) && \
defined ( MBEDTLS_SSL_PROTO_TLS1_1 ) & & ! defined ( MBEDTLS_SSL_PROTO_TLS1 ) )
2014-04-30 12:35:08 +02:00
# error "Illegal protocol selection"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \
defined ( MBEDTLS_SSL_PROTO_TLS1_2 ) & & ! defined ( MBEDTLS_SSL_PROTO_TLS1_1 ) )
2014-04-30 12:35:08 +02:00
# error "Illegal protocol selection"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \
defined ( MBEDTLS_SSL_PROTO_TLS1_2 ) & & ( ! defined ( MBEDTLS_SSL_PROTO_TLS1 ) | | \
! defined ( MBEDTLS_SSL_PROTO_TLS1_1 ) ) )
2014-04-30 12:35:08 +02:00
# error "Illegal protocol selection"
# 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
2019-07-05 12:20:49 +02:00
# if defined(MBEDTLS_SSL_CONF_MIN_MINOR_VER) || \
defined ( MBEDTLS_SSL_CONF_MAX_MINOR_VER ) | | \
defined ( MBEDTLS_SSL_CONF_MIN_MAJOR_VER ) | | \
defined ( MBEDTLS_SSL_CONF_MAX_MAJOR_VER )
# if !( defined(MBEDTLS_SSL_CONF_MIN_MINOR_VER) && \
defined ( MBEDTLS_SSL_CONF_MAX_MINOR_VER ) & & \
defined ( MBEDTLS_SSL_CONF_MIN_MAJOR_VER ) & & \
defined ( MBEDTLS_SSL_CONF_MAX_MAJOR_VER ) )
# error "MBEDTLS_SSL_CONF_MIN_MINOR_VER, MBEDTLS_SSL_CONF_MAX_MINOR_VER, MBEDTLS_SSL_CONF_MIN_MAJOR_VER, MBEDTLS_SSL_CONF_MAX_MAJOR_VER must be defined simultaneously"
# endif
# endif
2019-05-15 15:03:01 +02:00
# if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \
2019-04-09 16:14:28 +02:00
( ! defined ( MBEDTLS_SSL_TLS_C ) | | ! defined ( MBEDTLS_SSL_PROTO_DTLS ) )
2019-05-15 15:03:01 +02:00
# error "MBEDTLS_SSL_DTLS_CONNECTION_ID defined, but not all prerequisites"
2019-04-09 16:14:28 +02:00
# endif
2019-05-15 15:03:01 +02:00
# if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \
2019-04-25 17:47:57 +02:00
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
2019-05-15 15:03:01 +02:00
# if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \
2019-04-25 17:47:57 +02:00
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
2019-06-13 10:23:43 +02:00
# if ( defined(MBEDTLS_SSL_CONF_CID_LEN) && \
! defined ( MBEDTLS_SSL_CONF_IGNORE_UNEXPECTED_CID ) ) | | \
( ! defined ( MBEDTLS_SSL_CONF_CID_LEN ) & & \
defined ( MBEDTLS_SSL_CONF_IGNORE_UNEXPECTED_CID ) )
# error "MBEDTLS_SSL_CONF_CID_LEN and MBEDTLS_SSL_CONF_IGNORE_UNEXPECTED_CID must be defined simultaneously"
# endif
2019-06-13 11:14:59 +02:00
# if ( defined(MBEDTLS_SSL_CONF_HS_TIMEOUT_MIN) && \
! defined ( MBEDTLS_SSL_CONF_HS_TIMEOUT_MAX ) ) | | \
( ! defined ( MBEDTLS_SSL_CONF_HS_TIMEOUT_MIN ) & & \
defined ( MBEDTLS_SSL_CONF_HS_TIMEOUT_MAX ) )
# error "MBEDTLS_SSL_CONF_HS_TIMEOUT_MIN and MBEDTLS_SSL_CONF_HS_TIMEOUT_MAX must be defined simultaneously"
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) && \
( ! defined ( MBEDTLS_SSL_TLS_C ) | | ! defined ( MBEDTLS_SSL_PROTO_DTLS ) )
# error "MBEDTLS_SSL_DTLS_BADMAC_LIMIT defined, but not all prerequisites"
2014-10-14 18:30:36 +02:00
# endif
2015-04-08 12:49:31 +02:00
# if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \
! defined ( MBEDTLS_SSL_PROTO_TLS1 ) & & \
! defined ( MBEDTLS_SSL_PROTO_TLS1_1 ) & & \
! defined ( MBEDTLS_SSL_PROTO_TLS1_2 )
# error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites"
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 ) & & \
! defined ( MBEDTLS_SSL_PROTO_TLS1_1 ) & & \
! defined ( MBEDTLS_SSL_PROTO_TLS1_2 )
# error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites"
2014-10-28 14:13:55 +01:00
# endif
2019-06-21 14:17:14 +02:00
# if ( defined(MBEDTLS_SSL_CONF_EXTENDED_MASTER_SECRET) && \
! defined ( MBEDTLS_SSL_CONF_ENFORCE_EXTENDED_MASTER_SECRET ) ) | | \
( ! defined ( MBEDTLS_SSL_CONF_EXTENDED_MASTER_SECRET ) & & \
defined ( MBEDTLS_SSL_CONF_ENFORCE_EXTENDED_MASTER_SECRET ) )
2019-07-01 16:57:20 +02:00
# error "MBEDTLS_SSL_CONF_EXTENDED_MASTER_SECRET and MBEDTLS_SSL_CONF_ENFORCE_EXTENDED_MASTER_SECRET must be defined together."
2019-06-21 14:17:14 +02:00
# endif
2019-06-13 17:11:15 +02:00
# if ( defined(MBEDTLS_SSL_CONF_SEND) && \
! ( defined ( MBEDTLS_SSL_CONF_RECV ) & & \
defined ( MBEDTLS_SSL_CONF_RECV_TIMEOUT ) ) ) | | \
( defined ( MBEDTLS_SSL_CONF_RECV ) & & \
! ( defined ( MBEDTLS_SSL_CONF_SEND ) & & \
defined ( MBEDTLS_SSL_CONF_RECV_TIMEOUT ) ) ) | | \
( defined ( MBEDTLS_SSL_CONF_RECV_TIMEOUT ) & & \
! ( defined ( MBEDTLS_SSL_CONF_SEND ) & & \
defined ( MBEDTLS_SSL_CONF_RECV ) ) )
2019-07-01 16:57:20 +02:00
# error "MBEDTLS_SSL_CONF_SEND / RECV / RECV_TIMEOUT must be defined simultaneously"
2019-06-13 17:11:15 +02:00
# endif
2019-06-13 17:45:36 +02:00
# if ( defined(MBEDTLS_SSL_CONF_GET_TIMER) && \
! defined ( MBEDTLS_SSL_CONF_SET_TIMER ) ) | | \
( ! defined ( MBEDTLS_SSL_CONF_GET_TIMER ) & & \
defined ( MBEDTLS_SSL_CONF_SET_TIMER ) )
2019-07-01 16:57:20 +02:00
# error "MBEDTLS_SSL_CONF_GET_TIMER and MBEDTLS_SSL_CONF_SET_TIMER must be defined together."
2019-06-13 17:45:36 +02:00
# endif
2015-05-25 19:34:49 +02:00
# if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C)
2015-05-20 09:55:50 +02:00
# error "MBEDTLS_SSL_TICKET_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_CBC_RECORD_SPLITTING) && \
! defined ( MBEDTLS_SSL_PROTO_SSL3 ) & & ! defined ( MBEDTLS_SSL_PROTO_TLS1 )
# error "MBEDTLS_SSL_CBC_RECORD_SPLITTING defined, but not all prerequisites"
2015-01-07 12:39:44 +01: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
2019-06-20 14:31:52 +02:00
# if defined(MBEDTLS_SSL_SESSION_TICKETS) && \
defined ( MBEDTLS_SSL_NO_SESSION_RESUMPTION )
# error "MBEDTLS_SSL_SESSION_TICKETS cannot be defined with MBEDTLS_SSL_NO_SESSION_RESUMPTION"
# endif
# if !defined(MBEDTLS_SSL_NO_SESSION_CACHE) && \
defined ( MBEDTLS_SSL_NO_SESSION_RESUMPTION )
2019-07-01 13:05:39 +02:00
# error "MBEDTLS_SSL_NO_SESSION_CACHE needs to be defined with MBEDTLS_SSL_NO_SESSION_RESUMPTION"
2019-06-18 12:49:02 +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
2019-09-06 12:59:11 +02:00
/* Ensure that precisely one hash is enabled. */
2019-09-03 14:55:19 +02:00
# if defined(MBEDTLS_MD_SINGLE_HASH)
# if defined(MBEDTLS_SHA256_C)
# define MBEDTLS_SHA256_ENABLED 1
# else
# define MBEDTLS_SHA256_ENABLED 0
# endif /* MBEDTLS_SHA256_C */
# if defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA256_NO_SHA224)
# define MBEDTLS_SHA224_ENABLED 1
# else
# define MBEDTLS_SHA224_ENABLED 0
# endif /* MBEDTLS_SHA256_C && !MBEDTLS_SHA256_NO_SHA224 */
# if defined(MBEDTLS_SHA512_C)
# define MBEDTLS_SHA512_ENABLED 2
# else
# define MBEDTLS_SHA512_ENABLED 0
# endif /* MBEDTLS_SHA512_C */
# if defined(MBEDTLS_SHA1_C)
# define MBEDTLS_SHA1_ENABLED 1
# else
# define MBEDTLS_SHA1_ENABLED 0
# endif /* MBEDTLS_SHA1_C */
# if defined(MBEDTLS_MD2_C)
# define MBEDTLS_MD2_ENABLED 1
# else
# define MBEDTLS_MD2_ENABLED 0
# endif /* MBEDTLS_MD2_C */
# if defined(MBEDTLS_MD4_C)
# define MBEDTLS_MD4_ENABLED 1
# else
# define MBEDTLS_MD4_ENABLED 0
# endif /* MBEDTLS_MD4_C */
# if defined(MBEDTLS_MD5_C)
# define MBEDTLS_MD5_ENABLED 1
# else
# define MBEDTLS_MD5_ENABLED 0
# endif /* MBEDTLS_MD5_C */
# if defined(MBEDTLS_RIPEMD160_C)
# define MBEDTLS_RIPEMD160_ENABLED 1
# else
# define MBEDTLS_RIPEMD160_ENABLED 0
# endif /* MBEDTLS_RIPEMD160_C */
# define MBEDTLS_HASHES_ENABLED \
( MBEDTLS_MD2_ENABLED + \
MBEDTLS_MD4_ENABLED + \
MBEDTLS_MD5_ENABLED + \
MBEDTLS_RIPEMD160_ENABLED + \
MBEDTLS_SHA1_ENABLED + \
MBEDTLS_SHA256_ENABLED + \
MBEDTLS_SHA512_ENABLED )
# if MBEDTLS_HASHES_ENABLED != 1
# error "MBEDTLS_MD_SINGLE_HASH must be used with precisely one hash algorithm enabled."
# endif
# undef MBEDTLS_HASHES_ENABLED
# endif /* MBEDTLS_MD_SINGLE_HASH */
2019-09-20 08:57:18 +02:00
/*
* Note : the dependency on TinyCrypt is reflected in several ways in the code :
*
* 1. We only define the various MBEDTLS_PK_INFO_ { TYPE } _ { FIELD } macros for
* TYPE = = ECKEY , resolving to the TinyCrypt version .
* 2. In pk_init ( ) and pk_free ( ) we assume that zeroization is a proper way
* to init / free the context , which is true of mbedtls_uecc_keypair , but
* might not always hold otherwise ( think hardware - accelerated ECP_ALT ) .
* 3. We rely on the fact that MBEDTLS_ECP_RESTARTABLE is disabled - code
* paths ( and pk_info fields ) that are guarded by this are currently not
* handled by the internal abstraction layers enabling PK_SINGLE_TYPE .
*
* If this dependency is ever removed , the above points need to be addressed
* in the code .
*/
2019-09-19 10:45:14 +02:00
# if defined(MBEDTLS_PK_SINGLE_TYPE) && !defined(MBEDTLS_USE_TINYCRYPT)
# error "MBEDTLS_PK_SINGLE_TYPE can only be used with MBEDTLS_USE_TINYCRYPT"
# endif
2019-09-20 08:57:18 +02:00
/* Note: code paths that depend on MBEDTLS_PK_RSA_ALT_SUPPORT are not ported
* to the internal abstraction layers that enable PK_SINGLE_TYPE . */
2019-09-19 10:45:14 +02:00
# if defined(MBEDTLS_PK_SINGLE_TYPE) && defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
# error "MBEDTLS_PK_SINGLE_TYPE is not compatible with MBEDTLS_PK_RSA_ALT_SUPPORT"
# endif
2019-09-20 08:57:18 +02:00
/* This is to avoid a situation where RSA is available, but not through the PK
* layer , which might surprise user code . */
2019-09-19 10:45:14 +02:00
# if defined(MBEDTLS_PK_SINGLE_TYPE) && defined(MBEDTLS_RSA_C)
# error "MBEDTLS_PK_SINGLE_TYPE is not compatible with MBEDTLS_RSA_C"
# 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
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
2019-08-23 16:24:34 +02:00
# if defined(MBEDTLS_X509_USE_C) && \
( ! defined ( MBEDTLS_OID_C ) | | \
! defined ( MBEDTLS_ASN1_PARSE_C ) | | \
! defined ( MBEDTLS_PK_PARSE_C ) )
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 ) | | \
! defined ( MBEDTLS_PK_WRITE_C ) )
# 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
2019-06-25 10:39:21 +02:00
# if defined(MBEDTLS_X509_CRT_REMOVE_TIME) && \
defined ( MBEDTLS_HAVE_TIME_DATE )
# error "MBEDTLS_X509_CRT_REMOVE_TIME and MBEDTLS_HAVE_TIME_DATE cannot be defined simultaneously"
# 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 */
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 */