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 | /* |
Bence Szépkúti | a2947ac | 2020-08-19 16:37:36 +0200 | [diff] [blame] | 7 | * Copyright The Mbed TLS Contributors |
Bence Szépkúti | f744bd7 | 2020-06-05 13:02:18 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
| 9 | * |
| 10 | * This file is provided under the Apache License 2.0, or the |
| 11 | * GNU General Public License v2.0 or later. |
| 12 | * |
| 13 | * ********** |
| 14 | * Apache License 2.0: |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 15 | * |
| 16 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 17 | * not use this file except in compliance with the License. |
| 18 | * You may obtain a copy of the License at |
| 19 | * |
| 20 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 21 | * |
| 22 | * Unless required by applicable law or agreed to in writing, software |
| 23 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 25 | * See the License for the specific language governing permissions and |
| 26 | * limitations under the License. |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 27 | * |
Bence Szépkúti | f744bd7 | 2020-06-05 13:02:18 +0200 | [diff] [blame] | 28 | * ********** |
| 29 | * |
| 30 | * ********** |
| 31 | * GNU General Public License v2.0 or later: |
| 32 | * |
| 33 | * This program is free software; you can redistribute it and/or modify |
| 34 | * it under the terms of the GNU General Public License as published by |
| 35 | * the Free Software Foundation; either version 2 of the License, or |
| 36 | * (at your option) any later version. |
| 37 | * |
| 38 | * This program is distributed in the hope that it will be useful, |
| 39 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 40 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 41 | * GNU General Public License for more details. |
| 42 | * |
| 43 | * You should have received a copy of the GNU General Public License along |
| 44 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 45 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 46 | * |
| 47 | * ********** |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 48 | */ |
| 49 | |
| 50 | /* |
| 51 | * It is recommended to include this file from your config.h |
| 52 | * in order to catch dependency issues early. |
| 53 | */ |
| 54 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 55 | #ifndef MBEDTLS_CHECK_CONFIG_H |
| 56 | #define MBEDTLS_CHECK_CONFIG_H |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 57 | |
Manuel Pégourié-Gonnard | d14acbc | 2015-05-29 11:26:37 +0200 | [diff] [blame] | 58 | /* |
| 59 | * We assume CHAR_BIT is 8 in many places. In practice, this is true on our |
| 60 | * target platforms, so not an issue, but let's just be extra sure. |
| 61 | */ |
| 62 | #include <limits.h> |
| 63 | #if CHAR_BIT != 8 |
| 64 | #error "mbed TLS requires a platform with 8-bit chars" |
| 65 | #endif |
| 66 | |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 67 | #if defined(_WIN32) |
| 68 | #if !defined(MBEDTLS_PLATFORM_C) |
Manuel Pégourié-Gonnard | 6c0c8e0 | 2015-06-22 10:23:34 +0200 | [diff] [blame] | 69 | #error "MBEDTLS_PLATFORM_C is required on Windows" |
| 70 | #endif |
| 71 | |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 72 | /* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as |
| 73 | * it would confuse config.pl. */ |
| 74 | #if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ |
| 75 | !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) |
| 76 | #define MBEDTLS_PLATFORM_SNPRINTF_ALT |
| 77 | #endif |
| 78 | #endif /* _WIN32 */ |
| 79 | |
Manuel Pégourié-Gonnard | 63e7eba | 2015-07-28 14:17:48 +0200 | [diff] [blame] | 80 | #if defined(TARGET_LIKE_MBED) && \ |
| 81 | ( defined(MBEDTLS_NET_C) || defined(MBEDTLS_TIMING_C) ) |
| 82 | #error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS" |
| 83 | #endif |
| 84 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 85 | #if defined(MBEDTLS_DEPRECATED_WARNING) && \ |
Manuel Pégourié-Gonnard | 757ca00 | 2015-03-23 15:24:07 +0100 | [diff] [blame] | 86 | !defined(__GNUC__) && !defined(__clang__) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 87 | #error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang" |
Manuel Pégourié-Gonnard | c70581c | 2015-03-23 13:58:27 +0100 | [diff] [blame] | 88 | #endif |
| 89 | |
Manuel Pégourié-Gonnard | 60c793b | 2015-06-18 20:52:58 +0200 | [diff] [blame] | 90 | #if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME) |
| 91 | #error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" |
| 92 | #endif |
| 93 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 94 | #if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM) |
| 95 | #error "MBEDTLS_AESNI_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 96 | #endif |
| 97 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 98 | #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) |
| 99 | #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 100 | #endif |
| 101 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 102 | #if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C) |
| 103 | #error "MBEDTLS_DHM_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 104 | #endif |
| 105 | |
Hanno Becker | e89353a | 2017-11-20 16:36:41 +0000 | [diff] [blame] | 106 | #if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) && !defined(MBEDTLS_SSL_TRUNCATED_HMAC) |
| 107 | #error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT defined, but not all prerequisites" |
| 108 | #endif |
| 109 | |
Brian Murray | 53e23b6 | 2016-09-13 14:00:15 -0700 | [diff] [blame] | 110 | #if defined(MBEDTLS_CMAC_C) && \ |
Simon Butcher | 69283e5 | 2016-10-06 12:49:58 +0100 | [diff] [blame] | 111 | !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C) |
Brian Murray | 53e23b6 | 2016-09-13 14:00:15 -0700 | [diff] [blame] | 112 | #error "MBEDTLS_CMAC_C defined, but not all prerequisites" |
| 113 | #endif |
| 114 | |
Ron Eldor | 466a57f | 2018-05-03 16:54:28 +0300 | [diff] [blame] | 115 | #if defined(MBEDTLS_NIST_KW_C) && \ |
| 116 | ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) ) |
| 117 | #error "MBEDTLS_NIST_KW_C defined, but not all prerequisites" |
| 118 | #endif |
| 119 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 120 | #if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C) |
| 121 | #error "MBEDTLS_ECDH_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 122 | #endif |
| 123 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 124 | #if defined(MBEDTLS_ECDSA_C) && \ |
| 125 | ( !defined(MBEDTLS_ECP_C) || \ |
| 126 | !defined(MBEDTLS_ASN1_PARSE_C) || \ |
| 127 | !defined(MBEDTLS_ASN1_WRITE_C) ) |
| 128 | #error "MBEDTLS_ECDSA_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 129 | #endif |
| 130 | |
Manuel Pégourié-Gonnard | 4d8685b | 2015-08-05 15:44:42 +0200 | [diff] [blame] | 131 | #if defined(MBEDTLS_ECJPAKE_C) && \ |
| 132 | ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) ) |
| 133 | #error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites" |
| 134 | #endif |
| 135 | |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 136 | #if defined(MBEDTLS_ECP_RESTARTABLE) && \ |
| 137 | ( defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ |
| 138 | defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \ |
| 139 | defined(MBEDTLS_ECDSA_SIGN_ALT) || \ |
| 140 | defined(MBEDTLS_ECDSA_VERIFY_ALT) || \ |
| 141 | defined(MBEDTLS_ECDSA_GENKEY_ALT) || \ |
Janos Follath | 172ba63 | 2018-12-07 12:13:54 +0000 | [diff] [blame] | 142 | defined(MBEDTLS_ECP_INTERNAL_ALT) || \ |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 143 | defined(MBEDTLS_ECP_ALT) ) |
| 144 | #error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative ECP implementation" |
| 145 | #endif |
| 146 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 147 | #if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C) |
| 148 | #error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 149 | #endif |
| 150 | |
k-stachowiak | c775ee1 | 2019-05-31 20:13:58 +0200 | [diff] [blame] | 151 | #if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 152 | !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \ |
| 153 | !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \ |
| 154 | !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \ |
| 155 | !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \ |
| 156 | !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \ |
| 157 | !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \ |
| 158 | !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \ |
| 159 | !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \ |
| 160 | !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \ |
| 161 | !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \ |
k-stachowiak | c775ee1 | 2019-05-31 20:13:58 +0200 | [diff] [blame] | 162 | !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) && \ |
| 163 | !defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) && \ |
| 164 | !defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) ) ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 165 | #error "MBEDTLS_ECP_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 166 | #endif |
| 167 | |
Manuel Pégourié-Gonnard | 23983f3 | 2020-05-19 12:38:31 +0200 | [diff] [blame] | 168 | #if defined(MBEDTLS_ECP_C) && !( \ |
| 169 | defined(MBEDTLS_ECP_ALT) || \ |
| 170 | defined(MBEDTLS_CTR_DRBG_C) || \ |
| 171 | defined(MBEDTLS_HMAC_DRBG_C) || \ |
Manuel Pégourié-Gonnard | 72177e3 | 2020-06-16 12:51:42 +0200 | [diff] [blame] | 172 | defined(MBEDTLS_SHA512_C) || \ |
| 173 | defined(MBEDTLS_SHA256_C) || \ |
Manuel Pégourié-Gonnard | 23983f3 | 2020-05-19 12:38:31 +0200 | [diff] [blame] | 174 | defined(MBEDTLS_ECP_NO_INTERNAL_RNG)) |
Manuel Pégourié-Gonnard | 2df5857 | 2020-06-18 12:14:34 +0200 | [diff] [blame] | 175 | #error "MBEDTLS_ECP_C requires a DRBG or SHA-2 module unless MBEDTLS_ECP_NO_INTERNAL_RNG is defined or an alternative implementation is used" |
Manuel Pégourié-Gonnard | 23983f3 | 2020-05-19 12:38:31 +0200 | [diff] [blame] | 176 | #endif |
| 177 | |
Hanno Becker | cb9debd | 2018-10-12 10:44:27 +0100 | [diff] [blame] | 178 | #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C) |
| 179 | #error "MBEDTLS_PK_PARSE_C defined, but not all prerequesites" |
| 180 | #endif |
| 181 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 182 | #if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \ |
| 183 | !defined(MBEDTLS_SHA256_C)) |
| 184 | #error "MBEDTLS_ENTROPY_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 185 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 186 | #if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \ |
| 187 | defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64) |
| 188 | #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 189 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 190 | #if defined(MBEDTLS_ENTROPY_C) && \ |
| 191 | ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \ |
| 192 | && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32) |
| 193 | #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 194 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 195 | #if defined(MBEDTLS_ENTROPY_C) && \ |
| 196 | defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C) |
| 197 | #error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 198 | #endif |
| 199 | |
Manuel Pégourié-Gonnard | a237722 | 2020-07-28 10:53:06 +0200 | [diff] [blame] | 200 | #if defined(__has_feature) |
| 201 | #if __has_feature(memory_sanitizer) |
| 202 | #define MBEDTLS_HAS_MEMSAN |
| 203 | #endif |
| 204 | #endif |
| 205 | #if defined(MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN) && !defined(MBEDTLS_HAS_MEMSAN) |
| 206 | #error "MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN requires building with MemorySanitizer" |
| 207 | #endif |
| 208 | #undef MBEDTLS_HAS_MEMSAN |
| 209 | |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 210 | #if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ |
| 211 | ( !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) ) |
| 212 | #error "MBEDTLS_TEST_NULL_ENTROPY defined, but not all prerequisites" |
Janos Follath | 53de784 | 2016-06-08 15:29:18 +0100 | [diff] [blame] | 213 | #endif |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 214 | #if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ |
| 215 | ( defined(MBEDTLS_ENTROPY_NV_SEED) || defined(MBEDTLS_ENTROPY_HARDWARE_ALT) || \ |
| 216 | defined(MBEDTLS_HAVEGE_C) ) |
| 217 | #error "MBEDTLS_TEST_NULL_ENTROPY defined, but entropy sources too" |
Janos Follath | 53de784 | 2016-06-08 15:29:18 +0100 | [diff] [blame] | 218 | #endif |
| 219 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 220 | #if defined(MBEDTLS_GCM_C) && ( \ |
| 221 | !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) ) |
| 222 | #error "MBEDTLS_GCM_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 223 | #endif |
| 224 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 225 | #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 226 | #error "MBEDTLS_ECP_RANDOMIZE_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_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 230 | #error "MBEDTLS_ECP_ADD_MIXED_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_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 234 | #error "MBEDTLS_ECP_DOUBLE_JAC_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_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 238 | #error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites" |
| 239 | #endif |
| 240 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 241 | #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 242 | #error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites" |
| 243 | #endif |
| 244 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 245 | #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] | 246 | #error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites" |
| 247 | #endif |
| 248 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 249 | #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 250 | #error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites" |
| 251 | #endif |
| 252 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 253 | #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 254 | #error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites" |
| 255 | #endif |
| 256 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 257 | #if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C) |
| 258 | #error "MBEDTLS_HAVEGE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 259 | #endif |
| 260 | |
Thomas Fossati | 656864b | 2016-07-17 08:51:22 +0100 | [diff] [blame] | 261 | #if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C) |
| 262 | #error "MBEDTLS_HKDF_C defined, but not all prerequisites" |
| 263 | #endif |
| 264 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 265 | #if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C) |
| 266 | #error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 267 | #endif |
| 268 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 269 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ |
| 270 | ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) ) |
| 271 | #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] | 272 | #endif |
| 273 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 274 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ |
| 275 | ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) ) |
| 276 | #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] | 277 | #endif |
| 278 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 279 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C) |
| 280 | #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] | 281 | #endif |
| 282 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 283 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ |
| 284 | !defined(MBEDTLS_ECDH_C) |
| 285 | #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] | 286 | #endif |
| 287 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 288 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ |
| 289 | ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \ |
| 290 | !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) |
| 291 | #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] | 292 | #endif |
| 293 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 294 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ |
| 295 | ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \ |
| 296 | !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) |
| 297 | #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] | 298 | #endif |
| 299 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 300 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ |
| 301 | ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ |
| 302 | !defined(MBEDTLS_X509_CRT_PARSE_C) ) |
| 303 | #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] | 304 | #endif |
| 305 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 306 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ |
| 307 | ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ |
| 308 | !defined(MBEDTLS_PKCS1_V15) ) |
| 309 | #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] | 310 | #endif |
| 311 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 312 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \ |
| 313 | ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ |
| 314 | !defined(MBEDTLS_PKCS1_V15) ) |
| 315 | #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] | 316 | #endif |
| 317 | |
Manuel Pégourié-Gonnard | 557535d | 2015-09-15 17:53:32 +0200 | [diff] [blame] | 318 | #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ |
| 319 | ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) || \ |
| 320 | !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) ) |
| 321 | #error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites" |
| 322 | #endif |
| 323 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 324 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ |
| 325 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
| 326 | #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] | 327 | #endif |
| 328 | |
Hanno Becker | e29e7eb | 2019-02-26 13:50:21 +0000 | [diff] [blame] | 329 | #if defined(MBEDTLS_MEMORY_BACKTRACE) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
| 330 | #error "MBEDTLS_MEMORY_BACKTRACE defined, but not all prerequesites" |
| 331 | #endif |
| 332 | |
Hanno Becker | 9ae9da9 | 2019-06-03 16:31:32 +0100 | [diff] [blame] | 333 | #if defined(MBEDTLS_MEMORY_DEBUG) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
| 334 | #error "MBEDTLS_MEMORY_DEBUG defined, but not all prerequesites" |
| 335 | #endif |
| 336 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 337 | #if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM) |
| 338 | #error "MBEDTLS_PADLOCK_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 339 | #endif |
| 340 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 341 | #if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C) |
| 342 | #error "MBEDTLS_PEM_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_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C) |
| 346 | #error "MBEDTLS_PEM_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_PK_C) && \ |
| 350 | ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) ) |
| 351 | #error "MBEDTLS_PK_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 94de331 | 2015-01-28 16:32:36 +0000 | [diff] [blame] | 352 | #endif |
| 353 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 354 | #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C) |
| 355 | #error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 356 | #endif |
| 357 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 358 | #if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C) |
| 359 | #error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 360 | #endif |
| 361 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 362 | #if defined(MBEDTLS_PKCS11_C) && !defined(MBEDTLS_PK_C) |
| 363 | #error "MBEDTLS_PKCS11_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 364 | #endif |
| 365 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 366 | #if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 367 | #error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 368 | #endif |
| 369 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 370 | #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 371 | #error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 372 | #endif |
| 373 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 374 | #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\ |
| 375 | ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\ |
| 376 | defined(MBEDTLS_PLATFORM_EXIT_ALT) ) |
| 377 | #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] | 378 | #endif |
| 379 | |
Andres Amaya Garcia | 1e4ec66 | 2016-07-20 10:16:25 +0100 | [diff] [blame] | 380 | #if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\ |
| 381 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 382 | !defined(MBEDTLS_HAVE_TIME) ) |
| 383 | #error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites" |
| 384 | #endif |
| 385 | |
| 386 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ |
| 387 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 388 | !defined(MBEDTLS_HAVE_TIME) ) |
| 389 | #error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites" |
| 390 | #endif |
| 391 | |
| 392 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ |
| 393 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 394 | !defined(MBEDTLS_HAVE_TIME) ) |
| 395 | #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites" |
| 396 | #endif |
| 397 | |
| 398 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ |
| 399 | ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ |
| 400 | defined(MBEDTLS_PLATFORM_TIME_ALT) ) |
| 401 | #error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" |
| 402 | #endif |
| 403 | |
| 404 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ |
| 405 | ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ |
| 406 | defined(MBEDTLS_PLATFORM_TIME_ALT) ) |
| 407 | #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" |
| 408 | #endif |
| 409 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 410 | #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 411 | #error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 412 | #endif |
| 413 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 414 | #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 415 | #error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 416 | #endif |
| 417 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 418 | #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\ |
| 419 | ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\ |
| 420 | defined(MBEDTLS_PLATFORM_FPRINTF_ALT) ) |
| 421 | #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] | 422 | #endif |
| 423 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 424 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ |
| 425 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
| 426 | #error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 427 | #endif |
| 428 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 429 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ |
| 430 | defined(MBEDTLS_PLATFORM_STD_FREE) |
| 431 | #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] | 432 | #endif |
| 433 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 434 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) |
| 435 | #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] | 436 | #endif |
| 437 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 438 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 439 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 440 | #error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 441 | #endif |
| 442 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 443 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ |
| 444 | defined(MBEDTLS_PLATFORM_STD_CALLOC) |
| 445 | #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] | 446 | #endif |
| 447 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 448 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) |
| 449 | #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] | 450 | #endif |
| 451 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 452 | #if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) |
| 453 | #error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 454 | #endif |
| 455 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 456 | #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 457 | #error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 458 | #endif |
| 459 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 460 | #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 461 | #error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 462 | #endif |
| 463 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 464 | #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\ |
| 465 | ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\ |
| 466 | defined(MBEDTLS_PLATFORM_PRINTF_ALT) ) |
| 467 | #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] | 468 | #endif |
| 469 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 470 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 471 | #error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 472 | #endif |
| 473 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 474 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 475 | #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 476 | #endif |
| 477 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 478 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\ |
| 479 | ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\ |
| 480 | defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) ) |
| 481 | #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] | 482 | #endif |
| 483 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 484 | #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\ |
| 485 | !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) |
| 486 | #error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 487 | #endif |
| 488 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 489 | #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) |
| 490 | #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 491 | #endif |
| 492 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 493 | #if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) |
| 494 | #error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 495 | #endif |
| 496 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 497 | #if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\ |
| 498 | !defined(MBEDTLS_PLATFORM_EXIT_ALT) |
| 499 | #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 500 | #endif |
| 501 | |
Andres Amaya Garcia | 1e4ec66 | 2016-07-20 10:16:25 +0100 | [diff] [blame] | 502 | #if defined(MBEDTLS_PLATFORM_STD_TIME) &&\ |
| 503 | ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\ |
| 504 | !defined(MBEDTLS_HAVE_TIME) ) |
| 505 | #error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites" |
| 506 | #endif |
| 507 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 508 | #if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\ |
| 509 | !defined(MBEDTLS_PLATFORM_FPRINTF_ALT) |
| 510 | #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 511 | #endif |
| 512 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 513 | #if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\ |
| 514 | !defined(MBEDTLS_PLATFORM_PRINTF_ALT) |
| 515 | #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 516 | #endif |
| 517 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 518 | #if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\ |
| 519 | !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) |
| 520 | #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 521 | #endif |
| 522 | |
Paul Bakker | cf0a9f9 | 2016-06-01 11:25:44 +0100 | [diff] [blame] | 523 | #if defined(MBEDTLS_ENTROPY_NV_SEED) &&\ |
| 524 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) ) |
| 525 | #error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites" |
| 526 | #endif |
| 527 | |
| 528 | #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\ |
| 529 | !defined(MBEDTLS_ENTROPY_NV_SEED) |
| 530 | #error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites" |
| 531 | #endif |
| 532 | |
| 533 | #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\ |
| 534 | !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) |
| 535 | #error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites" |
| 536 | #endif |
| 537 | |
| 538 | #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\ |
| 539 | !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) |
| 540 | #error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites" |
| 541 | #endif |
| 542 | |
| 543 | #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\ |
| 544 | ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\ |
| 545 | defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) |
| 546 | #error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously" |
| 547 | #endif |
| 548 | |
| 549 | #if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\ |
| 550 | ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\ |
| 551 | defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) |
| 552 | #error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously" |
| 553 | #endif |
| 554 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 555 | #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ |
| 556 | !defined(MBEDTLS_OID_C) ) |
| 557 | #error "MBEDTLS_RSA_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 558 | #endif |
| 559 | |
Paul Bakker | 4fde40f | 2016-05-09 15:13:04 +0100 | [diff] [blame] | 560 | #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \ |
Paul Bakker | 37068a7 | 2016-05-09 14:36:33 +0100 | [diff] [blame] | 561 | !defined(MBEDTLS_PKCS1_V15) ) |
| 562 | #error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled" |
| 563 | #endif |
| 564 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 565 | #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \ |
| 566 | ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) ) |
| 567 | #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] | 568 | #endif |
| 569 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 570 | #if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) || \ |
| 571 | !defined(MBEDTLS_SHA1_C) ) |
| 572 | #error "MBEDTLS_SSL_PROTO_SSL3 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 573 | #endif |
| 574 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 575 | #if defined(MBEDTLS_SSL_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) || \ |
| 576 | !defined(MBEDTLS_SHA1_C) ) |
| 577 | #error "MBEDTLS_SSL_PROTO_TLS1 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 578 | #endif |
| 579 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 580 | #if defined(MBEDTLS_SSL_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) || \ |
| 581 | !defined(MBEDTLS_SHA1_C) ) |
| 582 | #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] | 583 | #endif |
| 584 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 585 | #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \ |
| 586 | !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) ) |
| 587 | #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] | 588 | #endif |
| 589 | |
Simon Butcher | 14ba0ce | 2019-04-11 18:56:18 +0100 | [diff] [blame] | 590 | #if (defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \ |
| 591 | defined(MBEDTLS_SSL_PROTO_TLS1_1) || defined(MBEDTLS_SSL_PROTO_TLS1_2)) && \ |
| 592 | !(defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ |
| 593 | defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 594 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 595 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ |
| 596 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ |
| 597 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \ |
| 598 | defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ |
| 599 | defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ |
| 600 | defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ |
| 601 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ |
| 602 | defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) ) |
| 603 | #error "One or more versions of the TLS protocol are enabled " \ |
| 604 | "but no key exchange methods defined with MBEDTLS_KEY_EXCHANGE_xxxx" |
| 605 | #endif |
| 606 | |
Manuel Pégourié-Gonnard | 5a8d56d | 2015-05-13 10:10:00 +0200 | [diff] [blame] | 607 | #if defined(MBEDTLS_SSL_PROTO_DTLS) && \ |
| 608 | !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 609 | !defined(MBEDTLS_SSL_PROTO_TLS1_2) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 610 | #error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 0b1ff29 | 2014-02-06 13:04:16 +0100 | [diff] [blame] | 611 | #endif |
| 612 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 613 | #if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C) |
| 614 | #error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites" |
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_CIPHER_C) || \ |
| 618 | !defined(MBEDTLS_MD_C) ) |
| 619 | #error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 620 | #endif |
| 621 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 622 | #if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C) |
| 623 | #error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 624 | #endif |
| 625 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 626 | #if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \ |
| 627 | !defined(MBEDTLS_SSL_PROTO_TLS1) && !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 628 | !defined(MBEDTLS_SSL_PROTO_TLS1_2)) |
| 629 | #error "MBEDTLS_SSL_TLS_C defined, but no protocols are active" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 630 | #endif |
| 631 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 632 | #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ |
| 633 | 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] | 634 | #error "Illegal protocol selection" |
| 635 | #endif |
| 636 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 637 | #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \ |
| 638 | 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] | 639 | #error "Illegal protocol selection" |
| 640 | #endif |
| 641 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 642 | #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ |
| 643 | defined(MBEDTLS_SSL_PROTO_TLS1_2) && (!defined(MBEDTLS_SSL_PROTO_TLS1) || \ |
| 644 | !defined(MBEDTLS_SSL_PROTO_TLS1_1))) |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 645 | #error "Illegal protocol selection" |
| 646 | #endif |
| 647 | |
Manuel Pégourié-Gonnard | e057d3b | 2015-05-20 10:59:43 +0200 | [diff] [blame] | 648 | #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] | 649 | #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] | 650 | #endif |
| 651 | |
Manuel Pégourié-Gonnard | 62c74bb | 2015-09-08 17:50:29 +0200 | [diff] [blame] | 652 | #if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \ |
Manuel Pégourié-Gonnard | ddfe5d2 | 2015-09-09 12:46:16 +0200 | [diff] [blame] | 653 | !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) |
Manuel Pégourié-Gonnard | 62c74bb | 2015-09-08 17:50:29 +0200 | [diff] [blame] | 654 | #error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites" |
| 655 | #endif |
| 656 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 657 | #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \ |
| 658 | ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) |
| 659 | #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] | 660 | #endif |
| 661 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 662 | #if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) && \ |
| 663 | ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) |
| 664 | #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] | 665 | #endif |
| 666 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 667 | #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \ |
| 668 | !defined(MBEDTLS_SSL_PROTO_TLS1) && \ |
| 669 | !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 670 | !defined(MBEDTLS_SSL_PROTO_TLS1_2) |
| 671 | #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] | 672 | #endif |
| 673 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 674 | #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \ |
| 675 | !defined(MBEDTLS_SSL_PROTO_TLS1) && \ |
| 676 | !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 677 | !defined(MBEDTLS_SSL_PROTO_TLS1_2) |
| 678 | #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] | 679 | #endif |
| 680 | |
Manuel Pégourié-Gonnard | 4214e3a | 2015-05-25 19:34:49 +0200 | [diff] [blame] | 681 | #if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C) |
Manuel Pégourié-Gonnard | 0c0f11f | 2015-05-20 09:55:50 +0200 | [diff] [blame] | 682 | #error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 683 | #endif |
| 684 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 685 | #if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) && \ |
| 686 | !defined(MBEDTLS_SSL_PROTO_SSL3) && !defined(MBEDTLS_SSL_PROTO_TLS1) |
| 687 | #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] | 688 | #endif |
| 689 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 690 | #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \ |
| 691 | !defined(MBEDTLS_X509_CRT_PARSE_C) |
| 692 | #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] | 693 | #endif |
| 694 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 695 | #if defined(MBEDTLS_THREADING_PTHREAD) |
| 696 | #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) |
| 697 | #error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 698 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 699 | #define MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 700 | #endif |
| 701 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 702 | #if defined(MBEDTLS_THREADING_ALT) |
| 703 | #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) |
| 704 | #error "MBEDTLS_THREADING_ALT defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 705 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 706 | #define MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 707 | #endif |
| 708 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 709 | #if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL) |
| 710 | #error "MBEDTLS_THREADING_C defined, single threading implementation required" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 711 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 712 | #undef MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 713 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 714 | #if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C) |
| 715 | #error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 716 | #endif |
| 717 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 718 | #if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ |
| 719 | !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \ |
| 720 | !defined(MBEDTLS_PK_PARSE_C) ) |
| 721 | #error "MBEDTLS_X509_USE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 722 | #endif |
| 723 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 724 | #if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ |
| 725 | !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \ |
| 726 | !defined(MBEDTLS_PK_WRITE_C) ) |
| 727 | #error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 728 | #endif |
| 729 | |
Simon Butcher | 14ba0ce | 2019-04-11 18:56:18 +0100 | [diff] [blame] | 730 | #if defined(MBEDTLS_CERTS_C) && !defined(MBEDTLS_X509_USE_C) |
| 731 | #error "MBEDTLS_CERTS_C defined, but not all prerequisites" |
| 732 | #endif |
| 733 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 734 | #if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) |
| 735 | #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] | 736 | #endif |
| 737 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 738 | #if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) |
| 739 | #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] | 740 | #endif |
| 741 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 742 | #if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) |
| 743 | #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] | 744 | #endif |
| 745 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 746 | #if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) |
| 747 | #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] | 748 | #endif |
| 749 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 750 | #if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) |
| 751 | #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] | 752 | #endif |
| 753 | |
Andres Amaya Garcia | d7fce00 | 2017-07-20 11:49:32 +0100 | [diff] [blame] | 754 | #if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64) |
| 755 | #error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously" |
| 756 | #endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */ |
| 757 | |
Andres Amaya Garcia | 93db11a | 2017-07-20 12:11:19 +0100 | [diff] [blame] | 758 | #if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \ |
| 759 | defined(MBEDTLS_HAVE_ASM) |
Andres Amaya Garcia | b39467d | 2017-07-20 13:21:15 +0100 | [diff] [blame] | 760 | #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] | 761 | #endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */ |
| 762 | |
Manuel Pégourié-Gonnard | f78e4de | 2015-05-29 10:52:14 +0200 | [diff] [blame] | 763 | /* |
| 764 | * Avoid warning from -pedantic. This is a convenient place for this |
| 765 | * workaround since this is included by every single file before the |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 766 | * #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] | 767 | */ |
| 768 | typedef int mbedtls_iso_c_forbids_empty_translation_units; |
| 769 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 770 | #endif /* MBEDTLS_CHECK_CONFIG_H */ |