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 | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 7 | * Copyright The Mbed TLS Contributors |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: Apache-2.0 |
| 9 | * |
| 10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 11 | * not use this file except in compliance with the License. |
| 12 | * You may obtain a copy of the License at |
| 13 | * |
| 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | * |
| 16 | * Unless required by applicable law or agreed to in writing, software |
| 17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 | * See the License for the specific language governing permissions and |
| 20 | * limitations under the License. |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 21 | */ |
| 22 | |
| 23 | /* |
| 24 | * It is recommended to include this file from your config.h |
| 25 | * in order to catch dependency issues early. |
| 26 | */ |
| 27 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 28 | #ifndef MBEDTLS_CHECK_CONFIG_H |
| 29 | #define MBEDTLS_CHECK_CONFIG_H |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 30 | |
David Horstmann | d2c83be | 2022-11-14 15:40:46 +0000 | [diff] [blame^] | 31 | /* *INDENT-OFF* */ |
Manuel Pégourié-Gonnard | d14acbc | 2015-05-29 11:26:37 +0200 | [diff] [blame] | 32 | /* |
| 33 | * We assume CHAR_BIT is 8 in many places. In practice, this is true on our |
| 34 | * target platforms, so not an issue, but let's just be extra sure. |
| 35 | */ |
| 36 | #include <limits.h> |
| 37 | #if CHAR_BIT != 8 |
| 38 | #error "mbed TLS requires a platform with 8-bit chars" |
| 39 | #endif |
| 40 | |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 41 | #if defined(_WIN32) |
| 42 | #if !defined(MBEDTLS_PLATFORM_C) |
Manuel Pégourié-Gonnard | 6c0c8e0 | 2015-06-22 10:23:34 +0200 | [diff] [blame] | 43 | #error "MBEDTLS_PLATFORM_C is required on Windows" |
| 44 | #endif |
| 45 | |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 46 | /* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 47 | * it would confuse config.py. */ |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 48 | #if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ |
| 49 | !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) |
| 50 | #define MBEDTLS_PLATFORM_SNPRINTF_ALT |
| 51 | #endif |
k-stachowiak | 6b5ef48 | 2019-01-07 16:53:29 +0100 | [diff] [blame] | 52 | |
| 53 | #if !defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) && \ |
| 54 | !defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) |
| 55 | #define MBEDTLS_PLATFORM_VSNPRINTF_ALT |
| 56 | #endif |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 57 | #endif /* _WIN32 */ |
| 58 | |
Jaeden Amero | 128c94d | 2021-06-08 18:31:27 +0100 | [diff] [blame] | 59 | #if defined(TARGET_LIKE_MBED) && defined(MBEDTLS_NET_C) |
| 60 | #error "The NET module is not available for mbed OS - please use the network functions provided by Mbed OS" |
Manuel Pégourié-Gonnard | 63e7eba | 2015-07-28 14:17:48 +0200 | [diff] [blame] | 61 | #endif |
| 62 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 63 | #if defined(MBEDTLS_DEPRECATED_WARNING) && \ |
Manuel Pégourié-Gonnard | 757ca00 | 2015-03-23 15:24:07 +0100 | [diff] [blame] | 64 | !defined(__GNUC__) && !defined(__clang__) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 65 | #error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang" |
Manuel Pégourié-Gonnard | c70581c | 2015-03-23 13:58:27 +0100 | [diff] [blame] | 66 | #endif |
| 67 | |
Manuel Pégourié-Gonnard | 60c793b | 2015-06-18 20:52:58 +0200 | [diff] [blame] | 68 | #if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME) |
| 69 | #error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" |
| 70 | #endif |
| 71 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 72 | #if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM) |
| 73 | #error "MBEDTLS_AESNI_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 74 | #endif |
| 75 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 76 | #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) |
| 77 | #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 78 | #endif |
| 79 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 80 | #if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C) |
| 81 | #error "MBEDTLS_DHM_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 82 | #endif |
| 83 | |
Hanno Becker | e89353a | 2017-11-20 16:36:41 +0000 | [diff] [blame] | 84 | #if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) && !defined(MBEDTLS_SSL_TRUNCATED_HMAC) |
| 85 | #error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT defined, but not all prerequisites" |
| 86 | #endif |
| 87 | |
Brian Murray | 53e23b6 | 2016-09-13 14:00:15 -0700 | [diff] [blame] | 88 | #if defined(MBEDTLS_CMAC_C) && \ |
Simon Butcher | 69283e5 | 2016-10-06 12:49:58 +0100 | [diff] [blame] | 89 | !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C) |
Brian Murray | 53e23b6 | 2016-09-13 14:00:15 -0700 | [diff] [blame] | 90 | #error "MBEDTLS_CMAC_C defined, but not all prerequisites" |
| 91 | #endif |
| 92 | |
Ron Eldor | 466a57f | 2018-05-03 16:54:28 +0300 | [diff] [blame] | 93 | #if defined(MBEDTLS_NIST_KW_C) && \ |
| 94 | ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) ) |
| 95 | #error "MBEDTLS_NIST_KW_C defined, but not all prerequisites" |
| 96 | #endif |
| 97 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 98 | #if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C) |
| 99 | #error "MBEDTLS_ECDH_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_ECDSA_C) && \ |
| 103 | ( !defined(MBEDTLS_ECP_C) || \ |
Gilles Peskine | 799e576 | 2018-09-14 17:34:00 +0200 | [diff] [blame] | 104 | !( defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) || \ |
| 105 | defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) || \ |
| 106 | defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) || \ |
| 107 | defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) || \ |
| 108 | defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) || \ |
| 109 | defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) || \ |
| 110 | defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) || \ |
| 111 | defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) || \ |
| 112 | defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) || \ |
| 113 | defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) || \ |
| 114 | defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) ) || \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 115 | !defined(MBEDTLS_ASN1_PARSE_C) || \ |
| 116 | !defined(MBEDTLS_ASN1_WRITE_C) ) |
| 117 | #error "MBEDTLS_ECDSA_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 118 | #endif |
| 119 | |
Manuel Pégourié-Gonnard | 4d8685b | 2015-08-05 15:44:42 +0200 | [diff] [blame] | 120 | #if defined(MBEDTLS_ECJPAKE_C) && \ |
| 121 | ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) ) |
| 122 | #error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites" |
| 123 | #endif |
| 124 | |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 125 | #if defined(MBEDTLS_ECP_RESTARTABLE) && \ |
Hanno Becker | 85fd913 | 2019-02-22 12:50:35 +0000 | [diff] [blame] | 126 | ( defined(MBEDTLS_USE_PSA_CRYPTO) || \ |
Hanno Becker | 1ce51e4 | 2019-02-22 10:25:47 +0000 | [diff] [blame] | 127 | defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 128 | defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \ |
| 129 | defined(MBEDTLS_ECDSA_SIGN_ALT) || \ |
| 130 | defined(MBEDTLS_ECDSA_VERIFY_ALT) || \ |
| 131 | defined(MBEDTLS_ECDSA_GENKEY_ALT) || \ |
Andrzej Kurek | c470b6b | 2019-01-31 08:20:20 -0500 | [diff] [blame] | 132 | defined(MBEDTLS_ECP_INTERNAL_ALT) || \ |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 133 | defined(MBEDTLS_ECP_ALT) ) |
Hanno Becker | 1ce51e4 | 2019-02-22 10:25:47 +0000 | [diff] [blame] | 134 | #error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative or PSA-based ECP implementation" |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 135 | #endif |
| 136 | |
Gilles Peskine | 43f564f | 2019-02-22 12:14:02 +0100 | [diff] [blame] | 137 | #if defined(MBEDTLS_ECP_RESTARTABLE) && \ |
| 138 | ! defined(MBEDTLS_ECDH_LEGACY_CONTEXT) |
| 139 | #error "MBEDTLS_ECP_RESTARTABLE defined, but not MBEDTLS_ECDH_LEGACY_CONTEXT" |
| 140 | #endif |
| 141 | |
Christoph M. Wintersteiger | 9c1b56b | 2019-04-15 11:09:33 +0100 | [diff] [blame] | 142 | #if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED) && \ |
| 143 | defined(MBEDTLS_ECDH_LEGACY_CONTEXT) |
| 144 | #error "MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED defined, but MBEDTLS_ECDH_LEGACY_CONTEXT not disabled" |
| 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 | 5dbe7ca | 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 | 5dbe7ca | 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 | 1a3f9ed | 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) || \ |
| 172 | defined(MBEDTLS_ECP_NO_INTERNAL_RNG)) |
| 173 | #error "MBEDTLS_ECP_C requires a DRBG module unless MBEDTLS_ECP_NO_INTERNAL_RNG is defined or an alternative implementation is used" |
| 174 | #endif |
| 175 | |
Andrzej Kurek | c470b6b | 2019-01-31 08:20:20 -0500 | [diff] [blame] | 176 | #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C) |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 177 | #error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" |
Andrzej Kurek | c470b6b | 2019-01-31 08:20:20 -0500 | [diff] [blame] | 178 | #endif |
| 179 | |
Sebastian Bøe | 9db51a6 | 2022-01-19 12:04:35 +0100 | [diff] [blame] | 180 | #if defined(MBEDTLS_PKCS5_C) && !defined(MBEDTLS_MD_C) |
Andrzej Kurek | 293e452 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 181 | #error "MBEDTLS_PKCS5_C defined, but not all prerequisites" |
Sebastian Bøe | 9db51a6 | 2022-01-19 12:04:35 +0100 | [diff] [blame] | 182 | #endif |
| 183 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 184 | #if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \ |
| 185 | !defined(MBEDTLS_SHA256_C)) |
| 186 | #error "MBEDTLS_ENTROPY_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 187 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 188 | #if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \ |
| 189 | defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64) |
| 190 | #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 191 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 192 | #if defined(MBEDTLS_ENTROPY_C) && \ |
| 193 | ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \ |
| 194 | && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32) |
| 195 | #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 196 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 197 | #if defined(MBEDTLS_ENTROPY_C) && \ |
| 198 | defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C) |
| 199 | #error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 200 | #endif |
| 201 | |
Manuel Pégourié-Gonnard | 6240def | 2020-07-10 09:35:54 +0200 | [diff] [blame] | 202 | #if defined(__has_feature) |
| 203 | #if __has_feature(memory_sanitizer) |
| 204 | #define MBEDTLS_HAS_MEMSAN |
| 205 | #endif |
| 206 | #endif |
| 207 | #if defined(MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN) && !defined(MBEDTLS_HAS_MEMSAN) |
| 208 | #error "MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN requires building with MemorySanitizer" |
| 209 | #endif |
| 210 | #undef MBEDTLS_HAS_MEMSAN |
| 211 | |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 212 | #if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ |
| 213 | ( !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) ) |
| 214 | #error "MBEDTLS_TEST_NULL_ENTROPY defined, but not all prerequisites" |
Janos Follath | 53de784 | 2016-06-08 15:29:18 +0100 | [diff] [blame] | 215 | #endif |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 216 | #if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ |
| 217 | ( defined(MBEDTLS_ENTROPY_NV_SEED) || defined(MBEDTLS_ENTROPY_HARDWARE_ALT) || \ |
| 218 | defined(MBEDTLS_HAVEGE_C) ) |
| 219 | #error "MBEDTLS_TEST_NULL_ENTROPY defined, but entropy sources too" |
Janos Follath | 53de784 | 2016-06-08 15:29:18 +0100 | [diff] [blame] | 220 | #endif |
| 221 | |
Gilles Peskine | 9130b5b | 2021-09-02 10:33:57 +0200 | [diff] [blame] | 222 | #if defined(MBEDTLS_CCM_C) && ( \ |
Gilles Peskine | fa21dda | 2021-09-09 20:39:47 +0200 | [diff] [blame] | 223 | !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) && !defined(MBEDTLS_ARIA_C) ) |
Gilles Peskine | 9130b5b | 2021-09-02 10:33:57 +0200 | [diff] [blame] | 224 | #error "MBEDTLS_CCM_C defined, but not all prerequisites" |
| 225 | #endif |
| 226 | |
| 227 | #if defined(MBEDTLS_CCM_C) && !defined(MBEDTLS_CIPHER_C) |
| 228 | #error "MBEDTLS_CCM_C defined, but not all prerequisites" |
| 229 | #endif |
| 230 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 231 | #if defined(MBEDTLS_GCM_C) && ( \ |
Gilles Peskine | fa21dda | 2021-09-09 20:39:47 +0200 | [diff] [blame] | 232 | !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) && !defined(MBEDTLS_ARIA_C) ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 233 | #error "MBEDTLS_GCM_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 234 | #endif |
| 235 | |
Gilles Peskine | 9130b5b | 2021-09-02 10:33:57 +0200 | [diff] [blame] | 236 | #if defined(MBEDTLS_GCM_C) && !defined(MBEDTLS_CIPHER_C) |
| 237 | #error "MBEDTLS_GCM_C defined, but not all prerequisites" |
| 238 | #endif |
| 239 | |
| 240 | #if defined(MBEDTLS_CHACHAPOLY_C) && !defined(MBEDTLS_CHACHA20_C) |
| 241 | #error "MBEDTLS_CHACHAPOLY_C defined, but not all prerequisites" |
| 242 | #endif |
| 243 | |
| 244 | #if defined(MBEDTLS_CHACHAPOLY_C) && !defined(MBEDTLS_POLY1305_C) |
| 245 | #error "MBEDTLS_CHACHAPOLY_C defined, but not all prerequisites" |
| 246 | #endif |
| 247 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 248 | #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 249 | #error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites" |
| 250 | #endif |
| 251 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 252 | #if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 253 | #error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites" |
| 254 | #endif |
| 255 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 256 | #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 257 | #error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites" |
| 258 | #endif |
| 259 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 260 | #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] | 261 | #error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites" |
| 262 | #endif |
| 263 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 264 | #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 265 | #error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites" |
| 266 | #endif |
| 267 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 268 | #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] | 269 | #error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites" |
| 270 | #endif |
| 271 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 272 | #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 273 | #error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites" |
| 274 | #endif |
| 275 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 276 | #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 277 | #error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites" |
| 278 | #endif |
| 279 | |
Steven Cooreman | b587313 | 2021-01-21 13:59:17 +0100 | [diff] [blame] | 280 | #if defined(MBEDTLS_ECP_NO_FALLBACK) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
| 281 | #error "MBEDTLS_ECP_NO_FALLBACK defined, but no alternative implementation enabled" |
| 282 | #endif |
| 283 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 284 | #if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C) |
| 285 | #error "MBEDTLS_HAVEGE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 286 | #endif |
| 287 | |
Thomas Fossati | 656864b | 2016-07-17 08:51:22 +0100 | [diff] [blame] | 288 | #if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C) |
| 289 | #error "MBEDTLS_HKDF_C defined, but not all prerequisites" |
| 290 | #endif |
| 291 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 292 | #if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C) |
| 293 | #error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 294 | #endif |
| 295 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 296 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ |
Gilles Peskine | 7ab66a6 | 2018-09-14 17:47:41 +0200 | [diff] [blame] | 297 | ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ |
| 298 | !defined(MBEDTLS_X509_CRT_PARSE_C) ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 299 | #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] | 300 | #endif |
| 301 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 302 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ |
Gilles Peskine | 7ab66a6 | 2018-09-14 17:47:41 +0200 | [diff] [blame] | 303 | ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \ |
| 304 | !defined(MBEDTLS_X509_CRT_PARSE_C) ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 305 | #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] | 306 | #endif |
| 307 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 308 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C) |
| 309 | #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] | 310 | #endif |
| 311 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 312 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ |
| 313 | !defined(MBEDTLS_ECDH_C) |
| 314 | #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] | 315 | #endif |
| 316 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 317 | #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ |
| 318 | ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \ |
| 319 | !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) |
| 320 | #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] | 321 | #endif |
| 322 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 323 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ |
| 324 | ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \ |
| 325 | !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) |
| 326 | #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] | 327 | #endif |
| 328 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 329 | #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ |
| 330 | ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ |
| 331 | !defined(MBEDTLS_X509_CRT_PARSE_C) ) |
| 332 | #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] | 333 | #endif |
| 334 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 335 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ |
| 336 | ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ |
| 337 | !defined(MBEDTLS_PKCS1_V15) ) |
| 338 | #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] | 339 | #endif |
| 340 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 341 | #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \ |
| 342 | ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ |
| 343 | !defined(MBEDTLS_PKCS1_V15) ) |
| 344 | #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] | 345 | #endif |
| 346 | |
Manuel Pégourié-Gonnard | 557535d | 2015-09-15 17:53:32 +0200 | [diff] [blame] | 347 | #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ |
| 348 | ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) || \ |
| 349 | !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) ) |
| 350 | #error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites" |
| 351 | #endif |
| 352 | |
Gilles Peskine | eccd888 | 2020-03-10 12:19:08 +0100 | [diff] [blame] | 353 | #if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) && \ |
Hanno Becker | fe4ef0c | 2019-02-26 11:43:09 +0000 | [diff] [blame] | 354 | !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) && \ |
| 355 | ( !defined(MBEDTLS_SHA256_C) && \ |
| 356 | !defined(MBEDTLS_SHA512_C) && \ |
| 357 | !defined(MBEDTLS_SHA1_C) ) |
| 358 | #error "!MBEDTLS_SSL_KEEP_PEER_CERTIFICATE requires MBEDTLS_SHA512_C, MBEDTLS_SHA256_C or MBEDTLS_SHA1_C" |
| 359 | #endif |
| 360 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 361 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ |
| 362 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
| 363 | #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] | 364 | #endif |
| 365 | |
Hanno Becker | af46c5f | 2019-02-26 13:50:21 +0000 | [diff] [blame] | 366 | #if defined(MBEDTLS_MEMORY_BACKTRACE) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 367 | #error "MBEDTLS_MEMORY_BACKTRACE defined, but not all prerequisites" |
Hanno Becker | af46c5f | 2019-02-26 13:50:21 +0000 | [diff] [blame] | 368 | #endif |
| 369 | |
Hanno Becker | bfaa718 | 2019-06-03 16:31:32 +0100 | [diff] [blame] | 370 | #if defined(MBEDTLS_MEMORY_DEBUG) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 371 | #error "MBEDTLS_MEMORY_DEBUG defined, but not all prerequisites" |
Hanno Becker | bfaa718 | 2019-06-03 16:31:32 +0100 | [diff] [blame] | 372 | #endif |
| 373 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 374 | #if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM) |
| 375 | #error "MBEDTLS_PADLOCK_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 376 | #endif |
| 377 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 378 | #if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C) |
| 379 | #error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 380 | #endif |
| 381 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 382 | #if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C) |
| 383 | #error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 384 | #endif |
| 385 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 386 | #if defined(MBEDTLS_PK_C) && \ |
| 387 | ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) ) |
| 388 | #error "MBEDTLS_PK_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 94de331 | 2015-01-28 16:32:36 +0000 | [diff] [blame] | 389 | #endif |
| 390 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 391 | #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C) |
| 392 | #error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 393 | #endif |
| 394 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 395 | #if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C) |
| 396 | #error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 397 | #endif |
| 398 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 399 | #if defined(MBEDTLS_PKCS11_C) && !defined(MBEDTLS_PK_C) |
| 400 | #error "MBEDTLS_PKCS11_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 401 | #endif |
| 402 | |
Manuel Pégourié-Gonnard | 320f4d9 | 2020-02-04 09:17:29 +0100 | [diff] [blame] | 403 | #if defined(MBEDTLS_PKCS11_C) |
| 404 | #if defined(MBEDTLS_DEPRECATED_REMOVED) |
| 405 | #error "MBEDTLS_PKCS11_C is deprecated and will be removed in a future version of Mbed TLS" |
| 406 | #elif defined(MBEDTLS_DEPRECATED_WARNING) |
| 407 | #warning "MBEDTLS_PKCS11_C is deprecated and will be removed in a future version of Mbed TLS" |
| 408 | #endif |
| 409 | #endif /* MBEDTLS_PKCS11_C */ |
| 410 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 411 | #if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 412 | #error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 413 | #endif |
| 414 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 415 | #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 416 | #error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 417 | #endif |
| 418 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 419 | #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\ |
| 420 | ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\ |
| 421 | defined(MBEDTLS_PLATFORM_EXIT_ALT) ) |
| 422 | #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] | 423 | #endif |
| 424 | |
Andres Amaya Garcia | 1e4ec66 | 2016-07-20 10:16:25 +0100 | [diff] [blame] | 425 | #if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\ |
| 426 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 427 | !defined(MBEDTLS_HAVE_TIME) ) |
| 428 | #error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites" |
| 429 | #endif |
| 430 | |
| 431 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ |
| 432 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 433 | !defined(MBEDTLS_HAVE_TIME) ) |
| 434 | #error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites" |
| 435 | #endif |
| 436 | |
| 437 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ |
| 438 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 439 | !defined(MBEDTLS_HAVE_TIME) ) |
| 440 | #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites" |
| 441 | #endif |
| 442 | |
| 443 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ |
| 444 | ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ |
| 445 | defined(MBEDTLS_PLATFORM_TIME_ALT) ) |
| 446 | #error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" |
| 447 | #endif |
| 448 | |
| 449 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ |
| 450 | ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ |
| 451 | defined(MBEDTLS_PLATFORM_TIME_ALT) ) |
| 452 | #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" |
| 453 | #endif |
| 454 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 455 | #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 456 | #error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 457 | #endif |
| 458 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 459 | #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 460 | #error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 461 | #endif |
| 462 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 463 | #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\ |
| 464 | ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\ |
| 465 | defined(MBEDTLS_PLATFORM_FPRINTF_ALT) ) |
| 466 | #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] | 467 | #endif |
| 468 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 469 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ |
| 470 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
| 471 | #error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +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_FREE_MACRO) &&\ |
| 475 | defined(MBEDTLS_PLATFORM_STD_FREE) |
| 476 | #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] | 477 | #endif |
| 478 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 479 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) |
| 480 | #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] | 481 | #endif |
| 482 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 483 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 484 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 485 | #error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 486 | #endif |
| 487 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 488 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ |
| 489 | defined(MBEDTLS_PLATFORM_STD_CALLOC) |
| 490 | #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] | 491 | #endif |
| 492 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 493 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) |
| 494 | #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] | 495 | #endif |
| 496 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 497 | #if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) |
| 498 | #error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 499 | #endif |
| 500 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 501 | #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 502 | #error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 503 | #endif |
| 504 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 505 | #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 506 | #error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 507 | #endif |
| 508 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 509 | #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\ |
| 510 | ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\ |
| 511 | defined(MBEDTLS_PLATFORM_PRINTF_ALT) ) |
| 512 | #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] | 513 | #endif |
| 514 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 515 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 516 | #error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 517 | #endif |
| 518 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 519 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 520 | #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 521 | #endif |
| 522 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 523 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\ |
| 524 | ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\ |
| 525 | defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) ) |
| 526 | #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] | 527 | #endif |
| 528 | |
Gilles Peskine | 9c764bf | 2022-09-18 14:05:23 +0200 | [diff] [blame] | 529 | #if defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 530 | #error "MBEDTLS_PLATFORM_VSNPRINTF_ALT defined, but not all prerequisites" |
| 531 | #endif |
| 532 | |
| 533 | #if defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 534 | #error "MBEDTLS_PLATFORM_VSNPRINTF_MACRO defined, but not all prerequisites" |
| 535 | #endif |
| 536 | |
| 537 | #if defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) &&\ |
| 538 | ( defined(MBEDTLS_PLATFORM_STD_VSNPRINTF) ||\ |
| 539 | defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) ) |
| 540 | #error "MBEDTLS_PLATFORM_VSNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_VSNPRINTF/MBEDTLS_PLATFORM_VSNPRINTF_ALT cannot be defined simultaneously" |
| 541 | #endif |
| 542 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 543 | #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\ |
| 544 | !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) |
| 545 | #error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 546 | #endif |
| 547 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 548 | #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) |
| 549 | #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 550 | #endif |
| 551 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 552 | #if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) |
| 553 | #error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 554 | #endif |
| 555 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 556 | #if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\ |
| 557 | !defined(MBEDTLS_PLATFORM_EXIT_ALT) |
| 558 | #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 559 | #endif |
| 560 | |
Andres Amaya Garcia | 1e4ec66 | 2016-07-20 10:16:25 +0100 | [diff] [blame] | 561 | #if defined(MBEDTLS_PLATFORM_STD_TIME) &&\ |
| 562 | ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\ |
| 563 | !defined(MBEDTLS_HAVE_TIME) ) |
| 564 | #error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites" |
| 565 | #endif |
| 566 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 567 | #if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\ |
| 568 | !defined(MBEDTLS_PLATFORM_FPRINTF_ALT) |
| 569 | #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 570 | #endif |
| 571 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 572 | #if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\ |
| 573 | !defined(MBEDTLS_PLATFORM_PRINTF_ALT) |
| 574 | #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 575 | #endif |
| 576 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 577 | #if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\ |
| 578 | !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) |
| 579 | #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 580 | #endif |
| 581 | |
Paul Bakker | cf0a9f9 | 2016-06-01 11:25:44 +0100 | [diff] [blame] | 582 | #if defined(MBEDTLS_ENTROPY_NV_SEED) &&\ |
| 583 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) ) |
| 584 | #error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites" |
| 585 | #endif |
| 586 | |
| 587 | #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\ |
| 588 | !defined(MBEDTLS_ENTROPY_NV_SEED) |
| 589 | #error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites" |
| 590 | #endif |
| 591 | |
| 592 | #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\ |
| 593 | !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) |
| 594 | #error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites" |
| 595 | #endif |
| 596 | |
| 597 | #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\ |
| 598 | !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) |
| 599 | #error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites" |
| 600 | #endif |
| 601 | |
| 602 | #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\ |
| 603 | ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\ |
| 604 | defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) |
| 605 | #error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously" |
| 606 | #endif |
| 607 | |
| 608 | #if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\ |
| 609 | ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\ |
| 610 | defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) |
| 611 | #error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously" |
| 612 | #endif |
| 613 | |
Gilles Peskine | f08b3f8 | 2020-11-13 17:36:48 +0100 | [diff] [blame] | 614 | #if defined(MBEDTLS_PSA_CRYPTO_C) && \ |
Gilles Peskine | 82e57d1 | 2020-11-13 21:31:17 +0100 | [diff] [blame] | 615 | !( ( ( defined(MBEDTLS_CTR_DRBG_C) || defined(MBEDTLS_HMAC_DRBG_C) ) && \ |
Gilles Peskine | f08b3f8 | 2020-11-13 17:36:48 +0100 | [diff] [blame] | 616 | defined(MBEDTLS_ENTROPY_C) ) || \ |
| 617 | defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) ) |
| 618 | #error "MBEDTLS_PSA_CRYPTO_C defined, but not all prerequisites (missing RNG)" |
Jaeden Amero | 484ee33 | 2018-10-25 17:38:05 +0100 | [diff] [blame] | 619 | #endif |
| 620 | |
Andrzej Kurek | c690523 | 2019-02-05 05:23:41 -0500 | [diff] [blame] | 621 | #if defined(MBEDTLS_PSA_CRYPTO_SPM) && !defined(MBEDTLS_PSA_CRYPTO_C) |
| 622 | #error "MBEDTLS_PSA_CRYPTO_SPM defined, but not all prerequisites" |
| 623 | #endif |
| 624 | |
Gilles Peskine | a8ade16 | 2019-06-26 11:24:49 +0200 | [diff] [blame] | 625 | #if defined(MBEDTLS_PSA_CRYPTO_SE_C) && \ |
| 626 | ! ( defined(MBEDTLS_PSA_CRYPTO_C) && \ |
| 627 | defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) ) |
| 628 | #error "MBEDTLS_PSA_CRYPTO_SE_C defined, but not all prerequisites" |
| 629 | #endif |
| 630 | |
Andrzej Kurek | c690523 | 2019-02-05 05:23:41 -0500 | [diff] [blame] | 631 | #if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \ |
Jaeden Amero | 57f4d9e | 2019-03-15 16:14:19 +0000 | [diff] [blame] | 632 | ! defined(MBEDTLS_PSA_CRYPTO_C) |
Andrzej Kurek | c690523 | 2019-02-05 05:23:41 -0500 | [diff] [blame] | 633 | #error "MBEDTLS_PSA_CRYPTO_STORAGE_C defined, but not all prerequisites" |
| 634 | #endif |
| 635 | |
Jaeden Amero | 57f4d9e | 2019-03-15 16:14:19 +0000 | [diff] [blame] | 636 | #if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ |
| 637 | !( defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \ |
| 638 | defined(MBEDTLS_ENTROPY_NV_SEED) ) |
| 639 | #error "MBEDTLS_PSA_INJECT_ENTROPY defined, but not all prerequisites" |
Andrzej Kurek | c690523 | 2019-02-05 05:23:41 -0500 | [diff] [blame] | 640 | #endif |
| 641 | |
Jaeden Amero | 57f4d9e | 2019-03-15 16:14:19 +0000 | [diff] [blame] | 642 | #if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ |
| 643 | !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) |
| 644 | #error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with actual entropy sources" |
| 645 | #endif |
| 646 | |
Gilles Peskine | 4fc21fd | 2020-11-13 18:47:18 +0100 | [diff] [blame] | 647 | #if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ |
Gilles Peskine | 89ffb28 | 2020-11-18 15:23:08 +0100 | [diff] [blame] | 648 | defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) |
Gilles Peskine | 4fc21fd | 2020-11-13 18:47:18 +0100 | [diff] [blame] | 649 | #error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG" |
| 650 | #endif |
| 651 | |
Jaeden Amero | 57f4d9e | 2019-03-15 16:14:19 +0000 | [diff] [blame] | 652 | #if defined(MBEDTLS_PSA_ITS_FILE_C) && \ |
| 653 | !defined(MBEDTLS_FS_IO) |
| 654 | #error "MBEDTLS_PSA_ITS_FILE_C defined, but not all prerequisites" |
Andrzej Kurek | c690523 | 2019-02-05 05:23:41 -0500 | [diff] [blame] | 655 | #endif |
| 656 | |
Ronald Cron | c3623db | 2020-10-29 10:51:32 +0100 | [diff] [blame] | 657 | #if defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER) && \ |
| 658 | defined(MBEDTLS_USE_PSA_CRYPTO) |
| 659 | #error "MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER defined, but it cannot coexist with MBEDTLS_USE_PSA_CRYPTO." |
| 660 | #endif |
| 661 | |
Andrzej Kurek | 1faa2a3 | 2022-01-27 11:00:24 -0500 | [diff] [blame] | 662 | #if defined(MBEDTLS_PK_C) && defined(MBEDTLS_USE_PSA_CRYPTO) && \ |
Andrzej Kurek | d08ed95 | 2022-01-27 11:03:09 -0500 | [diff] [blame] | 663 | !defined(MBEDTLS_PK_WRITE_C) && defined(MBEDTLS_ECDSA_C) |
Andrzej Kurek | 1faa2a3 | 2022-01-27 11:00:24 -0500 | [diff] [blame] | 664 | #error "MBEDTLS_PK_C in configuration with MBEDTLS_USE_PSA_CRYPTO and \ |
Andrzej Kurek | d08ed95 | 2022-01-27 11:03:09 -0500 | [diff] [blame] | 665 | MBEDTLS_ECDSA_C requires MBEDTLS_PK_WRITE_C to be defined." |
Andrzej Kurek | 1faa2a3 | 2022-01-27 11:00:24 -0500 | [diff] [blame] | 666 | #endif |
| 667 | |
Gilles Peskine | 8fb928f | 2022-10-25 20:24:29 +0200 | [diff] [blame] | 668 | #if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_RSA_C) && \ |
| 669 | !( defined(MBEDTLS_PK_PARSE_C) && defined(MBEDTLS_PK_WRITE_C) ) |
| 670 | #error "MBEDTLS_PSA_CRYPTO_C with MBEDTLS_RSA_C requires MBEDTLS_PK_PARSE_C and MBEDTLS_PK_WRITE_C" |
Andrzej Kurek | a16ffaf | 2022-01-28 09:03:03 -0500 | [diff] [blame] | 671 | #endif |
| 672 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 673 | #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ |
| 674 | !defined(MBEDTLS_OID_C) ) |
| 675 | #error "MBEDTLS_RSA_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 676 | #endif |
| 677 | |
Paul Bakker | 4fde40f | 2016-05-09 15:13:04 +0100 | [diff] [blame] | 678 | #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \ |
Paul Bakker | 37068a7 | 2016-05-09 14:36:33 +0100 | [diff] [blame] | 679 | !defined(MBEDTLS_PKCS1_V15) ) |
| 680 | #error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled" |
| 681 | #endif |
| 682 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 683 | #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \ |
| 684 | ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) ) |
| 685 | #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] | 686 | #endif |
| 687 | |
Manuel Pégourié-Gonnard | 1e6fb01 | 2020-01-07 11:00:34 +0100 | [diff] [blame] | 688 | #if defined(MBEDTLS_SHA512_NO_SHA384) && !defined(MBEDTLS_SHA512_C) |
| 689 | #error "MBEDTLS_SHA512_NO_SHA384 defined without MBEDTLS_SHA512_C" |
| 690 | #endif |
| 691 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 692 | #if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) || \ |
| 693 | !defined(MBEDTLS_SHA1_C) ) |
| 694 | #error "MBEDTLS_SSL_PROTO_SSL3 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 695 | #endif |
| 696 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 697 | #if defined(MBEDTLS_SSL_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) || \ |
| 698 | !defined(MBEDTLS_SHA1_C) ) |
| 699 | #error "MBEDTLS_SSL_PROTO_TLS1 defined, but not all prerequisites" |
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_SSL_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) || \ |
| 703 | !defined(MBEDTLS_SHA1_C) ) |
| 704 | #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] | 705 | #endif |
| 706 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 707 | #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \ |
| 708 | !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) ) |
| 709 | #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] | 710 | #endif |
| 711 | |
Hanno Becker | afca47a | 2020-06-02 07:51:26 +0100 | [diff] [blame] | 712 | #if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL) && ( !defined(MBEDTLS_HKDF_C) && \ |
Hanno Becker | 6055a17 | 2020-06-02 06:20:23 +0100 | [diff] [blame] | 713 | !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) ) |
| 714 | #error "MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL defined, but not all prerequisites" |
| 715 | #endif |
| 716 | |
Simon Butcher | 432e702 | 2019-04-11 18:56:18 +0100 | [diff] [blame] | 717 | #if (defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \ |
| 718 | defined(MBEDTLS_SSL_PROTO_TLS1_1) || defined(MBEDTLS_SSL_PROTO_TLS1_2)) && \ |
| 719 | !(defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ |
| 720 | defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ |
| 721 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ |
| 722 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ |
| 723 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ |
| 724 | defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \ |
| 725 | defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ |
| 726 | defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ |
| 727 | defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ |
| 728 | defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ |
| 729 | defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) ) |
| 730 | #error "One or more versions of the TLS protocol are enabled " \ |
| 731 | "but no key exchange methods defined with MBEDTLS_KEY_EXCHANGE_xxxx" |
| 732 | #endif |
| 733 | |
Manuel Pégourié-Gonnard | 5a8d56d | 2015-05-13 10:10:00 +0200 | [diff] [blame] | 734 | #if defined(MBEDTLS_SSL_PROTO_DTLS) && \ |
| 735 | !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 736 | !defined(MBEDTLS_SSL_PROTO_TLS1_2) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 737 | #error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 0b1ff29 | 2014-02-06 13:04:16 +0100 | [diff] [blame] | 738 | #endif |
| 739 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 740 | #if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C) |
| 741 | #error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 742 | #endif |
| 743 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 744 | #if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \ |
| 745 | !defined(MBEDTLS_MD_C) ) |
| 746 | #error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 747 | #endif |
| 748 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 749 | #if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C) |
| 750 | #error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 751 | #endif |
| 752 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 753 | #if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \ |
| 754 | !defined(MBEDTLS_SSL_PROTO_TLS1) && !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 755 | !defined(MBEDTLS_SSL_PROTO_TLS1_2)) |
| 756 | #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] | 757 | #endif |
| 758 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 759 | #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ |
| 760 | 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] | 761 | #error "Illegal protocol selection" |
| 762 | #endif |
| 763 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 764 | #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \ |
| 765 | 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] | 766 | #error "Illegal protocol selection" |
| 767 | #endif |
| 768 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 769 | #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ |
| 770 | defined(MBEDTLS_SSL_PROTO_TLS1_2) && (!defined(MBEDTLS_SSL_PROTO_TLS1) || \ |
| 771 | !defined(MBEDTLS_SSL_PROTO_TLS1_1))) |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 772 | #error "Illegal protocol selection" |
| 773 | #endif |
| 774 | |
Manuel Pégourié-Gonnard | e057d3b | 2015-05-20 10:59:43 +0200 | [diff] [blame] | 775 | #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] | 776 | #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] | 777 | #endif |
| 778 | |
Manuel Pégourié-Gonnard | 62c74bb | 2015-09-08 17:50:29 +0200 | [diff] [blame] | 779 | #if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \ |
Manuel Pégourié-Gonnard | ddfe5d2 | 2015-09-09 12:46:16 +0200 | [diff] [blame] | 780 | !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) |
Manuel Pégourié-Gonnard | 62c74bb | 2015-09-08 17:50:29 +0200 | [diff] [blame] | 781 | #error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites" |
| 782 | #endif |
| 783 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 784 | #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \ |
| 785 | ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) |
| 786 | #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] | 787 | #endif |
| 788 | |
Gilles Peskine | d3d0290 | 2020-03-04 21:35:27 +0100 | [diff] [blame] | 789 | #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ |
| 790 | ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) |
| 791 | #error "MBEDTLS_SSL_DTLS_CONNECTION_ID defined, but not all prerequisites" |
| 792 | #endif |
| 793 | |
| 794 | #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ |
| 795 | defined(MBEDTLS_SSL_CID_IN_LEN_MAX) && \ |
| 796 | MBEDTLS_SSL_CID_IN_LEN_MAX > 255 |
| 797 | #error "MBEDTLS_SSL_CID_IN_LEN_MAX too large (max 255)" |
| 798 | #endif |
| 799 | |
| 800 | #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ |
| 801 | defined(MBEDTLS_SSL_CID_OUT_LEN_MAX) && \ |
| 802 | MBEDTLS_SSL_CID_OUT_LEN_MAX > 255 |
| 803 | #error "MBEDTLS_SSL_CID_OUT_LEN_MAX too large (max 255)" |
| 804 | #endif |
| 805 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 806 | #if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) && \ |
| 807 | ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) |
| 808 | #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] | 809 | #endif |
| 810 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 811 | #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \ |
| 812 | !defined(MBEDTLS_SSL_PROTO_TLS1) && \ |
| 813 | !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 814 | !defined(MBEDTLS_SSL_PROTO_TLS1_2) |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 815 | #error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 816 | #endif |
| 817 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 818 | #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \ |
| 819 | !defined(MBEDTLS_SSL_PROTO_TLS1) && \ |
| 820 | !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ |
| 821 | !defined(MBEDTLS_SSL_PROTO_TLS1_2) |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 822 | #error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 769c6b6 | 2014-10-28 14:13:55 +0100 | [diff] [blame] | 823 | #endif |
| 824 | |
Manuel Pégourié-Gonnard | 4214e3a | 2015-05-25 19:34:49 +0200 | [diff] [blame] | 825 | #if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C) |
Manuel Pégourié-Gonnard | 0c0f11f | 2015-05-20 09:55:50 +0200 | [diff] [blame] | 826 | #error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 827 | #endif |
| 828 | |
Przemek Stekiel | 97d5740 | 2022-10-10 14:08:51 +0200 | [diff] [blame] | 829 | #if defined(MBEDTLS_SSL_TICKET_C) && \ |
| 830 | !( defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) ) |
| 831 | #error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites" |
| 832 | #endif |
| 833 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 834 | #if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) && \ |
| 835 | !defined(MBEDTLS_SSL_PROTO_SSL3) && !defined(MBEDTLS_SSL_PROTO_TLS1) |
| 836 | #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] | 837 | #endif |
| 838 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 839 | #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \ |
| 840 | !defined(MBEDTLS_X509_CRT_PARSE_C) |
| 841 | #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] | 842 | #endif |
| 843 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 844 | #if defined(MBEDTLS_THREADING_PTHREAD) |
| 845 | #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) |
| 846 | #error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 847 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 848 | #define MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 849 | #endif |
| 850 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 851 | #if defined(MBEDTLS_THREADING_ALT) |
| 852 | #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) |
| 853 | #error "MBEDTLS_THREADING_ALT defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 854 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 855 | #define MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 856 | #endif |
| 857 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 858 | #if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL) |
| 859 | #error "MBEDTLS_THREADING_C defined, single threading implementation required" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 860 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 861 | #undef MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 862 | |
Manuel Pégourié-Gonnard | aeefa49 | 2018-10-22 12:14:52 +0200 | [diff] [blame] | 863 | #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_PSA_CRYPTO_C) |
| 864 | #error "MBEDTLS_USE_PSA_CRYPTO defined, but not all prerequisites" |
| 865 | #endif |
| 866 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 867 | #if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C) |
| 868 | #error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 869 | #endif |
| 870 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 871 | #if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ |
| 872 | !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \ |
| 873 | !defined(MBEDTLS_PK_PARSE_C) ) |
| 874 | #error "MBEDTLS_X509_USE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 875 | #endif |
| 876 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 877 | #if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ |
| 878 | !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \ |
| 879 | !defined(MBEDTLS_PK_WRITE_C) ) |
| 880 | #error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 881 | #endif |
| 882 | |
Simon Butcher | 432e702 | 2019-04-11 18:56:18 +0100 | [diff] [blame] | 883 | #if defined(MBEDTLS_CERTS_C) && !defined(MBEDTLS_X509_USE_C) |
| 884 | #error "MBEDTLS_CERTS_C defined, but not all prerequisites" |
| 885 | #endif |
| 886 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 887 | #if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) |
| 888 | #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] | 889 | #endif |
| 890 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 891 | #if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) |
| 892 | #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] | 893 | #endif |
| 894 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 895 | #if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) |
| 896 | #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] | 897 | #endif |
| 898 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 899 | #if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) |
| 900 | #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] | 901 | #endif |
| 902 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 903 | #if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) |
| 904 | #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] | 905 | #endif |
| 906 | |
Andres Amaya Garcia | d7fce00 | 2017-07-20 11:49:32 +0100 | [diff] [blame] | 907 | #if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64) |
| 908 | #error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously" |
| 909 | #endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */ |
| 910 | |
Andres Amaya Garcia | 93db11a | 2017-07-20 12:11:19 +0100 | [diff] [blame] | 911 | #if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \ |
| 912 | defined(MBEDTLS_HAVE_ASM) |
Andres Amaya Garcia | b39467d | 2017-07-20 13:21:15 +0100 | [diff] [blame] | 913 | #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] | 914 | #endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */ |
| 915 | |
Andres Amaya Garcia | 88c2cc7 | 2018-11-29 09:56:02 +0000 | [diff] [blame] | 916 | #if defined(MBEDTLS_SSL_PROTO_SSL3) |
Andres Amaya Garcia | e58532e | 2018-12-05 20:29:07 +0000 | [diff] [blame] | 917 | #if defined(MBEDTLS_DEPRECATED_REMOVED) |
Andres Amaya Garcia | 835b299 | 2019-01-15 19:36:00 +0000 | [diff] [blame] | 918 | #error "MBEDTLS_SSL_PROTO_SSL3 is deprecated and will be removed in a future version of Mbed TLS" |
Andres Amaya Garcia | e58532e | 2018-12-05 20:29:07 +0000 | [diff] [blame] | 919 | #elif defined(MBEDTLS_DEPRECATED_WARNING) |
Andres Amaya Garcia | 835b299 | 2019-01-15 19:36:00 +0000 | [diff] [blame] | 920 | #warning "MBEDTLS_SSL_PROTO_SSL3 is deprecated and will be removed in a future version of Mbed TLS" |
Andres Amaya Garcia | 88c2cc7 | 2018-11-29 09:56:02 +0000 | [diff] [blame] | 921 | #endif |
| 922 | #endif /* MBEDTLS_SSL_PROTO_SSL3 */ |
| 923 | |
Andres Amaya Garcia | 0963424 | 2018-11-29 09:55:41 +0000 | [diff] [blame] | 924 | #if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO) |
Andres Amaya Garcia | e58532e | 2018-12-05 20:29:07 +0000 | [diff] [blame] | 925 | #if defined(MBEDTLS_DEPRECATED_REMOVED) |
Andres Amaya Garcia | 835b299 | 2019-01-15 19:36:00 +0000 | [diff] [blame] | 926 | #error "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO is deprecated and will be removed in a future version of Mbed TLS" |
Andres Amaya Garcia | e58532e | 2018-12-05 20:29:07 +0000 | [diff] [blame] | 927 | #elif defined(MBEDTLS_DEPRECATED_WARNING) |
Andres Amaya Garcia | 835b299 | 2019-01-15 19:36:00 +0000 | [diff] [blame] | 928 | #warning "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO is deprecated and will be removed in a future version of Mbed TLS" |
Andres Amaya Garcia | 0963424 | 2018-11-29 09:55:41 +0000 | [diff] [blame] | 929 | #endif |
| 930 | #endif /* MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO */ |
| 931 | |
Andres Amaya Garcia | 84b4e79 | 2018-12-05 22:39:38 +0000 | [diff] [blame] | 932 | #if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) |
| 933 | #if defined(MBEDTLS_DEPRECATED_REMOVED) |
Andres Amaya Garcia | da15409 | 2019-01-15 18:43:48 +0000 | [diff] [blame] | 934 | #error "MBEDTLS_SSL_HW_RECORD_ACCEL is deprecated and will be removed in a future version of Mbed TLS" |
Andres Amaya Garcia | 84b4e79 | 2018-12-05 22:39:38 +0000 | [diff] [blame] | 935 | #elif defined(MBEDTLS_DEPRECATED_WARNING) |
Andres Amaya Garcia | da15409 | 2019-01-15 18:43:48 +0000 | [diff] [blame] | 936 | #warning "MBEDTLS_SSL_HW_RECORD_ACCEL is deprecated and will be removed in a future version of Mbed TLS" |
Andres Amaya Garcia | 10edb3e | 2019-01-15 18:44:06 +0000 | [diff] [blame] | 937 | #endif /* MBEDTLS_DEPRECATED_REMOVED */ |
Andres Amaya Garcia | 84b4e79 | 2018-12-05 22:39:38 +0000 | [diff] [blame] | 938 | #endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */ |
| 939 | |
Ron Eldor | 3adb992 | 2017-12-21 10:15:08 +0200 | [diff] [blame] | 940 | #if defined(MBEDTLS_SSL_DTLS_SRTP) && ( !defined(MBEDTLS_SSL_PROTO_DTLS) ) |
| 941 | #error "MBEDTLS_SSL_DTLS_SRTP defined, but not all prerequisites" |
| 942 | #endif |
| 943 | |
Andrzej Kurek | 557289b | 2020-10-21 15:12:39 +0200 | [diff] [blame] | 944 | #if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH) && ( !defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) ) |
| 945 | #error "MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH defined, but not all prerequisites" |
| 946 | #endif |
| 947 | |
Przemek Stekiel | 864b43d | 2022-10-05 11:47:29 +0200 | [diff] [blame] | 948 | #if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) && !( defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) ) |
| 949 | #error "MBEDTLS_SSL_CONTEXT_SERIALIZATION defined, but not all prerequisites" |
| 950 | #endif |
| 951 | |
Manuel Pégourié-Gonnard | f78e4de | 2015-05-29 10:52:14 +0200 | [diff] [blame] | 952 | /* |
| 953 | * Avoid warning from -pedantic. This is a convenient place for this |
| 954 | * workaround since this is included by every single file before the |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 955 | * #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] | 956 | */ |
| 957 | typedef int mbedtls_iso_c_forbids_empty_translation_units; |
| 958 | |
David Horstmann | d2c83be | 2022-11-14 15:40:46 +0000 | [diff] [blame^] | 959 | /* *INDENT-ON* */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 960 | #endif /* MBEDTLS_CHECK_CONFIG_H */ |