1 /** 2 * \file check_config.h 3 * 4 * \brief Consistency checks for configuration options 5 */ 6 /* 7 * Copyright The Mbed TLS Contributors 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. 21 */ 22 23 #ifndef MBEDTLS_CHECK_CONFIG_H 24 #define MBEDTLS_CHECK_CONFIG_H 25 26 /* 27 * We assume CHAR_BIT is 8 in many places. In practice, this is true on our 28 * target platforms, so not an issue, but let's just be extra sure. 29 */ 30 #include <limits.h> 31 #if CHAR_BIT != 8 32 #error "mbed TLS requires a platform with 8-bit chars" 33 #endif 34 35 #if defined(_WIN32) 36 #if !defined(MBEDTLS_PLATFORM_C) 37 #error "MBEDTLS_PLATFORM_C is required on Windows" 38 #endif 39 40 /* Fix the config here. Not convenient to put an #ifdef _WIN32 in mbedtls_config.h as 41 * it would confuse config.py. */ 42 #if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ 43 !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) 44 #define MBEDTLS_PLATFORM_SNPRINTF_ALT 45 #endif 46 47 #if !defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) && \ 48 !defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) 49 #define MBEDTLS_PLATFORM_VSNPRINTF_ALT 50 #endif 51 #endif /* _WIN32 */ 52 53 #if defined(TARGET_LIKE_MBED) && defined(MBEDTLS_NET_C) 54 #error "The NET module is not available for mbed OS - please use the network functions provided by Mbed OS" 55 #endif 56 57 #if defined(MBEDTLS_DEPRECATED_WARNING) && \ 58 !defined(__GNUC__) && !defined(__clang__) 59 #error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang" 60 #endif 61 62 #if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME) 63 #error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" 64 #endif 65 66 #if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM) 67 #error "MBEDTLS_AESNI_C defined, but not all prerequisites" 68 #endif 69 70 #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) 71 #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" 72 #endif 73 74 #if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C) 75 #error "MBEDTLS_DHM_C defined, but not all prerequisites" 76 #endif 77 78 #if defined(MBEDTLS_CMAC_C) && \ 79 !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C) 80 #error "MBEDTLS_CMAC_C defined, but not all prerequisites" 81 #endif 82 83 #if defined(MBEDTLS_NIST_KW_C) && \ 84 ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) ) 85 #error "MBEDTLS_NIST_KW_C defined, but not all prerequisites" 86 #endif 87 88 #if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C) 89 #error "MBEDTLS_ECDH_C defined, but not all prerequisites" 90 #endif 91 92 #if defined(MBEDTLS_ECDSA_C) && \ 93 ( !defined(MBEDTLS_ECP_C) || \ 94 !( defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) || \ 95 defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) || \ 96 defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) || \ 97 defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) || \ 98 defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) || \ 99 defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) || \ 100 defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) || \ 101 defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) || \ 102 defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) || \ 103 defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) || \ 104 defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) ) || \ 105 !defined(MBEDTLS_ASN1_PARSE_C) || \ 106 !defined(MBEDTLS_ASN1_WRITE_C) ) 107 #error "MBEDTLS_ECDSA_C defined, but not all prerequisites" 108 #endif 109 110 #if defined(MBEDTLS_ECJPAKE_C) && \ 111 ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) ) 112 #error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites" 113 #endif 114 115 #if defined(MBEDTLS_ECP_RESTARTABLE) && \ 116 ( defined(MBEDTLS_USE_PSA_CRYPTO) || \ 117 defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ 118 defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \ 119 defined(MBEDTLS_ECDSA_SIGN_ALT) || \ 120 defined(MBEDTLS_ECDSA_VERIFY_ALT) || \ 121 defined(MBEDTLS_ECDSA_GENKEY_ALT) || \ 122 defined(MBEDTLS_ECP_INTERNAL_ALT) || \ 123 defined(MBEDTLS_ECP_ALT) ) 124 #error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative or PSA-based ECP implementation" 125 #endif 126 127 #if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C) 128 #error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites" 129 #endif 130 131 #if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \ 132 !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \ 133 !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \ 134 !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \ 135 !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \ 136 !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \ 137 !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \ 138 !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \ 139 !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \ 140 !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \ 141 !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \ 142 !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) && \ 143 !defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) && \ 144 !defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) ) ) 145 #error "MBEDTLS_ECP_C defined, but not all prerequisites" 146 #endif 147 148 #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C) 149 #error "MBEDTLS_PK_PARSE_C defined, but not all prerequesites" 150 #endif 151 152 #if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \ 153 !defined(MBEDTLS_SHA256_C)) 154 #error "MBEDTLS_ENTROPY_C defined, but not all prerequisites" 155 #endif 156 #if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \ 157 defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64) 158 #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" 159 #endif 160 #if defined(MBEDTLS_ENTROPY_C) && \ 161 ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \ 162 && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32) 163 #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" 164 #endif 165 #if defined(MBEDTLS_ENTROPY_C) && \ 166 defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C) 167 #error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" 168 #endif 169 170 #if defined(__has_feature) 171 #if __has_feature(memory_sanitizer) 172 #define MBEDTLS_HAS_MEMSAN 173 #endif 174 #endif 175 #if defined(MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN) && !defined(MBEDTLS_HAS_MEMSAN) 176 #error "MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN requires building with MemorySanitizer" 177 #endif 178 #undef MBEDTLS_HAS_MEMSAN 179 180 #if defined(MBEDTLS_GCM_C) && ( \ 181 !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) && !defined(MBEDTLS_ARIA_C) ) 182 #error "MBEDTLS_GCM_C defined, but not all prerequisites" 183 #endif 184 185 #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 186 #error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites" 187 #endif 188 189 #if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 190 #error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites" 191 #endif 192 193 #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 194 #error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites" 195 #endif 196 197 #if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 198 #error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites" 199 #endif 200 201 #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 202 #error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites" 203 #endif 204 205 #if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 206 #error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites" 207 #endif 208 209 #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 210 #error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites" 211 #endif 212 213 #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 214 #error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites" 215 #endif 216 217 #if defined(MBEDTLS_ECP_NO_FALLBACK) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 218 #error "MBEDTLS_ECP_NO_FALLBACK defined, but no alternative implementation enabled" 219 #endif 220 221 #if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C) 222 #error "MBEDTLS_HKDF_C defined, but not all prerequisites" 223 #endif 224 225 #if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C) 226 #error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites" 227 #endif 228 229 #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ 230 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ 231 !defined(MBEDTLS_X509_CRT_PARSE_C) ) 232 #error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites" 233 #endif 234 235 #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ 236 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \ 237 !defined(MBEDTLS_X509_CRT_PARSE_C) ) 238 #error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites" 239 #endif 240 241 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C) 242 #error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites" 243 #endif 244 245 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ 246 !defined(MBEDTLS_ECDH_C) 247 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites" 248 #endif 249 250 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ 251 ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \ 252 !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) 253 #error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites" 254 #endif 255 256 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ 257 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \ 258 !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) 259 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites" 260 #endif 261 262 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ 263 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ 264 !defined(MBEDTLS_X509_CRT_PARSE_C) ) 265 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites" 266 #endif 267 268 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ 269 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ 270 !defined(MBEDTLS_PKCS1_V15) ) 271 #error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites" 272 #endif 273 274 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \ 275 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ 276 !defined(MBEDTLS_PKCS1_V15) ) 277 #error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites" 278 #endif 279 280 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ 281 ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) || \ 282 !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) ) 283 #error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites" 284 #endif 285 286 #if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) && \ 287 !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) && \ 288 ( !defined(MBEDTLS_SHA256_C) && \ 289 !defined(MBEDTLS_SHA512_C) && \ 290 !defined(MBEDTLS_SHA1_C) ) 291 #error "!MBEDTLS_SSL_KEEP_PEER_CERTIFICATE requires MBEDTLS_SHA512_C, MBEDTLS_SHA256_C or MBEDTLS_SHA1_C" 292 #endif 293 294 #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ 295 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) 296 #error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" 297 #endif 298 299 #if defined(MBEDTLS_MEMORY_BACKTRACE) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) 300 #error "MBEDTLS_MEMORY_BACKTRACE defined, but not all prerequesites" 301 #endif 302 303 #if defined(MBEDTLS_MEMORY_DEBUG) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) 304 #error "MBEDTLS_MEMORY_DEBUG defined, but not all prerequesites" 305 #endif 306 307 #if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM) 308 #error "MBEDTLS_PADLOCK_C defined, but not all prerequisites" 309 #endif 310 311 #if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C) 312 #error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites" 313 #endif 314 315 #if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C) 316 #error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites" 317 #endif 318 319 #if defined(MBEDTLS_PK_C) && \ 320 ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) ) 321 #error "MBEDTLS_PK_C defined, but not all prerequisites" 322 #endif 323 324 #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C) 325 #error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" 326 #endif 327 328 #if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C) 329 #error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" 330 #endif 331 332 #if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) 333 #error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" 334 #endif 335 336 #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C) 337 #error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites" 338 #endif 339 340 #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\ 341 ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\ 342 defined(MBEDTLS_PLATFORM_EXIT_ALT) ) 343 #error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously" 344 #endif 345 346 #if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\ 347 ( !defined(MBEDTLS_PLATFORM_C) ||\ 348 !defined(MBEDTLS_HAVE_TIME) ) 349 #error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites" 350 #endif 351 352 #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ 353 ( !defined(MBEDTLS_PLATFORM_C) ||\ 354 !defined(MBEDTLS_HAVE_TIME) ) 355 #error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites" 356 #endif 357 358 #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ 359 ( !defined(MBEDTLS_PLATFORM_C) ||\ 360 !defined(MBEDTLS_HAVE_TIME) ) 361 #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites" 362 #endif 363 364 #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ 365 ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ 366 defined(MBEDTLS_PLATFORM_TIME_ALT) ) 367 #error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" 368 #endif 369 370 #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ 371 ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ 372 defined(MBEDTLS_PLATFORM_TIME_ALT) ) 373 #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" 374 #endif 375 376 #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) 377 #error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" 378 #endif 379 380 #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) 381 #error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites" 382 #endif 383 384 #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\ 385 ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\ 386 defined(MBEDTLS_PLATFORM_FPRINTF_ALT) ) 387 #error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously" 388 #endif 389 390 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ 391 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) 392 #error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites" 393 #endif 394 395 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ 396 defined(MBEDTLS_PLATFORM_STD_FREE) 397 #error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously" 398 #endif 399 400 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) 401 #error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is" 402 #endif 403 404 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ 405 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) 406 #error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" 407 #endif 408 409 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ 410 defined(MBEDTLS_PLATFORM_STD_CALLOC) 411 #error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously" 412 #endif 413 414 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) 415 #error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is" 416 #endif 417 418 #if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) 419 #error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites" 420 #endif 421 422 #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) 423 #error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites" 424 #endif 425 426 #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) 427 #error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites" 428 #endif 429 430 #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\ 431 ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\ 432 defined(MBEDTLS_PLATFORM_PRINTF_ALT) ) 433 #error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously" 434 #endif 435 436 #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) 437 #error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" 438 #endif 439 440 #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) 441 #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites" 442 #endif 443 444 #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\ 445 ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\ 446 defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) ) 447 #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously" 448 #endif 449 450 #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\ 451 !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) 452 #error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" 453 #endif 454 455 #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) 456 #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" 457 #endif 458 459 #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) 460 #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" 461 #endif 462 463 #if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) 464 #error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites" 465 #endif 466 467 #if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\ 468 !defined(MBEDTLS_PLATFORM_EXIT_ALT) 469 #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" 470 #endif 471 472 #if defined(MBEDTLS_PLATFORM_STD_TIME) &&\ 473 ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\ 474 !defined(MBEDTLS_HAVE_TIME) ) 475 #error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites" 476 #endif 477 478 #if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\ 479 !defined(MBEDTLS_PLATFORM_FPRINTF_ALT) 480 #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" 481 #endif 482 483 #if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\ 484 !defined(MBEDTLS_PLATFORM_PRINTF_ALT) 485 #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" 486 #endif 487 488 #if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\ 489 !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) 490 #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" 491 #endif 492 493 #if defined(MBEDTLS_ENTROPY_NV_SEED) &&\ 494 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) ) 495 #error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites" 496 #endif 497 498 #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\ 499 !defined(MBEDTLS_ENTROPY_NV_SEED) 500 #error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites" 501 #endif 502 503 #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\ 504 !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) 505 #error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites" 506 #endif 507 508 #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\ 509 !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) 510 #error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites" 511 #endif 512 513 #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\ 514 ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\ 515 defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) 516 #error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously" 517 #endif 518 519 #if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\ 520 ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\ 521 defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) 522 #error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously" 523 #endif 524 525 #if defined(MBEDTLS_PSA_CRYPTO_C) && \ 526 !( ( ( defined(MBEDTLS_CTR_DRBG_C) || defined(MBEDTLS_HMAC_DRBG_C) ) && \ 527 defined(MBEDTLS_ENTROPY_C) ) || \ 528 defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) ) 529 #error "MBEDTLS_PSA_CRYPTO_C defined, but not all prerequisites (missing RNG)" 530 #endif 531 532 #if defined(MBEDTLS_PSA_CRYPTO_SPM) && !defined(MBEDTLS_PSA_CRYPTO_C) 533 #error "MBEDTLS_PSA_CRYPTO_SPM defined, but not all prerequisites" 534 #endif 535 536 #if defined(MBEDTLS_PSA_CRYPTO_SE_C) && \ 537 ! ( defined(MBEDTLS_PSA_CRYPTO_C) && \ 538 defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) ) 539 #error "MBEDTLS_PSA_CRYPTO_SE_C defined, but not all prerequisites" 540 #endif 541 542 #if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \ 543 ! defined(MBEDTLS_PSA_CRYPTO_C) 544 #error "MBEDTLS_PSA_CRYPTO_STORAGE_C defined, but not all prerequisites" 545 #endif 546 547 #if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ 548 !( defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \ 549 defined(MBEDTLS_ENTROPY_NV_SEED) ) 550 #error "MBEDTLS_PSA_INJECT_ENTROPY defined, but not all prerequisites" 551 #endif 552 553 #if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ 554 !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) 555 #error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with actual entropy sources" 556 #endif 557 558 #if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ 559 defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) 560 #error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG" 561 #endif 562 563 #if defined(MBEDTLS_PSA_ITS_FILE_C) && \ 564 !defined(MBEDTLS_FS_IO) 565 #error "MBEDTLS_PSA_ITS_FILE_C defined, but not all prerequisites" 566 #endif 567 568 #if defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER) && \ 569 defined(MBEDTLS_USE_PSA_CRYPTO) 570 #error "MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER defined, but it cannot coexist with MBEDTLS_USE_PSA_CRYPTO." 571 #endif 572 573 #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ 574 !defined(MBEDTLS_OID_C) ) 575 #error "MBEDTLS_RSA_C defined, but not all prerequisites" 576 #endif 577 578 #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \ 579 !defined(MBEDTLS_PKCS1_V15) ) 580 #error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled" 581 #endif 582 583 #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \ 584 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) ) 585 #error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites" 586 #endif 587 588 #if defined(MBEDTLS_SHA384_C) && !defined(MBEDTLS_SHA512_C) 589 #error "MBEDTLS_SHA384_C defined without MBEDTLS_SHA512_C" 590 #endif 591 592 #if defined(MBEDTLS_SHA224_C) && !defined(MBEDTLS_SHA256_C) 593 #error "MBEDTLS_SHA224_C defined without MBEDTLS_SHA256_C" 594 #endif 595 596 #if defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA224_C) 597 #error "MBEDTLS_SHA256_C defined without MBEDTLS_SHA224_C" 598 #endif 599 600 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \ 601 !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) ) 602 #error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites" 603 #endif 604 605 #if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL) && ( !defined(MBEDTLS_HKDF_C) && \ 606 !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) ) 607 #error "MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL defined, but not all prerequisites" 608 #endif 609 610 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ 611 !(defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ 612 defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ 613 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ 614 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ 615 defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ 616 defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \ 617 defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ 618 defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ 619 defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ 620 defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ 621 defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) ) 622 #error "One or more versions of the TLS protocol are enabled " \ 623 "but no key exchange methods defined with MBEDTLS_KEY_EXCHANGE_xxxx" 624 #endif 625 626 #if defined(MBEDTLS_SSL_PROTO_DTLS) && \ 627 !defined(MBEDTLS_SSL_PROTO_TLS1_2) 628 #error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites" 629 #endif 630 631 #if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C) 632 #error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites" 633 #endif 634 635 #if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \ 636 !defined(MBEDTLS_MD_C) ) 637 #error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites" 638 #endif 639 640 #if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C) 641 #error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites" 642 #endif 643 644 #if defined(MBEDTLS_SSL_TLS_C) && !defined(MBEDTLS_SSL_PROTO_TLS1_2) 645 #error "MBEDTLS_SSL_TLS_C defined, but no protocols are active" 646 #endif 647 648 #if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS) 649 #error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites" 650 #endif 651 652 #if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \ 653 !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) 654 #error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites" 655 #endif 656 657 #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \ 658 ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) 659 #error "MBEDTLS_SSL_DTLS_ANTI_REPLAY defined, but not all prerequisites" 660 #endif 661 662 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ 663 ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) 664 #error "MBEDTLS_SSL_DTLS_CONNECTION_ID defined, but not all prerequisites" 665 #endif 666 667 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ 668 defined(MBEDTLS_SSL_CID_IN_LEN_MAX) && \ 669 MBEDTLS_SSL_CID_IN_LEN_MAX > 255 670 #error "MBEDTLS_SSL_CID_IN_LEN_MAX too large (max 255)" 671 #endif 672 673 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ 674 defined(MBEDTLS_SSL_CID_OUT_LEN_MAX) && \ 675 MBEDTLS_SSL_CID_OUT_LEN_MAX > 255 676 #error "MBEDTLS_SSL_CID_OUT_LEN_MAX too large (max 255)" 677 #endif 678 679 #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \ 680 !defined(MBEDTLS_SSL_PROTO_TLS1_2) 681 #error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites" 682 #endif 683 684 #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \ 685 !defined(MBEDTLS_SSL_PROTO_TLS1_2) 686 #error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites" 687 #endif 688 689 #if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C) 690 #error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites" 691 #endif 692 693 #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \ 694 !defined(MBEDTLS_X509_CRT_PARSE_C) 695 #error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites" 696 #endif 697 698 #if defined(MBEDTLS_THREADING_PTHREAD) 699 #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) 700 #error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites" 701 #endif 702 #define MBEDTLS_THREADING_IMPL 703 #endif 704 705 #if defined(MBEDTLS_THREADING_ALT) 706 #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) 707 #error "MBEDTLS_THREADING_ALT defined, but not all prerequisites" 708 #endif 709 #define MBEDTLS_THREADING_IMPL 710 #endif 711 712 #if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL) 713 #error "MBEDTLS_THREADING_C defined, single threading implementation required" 714 #endif 715 #undef MBEDTLS_THREADING_IMPL 716 717 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_PSA_CRYPTO_C) 718 #error "MBEDTLS_USE_PSA_CRYPTO defined, but not all prerequisites" 719 #endif 720 721 #if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C) 722 #error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites" 723 #endif 724 725 #if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ 726 !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \ 727 !defined(MBEDTLS_PK_PARSE_C) ) 728 #error "MBEDTLS_X509_USE_C defined, but not all prerequisites" 729 #endif 730 731 #if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ 732 !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \ 733 !defined(MBEDTLS_PK_WRITE_C) ) 734 #error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites" 735 #endif 736 737 #if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) 738 #error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites" 739 #endif 740 741 #if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) 742 #error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites" 743 #endif 744 745 #if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) 746 #error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites" 747 #endif 748 749 #if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) 750 #error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites" 751 #endif 752 753 #if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) 754 #error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites" 755 #endif 756 757 #if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64) 758 #error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously" 759 #endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */ 760 761 #if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \ 762 defined(MBEDTLS_HAVE_ASM) 763 #error "MBEDTLS_HAVE_INT32/MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously" 764 #endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */ 765 766 #if defined(MBEDTLS_SSL_DTLS_SRTP) && ( !defined(MBEDTLS_SSL_PROTO_DTLS) ) 767 #error "MBEDTLS_SSL_DTLS_SRTP defined, but not all prerequisites" 768 #endif 769 770 #if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH) && ( !defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) ) 771 #error "MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH defined, but not all prerequisites" 772 #endif 773 774 775 776 /* Reject attempts to enable options that have been removed and that could 777 * cause a build to succeed but with features removed. */ 778 779 #if defined(MBEDTLS_HAVEGE_C) //no-check-names 780 #error "MBEDTLS_HAVEGE_C was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/2599" 781 #endif 782 783 #if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) //no-check-names 784 #error "MBEDTLS_SSL_HW_RECORD_ACCEL was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4031" 785 #endif 786 787 #if defined(MBEDTLS_SSL_PROTO_SSL3) //no-check-names 788 #error "MBEDTLS_SSL_PROTO_SSL3 (SSL v3.0 support) was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4031" 789 #endif 790 791 #if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO) //no-check-names 792 #error "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO (SSL v2 ClientHello support) was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4031" 793 #endif 794 795 #if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) //no-check-names 796 #error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT (compatibility with the buggy implementation of truncated HMAC in Mbed TLS up to 2.7) was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4031" 797 #endif 798 799 #if defined(MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES) //no-check-names 800 #error "MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES was removed in Mbed TLS 3.0. See the ChangeLog entry if you really need SHA-1-signed certificates." 801 #endif 802 803 #if defined(MBEDTLS_ZLIB_SUPPORT) //no-check-names 804 #error "MBEDTLS_ZLIB_SUPPORT was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4031" 805 #endif 806 807 #if defined(MBEDTLS_SSL_PROTO_TLS1) //no-check-names 808 #error "MBEDTLS_SSL_PROTO_TLS1 (TLS v1.0 support) was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4286" 809 #endif 810 811 #if defined(MBEDTLS_SSL_PROTO_TLS1_1) //no-check-names 812 #error "MBEDTLS_SSL_PROTO_TLS1_1 (TLS v1.1 support) was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4286" 813 #endif 814 815 #if defined(MBEDTLS_CHECK_PARAMS) //no-check-names 816 #error "MBEDTLS_CHECK_PARAMS was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4313" 817 #endif 818 819 #if defined(MBEDTLS_SSL_CID_PADDING_GRANULARITY) //no-check-names 820 #error "MBEDTLS_SSL_CID_PADDING_GRANULARITY was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4335" 821 #endif 822 823 #if defined(MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY) //no-check-names 824 #error "MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4335" 825 #endif 826 827 #if defined(MBEDTLS_SSL_TRUNCATED_HMAC) //no-check-names 828 #error "MBEDTLS_SSL_TRUNCATED_HMAC was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4341" 829 #endif 830 831 /* 832 * Avoid warning from -pedantic. This is a convenient place for this 833 * workaround since this is included by every single file before the 834 * #if defined(MBEDTLS_xxx_C) that results in empty translation units. 835 */ 836 typedef int mbedtls_iso_c_forbids_empty_translation_units; 837 838 #endif /* MBEDTLS_CHECK_CONFIG_H */ 839