30 #ifndef MBEDTLS_CHECK_CONFIG_H 31 #define MBEDTLS_CHECK_CONFIG_H 39 #error "mbed TLS requires a platform with 8-bit chars" 43 #if !defined(MBEDTLS_PLATFORM_C) 44 #error "MBEDTLS_PLATFORM_C is required on Windows" 49 #if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ 50 !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) 51 #define MBEDTLS_PLATFORM_SNPRINTF_ALT 55 #if defined(TARGET_LIKE_MBED) && \ 56 ( defined(MBEDTLS_NET_C) || defined(MBEDTLS_TIMING_C) ) 57 #error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS" 60 #if defined(MBEDTLS_DEPRECATED_WARNING) && \ 61 !defined(__GNUC__) && !defined(__clang__) 62 #error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang" 65 #if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME) 66 #error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" 69 #if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM) 70 #error "MBEDTLS_AESNI_C defined, but not all prerequisites" 73 #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) 74 #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" 77 #if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C) 78 #error "MBEDTLS_DHM_C defined, but not all prerequisites" 81 #if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) && !defined(MBEDTLS_SSL_TRUNCATED_HMAC) 82 #error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT defined, but not all prerequisites" 85 #if defined(MBEDTLS_CMAC_C) && \ 86 !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C) 87 #error "MBEDTLS_CMAC_C defined, but not all prerequisites" 90 #if defined(MBEDTLS_NIST_KW_C) && \ 91 ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) ) 92 #error "MBEDTLS_NIST_KW_C defined, but not all prerequisites" 95 #if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C) 96 #error "MBEDTLS_ECDH_C defined, but not all prerequisites" 99 #if defined(MBEDTLS_ECDSA_C) && \ 100 ( !defined(MBEDTLS_ECP_C) || \ 101 !defined(MBEDTLS_ASN1_PARSE_C) || \ 102 !defined(MBEDTLS_ASN1_WRITE_C) ) 103 #error "MBEDTLS_ECDSA_C defined, but not all prerequisites" 106 #if defined(MBEDTLS_ECJPAKE_C) && \ 107 ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) ) 108 #error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites" 111 #if defined(MBEDTLS_ECP_RESTARTABLE) && \ 112 ( defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ 113 defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \ 114 defined(MBEDTLS_ECDSA_SIGN_ALT) || \ 115 defined(MBEDTLS_ECDSA_VERIFY_ALT) || \ 116 defined(MBEDTLS_ECDSA_GENKEY_ALT) || \ 117 defined(MBEDTLS_ECP_INTERNAL_ALT) || \ 118 defined(MBEDTLS_ECP_ALT) ) 119 #error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative ECP implementation" 122 #if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C) 123 #error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites" 126 #if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \ 127 !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \ 128 !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \ 129 !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \ 130 !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \ 131 !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \ 132 !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \ 133 !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \ 134 !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \ 135 !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \ 136 !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \ 137 !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) ) ) 138 #error "MBEDTLS_ECP_C defined, but not all prerequisites" 141 #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C) 142 #error "MBEDTLS_PK_PARSE_C defined, but not all prerequesites" 145 #if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \ 146 !defined(MBEDTLS_SHA256_C)) 147 #error "MBEDTLS_ENTROPY_C defined, but not all prerequisites" 149 #if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \ 150 defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64) 151 #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" 153 #if defined(MBEDTLS_ENTROPY_C) && \ 154 ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \ 155 && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32) 156 #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" 158 #if defined(MBEDTLS_ENTROPY_C) && \ 159 defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C) 160 #error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" 163 #if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ 164 ( !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) ) 165 #error "MBEDTLS_TEST_NULL_ENTROPY defined, but not all prerequisites" 167 #if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ 168 ( defined(MBEDTLS_ENTROPY_NV_SEED) || defined(MBEDTLS_ENTROPY_HARDWARE_ALT) || \ 169 defined(MBEDTLS_HAVEGE_C) ) 170 #error "MBEDTLS_TEST_NULL_ENTROPY defined, but entropy sources too" 173 #if defined(MBEDTLS_GCM_C) && ( \ 174 !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) ) 175 #error "MBEDTLS_GCM_C defined, but not all prerequisites" 178 #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 179 #error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites" 182 #if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 183 #error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites" 186 #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 187 #error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites" 190 #if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 191 #error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites" 194 #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 195 #error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites" 198 #if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 199 #error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites" 202 #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 203 #error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites" 206 #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) 207 #error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites" 210 #if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C) 211 #error "MBEDTLS_HAVEGE_C defined, but not all prerequisites" 214 #if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C) 215 #error "MBEDTLS_HKDF_C defined, but not all prerequisites" 218 #if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C) 219 #error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites" 222 #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ 223 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) ) 224 #error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites" 227 #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ 228 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) ) 229 #error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites" 232 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C) 233 #error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites" 236 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ 237 !defined(MBEDTLS_ECDH_C) 238 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites" 241 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ 242 ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \ 243 !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) 244 #error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites" 247 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ 248 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \ 249 !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) 250 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites" 253 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ 254 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ 255 !defined(MBEDTLS_X509_CRT_PARSE_C) ) 256 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites" 259 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ 260 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ 261 !defined(MBEDTLS_PKCS1_V15) ) 262 #error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites" 265 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \ 266 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ 267 !defined(MBEDTLS_PKCS1_V15) ) 268 #error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites" 271 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ 272 ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) || \ 273 !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) ) 274 #error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites" 277 #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ 278 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) 279 #error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" 282 #if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM) 283 #error "MBEDTLS_PADLOCK_C defined, but not all prerequisites" 286 #if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C) 287 #error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites" 290 #if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C) 291 #error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites" 294 #if defined(MBEDTLS_PK_C) && \ 295 ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) ) 296 #error "MBEDTLS_PK_C defined, but not all prerequisites" 299 #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C) 300 #error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" 303 #if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C) 304 #error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" 307 #if defined(MBEDTLS_PKCS11_C) && !defined(MBEDTLS_PK_C) 308 #error "MBEDTLS_PKCS11_C defined, but not all prerequisites" 311 #if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) 312 #error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" 315 #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C) 316 #error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites" 319 #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\ 320 ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\ 321 defined(MBEDTLS_PLATFORM_EXIT_ALT) ) 322 #error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously" 325 #if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\ 326 ( !defined(MBEDTLS_PLATFORM_C) ||\ 327 !defined(MBEDTLS_HAVE_TIME) ) 328 #error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites" 331 #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ 332 ( !defined(MBEDTLS_PLATFORM_C) ||\ 333 !defined(MBEDTLS_HAVE_TIME) ) 334 #error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites" 337 #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ 338 ( !defined(MBEDTLS_PLATFORM_C) ||\ 339 !defined(MBEDTLS_HAVE_TIME) ) 340 #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites" 343 #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ 344 ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ 345 defined(MBEDTLS_PLATFORM_TIME_ALT) ) 346 #error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" 349 #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ 350 ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ 351 defined(MBEDTLS_PLATFORM_TIME_ALT) ) 352 #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" 355 #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) 356 #error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" 359 #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) 360 #error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites" 363 #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\ 364 ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\ 365 defined(MBEDTLS_PLATFORM_FPRINTF_ALT) ) 366 #error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously" 369 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ 370 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) 371 #error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites" 374 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ 375 defined(MBEDTLS_PLATFORM_STD_FREE) 376 #error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously" 379 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) 380 #error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is" 383 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ 384 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) 385 #error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" 388 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ 389 defined(MBEDTLS_PLATFORM_STD_CALLOC) 390 #error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously" 393 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) 394 #error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is" 397 #if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) 398 #error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites" 401 #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) 402 #error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites" 405 #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) 406 #error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites" 409 #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\ 410 ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\ 411 defined(MBEDTLS_PLATFORM_PRINTF_ALT) ) 412 #error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously" 415 #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) 416 #error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" 419 #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) 420 #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites" 423 #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\ 424 ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\ 425 defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) ) 426 #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously" 429 #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\ 430 !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) 431 #error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" 434 #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) 435 #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" 438 #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) 439 #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" 442 #if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) 443 #error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites" 446 #if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\ 447 !defined(MBEDTLS_PLATFORM_EXIT_ALT) 448 #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" 451 #if defined(MBEDTLS_PLATFORM_STD_TIME) &&\ 452 ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\ 453 !defined(MBEDTLS_HAVE_TIME) ) 454 #error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites" 457 #if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\ 458 !defined(MBEDTLS_PLATFORM_FPRINTF_ALT) 459 #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" 462 #if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\ 463 !defined(MBEDTLS_PLATFORM_PRINTF_ALT) 464 #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" 467 #if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\ 468 !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) 469 #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" 472 #if defined(MBEDTLS_ENTROPY_NV_SEED) &&\ 473 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) ) 474 #error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites" 477 #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\ 478 !defined(MBEDTLS_ENTROPY_NV_SEED) 479 #error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites" 482 #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\ 483 !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) 484 #error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites" 487 #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\ 488 !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) 489 #error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites" 492 #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\ 493 ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\ 494 defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) 495 #error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously" 498 #if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\ 499 ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\ 500 defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) 501 #error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously" 504 #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ 505 !defined(MBEDTLS_OID_C) ) 506 #error "MBEDTLS_RSA_C defined, but not all prerequisites" 509 #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \ 510 !defined(MBEDTLS_PKCS1_V15) ) 511 #error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled" 514 #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \ 515 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) ) 516 #error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites" 519 #if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) || \ 520 !defined(MBEDTLS_SHA1_C) ) 521 #error "MBEDTLS_SSL_PROTO_SSL3 defined, but not all prerequisites" 524 #if defined(MBEDTLS_SSL_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) || \ 525 !defined(MBEDTLS_SHA1_C) ) 526 #error "MBEDTLS_SSL_PROTO_TLS1 defined, but not all prerequisites" 529 #if defined(MBEDTLS_SSL_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) || \ 530 !defined(MBEDTLS_SHA1_C) ) 531 #error "MBEDTLS_SSL_PROTO_TLS1_1 defined, but not all prerequisites" 534 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \ 535 !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) ) 536 #error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites" 539 #if defined(MBEDTLS_SSL_PROTO_DTLS) && \ 540 !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ 541 !defined(MBEDTLS_SSL_PROTO_TLS1_2) 542 #error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites" 545 #if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C) 546 #error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites" 549 #if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \ 550 !defined(MBEDTLS_MD_C) ) 551 #error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites" 554 #if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C) 555 #error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites" 558 #if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \ 559 !defined(MBEDTLS_SSL_PROTO_TLS1) && !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ 560 !defined(MBEDTLS_SSL_PROTO_TLS1_2)) 561 #error "MBEDTLS_SSL_TLS_C defined, but no protocols are active" 564 #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ 565 defined(MBEDTLS_SSL_PROTO_TLS1_1) && !defined(MBEDTLS_SSL_PROTO_TLS1)) 566 #error "Illegal protocol selection" 569 #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \ 570 defined(MBEDTLS_SSL_PROTO_TLS1_2) && !defined(MBEDTLS_SSL_PROTO_TLS1_1)) 571 #error "Illegal protocol selection" 574 #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ 575 defined(MBEDTLS_SSL_PROTO_TLS1_2) && (!defined(MBEDTLS_SSL_PROTO_TLS1) || \ 576 !defined(MBEDTLS_SSL_PROTO_TLS1_1))) 577 #error "Illegal protocol selection" 580 #if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS) 581 #error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites" 584 #if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \ 585 !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) 586 #error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites" 589 #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \ 590 ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) 591 #error "MBEDTLS_SSL_DTLS_ANTI_REPLAY defined, but not all prerequisites" 594 #if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) && \ 595 ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) 596 #error "MBEDTLS_SSL_DTLS_BADMAC_LIMIT defined, but not all prerequisites" 599 #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \ 600 !defined(MBEDTLS_SSL_PROTO_TLS1) && \ 601 !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ 602 !defined(MBEDTLS_SSL_PROTO_TLS1_2) 603 #error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites" 606 #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \ 607 !defined(MBEDTLS_SSL_PROTO_TLS1) && \ 608 !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ 609 !defined(MBEDTLS_SSL_PROTO_TLS1_2) 610 #error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites" 613 #if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C) 614 #error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites" 617 #if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) && \ 618 !defined(MBEDTLS_SSL_PROTO_SSL3) && !defined(MBEDTLS_SSL_PROTO_TLS1) 619 #error "MBEDTLS_SSL_CBC_RECORD_SPLITTING defined, but not all prerequisites" 622 #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \ 623 !defined(MBEDTLS_X509_CRT_PARSE_C) 624 #error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites" 627 #if defined(MBEDTLS_THREADING_PTHREAD) 628 #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) 629 #error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites" 631 #define MBEDTLS_THREADING_IMPL 634 #if defined(MBEDTLS_THREADING_ALT) 635 #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) 636 #error "MBEDTLS_THREADING_ALT defined, but not all prerequisites" 638 #define MBEDTLS_THREADING_IMPL 641 #if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL) 642 #error "MBEDTLS_THREADING_C defined, single threading implementation required" 644 #undef MBEDTLS_THREADING_IMPL 646 #if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C) 647 #error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites" 650 #if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ 651 !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \ 652 !defined(MBEDTLS_PK_PARSE_C) ) 653 #error "MBEDTLS_X509_USE_C defined, but not all prerequisites" 656 #if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ 657 !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \ 658 !defined(MBEDTLS_PK_WRITE_C) ) 659 #error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites" 662 #if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) 663 #error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites" 666 #if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) 667 #error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites" 670 #if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) 671 #error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites" 674 #if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) 675 #error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites" 678 #if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) 679 #error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites" 682 #if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64) 683 #error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously" 686 #if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \ 687 defined(MBEDTLS_HAVE_ASM) 688 #error "MBEDTLS_HAVE_INT32/MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously" int mbedtls_iso_c_forbids_empty_translation_units
Definition: check_config.h:696