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