blob: db2d4ddf64bde38aede24db6c640b47fb76bc161 [file] [log] [blame]
Marc Moreno Berengue20dab392017-11-29 13:18:58 +00001/**
2 * \file config.h
3 *
4 * \brief Configuration options (set of defines)
5 *
6 * This set of compile-time options may be used to enable
7 * or disable features selectively, and reduce the global
8 * memory footprint.
9 *
10 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
11 * SPDX-License-Identifier: Apache-2.0
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License"); you may
14 * not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
21 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 * This file is part of mbed TLS (https://tls.mbed.org)
26 */
27
28#ifndef MBEDTLS_CONFIG_H
29#define MBEDTLS_CONFIG_H
30
31#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
32#define _CRT_SECURE_NO_DEPRECATE 1
33#endif
34
35/**
36 * \name SECTION: System support
37 *
38 * This section sets system specific settings.
39 * \{
40 */
41
42/**
43 * \def MBEDTLS_HAVE_ASM
44 *
45 * The compiler has support for asm().
46 *
47 * Requires support for asm() in compiler.
48 *
49 * Used in:
50 * library/timing.c
51 * library/padlock.c
52 * include/mbedtls/bn_mul.h
53 *
54 * Comment to disable the use of assembly code.
55 */
56#define MBEDTLS_HAVE_ASM
57
58/**
59 * \def MBEDTLS_HAVE_SSE2
60 *
61 * CPU supports SSE2 instruction set.
62 *
63 * Uncomment if the CPU supports SSE2 (IA-32 specific).
64 */
65//#define MBEDTLS_HAVE_SSE2
66
67/**
68 * \def MBEDTLS_HAVE_TIME
69 *
70 * System has time.h and time().
71 * The time does not need to be correct, only time differences are used,
72 * by contrast with MBEDTLS_HAVE_TIME_DATE
73 *
74 * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT,
75 * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and
76 * MBEDTLS_PLATFORM_STD_TIME.
77 *
78 * Comment if your system does not support time functions
79 */
80#define MBEDTLS_HAVE_TIME
81
82/**
83 * \def MBEDTLS_HAVE_TIME_DATE
84 *
85 * System has time.h and time(), gmtime() and the clock is correct.
86 * The time needs to be correct (not necesarily very accurate, but at least
87 * the date should be correct). This is used to verify the validity period of
88 * X.509 certificates.
89 *
90 * Comment if your system does not have a correct clock.
91 */
92#define MBEDTLS_HAVE_TIME_DATE
93
94/**
95 * \def MBEDTLS_PLATFORM_MEMORY
96 *
97 * Enable the memory allocation layer.
98 *
99 * By default mbed TLS uses the system-provided calloc() and free().
100 * This allows different allocators (self-implemented or provided) to be
101 * provided to the platform abstraction layer.
102 *
103 * Enabling MBEDTLS_PLATFORM_MEMORY without the
104 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
105 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
106 * free() function pointer at runtime.
107 *
108 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
109 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
110 * alternate function at compile time.
111 *
112 * Requires: MBEDTLS_PLATFORM_C
113 *
114 * Enable this layer to allow use of alternative memory allocators.
115 */
116#define MBEDTLS_PLATFORM_MEMORY
117
118/**
119 * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
120 *
121 * Do not assign standard functions in the platform layer (e.g. calloc() to
122 * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF)
123 *
124 * This makes sure there are no linking errors on platforms that do not support
125 * these functions. You will HAVE to provide alternatives, either at runtime
126 * via the platform_set_xxx() functions or at compile time by setting
127 * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a
128 * MBEDTLS_PLATFORM_XXX_MACRO.
129 *
130 * Requires: MBEDTLS_PLATFORM_C
131 *
132 * Uncomment to prevent default assignment of standard functions in the
133 * platform layer.
134 */
135//#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
136
137/**
138 * \def MBEDTLS_PLATFORM_EXIT_ALT
139 *
140 * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the
141 * function in the platform abstraction layer.
142 *
143 * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will
144 * provide a function "mbedtls_platform_set_printf()" that allows you to set an
145 * alternative printf function pointer.
146 *
147 * All these define require MBEDTLS_PLATFORM_C to be defined!
148 *
149 * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows;
150 * it will be enabled automatically by check_config.h
151 *
152 * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as
153 * MBEDTLS_PLATFORM_XXX_MACRO!
154 *
155 * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME
156 *
157 * Uncomment a macro to enable alternate implementation of specific base
158 * platform function
159 */
160//#define MBEDTLS_PLATFORM_EXIT_ALT
161//#define MBEDTLS_PLATFORM_TIME_ALT
162//#define MBEDTLS_PLATFORM_FPRINTF_ALT
163//#define MBEDTLS_PLATFORM_PRINTF_ALT
164//#define MBEDTLS_PLATFORM_SNPRINTF_ALT
165//#define MBEDTLS_PLATFORM_NV_SEED_ALT
166
167/**
168 * \def MBEDTLS_DEPRECATED_WARNING
169 *
170 * Mark deprecated functions so that they generate a warning if used.
171 * Functions deprecated in one version will usually be removed in the next
172 * version. You can enable this to help you prepare the transition to a new
173 * major version by making sure your code is not using these functions.
174 *
175 * This only works with GCC and Clang. With other compilers, you may want to
176 * use MBEDTLS_DEPRECATED_REMOVED
177 *
178 * Uncomment to get warnings on using deprecated functions.
179 */
180//#define MBEDTLS_DEPRECATED_WARNING
181
182/**
183 * \def MBEDTLS_DEPRECATED_REMOVED
184 *
185 * Remove deprecated functions so that they generate an error if used.
186 * Functions deprecated in one version will usually be removed in the next
187 * version. You can enable this to help you prepare the transition to a new
188 * major version by making sure your code is not using these functions.
189 *
190 * Uncomment to get errors on using deprecated functions.
191 */
192//#define MBEDTLS_DEPRECATED_REMOVED
193
194/* \} name SECTION: System support */
195
196/**
197 * \name SECTION: mbed TLS feature support
198 *
199 * This section sets support for features that are or are not needed
200 * within the modules that are enabled.
201 * \{
202 */
203
204/**
205 * \def MBEDTLS_TIMING_ALT
206 *
207 * Uncomment to provide your own alternate implementation for mbedtls_timing_hardclock(),
208 * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay()
209 *
210 * Only works if you have MBEDTLS_TIMING_C enabled.
211 *
212 * You will need to provide a header "timing_alt.h" and an implementation at
213 * compile time.
214 */
215//#define MBEDTLS_TIMING_ALT
216
217/**
218 * \def MBEDTLS_AES_ALT
219 *
220 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
221 * alternate core implementation of a symmetric crypto, an arithmetic or hash
222 * module (e.g. platform specific assembly optimized implementations). Keep
223 * in mind that the function prototypes should remain the same.
224 *
225 * This replaces the whole module. If you only want to replace one of the
226 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
227 *
228 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
229 * provide the "struct mbedtls_aes_context" definition and omit the base
230 * function declarations and implementations. "aes_alt.h" will be included from
231 * "aes.h" to include the new function definitions.
232 *
233 * Uncomment a macro to enable alternate implementation of the corresponding
234 * module.
235 */
236//#define MBEDTLS_AES_ALT
237//#define MBEDTLS_ARC4_ALT
238//#define MBEDTLS_BLOWFISH_ALT
239//#define MBEDTLS_CAMELLIA_ALT
240//#define MBEDTLS_DES_ALT
241//#define MBEDTLS_XTEA_ALT
242//#define MBEDTLS_MD2_ALT
243//#define MBEDTLS_MD4_ALT
244//#define MBEDTLS_MD5_ALT
245//#define MBEDTLS_RIPEMD160_ALT
246//#define MBEDTLS_SHA1_ALT
247//#define MBEDTLS_SHA256_ALT
248//#define MBEDTLS_SHA512_ALT
249/*
250 * When replacing the elliptic curve module, pleace consider, that it is
251 * implemented with two .c files:
252 * - ecp.c
253 * - ecp_curves.c
254 * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT
255 * macros as described above. The only difference is that you have to make sure
256 * that you provide functionality for both .c files.
257 */
258//#define MBEDTLS_ECP_ALT
259
260/**
261 * \def MBEDTLS_MD2_PROCESS_ALT
262 *
263 * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you
264 * alternate core implementation of symmetric crypto or hash function. Keep in
265 * mind that function prototypes should remain the same.
266 *
267 * This replaces only one function. The header file from mbed TLS is still
268 * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags.
269 *
270 * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will
271 * no longer provide the mbedtls_sha1_process() function, but it will still provide
272 * the other function (using your mbedtls_sha1_process() function) and the definition
273 * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible
274 * with this definition.
275 *
276 * Note: if you use the AES_xxx_ALT macros, then is is recommended to also set
277 * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES
278 * tables.
279 *
280 * Uncomment a macro to enable alternate implementation of the corresponding
281 * function.
282 */
283//#define MBEDTLS_MD2_PROCESS_ALT
284//#define MBEDTLS_MD4_PROCESS_ALT
285//#define MBEDTLS_MD5_PROCESS_ALT
286//#define MBEDTLS_RIPEMD160_PROCESS_ALT
287//#define MBEDTLS_SHA1_PROCESS_ALT
288//#define MBEDTLS_SHA256_PROCESS_ALT
289//#define MBEDTLS_SHA512_PROCESS_ALT
290//#define MBEDTLS_DES_SETKEY_ALT
291//#define MBEDTLS_DES_CRYPT_ECB_ALT
292//#define MBEDTLS_DES3_CRYPT_ECB_ALT
293//#define MBEDTLS_AES_SETKEY_ENC_ALT
294//#define MBEDTLS_AES_SETKEY_DEC_ALT
295//#define MBEDTLS_AES_ENCRYPT_ALT
296//#define MBEDTLS_AES_DECRYPT_ALT
297
298/**
299 * \def MBEDTLS_ECP_INTERNAL_ALT
300 *
301 * Expose a part of the internal interface of the Elliptic Curve Point module.
302 *
303 * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your
304 * alternative core implementation of elliptic curve arithmetic. Keep in mind
305 * that function prototypes should remain the same.
306 *
307 * This partially replaces one function. The header file from mbed TLS is still
308 * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation
309 * is still present and it is used for group structures not supported by the
310 * alternative.
311 *
312 * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT
313 * and implementing the following functions:
314 * unsigned char mbedtls_internal_ecp_grp_capable(
315 * const mbedtls_ecp_group *grp )
316 * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp )
317 * void mbedtls_internal_ecp_deinit( const mbedtls_ecp_group *grp )
318 * The mbedtls_internal_ecp_grp_capable function should return 1 if the
319 * replacement functions implement arithmetic for the given group and 0
320 * otherwise.
321 * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_deinit are
322 * called before and after each point operation and provide an opportunity to
323 * implement optimized set up and tear down instructions.
324 *
325 * Example: In case you uncomment MBEDTLS_ECP_INTERNAL_ALT and
326 * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac
327 * function, but will use your mbedtls_internal_ecp_double_jac if the group is
328 * supported (your mbedtls_internal_ecp_grp_capable function returns 1 when
329 * receives it as an argument). If the group is not supported then the original
330 * implementation is used. The other functions and the definition of
331 * mbedtls_ecp_group and mbedtls_ecp_point will not change, so your
332 * implementation of mbedtls_internal_ecp_double_jac and
333 * mbedtls_internal_ecp_grp_capable must be compatible with this definition.
334 *
335 * Uncomment a macro to enable alternate implementation of the corresponding
336 * function.
337 */
338/* Required for all the functions in this section */
339//#define MBEDTLS_ECP_INTERNAL_ALT
340/* Support for Weierstrass curves with Jacobi representation */
341//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT
342//#define MBEDTLS_ECP_ADD_MIXED_ALT
343//#define MBEDTLS_ECP_DOUBLE_JAC_ALT
344//#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT
345//#define MBEDTLS_ECP_NORMALIZE_JAC_ALT
346/* Support for curves with Montgomery arithmetic */
347//#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT
348//#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT
349//#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT
350
351/**
352 * \def MBEDTLS_TEST_NULL_ENTROPY
353 *
354 * Enables testing and use of mbed TLS without any configured entropy sources.
355 * This permits use of the library on platforms before an entropy source has
356 * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the
357 * MBEDTLS_ENTROPY_NV_SEED switches).
358 *
359 * WARNING! This switch MUST be disabled in production builds, and is suitable
360 * only for development.
361 * Enabling the switch negates any security provided by the library.
362 *
363 * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
364 *
365 */
366//#define MBEDTLS_TEST_NULL_ENTROPY
367
368/**
369 * \def MBEDTLS_ENTROPY_HARDWARE_ALT
370 *
371 * Uncomment this macro to let mbed TLS use your own implementation of a
372 * hardware entropy collector.
373 *
374 * Your function must be called \c mbedtls_hardware_poll(), have the same
375 * prototype as declared in entropy_poll.h, and accept NULL as first argument.
376 *
377 * Uncomment to use your own hardware entropy collector.
378 */
379//#define MBEDTLS_ENTROPY_HARDWARE_ALT
380
381/**
382 * \def MBEDTLS_AES_ROM_TABLES
383 *
384 * Store the AES tables in ROM.
385 *
386 * Uncomment this macro to store the AES tables in ROM.
387 */
388//#define MBEDTLS_AES_ROM_TABLES
389
390/**
391 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
392 *
393 * Use less ROM for the Camellia implementation (saves about 768 bytes).
394 *
395 * Uncomment this macro to use less memory for Camellia.
396 */
397//#define MBEDTLS_CAMELLIA_SMALL_MEMORY
398
399/**
400 * \def MBEDTLS_CIPHER_MODE_CBC
401 *
402 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
403 */
404#define MBEDTLS_CIPHER_MODE_CBC
405
406/**
407 * \def MBEDTLS_CIPHER_MODE_CFB
408 *
409 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
410 */
411#define MBEDTLS_CIPHER_MODE_CFB
412
413/**
414 * \def MBEDTLS_CIPHER_MODE_CTR
415 *
416 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
417 */
418#define MBEDTLS_CIPHER_MODE_CTR
419
420/**
421 * \def MBEDTLS_CIPHER_NULL_CIPHER
422 *
423 * Enable NULL cipher.
424 * Warning: Only do so when you know what you are doing. This allows for
425 * encryption or channels without any security!
426 *
427 * Requires MBEDTLS_ENABLE_WEAK_CIPHERSUITES as well to enable
428 * the following ciphersuites:
429 * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA
430 * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA
431 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA
432 * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA
433 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384
434 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256
435 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA
436 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384
437 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256
438 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA
439 * MBEDTLS_TLS_RSA_WITH_NULL_SHA256
440 * MBEDTLS_TLS_RSA_WITH_NULL_SHA
441 * MBEDTLS_TLS_RSA_WITH_NULL_MD5
442 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384
443 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256
444 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA
445 * MBEDTLS_TLS_PSK_WITH_NULL_SHA384
446 * MBEDTLS_TLS_PSK_WITH_NULL_SHA256
447 * MBEDTLS_TLS_PSK_WITH_NULL_SHA
448 *
449 * Uncomment this macro to enable the NULL cipher and ciphersuites
450 */
451//#define MBEDTLS_CIPHER_NULL_CIPHER
452
453/**
454 * \def MBEDTLS_CIPHER_PADDING_PKCS7
455 *
456 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
457 * specific padding modes in the cipher layer with cipher modes that support
458 * padding (e.g. CBC)
459 *
460 * If you disable all padding modes, only full blocks can be used with CBC.
461 *
462 * Enable padding modes in the cipher layer.
463 */
464#define MBEDTLS_CIPHER_PADDING_PKCS7
465#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
466#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
467#define MBEDTLS_CIPHER_PADDING_ZEROS
468
469/**
470 * \def MBEDTLS_ENABLE_WEAK_CIPHERSUITES
471 *
472 * Enable weak ciphersuites in SSL / TLS.
473 * Warning: Only do so when you know what you are doing. This allows for
474 * channels with virtually no security at all!
475 *
476 * This enables the following ciphersuites:
477 * MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA
478 * MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA
479 *
480 * Uncomment this macro to enable weak ciphersuites
481 */
482//#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES
483
484/**
485 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
486 *
487 * Remove RC4 ciphersuites by default in SSL / TLS.
488 * This flag removes the ciphersuites based on RC4 from the default list as
489 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
490 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
491 * explicitly.
492 *
493 * Uncomment this macro to remove RC4 ciphersuites by default.
494 */
495#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
496
497/**
498 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
499 *
500 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
501 * module. By default all supported curves are enabled.
502 *
503 * Comment macros to disable the curve and functions for it
504 */
505#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
506#define MBEDTLS_ECP_DP_SECP224R1_ENABLED
507#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
508#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
509#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
510#define MBEDTLS_ECP_DP_SECP192K1_ENABLED
511#define MBEDTLS_ECP_DP_SECP224K1_ENABLED
512#define MBEDTLS_ECP_DP_SECP256K1_ENABLED
513#define MBEDTLS_ECP_DP_BP256R1_ENABLED
514#define MBEDTLS_ECP_DP_BP384R1_ENABLED
515#define MBEDTLS_ECP_DP_BP512R1_ENABLED
516#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
517
518/**
519 * \def MBEDTLS_ECP_NIST_OPTIM
520 *
521 * Enable specific 'modulo p' routines for each NIST prime.
522 * Depending on the prime and architecture, makes operations 4 to 8 times
523 * faster on the corresponding curve.
524 *
525 * Comment this macro to disable NIST curves optimisation.
526 */
527#define MBEDTLS_ECP_NIST_OPTIM
528
529/**
530 * \def MBEDTLS_ECDSA_DETERMINISTIC
531 *
532 * Enable deterministic ECDSA (RFC 6979).
533 * Standard ECDSA is "fragile" in the sense that lack of entropy when signing
534 * may result in a compromise of the long-term signing key. This is avoided by
535 * the deterministic variant.
536 *
537 * Requires: MBEDTLS_HMAC_DRBG_C
538 *
539 * Comment this macro to disable deterministic ECDSA.
540 */
541#define MBEDTLS_ECDSA_DETERMINISTIC
542
543/**
544 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
545 *
546 * Enable the PSK based ciphersuite modes in SSL / TLS.
547 *
548 * This enables the following ciphersuites (if other requisites are
549 * enabled as well):
550 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
551 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
552 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
553 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
554 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
555 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
556 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
557 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
558 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
559 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
560 * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
561 * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
562 */
563#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
564
565/**
566 * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
567 *
568 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS.
569 *
570 * Requires: MBEDTLS_DHM_C
571 *
572 * This enables the following ciphersuites (if other requisites are
573 * enabled as well):
574 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
575 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
576 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
577 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
578 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
579 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
580 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
581 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
582 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
583 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
584 * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
585 * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
586 */
587#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
588
589/**
590 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
591 *
592 * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
593 *
594 * Requires: MBEDTLS_ECDH_C
595 *
596 * This enables the following ciphersuites (if other requisites are
597 * enabled as well):
598 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
599 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
600 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
601 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
602 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
603 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
604 * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
605 * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
606 */
607#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
608
609/**
610 * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
611 *
612 * Enable the RSA-PSK based ciphersuite modes in SSL / TLS.
613 *
614 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
615 * MBEDTLS_X509_CRT_PARSE_C
616 *
617 * This enables the following ciphersuites (if other requisites are
618 * enabled as well):
619 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
620 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
621 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
622 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
623 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
624 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
625 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
626 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
627 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
628 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
629 * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
630 * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
631 */
632#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
633
634/**
635 * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
636 *
637 * Enable the RSA-only based ciphersuite modes in SSL / TLS.
638 *
639 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
640 * MBEDTLS_X509_CRT_PARSE_C
641 *
642 * This enables the following ciphersuites (if other requisites are
643 * enabled as well):
644 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
645 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
646 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
647 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
648 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
649 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
650 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
651 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
652 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
653 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
654 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
655 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
656 * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
657 * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
658 * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
659 */
660#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
661
662/**
663 * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
664 *
665 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS.
666 *
667 * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
668 * MBEDTLS_X509_CRT_PARSE_C
669 *
670 * This enables the following ciphersuites (if other requisites are
671 * enabled as well):
672 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
673 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
674 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
675 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
676 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
677 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
678 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
679 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
680 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
681 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
682 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
683 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
684 * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
685 */
686#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
687
688/**
689 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
690 *
691 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
692 *
693 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
694 * MBEDTLS_X509_CRT_PARSE_C
695 *
696 * This enables the following ciphersuites (if other requisites are
697 * enabled as well):
698 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
699 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
700 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
701 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
702 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
703 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
704 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
705 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
706 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
707 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
708 * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
709 * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
710 */
711#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
712
713/**
714 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
715 *
716 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
717 *
718 * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C,
719 *
720 * This enables the following ciphersuites (if other requisites are
721 * enabled as well):
722 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
723 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
724 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
725 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
726 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
727 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
728 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
729 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
730 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
731 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
732 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
733 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
734 */
735#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
736
737/**
738 * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
739 *
740 * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
741 *
742 * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C
743 *
744 * This enables the following ciphersuites (if other requisites are
745 * enabled as well):
746 * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
747 * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
748 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
749 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
750 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
751 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
752 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
753 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
754 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
755 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
756 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
757 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
758 */
759#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
760
761/**
762 * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
763 *
764 * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS.
765 *
766 * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C
767 *
768 * This enables the following ciphersuites (if other requisites are
769 * enabled as well):
770 * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
771 * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
772 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
773 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
774 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
775 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
776 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
777 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
778 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
779 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
780 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
781 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
782 */
783#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
784
785/**
786 * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
787 *
788 * Enable the ECJPAKE based ciphersuite modes in SSL / TLS.
789 *
790 * \warning This is currently experimental. EC J-PAKE support is based on the
791 * Thread v1.0.0 specification; incompatible changes to the specification
792 * might still happen. For this reason, this is disabled by default.
793 *
794 * Requires: MBEDTLS_ECJPAKE_C
795 * MBEDTLS_SHA256_C
796 * MBEDTLS_ECP_DP_SECP256R1_ENABLED
797 *
798 * This enables the following ciphersuites (if other requisites are
799 * enabled as well):
800 * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
801 */
802//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
803
804/**
805 * \def MBEDTLS_PK_PARSE_EC_EXTENDED
806 *
807 * Enhance support for reading EC keys using variants of SEC1 not allowed by
808 * RFC 5915 and RFC 5480.
809 *
810 * Currently this means parsing the SpecifiedECDomain choice of EC
811 * parameters (only known groups are supported, not arbitrary domains, to
812 * avoid validation issues).
813 *
814 * Disable if you only need to support RFC 5915 + 5480 key formats.
815 */
816#define MBEDTLS_PK_PARSE_EC_EXTENDED
817
818/**
819 * \def MBEDTLS_ERROR_STRERROR_DUMMY
820 *
821 * Enable a dummy error function to make use of mbedtls_strerror() in
822 * third party libraries easier when MBEDTLS_ERROR_C is disabled
823 * (no effect when MBEDTLS_ERROR_C is enabled).
824 *
825 * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're
826 * not using mbedtls_strerror() or error_strerror() in your application.
827 *
828 * Disable if you run into name conflicts and want to really remove the
829 * mbedtls_strerror()
830 */
831#define MBEDTLS_ERROR_STRERROR_DUMMY
832
833/**
834 * \def MBEDTLS_GENPRIME
835 *
836 * Enable the prime-number generation code.
837 *
838 * Requires: MBEDTLS_BIGNUM_C
839 */
840#define MBEDTLS_GENPRIME
841
842/**
843 * \def MBEDTLS_FS_IO
844 *
845 * Enable functions that use the filesystem.
846 */
847//#define MBEDTLS_FS_IO
848
849/**
850 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
851 *
852 * Do not add default entropy sources. These are the platform specific,
853 * mbedtls_timing_hardclock and HAVEGE based poll functions.
854 *
855 * This is useful to have more control over the added entropy sources in an
856 * application.
857 *
858 * Uncomment this macro to prevent loading of default entropy functions.
859 */
860//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
861
862/**
863 * \def MBEDTLS_NO_PLATFORM_ENTROPY
864 *
865 * Do not use built-in platform entropy functions.
866 * This is useful if your platform does not support
867 * standards like the /dev/urandom or Windows CryptoAPI.
868 *
869 * Uncomment this macro to disable the built-in platform entropy functions.
870 */
871#define MBEDTLS_NO_PLATFORM_ENTROPY
872
873/**
874 * \def MBEDTLS_ENTROPY_FORCE_SHA256
875 *
876 * Force the entropy accumulator to use a SHA-256 accumulator instead of the
877 * default SHA-512 based one (if both are available).
878 *
879 * Requires: MBEDTLS_SHA256_C
880 *
881 * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option
882 * if you have performance concerns.
883 *
884 * This option is only useful if both MBEDTLS_SHA256_C and
885 * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
886 */
887//#define MBEDTLS_ENTROPY_FORCE_SHA256
888
889/**
890 * \def MBEDTLS_ENTROPY_NV_SEED
891 *
892 * Enable the non-volatile (NV) seed file-based entropy source.
893 * (Also enables the NV seed read/write functions in the platform layer)
894 *
895 * This is crucial (if not required) on systems that do not have a
896 * cryptographic entropy source (in hardware or kernel) available.
897 *
898 * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C
899 *
900 * \note The read/write functions that are used by the entropy source are
901 * determined in the platform layer, and can be modified at runtime and/or
902 * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used.
903 *
904 * \note If you use the default implementation functions that read a seedfile
905 * with regular fopen(), please make sure you make a seedfile with the
906 * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at
907 * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from
908 * and written to or you will get an entropy source error! The default
909 * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE
910 * bytes from the file.
911 *
912 * \note The entropy collector will write to the seed file before entropy is
913 * given to an external source, to update it.
914 */
915//#define MBEDTLS_ENTROPY_NV_SEED
916
917/**
918 * \def MBEDTLS_MEMORY_DEBUG
919 *
920 * Enable debugging of buffer allocator memory issues. Automatically prints
921 * (to stderr) all (fatal) messages on memory allocation issues. Enables
922 * function for 'debug output' of allocated memory.
923 *
924 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
925 *
926 * Uncomment this macro to let the buffer allocator print out error messages.
927 */
928//#define MBEDTLS_MEMORY_DEBUG
929
930/**
931 * \def MBEDTLS_MEMORY_BACKTRACE
932 *
933 * Include backtrace information with each allocated block.
934 *
935 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
936 * GLIBC-compatible backtrace() an backtrace_symbols() support
937 *
938 * Uncomment this macro to include backtrace information
939 */
940//#define MBEDTLS_MEMORY_BACKTRACE
941
942/**
943 * \def MBEDTLS_PK_RSA_ALT_SUPPORT
944 *
945 * Support external private RSA keys (eg from a HSM) in the PK layer.
946 *
947 * Comment this macro to disable support for external private RSA keys.
948 */
949#define MBEDTLS_PK_RSA_ALT_SUPPORT
950
951/**
952 * \def MBEDTLS_PKCS1_V15
953 *
954 * Enable support for PKCS#1 v1.5 encoding.
955 *
956 * Requires: MBEDTLS_RSA_C
957 *
958 * This enables support for PKCS#1 v1.5 operations.
959 */
960#define MBEDTLS_PKCS1_V15
961
962/**
963 * \def MBEDTLS_PKCS1_V21
964 *
965 * Enable support for PKCS#1 v2.1 encoding.
966 *
967 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
968 *
969 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
970 */
971#define MBEDTLS_PKCS1_V21
972
973/**
974 * \def MBEDTLS_RSA_NO_CRT
975 *
976 * Do not use the Chinese Remainder Theorem for the RSA private operation.
977 *
978 * Uncomment this macro to disable the use of CRT in RSA.
979 *
980 */
981//#define MBEDTLS_RSA_NO_CRT
982
983/**
984 * \def MBEDTLS_SELF_TEST
985 *
986 * Enable the checkup functions (*_self_test).
987 */
988#define MBEDTLS_SELF_TEST
989
990/**
991 * \def MBEDTLS_SHA256_SMALLER
992 *
993 * Enable an implementation of SHA-256 that has lower ROM footprint but also
994 * lower performance.
995 *
996 * The default implementation is meant to be a reasonnable compromise between
997 * performance and size. This version optimizes more aggressively for size at
998 * the expense of performance. Eg on Cortex-M4 it reduces the size of
999 * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about
1000 * 30%.
1001 *
1002 * Uncomment to enable the smaller implementation of SHA256.
1003 */
1004//#define MBEDTLS_SHA256_SMALLER
1005
1006/**
1007 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
1008 *
1009 * Enable sending of alert messages in case of encountered errors as per RFC.
1010 * If you choose not to send the alert messages, mbed TLS can still communicate
1011 * with other servers, only debugging of failures is harder.
1012 *
1013 * The advantage of not sending alert messages, is that no information is given
1014 * about reasons for failures thus preventing adversaries of gaining intel.
1015 *
1016 * Enable sending of all alert messages
1017 */
1018#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
1019
1020/**
1021 * \def MBEDTLS_SSL_DEBUG_ALL
1022 *
1023 * Enable the debug messages in SSL module for all issues.
1024 * Debug messages have been disabled in some places to prevent timing
1025 * attacks due to (unbalanced) debugging function calls.
1026 *
1027 * If you need all error reporting you should enable this during debugging,
1028 * but remove this for production servers that should log as well.
1029 *
1030 * Uncomment this macro to report all debug messages on errors introducing
1031 * a timing side-channel.
1032 *
1033 */
1034//#define MBEDTLS_SSL_DEBUG_ALL
1035
1036/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
1037 *
1038 * Enable support for Encrypt-then-MAC, RFC 7366.
1039 *
1040 * This allows peers that both support it to use a more robust protection for
1041 * ciphersuites using CBC, providing deep resistance against timing attacks
1042 * on the padding or underlying cipher.
1043 *
1044 * This only affects CBC ciphersuites, and is useless if none is defined.
1045 *
1046 * Requires: MBEDTLS_SSL_PROTO_TLS1 or
1047 * MBEDTLS_SSL_PROTO_TLS1_1 or
1048 * MBEDTLS_SSL_PROTO_TLS1_2
1049 *
1050 * Comment this macro to disable support for Encrypt-then-MAC
1051 */
1052#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
1053
1054/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
1055 *
1056 * Enable support for Extended Master Secret, aka Session Hash
1057 * (draft-ietf-tls-session-hash-02).
1058 *
1059 * This was introduced as "the proper fix" to the Triple Handshake familiy of
1060 * attacks, but it is recommended to always use it (even if you disable
1061 * renegotiation), since it actually fixes a more fundamental issue in the
1062 * original SSL/TLS design, and has implications beyond Triple Handshake.
1063 *
1064 * Requires: MBEDTLS_SSL_PROTO_TLS1 or
1065 * MBEDTLS_SSL_PROTO_TLS1_1 or
1066 * MBEDTLS_SSL_PROTO_TLS1_2
1067 *
1068 * Comment this macro to disable support for Extended Master Secret.
1069 */
1070#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
1071
1072/**
1073 * \def MBEDTLS_SSL_FALLBACK_SCSV
1074 *
1075 * Enable support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv-00).
1076 *
1077 * For servers, it is recommended to always enable this, unless you support
1078 * only one version of TLS, or know for sure that none of your clients
1079 * implements a fallback strategy.
1080 *
1081 * For clients, you only need this if you're using a fallback strategy, which
1082 * is not recommended in the first place, unless you absolutely need it to
1083 * interoperate with buggy (version-intolerant) servers.
1084 *
1085 * Comment this macro to disable support for FALLBACK_SCSV
1086 */
1087#define MBEDTLS_SSL_FALLBACK_SCSV
1088
1089/**
1090 * \def MBEDTLS_SSL_HW_RECORD_ACCEL
1091 *
1092 * Enable hooking functions in SSL module for hardware acceleration of
1093 * individual records.
1094 *
1095 * Uncomment this macro to enable hooking functions.
1096 */
1097//#define MBEDTLS_SSL_HW_RECORD_ACCEL
1098
1099/**
1100 * \def MBEDTLS_SSL_CBC_RECORD_SPLITTING
1101 *
1102 * Enable 1/n-1 record splitting for CBC mode in SSLv3 and TLS 1.0.
1103 *
1104 * This is a countermeasure to the BEAST attack, which also minimizes the risk
1105 * of interoperability issues compared to sending 0-length records.
1106 *
1107 * Comment this macro to disable 1/n-1 record splitting.
1108 */
1109#define MBEDTLS_SSL_CBC_RECORD_SPLITTING
1110
1111/**
1112 * \def MBEDTLS_SSL_RENEGOTIATION
1113 *
1114 * Disable support for TLS renegotiation.
1115 *
1116 * The two main uses of renegotiation are (1) refresh keys on long-lived
1117 * connections and (2) client authentication after the initial handshake.
1118 * If you don't need renegotiation, it's probably better to disable it, since
1119 * it has been associated with security issues in the past and is easy to
1120 * misuse/misunderstand.
1121 *
1122 * Comment this to disable support for renegotiation.
1123 */
1124#define MBEDTLS_SSL_RENEGOTIATION
1125
1126/**
1127 * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
1128 *
1129 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
1130 * SSL Server module (MBEDTLS_SSL_SRV_C).
1131 *
1132 * Uncomment this macro to enable support for SSLv2 Client Hello messages.
1133 */
1134//#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
1135
1136/**
1137 * \def MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
1138 *
1139 * Pick the ciphersuite according to the client's preferences rather than ours
1140 * in the SSL Server module (MBEDTLS_SSL_SRV_C).
1141 *
1142 * Uncomment this macro to respect client's ciphersuite order
1143 */
1144//#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
1145
1146/**
1147 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
1148 *
1149 * Enable support for RFC 6066 max_fragment_length extension in SSL.
1150 *
1151 * Comment this macro to disable support for the max_fragment_length extension
1152 */
1153#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
1154
1155/**
1156 * \def MBEDTLS_SSL_PROTO_SSL3
1157 *
1158 * Enable support for SSL 3.0.
1159 *
1160 * Requires: MBEDTLS_MD5_C
1161 * MBEDTLS_SHA1_C
1162 *
1163 * Comment this macro to disable support for SSL 3.0
1164 */
1165//#define MBEDTLS_SSL_PROTO_SSL3
1166
1167/**
1168 * \def MBEDTLS_SSL_PROTO_TLS1
1169 *
1170 * Enable support for TLS 1.0.
1171 *
1172 * Requires: MBEDTLS_MD5_C
1173 * MBEDTLS_SHA1_C
1174 *
1175 * Comment this macro to disable support for TLS 1.0
1176 */
1177#define MBEDTLS_SSL_PROTO_TLS1
1178
1179/**
1180 * \def MBEDTLS_SSL_PROTO_TLS1_1
1181 *
1182 * Enable support for TLS 1.1 (and DTLS 1.0 if DTLS is enabled).
1183 *
1184 * Requires: MBEDTLS_MD5_C
1185 * MBEDTLS_SHA1_C
1186 *
1187 * Comment this macro to disable support for TLS 1.1 / DTLS 1.0
1188 */
1189#define MBEDTLS_SSL_PROTO_TLS1_1
1190
1191/**
1192 * \def MBEDTLS_SSL_PROTO_TLS1_2
1193 *
1194 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
1195 *
1196 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
1197 * (Depends on ciphersuites)
1198 *
1199 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
1200 */
1201#define MBEDTLS_SSL_PROTO_TLS1_2
1202
1203/**
1204 * \def MBEDTLS_SSL_PROTO_DTLS
1205 *
1206 * Enable support for DTLS (all available versions).
1207 *
1208 * Enable this and MBEDTLS_SSL_PROTO_TLS1_1 to enable DTLS 1.0,
1209 * and/or this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2.
1210 *
1211 * Requires: MBEDTLS_SSL_PROTO_TLS1_1
1212 * or MBEDTLS_SSL_PROTO_TLS1_2
1213 *
1214 * Comment this macro to disable support for DTLS
1215 */
1216#define MBEDTLS_SSL_PROTO_DTLS
1217
1218/**
1219 * \def MBEDTLS_SSL_ALPN
1220 *
1221 * Enable support for RFC 7301 Application Layer Protocol Negotiation.
1222 *
1223 * Comment this macro to disable support for ALPN.
1224 */
1225#define MBEDTLS_SSL_ALPN
1226
1227/**
1228 * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY
1229 *
1230 * Enable support for the anti-replay mechanism in DTLS.
1231 *
1232 * Requires: MBEDTLS_SSL_TLS_C
1233 * MBEDTLS_SSL_PROTO_DTLS
1234 *
1235 * \warning Disabling this is often a security risk!
1236 * See mbedtls_ssl_conf_dtls_anti_replay() for details.
1237 *
1238 * Comment this to disable anti-replay in DTLS.
1239 */
1240#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
1241
1242/**
1243 * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY
1244 *
1245 * Enable support for HelloVerifyRequest on DTLS servers.
1246 *
1247 * This feature is highly recommended to prevent DTLS servers being used as
1248 * amplifiers in DoS attacks against other hosts. It should always be enabled
1249 * unless you know for sure amplification cannot be a problem in the
1250 * environment in which your server operates.
1251 *
1252 * \warning Disabling this can ba a security risk! (see above)
1253 *
1254 * Requires: MBEDTLS_SSL_PROTO_DTLS
1255 *
1256 * Comment this to disable support for HelloVerifyRequest.
1257 */
1258#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
1259
1260/**
1261 * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
1262 *
1263 * Enable server-side support for clients that reconnect from the same port.
1264 *
1265 * Some clients unexpectedly close the connection and try to reconnect using the
1266 * same source port. This needs special support from the server to handle the
1267 * new connection securely, as described in section 4.2.8 of RFC 6347. This
1268 * flag enables that support.
1269 *
1270 * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY
1271 *
1272 * Comment this to disable support for clients reusing the source port.
1273 */
1274#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
1275
1276/**
1277 * \def MBEDTLS_SSL_DTLS_BADMAC_LIMIT
1278 *
1279 * Enable support for a limit of records with bad MAC.
1280 *
1281 * See mbedtls_ssl_conf_dtls_badmac_limit().
1282 *
1283 * Requires: MBEDTLS_SSL_PROTO_DTLS
1284 */
1285#define MBEDTLS_SSL_DTLS_BADMAC_LIMIT
1286
1287/**
1288 * \def MBEDTLS_SSL_SESSION_TICKETS
1289 *
1290 * Enable support for RFC 5077 session tickets in SSL.
1291 * Client-side, provides full support for session tickets (maintainance of a
1292 * session store remains the responsibility of the application, though).
1293 * Server-side, you also need to provide callbacks for writing and parsing
1294 * tickets, including authenticated encryption and key management. Example
1295 * callbacks are provided by MBEDTLS_SSL_TICKET_C.
1296 *
1297 * Comment this macro to disable support for SSL session tickets
1298 */
1299#define MBEDTLS_SSL_SESSION_TICKETS
1300
1301/**
1302 * \def MBEDTLS_SSL_EXPORT_KEYS
1303 *
1304 * Enable support for exporting key block and master secret.
1305 * This is required for certain users of TLS, e.g. EAP-TLS.
1306 *
1307 * Comment this macro to disable support for key export
1308 */
1309#define MBEDTLS_SSL_EXPORT_KEYS
1310
1311/**
1312 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
1313 *
1314 * Enable support for RFC 6066 server name indication (SNI) in SSL.
1315 *
1316 * Requires: MBEDTLS_X509_CRT_PARSE_C
1317 *
1318 * Comment this macro to disable support for server name indication in SSL
1319 */
1320#define MBEDTLS_SSL_SERVER_NAME_INDICATION
1321
1322/**
1323 * \def MBEDTLS_SSL_TRUNCATED_HMAC
1324 *
1325 * Enable support for RFC 6066 truncated HMAC in SSL.
1326 *
1327 * Comment this macro to disable support for truncated HMAC in SSL
1328 */
1329#define MBEDTLS_SSL_TRUNCATED_HMAC
1330
1331/**
1332 * \def MBEDTLS_THREADING_ALT
1333 *
1334 * Provide your own alternate threading implementation.
1335 *
1336 * Requires: MBEDTLS_THREADING_C
1337 *
1338 * Uncomment this to allow your own alternate threading implementation.
1339 */
1340//#define MBEDTLS_THREADING_ALT
1341
1342/**
1343 * \def MBEDTLS_THREADING_PTHREAD
1344 *
1345 * Enable the pthread wrapper layer for the threading layer.
1346 *
1347 * Requires: MBEDTLS_THREADING_C
1348 *
1349 * Uncomment this to enable pthread mutexes.
1350 */
1351//#define MBEDTLS_THREADING_PTHREAD
1352
1353/**
1354 * \def MBEDTLS_VERSION_FEATURES
1355 *
1356 * Allow run-time checking of compile-time enabled features. Thus allowing users
1357 * to check at run-time if the library is for instance compiled with threading
1358 * support via mbedtls_version_check_feature().
1359 *
1360 * Requires: MBEDTLS_VERSION_C
1361 *
1362 * Comment this to disable run-time checking and save ROM space
1363 */
1364#define MBEDTLS_VERSION_FEATURES
1365
1366/**
1367 * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
1368 *
1369 * If set, the X509 parser will not break-off when parsing an X509 certificate
1370 * and encountering an extension in a v1 or v2 certificate.
1371 *
1372 * Uncomment to prevent an error.
1373 */
1374//#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
1375
1376/**
1377 * \def MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
1378 *
1379 * If set, the X509 parser will not break-off when parsing an X509 certificate
1380 * and encountering an unknown critical extension.
1381 *
1382 * \warning Depending on your PKI use, enabling this can be a security risk!
1383 *
1384 * Uncomment to prevent an error.
1385 */
1386//#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
1387
1388/**
1389 * \def MBEDTLS_X509_CHECK_KEY_USAGE
1390 *
1391 * Enable verification of the keyUsage extension (CA and leaf certificates).
1392 *
1393 * Disabling this avoids problems with mis-issued and/or misused
1394 * (intermediate) CA and leaf certificates.
1395 *
1396 * \warning Depending on your PKI use, disabling this can be a security risk!
1397 *
1398 * Comment to skip keyUsage checking for both CA and leaf certificates.
1399 */
1400#define MBEDTLS_X509_CHECK_KEY_USAGE
1401
1402/**
1403 * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
1404 *
1405 * Enable verification of the extendedKeyUsage extension (leaf certificates).
1406 *
1407 * Disabling this avoids problems with mis-issued and/or misused certificates.
1408 *
1409 * \warning Depending on your PKI use, disabling this can be a security risk!
1410 *
1411 * Comment to skip extendedKeyUsage checking for certificates.
1412 */
1413#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
1414
1415/**
1416 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
1417 *
1418 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
1419 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
1420 *
1421 * Comment this macro to disallow using RSASSA-PSS in certificates.
1422 */
1423#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
1424
1425/**
1426 * \def MBEDTLS_ZLIB_SUPPORT
1427 *
1428 * If set, the SSL/TLS module uses ZLIB to support compression and
1429 * decompression of packet data.
1430 *
1431 * \warning TLS-level compression MAY REDUCE SECURITY! See for example the
1432 * CRIME attack. Before enabling this option, you should examine with care if
1433 * CRIME or similar exploits may be a applicable to your use case.
1434 *
1435 * \note Currently compression can't be used with DTLS.
1436 *
1437 * Used in: library/ssl_tls.c
1438 * library/ssl_cli.c
1439 * library/ssl_srv.c
1440 *
1441 * This feature requires zlib library and headers to be present.
1442 *
1443 * Uncomment to enable use of ZLIB
1444 */
1445//#define MBEDTLS_ZLIB_SUPPORT
1446/* \} name SECTION: mbed TLS feature support */
1447
1448/**
1449 * \name SECTION: mbed TLS modules
1450 *
1451 * This section enables or disables entire modules in mbed TLS
1452 * \{
1453 */
1454
1455/**
1456 * \def MBEDTLS_AESNI_C
1457 *
1458 * Enable AES-NI support on x86-64.
1459 *
1460 * Module: library/aesni.c
1461 * Caller: library/aes.c
1462 *
1463 * Requires: MBEDTLS_HAVE_ASM
1464 *
1465 * This modules adds support for the AES-NI instructions on x86-64
1466 */
1467#define MBEDTLS_AESNI_C
1468
1469/**
1470 * \def MBEDTLS_AES_C
1471 *
1472 * Enable the AES block cipher.
1473 *
1474 * Module: library/aes.c
1475 * Caller: library/ssl_tls.c
1476 * library/pem.c
1477 * library/ctr_drbg.c
1478 *
1479 * This module enables the following ciphersuites (if other requisites are
1480 * enabled as well):
1481 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
1482 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
1483 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
1484 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
1485 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
1486 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
1487 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
1488 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
1489 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
1490 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
1491 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
1492 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
1493 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
1494 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
1495 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
1496 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
1497 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
1498 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
1499 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
1500 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
1501 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
1502 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
1503 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
1504 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
1505 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
1506 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
1507 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
1508 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
1509 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
1510 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
1511 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
1512 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
1513 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
1514 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
1515 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
1516 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
1517 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
1518 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
1519 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
1520 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
1521 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
1522 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
1523 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
1524 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
1525 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
1526 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
1527 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
1528 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
1529 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
1530 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
1531 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
1532 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
1533 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
1534 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
1535 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
1536 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
1537 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
1538 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
1539 *
1540 * PEM_PARSE uses AES for decrypting encrypted keys.
1541 */
1542#define MBEDTLS_AES_C
1543
1544/**
1545 * \def MBEDTLS_ARC4_C
1546 *
1547 * Enable the ARCFOUR stream cipher.
1548 *
1549 * Module: library/arc4.c
1550 * Caller: library/ssl_tls.c
1551 *
1552 * This module enables the following ciphersuites (if other requisites are
1553 * enabled as well):
1554 * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
1555 * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
1556 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
1557 * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
1558 * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
1559 * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
1560 * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
1561 * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
1562 * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
1563 * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
1564 */
1565#define MBEDTLS_ARC4_C
1566
1567/**
1568 * \def MBEDTLS_ASN1_PARSE_C
1569 *
1570 * Enable the generic ASN1 parser.
1571 *
1572 * Module: library/asn1.c
1573 * Caller: library/x509.c
1574 * library/dhm.c
1575 * library/pkcs12.c
1576 * library/pkcs5.c
1577 * library/pkparse.c
1578 */
1579#define MBEDTLS_ASN1_PARSE_C
1580
1581/**
1582 * \def MBEDTLS_ASN1_WRITE_C
1583 *
1584 * Enable the generic ASN1 writer.
1585 *
1586 * Module: library/asn1write.c
1587 * Caller: library/ecdsa.c
1588 * library/pkwrite.c
1589 * library/x509_create.c
1590 * library/x509write_crt.c
1591 * library/x509write_csr.c
1592 */
1593#define MBEDTLS_ASN1_WRITE_C
1594
1595/**
1596 * \def MBEDTLS_BASE64_C
1597 *
1598 * Enable the Base64 module.
1599 *
1600 * Module: library/base64.c
1601 * Caller: library/pem.c
1602 *
1603 * This module is required for PEM support (required by X.509).
1604 */
1605#define MBEDTLS_BASE64_C
1606
1607/**
1608 * \def MBEDTLS_BIGNUM_C
1609 *
1610 * Enable the multi-precision integer library.
1611 *
1612 * Module: library/bignum.c
1613 * Caller: library/dhm.c
1614 * library/ecp.c
1615 * library/ecdsa.c
1616 * library/rsa.c
1617 * library/ssl_tls.c
1618 *
1619 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
1620 */
1621#define MBEDTLS_BIGNUM_C
1622
1623/**
1624 * \def MBEDTLS_BLOWFISH_C
1625 *
1626 * Enable the Blowfish block cipher.
1627 *
1628 * Module: library/blowfish.c
1629 */
1630#define MBEDTLS_BLOWFISH_C
1631
1632/**
1633 * \def MBEDTLS_CAMELLIA_C
1634 *
1635 * Enable the Camellia block cipher.
1636 *
1637 * Module: library/camellia.c
1638 * Caller: library/ssl_tls.c
1639 *
1640 * This module enables the following ciphersuites (if other requisites are
1641 * enabled as well):
1642 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1643 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1644 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
1645 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
1646 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1647 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1648 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
1649 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
1650 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1651 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1652 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1653 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1654 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
1655 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
1656 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
1657 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1658 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1659 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1660 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1661 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1662 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1663 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
1664 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
1665 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1666 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
1667 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
1668 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1669 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
1670 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
1671 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
1672 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
1673 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
1674 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
1675 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
1676 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
1677 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
1678 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
1679 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
1680 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
1681 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
1682 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
1683 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
1684 */
1685#define MBEDTLS_CAMELLIA_C
1686
1687/**
1688 * \def MBEDTLS_CCM_C
1689 *
1690 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
1691 *
1692 * Module: library/ccm.c
1693 *
1694 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
1695 *
1696 * This module enables the AES-CCM ciphersuites, if other requisites are
1697 * enabled as well.
1698 */
1699#define MBEDTLS_CCM_C
1700
1701/**
1702 * \def MBEDTLS_CERTS_C
1703 *
1704 * Enable the test certificates.
1705 *
1706 * Module: library/certs.c
1707 * Caller:
1708 *
1709 * This module is used for testing (ssl_client/server).
1710 */
1711#define MBEDTLS_CERTS_C
1712
1713/**
1714 * \def MBEDTLS_CIPHER_C
1715 *
1716 * Enable the generic cipher layer.
1717 *
1718 * Module: library/cipher.c
1719 * Caller: library/ssl_tls.c
1720 *
1721 * Uncomment to enable generic cipher wrappers.
1722 */
1723#define MBEDTLS_CIPHER_C
1724
1725/**
1726 * \def MBEDTLS_CMAC_C
1727 *
1728 * Enable the CMAC (Cipher-based Message Authentication Code) mode for block
1729 * ciphers.
1730 *
1731 * Module: library/cmac.c
1732 *
1733 * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C
1734 *
1735 */
1736//#define MBEDTLS_CMAC_C
1737
1738/**
1739 * \def MBEDTLS_CTR_DRBG_C
1740 *
1741 * Enable the CTR_DRBG AES-256-based random generator.
1742 *
1743 * Module: library/ctr_drbg.c
1744 * Caller:
1745 *
1746 * Requires: MBEDTLS_AES_C
1747 *
1748 * This module provides the CTR_DRBG AES-256 random number generator.
1749 */
1750#define MBEDTLS_CTR_DRBG_C
1751
1752/**
1753 * \def MBEDTLS_DEBUG_C
1754 *
1755 * Enable the debug functions.
1756 *
1757 * Module: library/debug.c
1758 * Caller: library/ssl_cli.c
1759 * library/ssl_srv.c
1760 * library/ssl_tls.c
1761 *
1762 * This module provides debugging functions.
1763 */
1764#define MBEDTLS_DEBUG_C
1765
1766/**
1767 * \def MBEDTLS_DES_C
1768 *
1769 * Enable the DES block cipher.
1770 *
1771 * Module: library/des.c
1772 * Caller: library/pem.c
1773 * library/ssl_tls.c
1774 *
1775 * This module enables the following ciphersuites (if other requisites are
1776 * enabled as well):
1777 * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
1778 * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
1779 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
1780 * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
1781 * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
1782 * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
1783 * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
1784 * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
1785 * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
1786 * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
1787 *
1788 * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
1789 */
1790#define MBEDTLS_DES_C
1791
1792/**
1793 * \def MBEDTLS_DHM_C
1794 *
1795 * Enable the Diffie-Hellman-Merkle module.
1796 *
1797 * Module: library/dhm.c
1798 * Caller: library/ssl_cli.c
1799 * library/ssl_srv.c
1800 *
1801 * This module is used by the following key exchanges:
1802 * DHE-RSA, DHE-PSK
1803 */
1804#define MBEDTLS_DHM_C
1805
1806/**
1807 * \def MBEDTLS_ECDH_C
1808 *
1809 * Enable the elliptic curve Diffie-Hellman library.
1810 *
1811 * Module: library/ecdh.c
1812 * Caller: library/ssl_cli.c
1813 * library/ssl_srv.c
1814 *
1815 * This module is used by the following key exchanges:
1816 * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
1817 *
1818 * Requires: MBEDTLS_ECP_C
1819 */
1820#define MBEDTLS_ECDH_C
1821
1822/**
1823 * \def MBEDTLS_ECDSA_C
1824 *
1825 * Enable the elliptic curve DSA library.
1826 *
1827 * Module: library/ecdsa.c
1828 * Caller:
1829 *
1830 * This module is used by the following key exchanges:
1831 * ECDHE-ECDSA
1832 *
1833 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
1834 */
1835#define MBEDTLS_ECDSA_C
1836
1837/**
1838 * \def MBEDTLS_ECJPAKE_C
1839 *
1840 * Enable the elliptic curve J-PAKE library.
1841 *
1842 * \warning This is currently experimental. EC J-PAKE support is based on the
1843 * Thread v1.0.0 specification; incompatible changes to the specification
1844 * might still happen. For this reason, this is disabled by default.
1845 *
1846 * Module: library/ecjpake.c
1847 * Caller:
1848 *
1849 * This module is used by the following key exchanges:
1850 * ECJPAKE
1851 *
1852 * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C
1853 */
1854//#define MBEDTLS_ECJPAKE_C
1855
1856/**
1857 * \def MBEDTLS_ECP_C
1858 *
1859 * Enable the elliptic curve over GF(p) library.
1860 *
1861 * Module: library/ecp.c
1862 * Caller: library/ecdh.c
1863 * library/ecdsa.c
1864 * library/ecjpake.c
1865 *
1866 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
1867 */
1868#define MBEDTLS_ECP_C
1869
1870/**
1871 * \def MBEDTLS_ENTROPY_C
1872 *
1873 * Enable the platform-specific entropy code.
1874 *
1875 * Module: library/entropy.c
1876 * Caller:
1877 *
1878 * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
1879 *
1880 * This module provides a generic entropy pool
1881 */
1882#define MBEDTLS_ENTROPY_C
1883
1884/**
1885 * \def MBEDTLS_ERROR_C
1886 *
1887 * Enable error code to error string conversion.
1888 *
1889 * Module: library/error.c
1890 * Caller:
1891 *
1892 * This module enables mbedtls_strerror().
1893 */
1894#define MBEDTLS_ERROR_C
1895
1896/**
1897 * \def MBEDTLS_GCM_C
1898 *
1899 * Enable the Galois/Counter Mode (GCM) for AES.
1900 *
1901 * Module: library/gcm.c
1902 *
1903 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
1904 *
1905 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
1906 * requisites are enabled as well.
1907 */
1908#define MBEDTLS_GCM_C
1909
1910/**
1911 * \def MBEDTLS_HAVEGE_C
1912 *
1913 * Enable the HAVEGE random generator.
1914 *
1915 * Warning: the HAVEGE random generator is not suitable for virtualized
1916 * environments
1917 *
1918 * Warning: the HAVEGE random generator is dependent on timing and specific
1919 * processor traits. It is therefore not advised to use HAVEGE as
1920 * your applications primary random generator or primary entropy pool
1921 * input. As a secondary input to your entropy pool, it IS able add
1922 * the (limited) extra entropy it provides.
1923 *
1924 * Module: library/havege.c
1925 * Caller:
1926 *
1927 * Requires: MBEDTLS_TIMING_C
1928 *
1929 * Uncomment to enable the HAVEGE random generator.
1930 */
1931//#define MBEDTLS_HAVEGE_C
1932
1933/**
1934 * \def MBEDTLS_HMAC_DRBG_C
1935 *
1936 * Enable the HMAC_DRBG random generator.
1937 *
1938 * Module: library/hmac_drbg.c
1939 * Caller:
1940 *
1941 * Requires: MBEDTLS_MD_C
1942 *
1943 * Uncomment to enable the HMAC_DRBG random number geerator.
1944 */
1945#define MBEDTLS_HMAC_DRBG_C
1946
1947/**
1948 * \def MBEDTLS_MD_C
1949 *
1950 * Enable the generic message digest layer.
1951 *
1952 * Module: library/md.c
1953 * Caller:
1954 *
1955 * Uncomment to enable generic message digest wrappers.
1956 */
1957#define MBEDTLS_MD_C
1958
1959/**
1960 * \def MBEDTLS_MD2_C
1961 *
1962 * Enable the MD2 hash algorithm.
1963 *
1964 * Module: library/md2.c
1965 * Caller:
1966 *
1967 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
1968 */
1969//#define MBEDTLS_MD2_C
1970
1971/**
1972 * \def MBEDTLS_MD4_C
1973 *
1974 * Enable the MD4 hash algorithm.
1975 *
1976 * Module: library/md4.c
1977 * Caller:
1978 *
1979 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1980 */
1981//#define MBEDTLS_MD4_C
1982
1983/**
1984 * \def MBEDTLS_MD5_C
1985 *
1986 * Enable the MD5 hash algorithm.
1987 *
1988 * Module: library/md5.c
1989 * Caller: library/md.c
1990 * library/pem.c
1991 * library/ssl_tls.c
1992 *
1993 * This module is required for SSL/TLS and X.509.
1994 * PEM_PARSE uses MD5 for decrypting encrypted keys.
1995 */
1996#define MBEDTLS_MD5_C
1997
1998/**
1999 * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
2000 *
2001 * Enable the buffer allocator implementation that makes use of a (stack)
2002 * based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
2003 * calls)
2004 *
2005 * Module: library/memory_buffer_alloc.c
2006 *
2007 * Requires: MBEDTLS_PLATFORM_C
2008 * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS)
2009 *
2010 * Enable this module to enable the buffer memory allocator.
2011 */
2012#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
2013
2014/**
2015 * \def MBEDTLS_NET_C
2016 *
2017 * Enable the TCP and UDP over IPv6/IPv4 networking routines.
2018 *
2019 * \note This module only works on POSIX/Unix (including Linux, BSD and OS X)
2020 * and Windows. For other platforms, you'll want to disable it, and write your
2021 * own networking callbacks to be passed to \c mbedtls_ssl_set_bio().
2022 *
2023 * \note See also our Knowledge Base article about porting to a new
2024 * environment:
2025 * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
2026 *
2027 * Module: library/net_sockets.c
2028 *
2029 * This module provides networking routines.
2030 */
2031//#define MBEDTLS_NET_C
2032
2033/**
2034 * \def MBEDTLS_OID_C
2035 *
2036 * Enable the OID database.
2037 *
2038 * Module: library/oid.c
2039 * Caller: library/asn1write.c
2040 * library/pkcs5.c
2041 * library/pkparse.c
2042 * library/pkwrite.c
2043 * library/rsa.c
2044 * library/x509.c
2045 * library/x509_create.c
2046 * library/x509_crl.c
2047 * library/x509_crt.c
2048 * library/x509_csr.c
2049 * library/x509write_crt.c
2050 * library/x509write_csr.c
2051 *
2052 * This modules translates between OIDs and internal values.
2053 */
2054#define MBEDTLS_OID_C
2055
2056/**
2057 * \def MBEDTLS_PADLOCK_C
2058 *
2059 * Enable VIA Padlock support on x86.
2060 *
2061 * Module: library/padlock.c
2062 * Caller: library/aes.c
2063 *
2064 * Requires: MBEDTLS_HAVE_ASM
2065 *
2066 * This modules adds support for the VIA PadLock on x86.
2067 */
2068#define MBEDTLS_PADLOCK_C
2069
2070/**
2071 * \def MBEDTLS_PEM_PARSE_C
2072 *
2073 * Enable PEM decoding / parsing.
2074 *
2075 * Module: library/pem.c
2076 * Caller: library/dhm.c
2077 * library/pkparse.c
2078 * library/x509_crl.c
2079 * library/x509_crt.c
2080 * library/x509_csr.c
2081 *
2082 * Requires: MBEDTLS_BASE64_C
2083 *
2084 * This modules adds support for decoding / parsing PEM files.
2085 */
2086#define MBEDTLS_PEM_PARSE_C
2087
2088/**
2089 * \def MBEDTLS_PEM_WRITE_C
2090 *
2091 * Enable PEM encoding / writing.
2092 *
2093 * Module: library/pem.c
2094 * Caller: library/pkwrite.c
2095 * library/x509write_crt.c
2096 * library/x509write_csr.c
2097 *
2098 * Requires: MBEDTLS_BASE64_C
2099 *
2100 * This modules adds support for encoding / writing PEM files.
2101 */
2102#define MBEDTLS_PEM_WRITE_C
2103
2104/**
2105 * \def MBEDTLS_PK_C
2106 *
2107 * Enable the generic public (asymetric) key layer.
2108 *
2109 * Module: library/pk.c
2110 * Caller: library/ssl_tls.c
2111 * library/ssl_cli.c
2112 * library/ssl_srv.c
2113 *
2114 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
2115 *
2116 * Uncomment to enable generic public key wrappers.
2117 */
2118#define MBEDTLS_PK_C
2119
2120/**
2121 * \def MBEDTLS_PK_PARSE_C
2122 *
2123 * Enable the generic public (asymetric) key parser.
2124 *
2125 * Module: library/pkparse.c
2126 * Caller: library/x509_crt.c
2127 * library/x509_csr.c
2128 *
2129 * Requires: MBEDTLS_PK_C
2130 *
2131 * Uncomment to enable generic public key parse functions.
2132 */
2133#define MBEDTLS_PK_PARSE_C
2134
2135/**
2136 * \def MBEDTLS_PK_WRITE_C
2137 *
2138 * Enable the generic public (asymetric) key writer.
2139 *
2140 * Module: library/pkwrite.c
2141 * Caller: library/x509write.c
2142 *
2143 * Requires: MBEDTLS_PK_C
2144 *
2145 * Uncomment to enable generic public key write functions.
2146 */
2147#define MBEDTLS_PK_WRITE_C
2148
2149/**
2150 * \def MBEDTLS_PKCS5_C
2151 *
2152 * Enable PKCS#5 functions.
2153 *
2154 * Module: library/pkcs5.c
2155 *
2156 * Requires: MBEDTLS_MD_C
2157 *
2158 * This module adds support for the PKCS#5 functions.
2159 */
2160#define MBEDTLS_PKCS5_C
2161
2162/**
2163 * \def MBEDTLS_PKCS11_C
2164 *
2165 * Enable wrapper for PKCS#11 smartcard support.
2166 *
2167 * Module: library/pkcs11.c
2168 * Caller: library/pk.c
2169 *
2170 * Requires: MBEDTLS_PK_C
2171 *
2172 * This module enables SSL/TLS PKCS #11 smartcard support.
2173 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
2174 */
2175//#define MBEDTLS_PKCS11_C
2176
2177/**
2178 * \def MBEDTLS_PKCS12_C
2179 *
2180 * Enable PKCS#12 PBE functions.
2181 * Adds algorithms for parsing PKCS#8 encrypted private keys
2182 *
2183 * Module: library/pkcs12.c
2184 * Caller: library/pkparse.c
2185 *
2186 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
2187 * Can use: MBEDTLS_ARC4_C
2188 *
2189 * This module enables PKCS#12 functions.
2190 */
2191#define MBEDTLS_PKCS12_C
2192
2193/**
2194 * \def MBEDTLS_PLATFORM_C
2195 *
2196 * Enable the platform abstraction layer that allows you to re-assign
2197 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
2198 *
2199 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
2200 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
2201 * above to be specified at runtime or compile time respectively.
2202 *
2203 * \note This abstraction layer must be enabled on Windows (including MSYS2)
2204 * as other module rely on it for a fixed snprintf implementation.
2205 *
2206 * Module: library/platform.c
2207 * Caller: Most other .c files
2208 *
2209 * This module enables abstraction of common (libc) functions.
2210 */
2211#define MBEDTLS_PLATFORM_C
2212
2213/**
2214 * \def MBEDTLS_RIPEMD160_C
2215 *
2216 * Enable the RIPEMD-160 hash algorithm.
2217 *
2218 * Module: library/ripemd160.c
2219 * Caller: library/md.c
2220 *
2221 */
2222#define MBEDTLS_RIPEMD160_C
2223
2224/**
2225 * \def MBEDTLS_RSA_C
2226 *
2227 * Enable the RSA public-key cryptosystem.
2228 *
2229 * Module: library/rsa.c
2230 * Caller: library/ssl_cli.c
2231 * library/ssl_srv.c
2232 * library/ssl_tls.c
2233 * library/x509.c
2234 *
2235 * This module is used by the following key exchanges:
2236 * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
2237 *
2238 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
2239 */
2240#define MBEDTLS_RSA_C
2241
2242/**
2243 * \def MBEDTLS_SHA1_C
2244 *
2245 * Enable the SHA1 cryptographic hash algorithm.
2246 *
2247 * Module: library/sha1.c
2248 * Caller: library/md.c
2249 * library/ssl_cli.c
2250 * library/ssl_srv.c
2251 * library/ssl_tls.c
2252 * library/x509write_crt.c
2253 *
2254 * This module is required for SSL/TLS up to version 1.1, for TLS 1.2
2255 * depending on the handshake parameters, and for SHA1-signed certificates.
2256 */
2257#define MBEDTLS_SHA1_C
2258
2259/**
2260 * \def MBEDTLS_SHA256_C
2261 *
2262 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
2263 *
2264 * Module: library/sha256.c
2265 * Caller: library/entropy.c
2266 * library/md.c
2267 * library/ssl_cli.c
2268 * library/ssl_srv.c
2269 * library/ssl_tls.c
2270 *
2271 * This module adds support for SHA-224 and SHA-256.
2272 * This module is required for the SSL/TLS 1.2 PRF function.
2273 */
2274#define MBEDTLS_SHA256_C
2275
2276/**
2277 * \def MBEDTLS_SHA512_C
2278 *
2279 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
2280 *
2281 * Module: library/sha512.c
2282 * Caller: library/entropy.c
2283 * library/md.c
2284 * library/ssl_cli.c
2285 * library/ssl_srv.c
2286 *
2287 * This module adds support for SHA-384 and SHA-512.
2288 */
2289#define MBEDTLS_SHA512_C
2290
2291/**
2292 * \def MBEDTLS_SSL_CACHE_C
2293 *
2294 * Enable simple SSL cache implementation.
2295 *
2296 * Module: library/ssl_cache.c
2297 * Caller:
2298 *
2299 * Requires: MBEDTLS_SSL_CACHE_C
2300 */
2301#define MBEDTLS_SSL_CACHE_C
2302
2303/**
2304 * \def MBEDTLS_SSL_COOKIE_C
2305 *
2306 * Enable basic implementation of DTLS cookies for hello verification.
2307 *
2308 * Module: library/ssl_cookie.c
2309 * Caller:
2310 */
2311#define MBEDTLS_SSL_COOKIE_C
2312
2313/**
2314 * \def MBEDTLS_SSL_TICKET_C
2315 *
2316 * Enable an implementation of TLS server-side callbacks for session tickets.
2317 *
2318 * Module: library/ssl_ticket.c
2319 * Caller:
2320 *
2321 * Requires: MBEDTLS_CIPHER_C
2322 */
2323#define MBEDTLS_SSL_TICKET_C
2324
2325/**
2326 * \def MBEDTLS_SSL_CLI_C
2327 *
2328 * Enable the SSL/TLS client code.
2329 *
2330 * Module: library/ssl_cli.c
2331 * Caller:
2332 *
2333 * Requires: MBEDTLS_SSL_TLS_C
2334 *
2335 * This module is required for SSL/TLS client support.
2336 */
2337#define MBEDTLS_SSL_CLI_C
2338
2339/**
2340 * \def MBEDTLS_SSL_SRV_C
2341 *
2342 * Enable the SSL/TLS server code.
2343 *
2344 * Module: library/ssl_srv.c
2345 * Caller:
2346 *
2347 * Requires: MBEDTLS_SSL_TLS_C
2348 *
2349 * This module is required for SSL/TLS server support.
2350 */
2351#define MBEDTLS_SSL_SRV_C
2352
2353/**
2354 * \def MBEDTLS_SSL_TLS_C
2355 *
2356 * Enable the generic SSL/TLS code.
2357 *
2358 * Module: library/ssl_tls.c
2359 * Caller: library/ssl_cli.c
2360 * library/ssl_srv.c
2361 *
2362 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
2363 * and at least one of the MBEDTLS_SSL_PROTO_XXX defines
2364 *
2365 * This module is required for SSL/TLS.
2366 */
2367#define MBEDTLS_SSL_TLS_C
2368
2369/**
2370 * \def MBEDTLS_THREADING_C
2371 *
2372 * Enable the threading abstraction layer.
2373 * By default mbed TLS assumes it is used in a non-threaded environment or that
2374 * contexts are not shared between threads. If you do intend to use contexts
2375 * between threads, you will need to enable this layer to prevent race
2376 * conditions. See also our Knowledge Base article about threading:
2377 * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
2378 *
2379 * Module: library/threading.c
2380 *
2381 * This allows different threading implementations (self-implemented or
2382 * provided).
2383 *
2384 * You will have to enable either MBEDTLS_THREADING_ALT or
2385 * MBEDTLS_THREADING_PTHREAD.
2386 *
2387 * Enable this layer to allow use of mutexes within mbed TLS
2388 */
2389//#define MBEDTLS_THREADING_C
2390
2391/**
2392 * \def MBEDTLS_TIMING_C
2393 *
2394 * Enable the semi-portable timing interface.
2395 *
2396 * \note The provided implementation only works on POSIX/Unix (including Linux,
2397 * BSD and OS X) and Windows. On other platforms, you can either disable that
2398 * module and provide your own implementations of the callbacks needed by
2399 * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide
2400 * your own implementation of the whole module by setting
2401 * \c MBEDTLS_TIMING_ALT in the current file.
2402 *
2403 * \note See also our Knowledge Base article about porting to a new
2404 * environment:
2405 * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
2406 *
2407 * Module: library/timing.c
2408 * Caller: library/havege.c
2409 *
2410 * This module is used by the HAVEGE random number generator.
2411 */
2412//#define MBEDTLS_TIMING_C
2413
2414/**
2415 * \def MBEDTLS_VERSION_C
2416 *
2417 * Enable run-time version information.
2418 *
2419 * Module: library/version.c
2420 *
2421 * This module provides run-time version information.
2422 */
2423#define MBEDTLS_VERSION_C
2424
2425/**
2426 * \def MBEDTLS_X509_USE_C
2427 *
2428 * Enable X.509 core for using certificates.
2429 *
2430 * Module: library/x509.c
2431 * Caller: library/x509_crl.c
2432 * library/x509_crt.c
2433 * library/x509_csr.c
2434 *
2435 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
2436 * MBEDTLS_PK_PARSE_C
2437 *
2438 * This module is required for the X.509 parsing modules.
2439 */
2440#define MBEDTLS_X509_USE_C
2441
2442/**
2443 * \def MBEDTLS_X509_CRT_PARSE_C
2444 *
2445 * Enable X.509 certificate parsing.
2446 *
2447 * Module: library/x509_crt.c
2448 * Caller: library/ssl_cli.c
2449 * library/ssl_srv.c
2450 * library/ssl_tls.c
2451 *
2452 * Requires: MBEDTLS_X509_USE_C
2453 *
2454 * This module is required for X.509 certificate parsing.
2455 */
2456#define MBEDTLS_X509_CRT_PARSE_C
2457
2458/**
2459 * \def MBEDTLS_X509_CRL_PARSE_C
2460 *
2461 * Enable X.509 CRL parsing.
2462 *
2463 * Module: library/x509_crl.c
2464 * Caller: library/x509_crt.c
2465 *
2466 * Requires: MBEDTLS_X509_USE_C
2467 *
2468 * This module is required for X.509 CRL parsing.
2469 */
2470#define MBEDTLS_X509_CRL_PARSE_C
2471
2472/**
2473 * \def MBEDTLS_X509_CSR_PARSE_C
2474 *
2475 * Enable X.509 Certificate Signing Request (CSR) parsing.
2476 *
2477 * Module: library/x509_csr.c
2478 * Caller: library/x509_crt_write.c
2479 *
2480 * Requires: MBEDTLS_X509_USE_C
2481 *
2482 * This module is used for reading X.509 certificate request.
2483 */
2484#define MBEDTLS_X509_CSR_PARSE_C
2485
2486/**
2487 * \def MBEDTLS_X509_CREATE_C
2488 *
2489 * Enable X.509 core for creating certificates.
2490 *
2491 * Module: library/x509_create.c
2492 *
2493 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C
2494 *
2495 * This module is the basis for creating X.509 certificates and CSRs.
2496 */
2497#define MBEDTLS_X509_CREATE_C
2498
2499/**
2500 * \def MBEDTLS_X509_CRT_WRITE_C
2501 *
2502 * Enable creating X.509 certificates.
2503 *
2504 * Module: library/x509_crt_write.c
2505 *
2506 * Requires: MBEDTLS_X509_CREATE_C
2507 *
2508 * This module is required for X.509 certificate creation.
2509 */
2510#define MBEDTLS_X509_CRT_WRITE_C
2511
2512/**
2513 * \def MBEDTLS_X509_CSR_WRITE_C
2514 *
2515 * Enable creating X.509 Certificate Signing Requests (CSR).
2516 *
2517 * Module: library/x509_csr_write.c
2518 *
2519 * Requires: MBEDTLS_X509_CREATE_C
2520 *
2521 * This module is required for X.509 certificate request writing.
2522 */
2523#define MBEDTLS_X509_CSR_WRITE_C
2524
2525/**
2526 * \def MBEDTLS_XTEA_C
2527 *
2528 * Enable the XTEA block cipher.
2529 *
2530 * Module: library/xtea.c
2531 * Caller:
2532 */
2533#define MBEDTLS_XTEA_C
2534
2535/* \} name SECTION: mbed TLS modules */
2536
2537/**
2538 * \name SECTION: Module configuration options
2539 *
2540 * This section allows for the setting of module specific sizes and
2541 * configuration options. The default values are already present in the
2542 * relevant header files and should suffice for the regular use cases.
2543 *
2544 * Our advice is to enable options and change their values here
2545 * only if you have a good reason and know the consequences.
2546 *
2547 * Please check the respective header file for documentation on these
2548 * parameters (to prevent duplicate documentation).
2549 * \{
2550 */
2551
2552/* MPI / BIGNUM options */
2553//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
2554//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
2555
2556/* CTR_DRBG options */
2557//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
2558//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
2559//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
2560//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
2561//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
2562
2563/* HMAC_DRBG options */
2564//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
2565//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
2566//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
2567//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
2568
2569/* ECP options */
2570//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
2571//#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */
2572//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
2573
2574/* Entropy options */
2575//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
2576//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
2577//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */
2578
2579/* Memory buffer allocator options */
2580//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
2581
2582/* Platform options */
2583//#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. */
2584//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
2585//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
2586//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
2587//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
2588//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
2589//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
2590/* Note: your snprintf must correclty zero-terminate the buffer! */
2591//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
2592//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */
2593//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */
2594//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
2595//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
2596//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */
2597
2598/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
2599/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
2600//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */
2601//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
2602//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
2603//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
2604//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
2605//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
2606//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
2607/* Note: your snprintf must correclty zero-terminate the buffer! */
2608//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
2609//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
2610//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
2611
2612/* SSL Cache options */
2613//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
2614//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
2615
2616/* SSL options */
2617//#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */
2618//#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
2619//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */
2620//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
2621
2622/**
2623 * Complete list of ciphersuites to use, in order of preference.
2624 *
2625 * \warning No dependency checking is done on that field! This option can only
2626 * be used to restrict the set of available ciphersuites. It is your
2627 * responsibility to make sure the needed modules are active.
2628 *
2629 * Use this to save a few hundred bytes of ROM (default ordering of all
2630 * available ciphersuites) and a few to a few hundred bytes of RAM.
2631 *
2632 * The value below is only an example, not the default.
2633 */
2634//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
2635
2636/* X509 options */
2637//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
2638//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
2639
2640/**
2641 * Allow SHA-1 in the default TLS configuration for certificate signing.
2642 * Without this build-time option, SHA-1 support must be activated explicitly
2643 * through mbedtls_ssl_conf_cert_profile. Turning on this option is not
2644 * recommended because of it is possible to generte SHA-1 collisions, however
2645 * this may be safe for legacy infrastructure where additional controls apply.
2646 */
2647// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
2648
2649/**
2650 * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
2651 * signature and ciphersuite selection. Without this build-time option, SHA-1
2652 * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes.
2653 * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by
2654 * default. At the time of writing, there is no practical attack on the use
2655 * of SHA-1 in handshake signatures, hence this option is turned on by default
2656 * for compatibility with existing peers.
2657 */
2658#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
2659
2660/* \} name SECTION: Customisation configuration options */
2661
2662/* Target and application specific configurations */
2663//#define YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE "mbedtls/target_config.h"
2664
2665#if defined(TARGET_LIKE_MBED) && defined(YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE)
2666#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
2667#endif
2668
2669/*
2670 * Allow user to override any previous default.
2671 *
2672 * Use two macro names for that, as:
2673 * - with yotta the prefix YOTTA_CFG_ is forced
2674 * - without yotta is looks weird to have a YOTTA prefix.
2675 */
2676#if defined(YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE)
2677#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
2678#elif defined(MBEDTLS_USER_CONFIG_FILE)
2679#include MBEDTLS_USER_CONFIG_FILE
2680#endif
2681
2682#endif /* MBEDTLS_CONFIG_H */