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