Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 1 | /** |
| 2 | * \file check_config.h |
| 3 | * |
| 4 | * \brief Consistency checks for configuration options |
Darryl Green | a40a101 | 2018-01-05 15:33:17 +0000 | [diff] [blame] | 5 | */ |
| 6 | /* |
Thomas Fossati | 656864b | 2016-07-17 08:51:22 +0100 | [diff] [blame] | 7 | * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: Apache-2.0 |
| 9 | * |
| 10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 11 | * not use this file except in compliance with the License. |
| 12 | * You may obtain a copy of the License at |
| 13 | * |
| 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | * |
| 16 | * Unless required by applicable law or agreed to in writing, software |
| 17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 | * See the License for the specific language governing permissions and |
| 20 | * limitations under the License. |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 21 | * |
Manuel Pégourié-Gonnard | fe44643 | 2015-03-06 13:17:10 +0000 | [diff] [blame] | 22 | * This file is part of mbed TLS (https://tls.mbed.org) |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 23 | */ |
| 24 | |
| 25 | /* |
| 26 | * It is recommended to include this file from your config.h |
| 27 | * in order to catch dependency issues early. |
| 28 | */ |
| 29 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 30 | #ifndef MBEDTLS_CHECK_CONFIG_H |
| 31 | #define MBEDTLS_CHECK_CONFIG_H |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 32 | |
Manuel Pégourié-Gonnard | d14acbc | 2015-05-29 11:26:37 +0200 | [diff] [blame] | 33 | /* |
| 34 | * We assume CHAR_BIT is 8 in many places. In practice, this is true on our |
| 35 | * target platforms, so not an issue, but let's just be extra sure. |
| 36 | */ |
| 37 | #include <limits.h> |
| 38 | #if CHAR_BIT != 8 |
| 39 | #error "mbed TLS requires a platform with 8-bit chars" |
| 40 | #endif |
| 41 | |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 42 | #if defined(_WIN32) |
| 43 | #if !defined(MBEDTLS_PLATFORM_C) |
Manuel Pégourié-Gonnard | 6c0c8e0 | 2015-06-22 10:23:34 +0200 | [diff] [blame] | 44 | #error "MBEDTLS_PLATFORM_C is required on Windows" |
| 45 | #endif |
| 46 | |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 47 | /* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as |
| 48 | * it would confuse config.pl. */ |
| 49 | #if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ |
| 50 | !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) |
| 51 | #define MBEDTLS_PLATFORM_SNPRINTF_ALT |
| 52 | #endif |
| 53 | #endif /* _WIN32 */ |
| 54 | |
Manuel Pégourié-Gonnard | 63e7eba | 2015-07-28 14:17:48 +0200 | [diff] [blame] | 55 | #if defined(TARGET_LIKE_MBED) && \ |
| 56 | ( defined(MBEDTLS_NET_C) || defined(MBEDTLS_TIMING_C) ) |
| 57 | #error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS" |
| 58 | #endif |
| 59 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 60 | #if defined(MBEDTLS_DEPRECATED_WARNING) && \ |
Manuel Pégourié-Gonnard | 757ca00 | 2015-03-23 15:24:07 +0100 | [diff] [blame] | 61 | !defined(__GNUC__) && !defined(__clang__) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 62 | #error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang" |
Manuel Pégourié-Gonnard | c70581c | 2015-03-23 13:58:27 +0100 | [diff] [blame] | 63 | #endif |
| 64 | |
Manuel Pégourié-Gonnard | 60c793b | 2015-06-18 20:52:58 +0200 | [diff] [blame] | 65 | #if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME) |
| 66 | #error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" |
| 67 | #endif |
| 68 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 69 | #if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM) |
| 70 | #error "MBEDTLS_AESNI_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 71 | #endif |
| 72 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 73 | #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) |
| 74 | #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 75 | #endif |
| 76 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 77 | #if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C) |
| 78 | #error "MBEDTLS_DHM_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 79 | #endif |
| 80 | |
Hanno Becker | e89353a | 2017-11-20 16:36:41 +0000 | [diff] [blame] | 81 | #if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) && !defined(MBEDTLS_SSL_TRUNCATED_HMAC) |
| 82 | #error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT defined, but not all prerequisites" |
| 83 | #endif |
| 84 | |
Brian Murray | 53e23b6 | 2016-09-13 14:00:15 -0700 | [diff] [blame] | 85 | #if defined(MBEDTLS_CMAC_C) && \ |
Simon Butcher | 69283e5 | 2016-10-06 12:49:58 +0100 | [diff] [blame] | 86 | !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C) |
Brian Murray | 53e23b6 | 2016-09-13 14:00:15 -0700 | [diff] [blame] | 87 | #error "MBEDTLS_CMAC_C defined, but not all prerequisites" |
| 88 | #endif |
| 89 | |
Hanno Becker | 483fd66 | 2019-09-02 12:39:24 +0100 | [diff] [blame] | 90 | #if defined(MBEDTLS_SSL_CONF_SINGLE_EC) && \ |
| 91 | ( !defined(MBEDTLS_SSL_CONF_SINGLE_EC_TLS_ID) || \ |
| 92 | ( defined(MBEDTLS_USE_TINYCRYPT) && \ |
| 93 | !defined(MBEDTLS_SSL_CONF_SINGLE_UECC_GRP_ID) ) || \ |
| 94 | ( defined(MBEDTLS_ECP_C) && \ |
| 95 | !defined(MBEDTLS_SSL_CONF_SINGLE_EC_GRP_ID) ) ) |
Hanno Becker | c1096e7 | 2019-06-19 12:30:41 +0100 | [diff] [blame] | 96 | #error "MBEDTLS_SSL_CONF_SINGLE_EC defined, but not all prerequesites" |
| 97 | #endif |
| 98 | |
Hanno Becker | 56595f4 | 2019-06-19 16:31:38 +0100 | [diff] [blame] | 99 | #if defined(MBEDTLS_SSL_CONF_SINGLE_SIG_HASH) && \ |
| 100 | ( !defined(MBEDTLS_SSL_CONF_SINGLE_SIG_HASH_MD_ID) || \ |
| 101 | !defined(MBEDTLS_SSL_CONF_SINGLE_SIG_HASH_TLS_ID) ) |
| 102 | #error "MBEDTLS_SSL_CONF_SINGLE_SIG_HASH defined, but not all prerequesites" |
| 103 | #endif |
| 104 | |
Manuel Pégourié-Gonnard | afdc1b5 | 2019-05-09 11:24:11 +0200 | [diff] [blame] | 105 | #if defined(MBEDTLS_USE_TINYCRYPT) && defined(MBEDTLS_NO_64BIT_MULTIPLICATION) |
| 106 | #error "MBEDTLS_USE_TINYCRYPT defined, but it cannot be defined with MBEDTLS_NO_64BIT_MULTIPLICATION" |
Jarno Lamsa | 5b87128 | 2019-04-29 10:29:06 +0300 | [diff] [blame] | 107 | #endif |
| 108 | |
Hanno Becker | 483fd66 | 2019-09-02 12:39:24 +0100 | [diff] [blame] | 109 | #if defined(MBEDTLS_USE_TINYCRYPT) && \ |
| 110 | !( defined(MBEDTLS_SSL_CONF_SINGLE_EC) && \ |
| 111 | MBEDTLS_SSL_CONF_SINGLE_EC_TLS_ID == 23 && \ |
| 112 | MBEDTLS_SSL_CONF_SINGLE_UECC_GRP_ID == MBEDTLS_UECC_DP_SECP256R1 ) |
| 113 | #error "MBEDTLS_USE_TINYCRYPT requires the use of MBEDTLS_SSL_CONF_SINGLE_UECC_GRP_ID to hardcode the choice of Secp256r1" |
Hanno Becker | af9ff4a | 2019-07-24 11:40:53 +0100 | [diff] [blame] | 114 | #endif |
| 115 | |
Hanno Becker | 00a9b6d | 2019-07-24 09:43:44 +0100 | [diff] [blame] | 116 | #if defined(MBEDTLS_USE_TINYCRYPT) && \ |
| 117 | !defined(MBEDTLS_SSL_CONF_RNG) |
| 118 | #error "MBEDTLS_USE_TINYCRYPT defined, but not all prerequesites" |
| 119 | #endif |
| 120 | |
Ron Eldor | 466a57f | 2018-05-03 16:54:28 +0300 | [diff] [blame] | 121 | #if defined(MBEDTLS_NIST_KW_C) && \ |
| 122 | ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) ) |
| 123 | #error "MBEDTLS_NIST_KW_C defined, but not all prerequisites" |
| 124 | #endif |
| 125 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 126 | #if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C) |
| 127 | #error "MBEDTLS_ECDH_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 128 | #endif |
| 129 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 130 | #if defined(MBEDTLS_ECDSA_C) && \ |
| 131 | ( !defined(MBEDTLS_ECP_C) || \ |
| 132 | !defined(MBEDTLS_ASN1_PARSE_C) || \ |
| 133 | !defined(MBEDTLS_ASN1_WRITE_C) ) |
| 134 | #error "MBEDTLS_ECDSA_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 135 | #endif |
| 136 | |
Manuel Pégourié-Gonnard | 4d8685b | 2015-08-05 15:44:42 +0200 | [diff] [blame] | 137 | #if defined(MBEDTLS_ECJPAKE_C) && \ |
| 138 | ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) ) |
| 139 | #error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites" |
| 140 | #endif |
| 141 | |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 142 | #if defined(MBEDTLS_ECP_RESTARTABLE) && \ |
| 143 | ( defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ |
| 144 | defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \ |
| 145 | defined(MBEDTLS_ECDSA_SIGN_ALT) || \ |
| 146 | defined(MBEDTLS_ECDSA_VERIFY_ALT) || \ |
| 147 | defined(MBEDTLS_ECDSA_GENKEY_ALT) || \ |
Janos Follath | 172ba63 | 2018-12-07 12:13:54 +0000 | [diff] [blame] | 148 | defined(MBEDTLS_ECP_INTERNAL_ALT) || \ |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 149 | defined(MBEDTLS_ECP_ALT) ) |
| 150 | #error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative ECP implementation" |
| 151 | #endif |
| 152 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 153 | #if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C) |
| 154 | #error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 155 | #endif |
| 156 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 157 | #if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \ |
| 158 | !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \ |
| 159 | !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \ |
| 160 | !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \ |
| 161 | !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \ |
| 162 | !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \ |
| 163 | !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \ |
| 164 | !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \ |
| 165 | !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \ |
| 166 | !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \ |
| 167 | !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \ |
| 168 | !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) ) ) |
| 169 | #error "MBEDTLS_ECP_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 170 | #endif |
| 171 | |
Hanno Becker | cb9debd | 2018-10-12 10:44:27 +0100 | [diff] [blame] | 172 | #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C) |
| 173 | #error "MBEDTLS_PK_PARSE_C defined, but not all prerequesites" |
| 174 | #endif |
| 175 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 176 | #if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \ |
| 177 | !defined(MBEDTLS_SHA256_C)) |
| 178 | #error "MBEDTLS_ENTROPY_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 179 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 180 | #if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \ |
| 181 | defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64) |
| 182 | #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 183 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 184 | #if defined(MBEDTLS_ENTROPY_C) && \ |
| 185 | ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \ |
| 186 | && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32) |
| 187 | #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 188 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 189 | #if defined(MBEDTLS_ENTROPY_C) && \ |
| 190 | defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C) |
| 191 | #error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 192 | #endif |
| 193 | |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 194 | #if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ |
| 195 | ( !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) ) |
| 196 | #error "MBEDTLS_TEST_NULL_ENTROPY defined, but not all prerequisites" |
Janos Follath | 53de784 | 2016-06-08 15:29:18 +0100 | [diff] [blame] | 197 | #endif |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 198 | #if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ |
| 199 | ( defined(MBEDTLS_ENTROPY_NV_SEED) || defined(MBEDTLS_ENTROPY_HARDWARE_ALT) || \ |
| 200 | defined(MBEDTLS_HAVEGE_C) ) |
| 201 | #error "MBEDTLS_TEST_NULL_ENTROPY defined, but entropy sources too" |
Janos Follath | 53de784 | 2016-06-08 15:29:18 +0100 | [diff] [blame] | 202 | #endif |
| 203 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 204 | #if defined(MBEDTLS_GCM_C) && ( \ |
| 205 | !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) ) |
| 206 | #error "MBEDTLS_GCM_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 207 | #endif |
| 208 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 209 | #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 210 | #error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites" |
| 211 | #endif |
| 212 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 213 | #if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 214 | #error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites" |
| 215 | #endif |
| 216 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 217 | #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 218 | #error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites" |
| 219 | #endif |
| 220 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 221 | #if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 222 | #error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites" |
| 223 | #endif |
| 224 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 225 | #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 226 | #error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites" |
| 227 | #endif |
| 228 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 229 | #if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 230 | #error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites" |
| 231 | #endif |
| 232 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 233 | #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 234 | #error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites" |
| 235 | #endif |
| 236 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 237 | #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 238 | #error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites" |
| 239 | #endif |
| 240 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 241 | #if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C) |
| 242 | #error "MBEDTLS_HAVEGE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 243 | #endif |
| 244 | |
Thomas Fossati | 656864b | 2016-07-17 08:51:22 +0100 | [diff] [blame] | 245 | #if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C) |
| 246 | #error "MBEDTLS_HKDF_C defined, but not all prerequisites" |
| 247 | #endif |
| 248 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 249 | #if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C) |
| 250 | #error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 251 | #endif |
| 252 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 253 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ |
| 254 | ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) ) |
| 255 | #error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 256 | #endif |
| 257 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 258 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ |
| 259 | ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) ) |
| 260 | #error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 261 | #endif |
| 262 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 263 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C) |
| 264 | #error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 265 | #endif |
| 266 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 267 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ |
| 268 | !defined(MBEDTLS_ECDH_C) |
| 269 | #error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 270 | #endif |
| 271 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 272 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ |
| 273 | ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \ |
| 274 | !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) |
| 275 | #error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 276 | #endif |
| 277 | |
Hanno Becker | 49dc8ed | 2019-07-24 10:08:11 +0100 | [diff] [blame] | 278 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ |
| 279 | ( !( defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_USE_TINYCRYPT) ) || \ |
| 280 | !defined(MBEDTLS_RSA_C) || \ |
| 281 | !defined(MBEDTLS_X509_CRT_PARSE_C) || \ |
| 282 | !defined(MBEDTLS_PKCS1_V15) ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 283 | #error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 284 | #endif |
| 285 | |
Hanno Becker | 49dc8ed | 2019-07-24 10:08:11 +0100 | [diff] [blame] | 286 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ |
| 287 | ( !( defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_USE_TINYCRYPT) ) || \ |
| 288 | !defined(MBEDTLS_ECDSA_C) || \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 289 | !defined(MBEDTLS_X509_CRT_PARSE_C) ) |
| 290 | #error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 291 | #endif |
| 292 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 293 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ |
| 294 | ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ |
| 295 | !defined(MBEDTLS_PKCS1_V15) ) |
| 296 | #error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 297 | #endif |
| 298 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 299 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \ |
| 300 | ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ |
| 301 | !defined(MBEDTLS_PKCS1_V15) ) |
| 302 | #error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 303 | #endif |
| 304 | |
Manuel Pégourié-Gonnard | 557535d | 2015-09-15 17:53:32 +0200 | [diff] [blame] | 305 | #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ |
| 306 | ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) || \ |
| 307 | !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) ) |
| 308 | #error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites" |
| 309 | #endif |
| 310 | |
Hanno Becker | 2984bd2 | 2019-02-26 11:43:09 +0000 | [diff] [blame] | 311 | #if defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) && \ |
| 312 | !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) && \ |
| 313 | ( !defined(MBEDTLS_SHA256_C) && \ |
| 314 | !defined(MBEDTLS_SHA512_C) && \ |
| 315 | !defined(MBEDTLS_SHA1_C) ) |
Hanno Becker | d972f00 | 2019-06-18 12:41:15 +0100 | [diff] [blame] | 316 | #error "MBEDTLS_SSL_KEEP_PEER_CERTIFICATE defined, but not all prerequesites" |
Hanno Becker | 2984bd2 | 2019-02-26 11:43:09 +0000 | [diff] [blame] | 317 | #endif |
| 318 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 319 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ |
| 320 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
| 321 | #error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 322 | #endif |
| 323 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 324 | #if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM) |
| 325 | #error "MBEDTLS_PADLOCK_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 326 | #endif |
| 327 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 328 | #if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C) |
| 329 | #error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 330 | #endif |
| 331 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 332 | #if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C) |
| 333 | #error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 334 | #endif |
| 335 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 336 | #if defined(MBEDTLS_PK_C) && \ |
| 337 | ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) ) |
| 338 | #error "MBEDTLS_PK_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 94de331 | 2015-01-28 16:32:36 +0000 | [diff] [blame] | 339 | #endif |
| 340 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 341 | #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C) |
| 342 | #error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 343 | #endif |
| 344 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 345 | #if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C) |
| 346 | #error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 347 | #endif |
| 348 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 349 | #if defined(MBEDTLS_PKCS11_C) && !defined(MBEDTLS_PK_C) |
| 350 | #error "MBEDTLS_PKCS11_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 351 | #endif |
| 352 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 353 | #if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 354 | #error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 355 | #endif |
| 356 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 357 | #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 358 | #error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 359 | #endif |
| 360 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 361 | #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\ |
| 362 | ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\ |
| 363 | defined(MBEDTLS_PLATFORM_EXIT_ALT) ) |
| 364 | #error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 365 | #endif |
| 366 | |
Andres Amaya Garcia | 1e4ec66 | 2016-07-20 10:16:25 +0100 | [diff] [blame] | 367 | #if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\ |
| 368 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 369 | !defined(MBEDTLS_HAVE_TIME) ) |
| 370 | #error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites" |
| 371 | #endif |
| 372 | |
| 373 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ |
| 374 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 375 | !defined(MBEDTLS_HAVE_TIME) ) |
| 376 | #error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites" |
| 377 | #endif |
| 378 | |
| 379 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ |
| 380 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 381 | !defined(MBEDTLS_HAVE_TIME) ) |
| 382 | #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites" |
| 383 | #endif |
| 384 | |
| 385 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ |
| 386 | ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ |
| 387 | defined(MBEDTLS_PLATFORM_TIME_ALT) ) |
| 388 | #error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" |
| 389 | #endif |
| 390 | |
| 391 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ |
| 392 | ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ |
| 393 | defined(MBEDTLS_PLATFORM_TIME_ALT) ) |
| 394 | #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" |
| 395 | #endif |
| 396 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 397 | #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 398 | #error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 399 | #endif |
| 400 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 401 | #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 402 | #error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 403 | #endif |
| 404 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 405 | #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\ |
| 406 | ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\ |
| 407 | defined(MBEDTLS_PLATFORM_FPRINTF_ALT) ) |
| 408 | #error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 409 | #endif |
| 410 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 411 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ |
| 412 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
| 413 | #error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 414 | #endif |
| 415 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 416 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ |
| 417 | defined(MBEDTLS_PLATFORM_STD_FREE) |
| 418 | #error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 419 | #endif |
| 420 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 421 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) |
| 422 | #error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is" |
Rich Evans | 16f8cd8 | 2015-02-06 16:14:34 +0000 | [diff] [blame] | 423 | #endif |
| 424 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 425 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 426 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 427 | #error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 428 | #endif |
| 429 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 430 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ |
| 431 | defined(MBEDTLS_PLATFORM_STD_CALLOC) |
| 432 | #error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 433 | #endif |
| 434 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 435 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) |
| 436 | #error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is" |
Rich Evans | 16f8cd8 | 2015-02-06 16:14:34 +0000 | [diff] [blame] | 437 | #endif |
| 438 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 439 | #if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) |
| 440 | #error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 441 | #endif |
| 442 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 443 | #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 444 | #error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 445 | #endif |
| 446 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 447 | #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 448 | #error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 449 | #endif |
| 450 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 451 | #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\ |
| 452 | ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\ |
| 453 | defined(MBEDTLS_PLATFORM_PRINTF_ALT) ) |
| 454 | #error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 455 | #endif |
| 456 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 457 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 458 | #error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 459 | #endif |
| 460 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 461 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 462 | #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 463 | #endif |
| 464 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 465 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\ |
| 466 | ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\ |
| 467 | defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) ) |
| 468 | #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 469 | #endif |
| 470 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 471 | #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\ |
| 472 | !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) |
| 473 | #error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 474 | #endif |
| 475 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 476 | #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) |
| 477 | #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 478 | #endif |
| 479 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 480 | #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) |
| 481 | #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 482 | #endif |
| 483 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 484 | #if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) |
| 485 | #error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 486 | #endif |
| 487 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 488 | #if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\ |
| 489 | !defined(MBEDTLS_PLATFORM_EXIT_ALT) |
| 490 | #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 491 | #endif |
| 492 | |
Andres Amaya Garcia | 1e4ec66 | 2016-07-20 10:16:25 +0100 | [diff] [blame] | 493 | #if defined(MBEDTLS_PLATFORM_STD_TIME) &&\ |
| 494 | ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\ |
| 495 | !defined(MBEDTLS_HAVE_TIME) ) |
| 496 | #error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites" |
| 497 | #endif |
| 498 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 499 | #if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\ |
| 500 | !defined(MBEDTLS_PLATFORM_FPRINTF_ALT) |
| 501 | #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 502 | #endif |
| 503 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 504 | #if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\ |
| 505 | !defined(MBEDTLS_PLATFORM_PRINTF_ALT) |
| 506 | #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 507 | #endif |
| 508 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 509 | #if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\ |
| 510 | !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) |
| 511 | #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 512 | #endif |
| 513 | |
Paul Bakker | cf0a9f9 | 2016-06-01 11:25:44 +0100 | [diff] [blame] | 514 | #if defined(MBEDTLS_ENTROPY_NV_SEED) &&\ |
| 515 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) ) |
| 516 | #error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites" |
| 517 | #endif |
| 518 | |
| 519 | #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\ |
| 520 | !defined(MBEDTLS_ENTROPY_NV_SEED) |
| 521 | #error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites" |
| 522 | #endif |
| 523 | |
| 524 | #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\ |
| 525 | !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) |
| 526 | #error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites" |
| 527 | #endif |
| 528 | |
| 529 | #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\ |
| 530 | !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) |
| 531 | #error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites" |
| 532 | #endif |
| 533 | |
| 534 | #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\ |
| 535 | ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\ |
| 536 | defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) |
| 537 | #error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously" |
| 538 | #endif |
| 539 | |
| 540 | #if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\ |
| 541 | ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\ |
| 542 | defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) |
| 543 | #error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously" |
| 544 | #endif |
| 545 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 546 | #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ |
| 547 | !defined(MBEDTLS_OID_C) ) |
| 548 | #error "MBEDTLS_RSA_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 549 | #endif |
| 550 | |
Paul Bakker | 4fde40f | 2016-05-09 15:13:04 +0100 | [diff] [blame] | 551 | #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \ |
Paul Bakker | 37068a7 | 2016-05-09 14:36:33 +0100 | [diff] [blame] | 552 | !defined(MBEDTLS_PKCS1_V15) ) |
| 553 | #error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled" |
| 554 | #endif |
| 555 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 556 | #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \ |
| 557 | ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) ) |
| 558 | #error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 9df5c96 | 2014-01-24 14:37:29 +0100 | [diff] [blame] | 559 | #endif |
| 560 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 561 | #if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) || \ |
| 562 | !defined(MBEDTLS_SHA1_C) ) |
| 563 | #error "MBEDTLS_SSL_PROTO_SSL3 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 564 | #endif |
| 565 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 566 | #if defined(MBEDTLS_SSL_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) || \ |
| 567 | !defined(MBEDTLS_SHA1_C) ) |
| 568 | #error "MBEDTLS_SSL_PROTO_TLS1 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 569 | #endif |
| 570 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 571 | #if defined(MBEDTLS_SSL_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) || \ |
| 572 | !defined(MBEDTLS_SHA1_C) ) |
| 573 | #error "MBEDTLS_SSL_PROTO_TLS1_1 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 574 | #endif |
| 575 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 576 | #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \ |
| 577 | !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) ) |
| 578 | #error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 579 | #endif |
| 580 | |
Manuel Pégourié-Gonnard | 5a8d56d | 2015-05-13 10:10:00 +0200 | [diff] [blame] | 581 | #if defined(MBEDTLS_SSL_PROTO_DTLS) && \ |
| 582 | !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 583 | !defined(MBEDTLS_SSL_PROTO_TLS1_2) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 584 | #error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 0b1ff29 | 2014-02-06 13:04:16 +0100 | [diff] [blame] | 585 | #endif |
| 586 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 587 | #if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C) |
| 588 | #error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 589 | #endif |
| 590 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 591 | #if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \ |
| 592 | !defined(MBEDTLS_MD_C) ) |
| 593 | #error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 594 | #endif |
| 595 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 596 | #if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C) |
| 597 | #error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 598 | #endif |
| 599 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 600 | #if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \ |
| 601 | !defined(MBEDTLS_SSL_PROTO_TLS1) && !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 602 | !defined(MBEDTLS_SSL_PROTO_TLS1_2)) |
Manuel Pégourié-Gonnard | a771160 | 2019-03-18 10:18:37 +0100 | [diff] [blame] | 603 | #error "MBEDTLS_SSL_TLS_C defined, but no protocol version is active" |
| 604 | #endif |
| 605 | |
Manuel Pégourié-Gonnard | c84511f | 2019-06-18 10:32:25 +0200 | [diff] [blame] | 606 | /* PROTO_TLS is not a documented option so far, but still check for conflicts |
| 607 | * involving it, in preparation for making it the documented option later */ |
| 608 | #if defined(MBEDTLS_SSL_PROTO_TLS) && defined(MBEDTLS_SSL_PROTO_NO_TLS) |
| 609 | #error "MBEDTLS_SSL_PROTO_TLS and MBEDTLS_SSL_PROTO_NO_TLS both defined" |
| 610 | #endif |
| 611 | |
Manuel Pégourié-Gonnard | a771160 | 2019-03-18 10:18:37 +0100 | [diff] [blame] | 612 | #if defined(MBEDTLS_SSL_TLS_C) && \ |
Manuel Pégourié-Gonnard | ba8b1eb | 2019-06-17 15:21:07 +0200 | [diff] [blame] | 613 | ( defined(MBEDTLS_SSL_PROTO_NO_TLS) && !defined(MBEDTLS_SSL_PROTO_DTLS) ) |
Manuel Pégourié-Gonnard | a771160 | 2019-03-18 10:18:37 +0100 | [diff] [blame] | 614 | #error "MBEDTLS_SSL_TLS_C defined, but neither TLS or DTLS is active" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 615 | #endif |
| 616 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 617 | #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ |
| 618 | defined(MBEDTLS_SSL_PROTO_TLS1_1) && !defined(MBEDTLS_SSL_PROTO_TLS1)) |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 619 | #error "Illegal protocol selection" |
| 620 | #endif |
| 621 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 622 | #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \ |
| 623 | defined(MBEDTLS_SSL_PROTO_TLS1_2) && !defined(MBEDTLS_SSL_PROTO_TLS1_1)) |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 624 | #error "Illegal protocol selection" |
| 625 | #endif |
| 626 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 627 | #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ |
| 628 | defined(MBEDTLS_SSL_PROTO_TLS1_2) && (!defined(MBEDTLS_SSL_PROTO_TLS1) || \ |
| 629 | !defined(MBEDTLS_SSL_PROTO_TLS1_1))) |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 630 | #error "Illegal protocol selection" |
| 631 | #endif |
| 632 | |
Manuel Pégourié-Gonnard | e057d3b | 2015-05-20 10:59:43 +0200 | [diff] [blame] | 633 | #if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 634 | #error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 82202f0 | 2014-07-23 00:28:58 +0200 | [diff] [blame] | 635 | #endif |
| 636 | |
Manuel Pégourié-Gonnard | 62c74bb | 2015-09-08 17:50:29 +0200 | [diff] [blame] | 637 | #if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \ |
Manuel Pégourié-Gonnard | ddfe5d2 | 2015-09-09 12:46:16 +0200 | [diff] [blame] | 638 | !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) |
Manuel Pégourié-Gonnard | 62c74bb | 2015-09-08 17:50:29 +0200 | [diff] [blame] | 639 | #error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites" |
| 640 | #endif |
| 641 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 642 | #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \ |
| 643 | ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) |
| 644 | #error "MBEDTLS_SSL_DTLS_ANTI_REPLAY defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 8464a46 | 2014-09-24 14:05:32 +0200 | [diff] [blame] | 645 | #endif |
| 646 | |
Hanno Becker | cb8774b | 2019-07-05 11:20:49 +0100 | [diff] [blame] | 647 | #if defined(MBEDTLS_SSL_CONF_MIN_MINOR_VER) || \ |
| 648 | defined(MBEDTLS_SSL_CONF_MAX_MINOR_VER) || \ |
| 649 | defined(MBEDTLS_SSL_CONF_MIN_MAJOR_VER) || \ |
| 650 | defined(MBEDTLS_SSL_CONF_MAX_MAJOR_VER) |
| 651 | #if !( defined(MBEDTLS_SSL_CONF_MIN_MINOR_VER) && \ |
| 652 | defined(MBEDTLS_SSL_CONF_MAX_MINOR_VER) && \ |
| 653 | defined(MBEDTLS_SSL_CONF_MIN_MAJOR_VER) && \ |
| 654 | defined(MBEDTLS_SSL_CONF_MAX_MAJOR_VER) ) |
| 655 | #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" |
| 656 | #endif |
| 657 | #endif |
| 658 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 659 | #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ |
Hanno Becker | 29a54c8 | 2019-04-09 15:14:28 +0100 | [diff] [blame] | 660 | ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 661 | #error "MBEDTLS_SSL_DTLS_CONNECTION_ID defined, but not all prerequisites" |
Hanno Becker | 29a54c8 | 2019-04-09 15:14:28 +0100 | [diff] [blame] | 662 | #endif |
| 663 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 664 | #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ |
Hanno Becker | 4662971 | 2019-04-25 16:47:57 +0100 | [diff] [blame] | 665 | defined(MBEDTLS_SSL_CID_IN_LEN_MAX) && \ |
| 666 | MBEDTLS_SSL_CID_IN_LEN_MAX > 255 |
| 667 | #error "MBEDTLS_SSL_CID_IN_LEN_MAX too large (max 255)" |
| 668 | #endif |
| 669 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 670 | #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ |
Hanno Becker | 4662971 | 2019-04-25 16:47:57 +0100 | [diff] [blame] | 671 | defined(MBEDTLS_SSL_CID_OUT_LEN_MAX) && \ |
| 672 | MBEDTLS_SSL_CID_OUT_LEN_MAX > 255 |
| 673 | #error "MBEDTLS_SSL_CID_OUT_LEN_MAX too large (max 255)" |
| 674 | #endif |
| 675 | |
Hanno Becker | e0200da | 2019-06-13 09:23:43 +0100 | [diff] [blame] | 676 | #if ( defined(MBEDTLS_SSL_CONF_CID_LEN) && \ |
| 677 | !defined(MBEDTLS_SSL_CONF_IGNORE_UNEXPECTED_CID) ) || \ |
| 678 | ( !defined(MBEDTLS_SSL_CONF_CID_LEN) && \ |
| 679 | defined(MBEDTLS_SSL_CONF_IGNORE_UNEXPECTED_CID) ) |
| 680 | #error "MBEDTLS_SSL_CONF_CID_LEN and MBEDTLS_SSL_CONF_IGNORE_UNEXPECTED_CID must be defined simultaneously" |
| 681 | #endif |
| 682 | |
Hanno Becker | 1f835fa | 2019-06-13 10:14:59 +0100 | [diff] [blame] | 683 | #if ( defined(MBEDTLS_SSL_CONF_HS_TIMEOUT_MIN) && \ |
| 684 | !defined(MBEDTLS_SSL_CONF_HS_TIMEOUT_MAX) ) || \ |
| 685 | ( !defined(MBEDTLS_SSL_CONF_HS_TIMEOUT_MIN) && \ |
| 686 | defined(MBEDTLS_SSL_CONF_HS_TIMEOUT_MAX) ) |
| 687 | #error "MBEDTLS_SSL_CONF_HS_TIMEOUT_MIN and MBEDTLS_SSL_CONF_HS_TIMEOUT_MAX must be defined simultaneously" |
| 688 | #endif |
| 689 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 690 | #if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) && \ |
| 691 | ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) |
| 692 | #error "MBEDTLS_SSL_DTLS_BADMAC_LIMIT defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | b0643d1 | 2014-10-14 18:30:36 +0200 | [diff] [blame] | 693 | #endif |
| 694 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 695 | #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \ |
| 696 | !defined(MBEDTLS_SSL_PROTO_TLS1) && \ |
| 697 | !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 698 | !defined(MBEDTLS_SSL_PROTO_TLS1_2) |
| 699 | #error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites" |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 700 | #endif |
| 701 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 702 | #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \ |
| 703 | !defined(MBEDTLS_SSL_PROTO_TLS1) && \ |
| 704 | !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 705 | !defined(MBEDTLS_SSL_PROTO_TLS1_2) |
| 706 | #error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites" |
Manuel Pégourié-Gonnard | 769c6b6 | 2014-10-28 14:13:55 +0100 | [diff] [blame] | 707 | #endif |
| 708 | |
Hanno Becker | f765ce6 | 2019-06-21 13:17:14 +0100 | [diff] [blame] | 709 | #if ( defined(MBEDTLS_SSL_CONF_EXTENDED_MASTER_SECRET) && \ |
| 710 | !defined(MBEDTLS_SSL_CONF_ENFORCE_EXTENDED_MASTER_SECRET) ) || \ |
| 711 | ( !defined(MBEDTLS_SSL_CONF_EXTENDED_MASTER_SECRET) && \ |
| 712 | defined(MBEDTLS_SSL_CONF_ENFORCE_EXTENDED_MASTER_SECRET) ) |
Hanno Becker | 62327ab | 2019-07-01 15:57:20 +0100 | [diff] [blame] | 713 | #error "MBEDTLS_SSL_CONF_EXTENDED_MASTER_SECRET and MBEDTLS_SSL_CONF_ENFORCE_EXTENDED_MASTER_SECRET must be defined together." |
Hanno Becker | f765ce6 | 2019-06-21 13:17:14 +0100 | [diff] [blame] | 714 | #endif |
| 715 | |
Hanno Becker | a58a896 | 2019-06-13 16:11:15 +0100 | [diff] [blame] | 716 | #if ( defined(MBEDTLS_SSL_CONF_SEND) && \ |
| 717 | !( defined(MBEDTLS_SSL_CONF_RECV) && \ |
| 718 | defined(MBEDTLS_SSL_CONF_RECV_TIMEOUT) ) ) || \ |
| 719 | ( defined(MBEDTLS_SSL_CONF_RECV) && \ |
| 720 | !( defined(MBEDTLS_SSL_CONF_SEND) && \ |
| 721 | defined(MBEDTLS_SSL_CONF_RECV_TIMEOUT) ) ) || \ |
| 722 | ( defined(MBEDTLS_SSL_CONF_RECV_TIMEOUT) && \ |
| 723 | !( defined(MBEDTLS_SSL_CONF_SEND) && \ |
| 724 | defined(MBEDTLS_SSL_CONF_RECV) ) ) |
Hanno Becker | 62327ab | 2019-07-01 15:57:20 +0100 | [diff] [blame] | 725 | #error "MBEDTLS_SSL_CONF_SEND/RECV/RECV_TIMEOUT must be defined simultaneously" |
Hanno Becker | a58a896 | 2019-06-13 16:11:15 +0100 | [diff] [blame] | 726 | #endif |
| 727 | |
Hanno Becker | 0ae6b24 | 2019-06-13 16:45:36 +0100 | [diff] [blame] | 728 | #if ( defined(MBEDTLS_SSL_CONF_GET_TIMER) && \ |
| 729 | !defined(MBEDTLS_SSL_CONF_SET_TIMER) ) || \ |
| 730 | ( !defined(MBEDTLS_SSL_CONF_GET_TIMER) && \ |
| 731 | defined(MBEDTLS_SSL_CONF_SET_TIMER) ) |
Hanno Becker | 62327ab | 2019-07-01 15:57:20 +0100 | [diff] [blame] | 732 | #error "MBEDTLS_SSL_CONF_GET_TIMER and MBEDTLS_SSL_CONF_SET_TIMER must be defined together." |
Hanno Becker | 0ae6b24 | 2019-06-13 16:45:36 +0100 | [diff] [blame] | 733 | #endif |
| 734 | |
Manuel Pégourié-Gonnard | 4214e3a | 2015-05-25 19:34:49 +0200 | [diff] [blame] | 735 | #if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C) |
Manuel Pégourié-Gonnard | 0c0f11f | 2015-05-20 09:55:50 +0200 | [diff] [blame] | 736 | #error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 737 | #endif |
| 738 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 739 | #if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) && \ |
| 740 | !defined(MBEDTLS_SSL_PROTO_SSL3) && !defined(MBEDTLS_SSL_PROTO_TLS1) |
| 741 | #error "MBEDTLS_SSL_CBC_RECORD_SPLITTING defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | d76314c | 2015-01-07 12:39:44 +0100 | [diff] [blame] | 742 | #endif |
| 743 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 744 | #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \ |
| 745 | !defined(MBEDTLS_X509_CRT_PARSE_C) |
| 746 | #error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 747 | #endif |
| 748 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 749 | #if defined(MBEDTLS_SSL_SESSION_TICKETS) && \ |
| 750 | defined(MBEDTLS_SSL_NO_SESSION_RESUMPTION) |
| 751 | #error "MBEDTLS_SSL_SESSION_TICKETS cannot be defined with MBEDTLS_SSL_NO_SESSION_RESUMPTION" |
| 752 | #endif |
| 753 | |
| 754 | #if !defined(MBEDTLS_SSL_NO_SESSION_CACHE) && \ |
| 755 | defined(MBEDTLS_SSL_NO_SESSION_RESUMPTION) |
Manuel Pégourié-Gonnard | c27fabf | 2019-07-01 13:05:39 +0200 | [diff] [blame] | 756 | #error "MBEDTLS_SSL_NO_SESSION_CACHE needs to be defined with MBEDTLS_SSL_NO_SESSION_RESUMPTION" |
Jarno Lamsa | 59bd12b | 2019-06-18 13:49:02 +0300 | [diff] [blame] | 757 | #endif |
| 758 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 759 | #if defined(MBEDTLS_THREADING_PTHREAD) |
| 760 | #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) |
| 761 | #error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 762 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 763 | #define MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 764 | #endif |
| 765 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 766 | #if defined(MBEDTLS_THREADING_ALT) |
| 767 | #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) |
| 768 | #error "MBEDTLS_THREADING_ALT defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 769 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 770 | #define MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 771 | #endif |
| 772 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 773 | #if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL) |
| 774 | #error "MBEDTLS_THREADING_C defined, single threading implementation required" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 775 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 776 | #undef MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 777 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 778 | #if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C) |
| 779 | #error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 780 | #endif |
| 781 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 782 | #if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ |
| 783 | !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \ |
| 784 | !defined(MBEDTLS_PK_PARSE_C) ) |
| 785 | #error "MBEDTLS_X509_USE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 786 | #endif |
| 787 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 788 | #if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ |
| 789 | !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \ |
| 790 | !defined(MBEDTLS_PK_WRITE_C) ) |
| 791 | #error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 792 | #endif |
| 793 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 794 | #if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) |
| 795 | #error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 796 | #endif |
| 797 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 798 | #if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) |
| 799 | #error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 800 | #endif |
| 801 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 802 | #if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) |
| 803 | #error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 804 | #endif |
| 805 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 806 | #if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) |
| 807 | #error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 808 | #endif |
| 809 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 810 | #if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) |
| 811 | #error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 812 | #endif |
| 813 | |
Hanno Becker | 843b71a | 2019-06-25 09:39:21 +0100 | [diff] [blame] | 814 | #if defined(MBEDTLS_X509_CRT_REMOVE_TIME) && \ |
| 815 | defined(MBEDTLS_HAVE_TIME_DATE) |
| 816 | #error "MBEDTLS_X509_CRT_REMOVE_TIME and MBEDTLS_HAVE_TIME_DATE cannot be defined simultaneously" |
| 817 | #endif |
| 818 | |
Andres Amaya Garcia | d7fce00 | 2017-07-20 11:49:32 +0100 | [diff] [blame] | 819 | #if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64) |
| 820 | #error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously" |
| 821 | #endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */ |
| 822 | |
Andres Amaya Garcia | 93db11a | 2017-07-20 12:11:19 +0100 | [diff] [blame] | 823 | #if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \ |
| 824 | defined(MBEDTLS_HAVE_ASM) |
Andres Amaya Garcia | b39467d | 2017-07-20 13:21:15 +0100 | [diff] [blame] | 825 | #error "MBEDTLS_HAVE_INT32/MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously" |
Andres Amaya Garcia | d7fce00 | 2017-07-20 11:49:32 +0100 | [diff] [blame] | 826 | #endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */ |
| 827 | |
Manuel Pégourié-Gonnard | f78e4de | 2015-05-29 10:52:14 +0200 | [diff] [blame] | 828 | /* |
| 829 | * Avoid warning from -pedantic. This is a convenient place for this |
| 830 | * workaround since this is included by every single file before the |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 831 | * #if defined(MBEDTLS_xxx_C) that results in empty translation units. |
Manuel Pégourié-Gonnard | f78e4de | 2015-05-29 10:52:14 +0200 | [diff] [blame] | 832 | */ |
| 833 | typedef int mbedtls_iso_c_forbids_empty_translation_units; |
| 834 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 835 | #endif /* MBEDTLS_CHECK_CONFIG_H */ |