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