mbed TLS v2.2.0
config.h
Go to the documentation of this file.
1 
29 /*
30  * This set of compile-time options may be used to enable
31  * or disable features selectively, and reduce the global
32  * memory footprint.
33  */
34 #ifndef MBEDTLS_CONFIG_H
35 #define MBEDTLS_CONFIG_H
36 
37 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
38 #define _CRT_SECURE_NO_DEPRECATE 1
39 #endif
40 
62 #define MBEDTLS_HAVE_ASM
63 
71 //#define MBEDTLS_HAVE_SSE2
72 
82 #define MBEDTLS_HAVE_TIME
83 
94 #define MBEDTLS_HAVE_TIME_DATE
95 
118 //#define MBEDTLS_PLATFORM_MEMORY
119 
137 //#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
138 
160 //#define MBEDTLS_PLATFORM_EXIT_ALT
161 //#define MBEDTLS_PLATFORM_FPRINTF_ALT
162 //#define MBEDTLS_PLATFORM_PRINTF_ALT
163 //#define MBEDTLS_PLATFORM_SNPRINTF_ALT
164 
178 //#define MBEDTLS_DEPRECATED_WARNING
179 
190 //#define MBEDTLS_DEPRECATED_REMOVED
191 
192 /* \} name SECTION: System support */
193 
213 //#define MBEDTLS_TIMING_ALT
214 
234 //#define MBEDTLS_AES_ALT
235 //#define MBEDTLS_ARC4_ALT
236 //#define MBEDTLS_BLOWFISH_ALT
237 //#define MBEDTLS_CAMELLIA_ALT
238 //#define MBEDTLS_DES_ALT
239 //#define MBEDTLS_XTEA_ALT
240 //#define MBEDTLS_MD2_ALT
241 //#define MBEDTLS_MD4_ALT
242 //#define MBEDTLS_MD5_ALT
243 //#define MBEDTLS_RIPEMD160_ALT
244 //#define MBEDTLS_SHA1_ALT
245 //#define MBEDTLS_SHA256_ALT
246 //#define MBEDTLS_SHA512_ALT
247 
271 //#define MBEDTLS_MD2_PROCESS_ALT
272 //#define MBEDTLS_MD4_PROCESS_ALT
273 //#define MBEDTLS_MD5_PROCESS_ALT
274 //#define MBEDTLS_RIPEMD160_PROCESS_ALT
275 //#define MBEDTLS_SHA1_PROCESS_ALT
276 //#define MBEDTLS_SHA256_PROCESS_ALT
277 //#define MBEDTLS_SHA512_PROCESS_ALT
278 //#define MBEDTLS_DES_SETKEY_ALT
279 //#define MBEDTLS_DES_CRYPT_ECB_ALT
280 //#define MBEDTLS_DES3_CRYPT_ECB_ALT
281 //#define MBEDTLS_AES_SETKEY_ENC_ALT
282 //#define MBEDTLS_AES_SETKEY_DEC_ALT
283 //#define MBEDTLS_AES_ENCRYPT_ALT
284 //#define MBEDTLS_AES_DECRYPT_ALT
285 
297 //#define MBEDTLS_ENTROPY_HARDWARE_ALT
298 
306 //#define MBEDTLS_AES_ROM_TABLES
307 
315 //#define MBEDTLS_CAMELLIA_SMALL_MEMORY
316 
322 #define MBEDTLS_CIPHER_MODE_CBC
323 
329 #define MBEDTLS_CIPHER_MODE_CFB
330 
336 #define MBEDTLS_CIPHER_MODE_CTR
337 
369 //#define MBEDTLS_CIPHER_NULL_CIPHER
370 
381 #define MBEDTLS_CIPHER_PADDING_PKCS7
382 #define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
383 #define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
384 #define MBEDTLS_CIPHER_PADDING_ZEROS
385 
399 //#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES
400 
412 #define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
413 
422 #define MBEDTLS_ECP_DP_SECP192R1_ENABLED
423 #define MBEDTLS_ECP_DP_SECP224R1_ENABLED
424 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
425 #define MBEDTLS_ECP_DP_SECP384R1_ENABLED
426 #define MBEDTLS_ECP_DP_SECP521R1_ENABLED
427 #define MBEDTLS_ECP_DP_SECP192K1_ENABLED
428 #define MBEDTLS_ECP_DP_SECP224K1_ENABLED
429 #define MBEDTLS_ECP_DP_SECP256K1_ENABLED
430 #define MBEDTLS_ECP_DP_BP256R1_ENABLED
431 #define MBEDTLS_ECP_DP_BP384R1_ENABLED
432 #define MBEDTLS_ECP_DP_BP512R1_ENABLED
433 #define MBEDTLS_ECP_DP_CURVE25519_ENABLED
434 
444 #define MBEDTLS_ECP_NIST_OPTIM
445 
458 #define MBEDTLS_ECDSA_DETERMINISTIC
459 
480 #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
481 
504 #define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
505 
524 #define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
525 
549 #define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
550 
577 #define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
578 
603 #define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
604 
628 #define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
629 
652 #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
653 
676 #define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
677 
700 #define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
701 
719 //#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
720 
733 #define MBEDTLS_PK_PARSE_EC_EXTENDED
734 
748 #define MBEDTLS_ERROR_STRERROR_DUMMY
749 
757 #define MBEDTLS_GENPRIME
758 
764 #define MBEDTLS_FS_IO
765 
777 //#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
778 
788 //#define MBEDTLS_NO_PLATFORM_ENTROPY
789 
804 //#define MBEDTLS_ENTROPY_FORCE_SHA256
805 
817 //#define MBEDTLS_MEMORY_DEBUG
818 
829 //#define MBEDTLS_MEMORY_BACKTRACE
830 
838 #define MBEDTLS_PK_RSA_ALT_SUPPORT
839 
849 #define MBEDTLS_PKCS1_V15
850 
860 #define MBEDTLS_PKCS1_V21
861 
870 //#define MBEDTLS_RSA_NO_CRT
871 
877 #define MBEDTLS_SELF_TEST
878 
893 //#define MBEDTLS_SHA256_SMALLER
894 
905 //#define MBEDTLS_SSL_AEAD_RANDOM_IV
906 
919 #define MBEDTLS_SSL_ALL_ALERT_MESSAGES
920 
935 //#define MBEDTLS_SSL_DEBUG_ALL
936 
953 #define MBEDTLS_SSL_ENCRYPT_THEN_MAC
954 
971 #define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
972 
988 #define MBEDTLS_SSL_FALLBACK_SCSV
989 
998 //#define MBEDTLS_SSL_HW_RECORD_ACCEL
999 
1010 #define MBEDTLS_SSL_CBC_RECORD_SPLITTING
1011 
1025 #define MBEDTLS_SSL_RENEGOTIATION
1026 
1035 //#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
1036 
1045 //#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
1046 
1054 #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
1055 
1066 #define MBEDTLS_SSL_PROTO_SSL3
1067 
1078 #define MBEDTLS_SSL_PROTO_TLS1
1079 
1090 #define MBEDTLS_SSL_PROTO_TLS1_1
1091 
1102 #define MBEDTLS_SSL_PROTO_TLS1_2
1103 
1117 #define MBEDTLS_SSL_PROTO_DTLS
1118 
1126 #define MBEDTLS_SSL_ALPN
1127 
1141 #define MBEDTLS_SSL_DTLS_ANTI_REPLAY
1142 
1159 #define MBEDTLS_SSL_DTLS_HELLO_VERIFY
1160 
1175 #define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
1176 
1186 #define MBEDTLS_SSL_DTLS_BADMAC_LIMIT
1187 
1200 #define MBEDTLS_SSL_SESSION_TICKETS
1201 
1210 #define MBEDTLS_SSL_EXPORT_KEYS
1211 
1221 #define MBEDTLS_SSL_SERVER_NAME_INDICATION
1222 
1230 #define MBEDTLS_SSL_TRUNCATED_HMAC
1231 
1241 //#define MBEDTLS_THREADING_ALT
1242 
1252 //#define MBEDTLS_THREADING_PTHREAD
1253 
1265 #define MBEDTLS_VERSION_FEATURES
1266 
1275 //#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
1276 
1287 //#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
1288 
1301 #define MBEDTLS_X509_CHECK_KEY_USAGE
1302 
1314 #define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
1315 
1324 #define MBEDTLS_X509_RSASSA_PSS_SUPPORT
1325 
1346 //#define MBEDTLS_ZLIB_SUPPORT
1347 /* \} name SECTION: mbed TLS feature support */
1348 
1368 #define MBEDTLS_AESNI_C
1369 
1443 #define MBEDTLS_AES_C
1444 
1466 #define MBEDTLS_ARC4_C
1467 
1480 #define MBEDTLS_ASN1_PARSE_C
1481 
1494 #define MBEDTLS_ASN1_WRITE_C
1495 
1506 #define MBEDTLS_BASE64_C
1507 
1522 #define MBEDTLS_BIGNUM_C
1523 
1531 #define MBEDTLS_BLOWFISH_C
1532 
1586 #define MBEDTLS_CAMELLIA_C
1587 
1600 #define MBEDTLS_CCM_C
1601 
1612 #define MBEDTLS_CERTS_C
1613 
1624 #define MBEDTLS_CIPHER_C
1625 
1638 #define MBEDTLS_CTR_DRBG_C
1639 
1652 #define MBEDTLS_DEBUG_C
1653 
1678 #define MBEDTLS_DES_C
1679 
1692 #define MBEDTLS_DHM_C
1693 
1708 #define MBEDTLS_ECDH_C
1709 
1723 #define MBEDTLS_ECDSA_C
1724 
1742 //#define MBEDTLS_ECJPAKE_C
1743 
1756 #define MBEDTLS_ECP_C
1757 
1770 #define MBEDTLS_ENTROPY_C
1771 
1782 #define MBEDTLS_ERROR_C
1783 
1796 #define MBEDTLS_GCM_C
1797 
1819 //#define MBEDTLS_HAVEGE_C
1820 
1833 #define MBEDTLS_HMAC_DRBG_C
1834 
1845 #define MBEDTLS_MD_C
1846 
1857 //#define MBEDTLS_MD2_C
1858 
1869 //#define MBEDTLS_MD4_C
1870 
1884 #define MBEDTLS_MD5_C
1885 
1900 //#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
1901 
1911 #define MBEDTLS_NET_C
1912 
1934 #define MBEDTLS_OID_C
1935 
1948 #define MBEDTLS_PADLOCK_C
1949 
1966 #define MBEDTLS_PEM_PARSE_C
1967 
1982 #define MBEDTLS_PEM_WRITE_C
1983 
1998 #define MBEDTLS_PK_C
1999 
2013 #define MBEDTLS_PK_PARSE_C
2014 
2027 #define MBEDTLS_PK_WRITE_C
2028 
2040 #define MBEDTLS_PKCS5_C
2041 
2055 //#define MBEDTLS_PKCS11_C
2056 
2071 #define MBEDTLS_PKCS12_C
2072 
2091 #define MBEDTLS_PLATFORM_C
2092 
2102 #define MBEDTLS_RIPEMD160_C
2103 
2120 #define MBEDTLS_RSA_C
2121 
2136 #define MBEDTLS_SHA1_C
2137 
2153 #define MBEDTLS_SHA256_C
2154 
2168 #define MBEDTLS_SHA512_C
2169 
2180 #define MBEDTLS_SSL_CACHE_C
2181 
2190 #define MBEDTLS_SSL_COOKIE_C
2191 
2202 #define MBEDTLS_SSL_TICKET_C
2203 
2216 #define MBEDTLS_SSL_CLI_C
2217 
2230 #define MBEDTLS_SSL_SRV_C
2231 
2246 #define MBEDTLS_SSL_TLS_C
2247 
2267 //#define MBEDTLS_THREADING_C
2268 
2279 #define MBEDTLS_TIMING_C
2280 
2290 #define MBEDTLS_VERSION_C
2291 
2307 #define MBEDTLS_X509_USE_C
2308 
2323 #define MBEDTLS_X509_CRT_PARSE_C
2324 
2337 #define MBEDTLS_X509_CRL_PARSE_C
2338 
2351 #define MBEDTLS_X509_CSR_PARSE_C
2352 
2364 #define MBEDTLS_X509_CREATE_C
2365 
2377 #define MBEDTLS_X509_CRT_WRITE_C
2378 
2390 #define MBEDTLS_X509_CSR_WRITE_C
2391 
2400 #define MBEDTLS_XTEA_C
2401 
2402 /* \} name SECTION: mbed TLS modules */
2403 
2419 /* MPI / BIGNUM options */
2420 //#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
2421 //#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
2422 
2423 /* CTR_DRBG options */
2424 //#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
2425 //#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
2426 //#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
2427 //#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
2428 //#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
2429 
2430 /* HMAC_DRBG options */
2431 //#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
2432 //#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
2433 //#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
2434 //#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
2435 
2436 /* ECP options */
2437 //#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
2438 //#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */
2439 //#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
2440 
2441 /* Entropy options */
2442 //#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
2443 //#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
2444 
2445 /* Memory buffer allocator options */
2446 //#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
2447 
2448 /* Platform options */
2449 //#define MBEDTLS_PLATFORM_STD_MEM_HDR <stdlib.h> /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */
2450 //#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
2451 //#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
2452 //#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
2453 //#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
2454 //#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
2455 /* Note: your snprintf must correclty zero-terminate the buffer! */
2456 //#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
2457 
2458 /* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
2459 /* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
2460 //#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */
2461 //#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
2462 //#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
2463 //#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
2464 //#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
2465 /* Note: your snprintf must correclty zero-terminate the buffer! */
2466 //#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
2467 
2468 /* SSL Cache options */
2469 //#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
2470 //#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
2471 
2472 /* SSL options */
2473 //#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */
2474 //#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
2475 //#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */
2476 //#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
2477 
2490 //#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
2491 
2492 /* X509 options */
2493 //#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
2494 
2495 /* \} name SECTION: Module configuration options */
2496 
2497 #if defined(TARGET_LIKE_MBED)
2498 #include "mbedtls/target_config.h"
2499 #endif
2500 
2501 /*
2502  * Allow user to override any previous default.
2503  *
2504  * Use two macro names for that, as:
2505  * - with yotta the prefix YOTTA_CFG_ is forced
2506  * - without yotta is looks weird to have a YOTTA prefix.
2507  */
2508 #if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE)
2509 #include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
2510 #elif defined(MBEDTLS_USER_CONFIG_FILE)
2511 #include MBEDTLS_USER_CONFIG_FILE
2512 #endif
2513 
2514 #include "check_config.h"
2515 
2518 #endif /* MBEDTLS_CONFIG_H */
Consistency checks for configuration options.