Mbed OS Reference
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1/**
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/*
11 * Copyright The Mbed TLS Contributors
12 * SPDX-License-Identifier: Apache-2.0
13 *
14 * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 * not use this file except in compliance with the License.
16 * You may obtain a copy of the License at
17 *
18 * http://www.apache.org/licenses/LICENSE-2.0
19 *
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
22 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
25 */
26
27#ifndef MBEDTLS_CONFIG_H
28
29#include "platform/inc/platform_mbed.h"
30
31/*
32 * Only use features that do not require an entropy source when
33 * DEVICE_ENTROPY_SOURCE is not defined in mbed OS.
34 */
35#if !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && !defined(MBEDTLS_TEST_NULL_ENTROPY) && \
36 !defined(MBEDTLS_ENTROPY_NV_SEED)
38
39#if defined(MBEDTLS_USER_CONFIG_FILE)
40#include MBEDTLS_USER_CONFIG_FILE
41#endif
42
43#else
44#define MBEDTLS_CONFIG_H
45
46#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
47#define _CRT_SECURE_NO_DEPRECATE 1
48#endif
49
50/**
51 * \name SECTION: System support
52 *
53 * This section sets system specific settings.
54 * \{
55 */
56
57/**
58 * \def MBEDTLS_HAVE_ASM
59 *
60 * The compiler has support for asm().
61 *
62 * Requires support for asm() in compiler.
63 *
64 * Used in:
65 * library/aria.c
66 * library/timing.c
67 * include/mbedtls/bn_mul.h
68 *
69 * Required by:
70 * MBEDTLS_AESNI_C
71 * MBEDTLS_PADLOCK_C
72 *
73 * Comment to disable the use of assembly code.
74 */
75#define MBEDTLS_HAVE_ASM
76
77/**
78 * \def MBEDTLS_NO_UDBL_DIVISION
79 *
80 * The platform lacks support for double-width integer division (64-bit
81 * division on a 32-bit platform, 128-bit division on a 64-bit platform).
82 *
83 * Used in:
84 * include/mbedtls/bignum.h
85 * library/bignum.c
86 *
87 * The bignum code uses double-width division to speed up some operations.
88 * Double-width division is often implemented in software that needs to
89 * be linked with the program. The presence of a double-width integer
90 * type is usually detected automatically through preprocessor macros,
91 * but the automatic detection cannot know whether the code needs to
92 * and can be linked with an implementation of division for that type.
93 * By default division is assumed to be usable if the type is present.
94 * Uncomment this option to prevent the use of double-width division.
95 *
96 * Note that division for the native integer type is always required.
97 * Furthermore, a 64-bit type is always required even on a 32-bit
98 * platform, but it need not support multiplication or division. In some
99 * cases it is also desirable to disable some double-width operations. For
100 * example, if double-width division is implemented in software, disabling
101 * it can reduce code size in some embedded targets.
102 */
103//#define MBEDTLS_NO_UDBL_DIVISION
104
105/**
106 * \def MBEDTLS_NO_64BIT_MULTIPLICATION
107 *
108 * The platform lacks support for 32x32 -> 64-bit multiplication.
109 *
110 * Used in:
111 * library/poly1305.c
112 *
113 * Some parts of the library may use multiplication of two unsigned 32-bit
114 * operands with a 64-bit result in order to speed up computations. On some
115 * platforms, this is not available in hardware and has to be implemented in
116 * software, usually in a library provided by the toolchain.
117 *
118 * Sometimes it is not desirable to have to link to that library. This option
119 * removes the dependency of that library on platforms that lack a hardware
120 * 64-bit multiplier by embedding a software implementation in Mbed TLS.
121 *
122 * Note that depending on the compiler, this may decrease performance compared
123 * to using the library function provided by the toolchain.
124 */
125//#define MBEDTLS_NO_64BIT_MULTIPLICATION
126
127/**
128 * \def MBEDTLS_HAVE_SSE2
129 *
130 * CPU supports SSE2 instruction set.
131 *
132 * Uncomment if the CPU supports SSE2 (IA-32 specific).
133 */
134//#define MBEDTLS_HAVE_SSE2
135
136/**
137 * \def MBEDTLS_HAVE_TIME
138 *
139 * System has time.h and time().
140 * The time does not need to be correct, only time differences are used,
141 * by contrast with MBEDTLS_HAVE_TIME_DATE
142 *
143 * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT,
144 * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and
145 * MBEDTLS_PLATFORM_STD_TIME.
146 *
147 * Comment if your system does not support time functions
148 */
149#define MBEDTLS_HAVE_TIME
150
151/**
152 * \def MBEDTLS_HAVE_TIME_DATE
153 *
154 * System has time.h, time(), and an implementation for
155 * mbedtls_platform_gmtime_r() (see below).
156 * The time needs to be correct (not necessarily very accurate, but at least
157 * the date should be correct). This is used to verify the validity period of
158 * X.509 certificates.
159 *
160 * Comment if your system does not have a correct clock.
161 *
162 * \note mbedtls_platform_gmtime_r() is an abstraction in platform_util.h that
163 * behaves similarly to the gmtime_r() function from the C standard. Refer to
164 * the documentation for mbedtls_platform_gmtime_r() for more information.
165 *
166 * \note It is possible to configure an implementation for
167 * mbedtls_platform_gmtime_r() at compile-time by using the macro
168 * MBEDTLS_PLATFORM_GMTIME_R_ALT.
169 */
170//#define MBEDTLS_HAVE_TIME_DATE
171
172/**
173 * \def MBEDTLS_PLATFORM_MEMORY
174 *
175 * Enable the memory allocation layer.
176 *
177 * By default mbed TLS uses the system-provided calloc() and free().
178 * This allows different allocators (self-implemented or provided) to be
179 * provided to the platform abstraction layer.
180 *
181 * Enabling MBEDTLS_PLATFORM_MEMORY without the
182 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
183 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
184 * free() function pointer at runtime.
185 *
186 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
187 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
188 * alternate function at compile time.
189 *
190 * Requires: MBEDTLS_PLATFORM_C
191 *
192 * Enable this layer to allow use of alternative memory allocators.
193 */
194//#define MBEDTLS_PLATFORM_MEMORY
195
196/**
197 * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
198 *
199 * Do not assign standard functions in the platform layer (e.g. calloc() to
200 * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF)
201 *
202 * This makes sure there are no linking errors on platforms that do not support
203 * these functions. You will HAVE to provide alternatives, either at runtime
204 * via the platform_set_xxx() functions or at compile time by setting
205 * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a
206 * MBEDTLS_PLATFORM_XXX_MACRO.
207 *
208 * Requires: MBEDTLS_PLATFORM_C
209 *
210 * Uncomment to prevent default assignment of standard functions in the
211 * platform layer.
212 */
213//#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
214
215/**
216 * \def MBEDTLS_PLATFORM_EXIT_ALT
217 *
218 * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the
219 * function in the platform abstraction layer.
220 *
221 * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will
222 * provide a function "mbedtls_platform_set_printf()" that allows you to set an
223 * alternative printf function pointer.
224 *
225 * All these define require MBEDTLS_PLATFORM_C to be defined!
226 *
227 * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows;
228 * it will be enabled automatically by check_config.h
229 *
230 * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as
231 * MBEDTLS_PLATFORM_XXX_MACRO!
232 *
233 * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME
234 *
235 * Uncomment a macro to enable alternate implementation of specific base
236 * platform function
237 */
238//#define MBEDTLS_PLATFORM_EXIT_ALT
239//#define MBEDTLS_PLATFORM_TIME_ALT
240//#define MBEDTLS_PLATFORM_FPRINTF_ALT
241//#define MBEDTLS_PLATFORM_PRINTF_ALT
242//#define MBEDTLS_PLATFORM_SNPRINTF_ALT
243//#define MBEDTLS_PLATFORM_VSNPRINTF_ALT
244//#define MBEDTLS_PLATFORM_NV_SEED_ALT
245//#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
246
247/**
248 * \def MBEDTLS_DEPRECATED_WARNING
249 *
250 * Mark deprecated functions and features so that they generate a warning if
251 * used. Functionality deprecated in one version will usually be removed in the
252 * next version. You can enable this to help you prepare the transition to a
253 * new major version by making sure your code is not using this functionality.
254 *
255 * This only works with GCC and Clang. With other compilers, you may want to
256 * use MBEDTLS_DEPRECATED_REMOVED
257 *
258 * Uncomment to get warnings on using deprecated functions and features.
259 */
260//#define MBEDTLS_DEPRECATED_WARNING
261
262/**
263 * \def MBEDTLS_DEPRECATED_REMOVED
264 *
265 * Remove deprecated functions and features so that they generate an error if
266 * used. Functionality deprecated in one version will usually be removed in the
267 * next version. You can enable this to help you prepare the transition to a
268 * new major version by making sure your code is not using this functionality.
269 *
270 * Uncomment to get errors on using deprecated functions and features.
271 */
272//#define MBEDTLS_DEPRECATED_REMOVED
273
274/**
275 * \def MBEDTLS_CHECK_PARAMS
276 *
277 * This configuration option controls whether the library validates more of
278 * the parameters passed to it.
279 *
280 * When this flag is not defined, the library only attempts to validate an
281 * input parameter if: (1) they may come from the outside world (such as the
282 * network, the filesystem, etc.) or (2) not validating them could result in
283 * internal memory errors such as overflowing a buffer controlled by the
284 * library. On the other hand, it doesn't attempt to validate parameters whose
285 * values are fully controlled by the application (such as pointers).
286 *
287 * When this flag is defined, the library additionally attempts to validate
288 * parameters that are fully controlled by the application, and should always
289 * be valid if the application code is fully correct and trusted.
290 *
291 * For example, when a function accepts as input a pointer to a buffer that may
292 * contain untrusted data, and its documentation mentions that this pointer
293 * must not be NULL:
294 * - The pointer is checked to be non-NULL only if this option is enabled.
295 * - The content of the buffer is always validated.
296 *
297 * When this flag is defined, if a library function receives a parameter that
298 * is invalid:
299 * 1. The function will invoke the macro MBEDTLS_PARAM_FAILED().
300 * 2. If MBEDTLS_PARAM_FAILED() did not terminate the program, the function
301 * will immediately return. If the function returns an Mbed TLS error code,
302 * the error code in this case is MBEDTLS_ERR_xxx_BAD_INPUT_DATA.
303 *
304 * When defining this flag, you also need to arrange a definition for
305 * MBEDTLS_PARAM_FAILED(). You can do this by any of the following methods:
306 * - By default, the library defines MBEDTLS_PARAM_FAILED() to call a
307 * function mbedtls_param_failed(), but the library does not define this
308 * function. If you do not make any other arrangements, you must provide
309 * the function mbedtls_param_failed() in your application.
310 * See `platform_util.h` for its prototype.
311 * - If you enable the macro #MBEDTLS_CHECK_PARAMS_ASSERT, then the
312 * library defines MBEDTLS_PARAM_FAILED(\c cond) to be `assert(cond)`.
313 * You can still supply an alternative definition of
314 * MBEDTLS_PARAM_FAILED(), which may call `assert`.
315 * - If you define a macro MBEDTLS_PARAM_FAILED() before including `config.h`
316 * or you uncomment the definition of MBEDTLS_PARAM_FAILED() in `config.h`,
317 * the library will call the macro that you defined and will not supply
318 * its own version. Note that if MBEDTLS_PARAM_FAILED() calls `assert`,
319 * you need to enable #MBEDTLS_CHECK_PARAMS_ASSERT so that library source
320 * files include `<assert.h>`.
321 *
322 * Uncomment to enable validation of application-controlled parameters.
323 */
324//#define MBEDTLS_CHECK_PARAMS
325
326/**
327 * \def MBEDTLS_CHECK_PARAMS_ASSERT
328 *
329 * Allow MBEDTLS_PARAM_FAILED() to call `assert`, and make it default to
330 * `assert`. This macro is only used if #MBEDTLS_CHECK_PARAMS is defined.
331 *
332 * If this macro is not defined, then MBEDTLS_PARAM_FAILED() defaults to
333 * calling a function mbedtls_param_failed(). See the documentation of
334 * #MBEDTLS_CHECK_PARAMS for details.
335 *
336 * Uncomment to allow MBEDTLS_PARAM_FAILED() to call `assert`.
337 */
338//#define MBEDTLS_CHECK_PARAMS_ASSERT
339
340/* \} name SECTION: System support */
341
342/**
343 * \name SECTION: mbed TLS feature support
344 *
345 * This section sets support for features that are or are not needed
346 * within the modules that are enabled.
347 * \{
348 */
349
350/**
351 * \def MBEDTLS_TIMING_ALT
352 *
353 * Uncomment to provide your own alternate implementation for mbedtls_timing_hardclock(),
354 * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay()
355 *
356 * Only works if you have MBEDTLS_TIMING_C enabled.
357 *
358 * You will need to provide a header "timing_alt.h" and an implementation at
359 * compile time.
360 */
361//#define MBEDTLS_TIMING_ALT
362
363/**
364 * \def MBEDTLS_AES_ALT
365 *
366 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
367 * alternate core implementation of a symmetric crypto, an arithmetic or hash
368 * module (e.g. platform specific assembly optimized implementations). Keep
369 * in mind that the function prototypes should remain the same.
370 *
371 * This replaces the whole module. If you only want to replace one of the
372 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
373 *
374 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
375 * provide the "struct mbedtls_aes_context" definition and omit the base
376 * function declarations and implementations. "aes_alt.h" will be included from
377 * "aes.h" to include the new function definitions.
378 *
379 * Uncomment a macro to enable alternate implementation of the corresponding
380 * module.
381 *
382 * \warning MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their
383 * use constitutes a security risk. If possible, we recommend
384 * avoiding dependencies on them, and considering stronger message
385 * digests and ciphers instead.
386 *
387 */
388//#define MBEDTLS_AES_ALT
389//#define MBEDTLS_ARC4_ALT
390//#define MBEDTLS_ARIA_ALT
391//#define MBEDTLS_BLOWFISH_ALT
392//#define MBEDTLS_CAMELLIA_ALT
393//#define MBEDTLS_CCM_ALT
394//#define MBEDTLS_CHACHA20_ALT
395//#define MBEDTLS_CHACHAPOLY_ALT
396//#define MBEDTLS_CMAC_ALT
397//#define MBEDTLS_DES_ALT
398//#define MBEDTLS_DHM_ALT
399//#define MBEDTLS_ECJPAKE_ALT
400//#define MBEDTLS_GCM_ALT
401//#define MBEDTLS_NIST_KW_ALT
402//#define MBEDTLS_MD2_ALT
403//#define MBEDTLS_MD4_ALT
404//#define MBEDTLS_MD5_ALT
405//#define MBEDTLS_POLY1305_ALT
406//#define MBEDTLS_RIPEMD160_ALT
407//#define MBEDTLS_RSA_ALT
408//#define MBEDTLS_SHA1_ALT
409//#define MBEDTLS_SHA256_ALT
410//#define MBEDTLS_SHA512_ALT
411//#define MBEDTLS_XTEA_ALT
412
413/*
414 * When replacing the elliptic curve module, pleace consider, that it is
415 * implemented with two .c files:
416 * - ecp.c
417 * - ecp_curves.c
418 * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT
419 * macros as described above. The only difference is that you have to make sure
420 * that you provide functionality for both .c files.
421 */
422//#define MBEDTLS_ECP_ALT
423
424/**
425 * \def MBEDTLS_MD2_PROCESS_ALT
426 *
427 * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you
428 * alternate core implementation of symmetric crypto or hash function. Keep in
429 * mind that function prototypes should remain the same.
430 *
431 * This replaces only one function. The header file from mbed TLS is still
432 * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags.
433 *
434 * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will
435 * no longer provide the mbedtls_sha1_process() function, but it will still provide
436 * the other function (using your mbedtls_sha1_process() function) and the definition
437 * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible
438 * with this definition.
439 *
440 * \note Because of a signature change, the core AES encryption and decryption routines are
441 * currently named mbedtls_aes_internal_encrypt and mbedtls_aes_internal_decrypt,
442 * respectively. When setting up alternative implementations, these functions should
443 * be overridden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt
444 * must stay untouched.
445 *
446 * \note If you use the AES_xxx_ALT macros, then is is recommended to also set
447 * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES
448 * tables.
449 *
450 * Uncomment a macro to enable alternate implementation of the corresponding
451 * function.
452 *
453 * \warning MD2, MD4, MD5, DES and SHA-1 are considered weak and their use
454 * constitutes a security risk. If possible, we recommend avoiding
455 * dependencies on them, and considering stronger message digests
456 * and ciphers instead.
457 *
458 * \warning If both MBEDTLS_ECDSA_SIGN_ALT and MBEDTLS_ECDSA_DETERMINISTIC are
459 * enabled, then the deterministic ECDH signature functions pass the
460 * the static HMAC-DRBG as RNG to mbedtls_ecdsa_sign(). Therefore
461 * alternative implementations should use the RNG only for generating
462 * the ephemeral key and nothing else. If this is not possible, then
463 * MBEDTLS_ECDSA_DETERMINISTIC should be disabled and an alternative
464 * implementation should be provided for mbedtls_ecdsa_sign_det_ext()
465 * (and for mbedtls_ecdsa_sign_det() too if backward compatibility is
466 * desirable).
467 *
468 */
469//#define MBEDTLS_MD2_PROCESS_ALT
470//#define MBEDTLS_MD4_PROCESS_ALT
471//#define MBEDTLS_MD5_PROCESS_ALT
472//#define MBEDTLS_RIPEMD160_PROCESS_ALT
473//#define MBEDTLS_SHA1_PROCESS_ALT
474//#define MBEDTLS_SHA256_PROCESS_ALT
475//#define MBEDTLS_SHA512_PROCESS_ALT
476//#define MBEDTLS_DES_SETKEY_ALT
477//#define MBEDTLS_DES_CRYPT_ECB_ALT
478//#define MBEDTLS_DES3_CRYPT_ECB_ALT
479//#define MBEDTLS_AES_SETKEY_ENC_ALT
480//#define MBEDTLS_AES_SETKEY_DEC_ALT
481//#define MBEDTLS_AES_ENCRYPT_ALT
482//#define MBEDTLS_AES_DECRYPT_ALT
483//#define MBEDTLS_ECDH_GEN_PUBLIC_ALT
484//#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT
485//#define MBEDTLS_ECDSA_VERIFY_ALT
486//#define MBEDTLS_ECDSA_SIGN_ALT
487//#define MBEDTLS_ECDSA_GENKEY_ALT
488
489/**
490 * \def MBEDTLS_ECP_INTERNAL_ALT
491 *
492 * Expose a part of the internal interface of the Elliptic Curve Point module.
493 *
494 * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your
495 * alternative core implementation of elliptic curve arithmetic. Keep in mind
496 * that function prototypes should remain the same.
497 *
498 * This partially replaces one function. The header file from mbed TLS is still
499 * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation
500 * is still present and it is used for group structures not supported by the
501 * alternative.
502 *
503 * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT
504 * and implementing the following functions:
505 * unsigned char mbedtls_internal_ecp_grp_capable(
506 * const mbedtls_ecp_group *grp )
507 * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp )
508 * void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp )
509 * The mbedtls_internal_ecp_grp_capable function should return 1 if the
510 * replacement functions implement arithmetic for the given group and 0
511 * otherwise.
512 * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_free are
513 * called before and after each point operation and provide an opportunity to
514 * implement optimized set up and tear down instructions.
515 *
516 * Example: In case you uncomment MBEDTLS_ECP_INTERNAL_ALT and
517 * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac
518 * function, but will use your mbedtls_internal_ecp_double_jac if the group is
519 * supported (your mbedtls_internal_ecp_grp_capable function returns 1 when
520 * receives it as an argument). If the group is not supported then the original
521 * implementation is used. The other functions and the definition of
522 * mbedtls_ecp_group and mbedtls_ecp_point will not change, so your
523 * implementation of mbedtls_internal_ecp_double_jac and
524 * mbedtls_internal_ecp_grp_capable must be compatible with this definition.
525 *
526 * Uncomment a macro to enable alternate implementation of the corresponding
527 * function.
528 */
529/* Required for all the functions in this section */
530//#define MBEDTLS_ECP_INTERNAL_ALT
531/* Support for Weierstrass curves with Jacobi representation */
532//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT
533//#define MBEDTLS_ECP_ADD_MIXED_ALT
534//#define MBEDTLS_ECP_DOUBLE_JAC_ALT
535//#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT
536//#define MBEDTLS_ECP_NORMALIZE_JAC_ALT
537/* Support for curves with Montgomery arithmetic */
538//#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT
539//#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT
540//#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT
541
542/**
543 * \def MBEDTLS_TEST_NULL_ENTROPY
544 *
545 * Enables testing and use of mbed TLS without any configured entropy sources.
546 * This permits use of the library on platforms before an entropy source has
547 * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the
548 * MBEDTLS_ENTROPY_NV_SEED switches).
549 *
550 * WARNING! This switch MUST be disabled in production builds, and is suitable
551 * only for development.
552 * Enabling the switch negates any security provided by the library.
553 *
554 * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
555 *
556 */
557//#define MBEDTLS_TEST_NULL_ENTROPY
558
559/**
560 * \def MBEDTLS_ENTROPY_HARDWARE_ALT
561 *
562 * Uncomment this macro to let mbed TLS use your own implementation of a
563 * hardware entropy collector.
564 *
565 * Your function must be called \c mbedtls_hardware_poll(), have the same
566 * prototype as declared in entropy_poll.h, and accept NULL as first argument.
567 *
568 * Uncomment to use your own hardware entropy collector.
569 */
570//#define MBEDTLS_ENTROPY_HARDWARE_ALT
571
572/**
573 * \def MBEDTLS_AES_ROM_TABLES
574 *
575 * Use precomputed AES tables stored in ROM.
576 *
577 * Uncomment this macro to use precomputed AES tables stored in ROM.
578 * Comment this macro to generate AES tables in RAM at runtime.
579 *
580 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
581 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
582 * initialization time before the first AES operation can be performed.
583 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
584 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
585 * performance if ROM access is slower than RAM access.
586 *
587 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
588 *
589 */
590#define MBEDTLS_AES_ROM_TABLES
591
592/**
593 * \def MBEDTLS_AES_FEWER_TABLES
594 *
595 * Use less ROM/RAM for AES tables.
596 *
597 * Uncommenting this macro omits 75% of the AES tables from
598 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
599 * by computing their values on the fly during operations
600 * (the tables are entry-wise rotations of one another).
601 *
602 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
603 * by ~6kb but at the cost of more arithmetic operations during
604 * runtime. Specifically, one has to compare 4 accesses within
605 * different tables to 4 accesses with additional arithmetic
606 * operations within the same table. The performance gain/loss
607 * depends on the system and memory details.
608 *
609 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
610 *
611 */
612//#define MBEDTLS_AES_FEWER_TABLES
613
614/**
615 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
616 *
617 * Use less ROM for the Camellia implementation (saves about 768 bytes).
618 *
619 * Uncomment this macro to use less memory for Camellia.
620 */
621//#define MBEDTLS_CAMELLIA_SMALL_MEMORY
622
623/**
624 * \def MBEDTLS_CIPHER_MODE_CBC
625 *
626 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
627 */
628#define MBEDTLS_CIPHER_MODE_CBC
629
630/**
631 * \def MBEDTLS_CIPHER_MODE_CFB
632 *
633 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
634 */
635//#define MBEDTLS_CIPHER_MODE_CFB
636
637/**
638 * \def MBEDTLS_CIPHER_MODE_CTR
639 *
640 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
641 */
642//#define MBEDTLS_CIPHER_MODE_CTR
643
644/**
645 * \def MBEDTLS_CIPHER_MODE_OFB
646 *
647 * Enable Output Feedback mode (OFB) for symmetric ciphers.
648 */
649//#define MBEDTLS_CIPHER_MODE_OFB
650
651/**
652 * \def MBEDTLS_CIPHER_MODE_XTS
653 *
654 * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES.
655 */
656//#define MBEDTLS_CIPHER_MODE_XTS
657
658/**
659 * \def MBEDTLS_CIPHER_NULL_CIPHER
660 *
661 * Enable NULL cipher.
662 * Warning: Only do so when you know what you are doing. This allows for
663 * encryption or channels without any security!
664 *
665 * Requires MBEDTLS_ENABLE_WEAK_CIPHERSUITES as well to enable
666 * the following ciphersuites:
667 * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA
668 * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA
669 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA
670 * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA
671 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384
672 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256
673 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA
674 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384
675 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256
676 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA
677 * MBEDTLS_TLS_RSA_WITH_NULL_SHA256
678 * MBEDTLS_TLS_RSA_WITH_NULL_SHA
679 * MBEDTLS_TLS_RSA_WITH_NULL_MD5
680 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384
681 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256
682 * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA
683 * MBEDTLS_TLS_PSK_WITH_NULL_SHA384
684 * MBEDTLS_TLS_PSK_WITH_NULL_SHA256
685 * MBEDTLS_TLS_PSK_WITH_NULL_SHA
686 *
687 * Uncomment this macro to enable the NULL cipher and ciphersuites
688 */
689//#define MBEDTLS_CIPHER_NULL_CIPHER
690
691/**
692 * \def MBEDTLS_CIPHER_PADDING_PKCS7
693 *
694 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
695 * specific padding modes in the cipher layer with cipher modes that support
696 * padding (e.g. CBC)
697 *
698 * If you disable all padding modes, only full blocks can be used with CBC.
699 *
700 * Enable padding modes in the cipher layer.
701 */
702#define MBEDTLS_CIPHER_PADDING_PKCS7
703//#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
704//#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
705//#define MBEDTLS_CIPHER_PADDING_ZEROS
706
707/** \def MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
708 *
709 * Uncomment this macro to use a 128-bit key in the CTR_DRBG module.
710 * By default, CTR_DRBG uses a 256-bit key.
711 */
712//#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
713
714/**
715 * \def MBEDTLS_ENABLE_WEAK_CIPHERSUITES
716 *
717 * Enable weak ciphersuites in SSL / TLS.
718 * Warning: Only do so when you know what you are doing. This allows for
719 * channels with virtually no security at all!
720 *
721 * This enables the following ciphersuites:
722 * MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA
723 * MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA
724 *
725 * Uncomment this macro to enable weak ciphersuites
726 *
727 * \warning DES is considered a weak cipher and its use constitutes a
728 * security risk. We recommend considering stronger ciphers instead.
729 */
730//#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES
731
732/**
733 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
734 *
735 * Remove RC4 ciphersuites by default in SSL / TLS.
736 * This flag removes the ciphersuites based on RC4 from the default list as
737 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
738 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
739 * explicitly.
740 *
741 * Uncomment this macro to remove RC4 ciphersuites by default.
742 */
743#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
744
745/**
746 * \def MBEDTLS_REMOVE_3DES_CIPHERSUITES
747 *
748 * Remove 3DES ciphersuites by default in SSL / TLS.
749 * This flag removes the ciphersuites based on 3DES from the default list as
750 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible
751 * to enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including
752 * them explicitly.
753 *
754 * A man-in-the-browser attacker can recover authentication tokens sent through
755 * a TLS connection using a 3DES based cipher suite (see "On the Practical
756 * (In-)Security of 64-bit Block Ciphers" by Karthikeyan Bhargavan and Gaëtan
757 * Leurent, see https://sweet32.info/SWEET32_CCS16.pdf). If this attack falls
758 * in your threat model or you are unsure, then you should keep this option
759 * enabled to remove 3DES based cipher suites.
760 *
761 * Comment this macro to keep 3DES in the default ciphersuite list.
762 */
763#define MBEDTLS_REMOVE_3DES_CIPHERSUITES
764
765/**
766 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
767 *
768 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
769 * module. By default all supported curves are enabled.
770 *
771 * Comment macros to disable the curve and functions for it
772 */
773/* Short Weierstrass curves (supporting ECP, ECDH, ECDSA) */
774//#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
775//#define MBEDTLS_ECP_DP_SECP224R1_ENABLED
776#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
777#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
778//#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
779//#define MBEDTLS_ECP_DP_SECP192K1_ENABLED
780//#define MBEDTLS_ECP_DP_SECP224K1_ENABLED
781//#define MBEDTLS_ECP_DP_SECP256K1_ENABLED
782//#define MBEDTLS_ECP_DP_BP256R1_ENABLED
783//#define MBEDTLS_ECP_DP_BP384R1_ENABLED
784//#define MBEDTLS_ECP_DP_BP512R1_ENABLED
785/* Montgomery curves (supporting ECP) */
786#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
787#define MBEDTLS_ECP_DP_CURVE448_ENABLED
788
789/**
790 * \def MBEDTLS_ECP_NIST_OPTIM
791 *
792 * Enable specific 'modulo p' routines for each NIST prime.
793 * Depending on the prime and architecture, makes operations 4 to 8 times
794 * faster on the corresponding curve.
795 *
796 * Comment this macro to disable NIST curves optimisation.
797 */
798#define MBEDTLS_ECP_NIST_OPTIM
799
800/**
801 * \def MBEDTLS_ECP_NO_INTERNAL_RNG
802 *
803 * When this option is disabled, mbedtls_ecp_mul() will make use of an
804 * internal RNG when called with a NULL \c f_rng argument, in order to protect
805 * against some side-channel attacks.
806 *
807 * This protection introduces a dependency of the ECP module on one of the
808 * DRBG modules. For very constrained implementations that don't require this
809 * protection (for example, because you're only doing signature verification,
810 * so not manipulating any secret, or because local/physical side-channel
811 * attacks are outside your threat model), it might be desirable to get rid of
812 * that dependency.
813 *
814 * \warning Enabling this option makes some uses of ECP vulnerable to some
815 * side-channel attacks. Only enable it if you know that's not a problem for
816 * your use case.
817 *
818 * Uncomment this macro to disable some counter-measures in ECP.
819 */
820//#define MBEDTLS_ECP_NO_INTERNAL_RNG
821
822/**
823 * \def MBEDTLS_ECP_RESTARTABLE
824 *
825 * Enable "non-blocking" ECC operations that can return early and be resumed.
826 *
827 * This allows various functions to pause by returning
828 * #MBEDTLS_ERR_ECP_IN_PROGRESS (or, for functions in the SSL module,
829 * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) and then be called later again in
830 * order to further progress and eventually complete their operation. This is
831 * controlled through mbedtls_ecp_set_max_ops() which limits the maximum
832 * number of ECC operations a function may perform before pausing; see
833 * mbedtls_ecp_set_max_ops() for more information.
834 *
835 * This is useful in non-threaded environments if you want to avoid blocking
836 * for too long on ECC (and, hence, X.509 or SSL/TLS) operations.
837 *
838 * Uncomment this macro to enable restartable ECC computations.
839 *
840 * \note This option only works with the default software implementation of
841 * elliptic curve functionality. It is incompatible with
842 * MBEDTLS_ECP_ALT, MBEDTLS_ECDH_XXX_ALT, MBEDTLS_ECDSA_XXX_ALT
843 * and MBEDTLS_ECDH_LEGACY_CONTEXT.
844 */
845//#define MBEDTLS_ECP_RESTARTABLE
846
847/**
848 * \def MBEDTLS_ECDH_LEGACY_CONTEXT
849 *
850 * Use a backward compatible ECDH context.
851 *
852 * Mbed TLS supports two formats for ECDH contexts (#mbedtls_ecdh_context
853 * defined in `ecdh.h`). For most applications, the choice of format makes
854 * no difference, since all library functions can work with either format,
855 * except that the new format is incompatible with MBEDTLS_ECP_RESTARTABLE.
856
857 * The new format used when this option is disabled is smaller
858 * (56 bytes on a 32-bit platform). In future versions of the library, it
859 * will support alternative implementations of ECDH operations.
860 * The new format is incompatible with applications that access
861 * context fields directly and with restartable ECP operations.
862 *
863 * Define this macro if you enable MBEDTLS_ECP_RESTARTABLE or if you
864 * want to access ECDH context fields directly. Otherwise you should
865 * comment out this macro definition.
866 *
867 * This option has no effect if #MBEDTLS_ECDH_C is not enabled.
868 *
869 * \note This configuration option is experimental. Future versions of the
870 * library may modify the way the ECDH context layout is configured
871 * and may modify the layout of the new context type.
872 */
873#define MBEDTLS_ECDH_LEGACY_CONTEXT
874
875/**
876 * \def MBEDTLS_ECDSA_DETERMINISTIC
877 *
878 * Enable deterministic ECDSA (RFC 6979).
879 * Standard ECDSA is "fragile" in the sense that lack of entropy when signing
880 * may result in a compromise of the long-term signing key. This is avoided by
881 * the deterministic variant.
882 *
883 * Requires: MBEDTLS_HMAC_DRBG_C, MBEDTLS_ECDSA_C
884 *
885 * Comment this macro to disable deterministic ECDSA.
886 */
887#define MBEDTLS_ECDSA_DETERMINISTIC
888
889/**
890 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
891 *
892 * Enable the PSK based ciphersuite modes in SSL / TLS.
893 *
894 * This enables the following ciphersuites (if other requisites are
895 * enabled as well):
896 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
897 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
898 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
899 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
900 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
901 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
902 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
903 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
904 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
905 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
906 * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
907 * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
908 */
909#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
910
911/**
912 * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
913 *
914 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS.
915 *
916 * Requires: MBEDTLS_DHM_C
917 *
918 * This enables the following ciphersuites (if other requisites are
919 * enabled as well):
920 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
921 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
922 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
923 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
924 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
925 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
926 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
927 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
928 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
929 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
930 * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
931 * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
932 *
933 * \warning Using DHE constitutes a security risk as it
934 * is not possible to validate custom DH parameters.
935 * If possible, it is recommended users should consider
936 * preferring other methods of key exchange.
937 * See dhm.h for more details.
938 *
939 */
940//#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
941
942/**
943 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
944 *
945 * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
946 *
947 * Requires: MBEDTLS_ECDH_C
948 *
949 * This enables the following ciphersuites (if other requisites are
950 * enabled as well):
951 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
952 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
953 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
954 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
955 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
956 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
957 * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
958 * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
959 */
960#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
961
962/**
963 * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
964 *
965 * Enable the RSA-PSK based ciphersuite modes in SSL / TLS.
966 *
967 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
968 * MBEDTLS_X509_CRT_PARSE_C
969 *
970 * This enables the following ciphersuites (if other requisites are
971 * enabled as well):
972 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
973 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
974 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
975 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
976 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
977 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
978 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
979 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
980 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
981 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
982 * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
983 * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
984 */
985//#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
986
987/**
988 * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
989 *
990 * Enable the RSA-only based ciphersuite modes in SSL / TLS.
991 *
992 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
993 * MBEDTLS_X509_CRT_PARSE_C
994 *
995 * This enables the following ciphersuites (if other requisites are
996 * enabled as well):
997 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
998 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
999 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
1000 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
1001 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
1002 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
1003 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
1004 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
1005 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
1006 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
1007 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
1008 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
1009 * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
1010 * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
1011 * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
1012 */
1013//#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
1014
1015/**
1016 * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
1017 *
1018 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS.
1019 *
1020 * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
1021 * MBEDTLS_X509_CRT_PARSE_C
1022 *
1023 * This enables the following ciphersuites (if other requisites are
1024 * enabled as well):
1025 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
1026 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
1027 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
1028 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1029 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
1030 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
1031 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
1032 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
1033 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
1034 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1035 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1036 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
1037 * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
1038 *
1039 * \warning Using DHE constitutes a security risk as it
1040 * is not possible to validate custom DH parameters.
1041 * If possible, it is recommended users should consider
1042 * preferring other methods of key exchange.
1043 * See dhm.h for more details.
1044 *
1045 */
1046//#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
1047
1048/**
1049 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
1050 *
1051 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
1052 *
1053 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
1054 * MBEDTLS_X509_CRT_PARSE_C
1055 *
1056 * This enables the following ciphersuites (if other requisites are
1057 * enabled as well):
1058 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
1059 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
1060 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
1061 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
1062 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
1063 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
1064 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
1065 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
1066 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
1067 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
1068 * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
1069 * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
1070 */
1071#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
1072
1073/**
1074 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
1075 *
1076 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
1077 *
1078 * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C,
1079 *
1080 * This enables the following ciphersuites (if other requisites are
1081 * enabled as well):
1082 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
1083 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
1084 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
1085 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1086 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1087 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
1088 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
1089 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
1090 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1091 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1092 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
1093 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
1094 */
1095#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
1096
1097/**
1098 * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
1099 *
1100 * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
1101 *
1102 * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C
1103 *
1104 * This enables the following ciphersuites (if other requisites are
1105 * enabled as well):
1106 * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
1107 * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
1108 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
1109 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
1110 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
1111 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
1112 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
1113 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
1114 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
1115 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
1116 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
1117 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
1118 */
1119//#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
1120
1121/**
1122 * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
1123 *
1124 * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS.
1125 *
1126 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_X509_CRT_PARSE_C
1127 *
1128 * This enables the following ciphersuites (if other requisites are
1129 * enabled as well):
1130 * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
1131 * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
1132 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
1133 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
1134 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
1135 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
1136 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
1137 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
1138 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
1139 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
1140 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
1141 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
1142 */
1143//#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
1144
1145/**
1146 * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
1147 *
1148 * Enable the ECJPAKE based ciphersuite modes in SSL / TLS.
1149 *
1150 * \warning This is currently experimental. EC J-PAKE support is based on the
1151 * Thread v1.0.0 specification; incompatible changes to the specification
1152 * might still happen. For this reason, this is disabled by default.
1153 *
1154 * Requires: MBEDTLS_ECJPAKE_C
1155 * MBEDTLS_SHA256_C
1156 * MBEDTLS_ECP_DP_SECP256R1_ENABLED
1157 *
1158 * This enables the following ciphersuites (if other requisites are
1159 * enabled as well):
1160 * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
1161 */
1162//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
1163
1164/**
1165 * \def MBEDTLS_PK_PARSE_EC_EXTENDED
1166 *
1167 * Enhance support for reading EC keys using variants of SEC1 not allowed by
1168 * RFC 5915 and RFC 5480.
1169 *
1170 * Currently this means parsing the SpecifiedECDomain choice of EC
1171 * parameters (only known groups are supported, not arbitrary domains, to
1172 * avoid validation issues).
1173 *
1174 * Disable if you only need to support RFC 5915 + 5480 key formats.
1175 */
1176//#define MBEDTLS_PK_PARSE_EC_EXTENDED
1177
1178/**
1179 * \def MBEDTLS_ERROR_STRERROR_DUMMY
1180 *
1181 * Enable a dummy error function to make use of mbedtls_strerror() in
1182 * third party libraries easier when MBEDTLS_ERROR_C is disabled
1183 * (no effect when MBEDTLS_ERROR_C is enabled).
1184 *
1185 * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're
1186 * not using mbedtls_strerror() or error_strerror() in your application.
1187 *
1188 * Disable if you run into name conflicts and want to really remove the
1189 * mbedtls_strerror()
1190 */
1191#define MBEDTLS_ERROR_STRERROR_DUMMY
1192
1193/**
1194 * \def MBEDTLS_GENPRIME
1195 *
1196 * Enable the prime-number generation code.
1197 *
1198 * Requires: MBEDTLS_BIGNUM_C
1199 */
1200//#define MBEDTLS_GENPRIME
1201
1202/**
1203 * \def MBEDTLS_FS_IO
1204 *
1205 * Enable functions that use the filesystem.
1206 */
1207#define MBEDTLS_FS_IO
1208
1209/**
1210 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
1211 *
1212 * Do not add default entropy sources. These are the platform specific,
1213 * mbedtls_timing_hardclock and HAVEGE based poll functions.
1214 *
1215 * This is useful to have more control over the added entropy sources in an
1216 * application.
1217 *
1218 * Uncomment this macro to prevent loading of default entropy functions.
1219 */
1220//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
1221
1222/**
1223 * \def MBEDTLS_NO_PLATFORM_ENTROPY
1224 *
1225 * Do not use built-in platform entropy functions.
1226 * This is useful if your platform does not support
1227 * standards like the /dev/urandom or Windows CryptoAPI.
1228 *
1229 * Uncomment this macro to disable the built-in platform entropy functions.
1230 */
1231#define MBEDTLS_NO_PLATFORM_ENTROPY
1232
1233/**
1234 * \def MBEDTLS_ENTROPY_FORCE_SHA256
1235 *
1236 * Force the entropy accumulator to use a SHA-256 accumulator instead of the
1237 * default SHA-512 based one (if both are available).
1238 *
1239 * Requires: MBEDTLS_SHA256_C
1240 *
1241 * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option
1242 * if you have performance concerns.
1243 *
1244 * This option is only useful if both MBEDTLS_SHA256_C and
1245 * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
1246 */
1247//#define MBEDTLS_ENTROPY_FORCE_SHA256
1248
1249/**
1250 * \def MBEDTLS_ENTROPY_NV_SEED
1251 *
1252 * Enable the non-volatile (NV) seed file-based entropy source.
1253 * (Also enables the NV seed read/write functions in the platform layer)
1254 *
1255 * This is crucial (if not required) on systems that do not have a
1256 * cryptographic entropy source (in hardware or kernel) available.
1257 *
1258 * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C
1259 *
1260 * \note The read/write functions that are used by the entropy source are
1261 * determined in the platform layer, and can be modified at runtime and/or
1262 * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used.
1263 *
1264 * \note If you use the default implementation functions that read a seedfile
1265 * with regular fopen(), please make sure you make a seedfile with the
1266 * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at
1267 * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from
1268 * and written to or you will get an entropy source error! The default
1269 * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE
1270 * bytes from the file.
1271 *
1272 * \note The entropy collector will write to the seed file before entropy is
1273 * given to an external source, to update it.
1274 */
1275//#define MBEDTLS_ENTROPY_NV_SEED
1276
1277/* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
1278 *
1279 * Enable key identifiers that encode a key owner identifier.
1280 *
1281 * The owner of a key is identified by a value of type ::mbedtls_key_owner_id_t
1282 * which is currently hard-coded to be int32_t.
1283 *
1284 * Note that this option is meant for internal use only and may be removed
1285 * without notice. It is incompatible with MBEDTLS_USE_PSA_CRYPTO.
1286 */
1287//#define MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
1288
1289/**
1290 * \def MBEDTLS_MEMORY_DEBUG
1291 *
1292 * Enable debugging of buffer allocator memory issues. Automatically prints
1293 * (to stderr) all (fatal) messages on memory allocation issues. Enables
1294 * function for 'debug output' of allocated memory.
1295 *
1296 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
1297 *
1298 * Uncomment this macro to let the buffer allocator print out error messages.
1299 */
1300//#define MBEDTLS_MEMORY_DEBUG
1301
1302/**
1303 * \def MBEDTLS_MEMORY_BACKTRACE
1304 *
1305 * Include backtrace information with each allocated block.
1306 *
1307 * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C
1308 * GLIBC-compatible backtrace() an backtrace_symbols() support
1309 *
1310 * Uncomment this macro to include backtrace information
1311 */
1312//#define MBEDTLS_MEMORY_BACKTRACE
1313
1314/**
1315 * \def MBEDTLS_PK_RSA_ALT_SUPPORT
1316 *
1317 * Support external private RSA keys (eg from a HSM) in the PK layer.
1318 *
1319 * Comment this macro to disable support for external private RSA keys.
1320 */
1321#define MBEDTLS_PK_RSA_ALT_SUPPORT
1322
1323/**
1324 * \def MBEDTLS_PKCS1_V15
1325 *
1326 * Enable support for PKCS#1 v1.5 encoding.
1327 *
1328 * Requires: MBEDTLS_RSA_C
1329 *
1330 * This enables support for PKCS#1 v1.5 operations.
1331 */
1332#define MBEDTLS_PKCS1_V15
1333
1334/**
1335 * \def MBEDTLS_PKCS1_V21
1336 *
1337 * Enable support for PKCS#1 v2.1 encoding.
1338 *
1339 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
1340 *
1341 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
1342 */
1343#define MBEDTLS_PKCS1_V21
1344
1345/** \def MBEDTLS_PSA_CRYPTO_DRIVERS
1346 *
1347 * Enable support for the experimental PSA crypto driver interface.
1348 *
1349 * Requires: MBEDTLS_PSA_CRYPTO_C
1350 *
1351 * \warning This interface is experimental and may change or be removed
1352 * without notice.
1353 */
1354//#define MBEDTLS_PSA_CRYPTO_DRIVERS
1355
1356/**
1357 * \def MBEDTLS_PSA_CRYPTO_SPM
1358 *
1359 * When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is built for SPM (Secure
1360 * Partition Manager) integration which separates the code into two parts: a
1361 * NSPE (Non-Secure Process Environment) and an SPE (Secure Process
1362 * Environment).
1363 *
1364 * Module: library/psa_crypto.c
1365 * Requires: MBEDTLS_PSA_CRYPTO_C
1366 *
1367 */
1368//#define MBEDTLS_PSA_CRYPTO_SPM
1369
1370/**
1371 * \def MBEDTLS_PSA_INJECT_ENTROPY
1372 *
1373 * Enable support for entropy injection at first boot. This feature is
1374 * required on systems that do not have a built-in entropy source (TRNG).
1375 * This feature is currently not supported on systems that have a built-in
1376 * entropy source.
1377 *
1378 * Requires: MBEDTLS_PSA_CRYPTO_STORAGE_C, MBEDTLS_ENTROPY_NV_SEED
1379 *
1380 */
1381//#define MBEDTLS_PSA_INJECT_ENTROPY
1382
1383/**
1384 * \def MBEDTLS_RSA_NO_CRT
1385 *
1386 * Do not use the Chinese Remainder Theorem
1387 * for the RSA private operation.
1388 *
1389 * Uncomment this macro to disable the use of CRT in RSA.
1390 *
1391 */
1392//#define MBEDTLS_RSA_NO_CRT
1393
1394/**
1395 * \def MBEDTLS_SELF_TEST
1396 *
1397 * Enable the checkup functions (*_self_test).
1398 */
1399#define MBEDTLS_SELF_TEST
1400
1401/**
1402 * \def MBEDTLS_SHA256_SMALLER
1403 *
1404 * Enable an implementation of SHA-256 that has lower ROM footprint but also
1405 * lower performance.
1406 *
1407 * The default implementation is meant to be a reasonnable compromise between
1408 * performance and size. This version optimizes more aggressively for size at
1409 * the expense of performance. Eg on Cortex-M4 it reduces the size of
1410 * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about
1411 * 30%.
1412 *
1413 * Uncomment to enable the smaller implementation of SHA256.
1414 */
1415//#define MBEDTLS_SHA256_SMALLER
1416
1417/**
1418 * \def MBEDTLS_SHA512_SMALLER
1419 *
1420 * Enable an implementation of SHA-512 that has lower ROM footprint but also
1421 * lower performance.
1422 *
1423 * Uncomment to enable the smaller implementation of SHA512.
1424 */
1425//#define MBEDTLS_SHA512_SMALLER
1426
1427/**
1428 * \def MBEDTLS_SHA512_NO_SHA384
1429 *
1430 * Disable the SHA-384 option of the SHA-512 module. Use this to save some
1431 * code size on devices that don't use SHA-384.
1432 *
1433 * Requires: MBEDTLS_SHA512_C
1434 *
1435 * Uncomment to disable SHA-384
1436 */
1437//#define MBEDTLS_SHA512_NO_SHA384
1438
1439/**
1440 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
1441 *
1442 * Enable sending of alert messages in case of encountered errors as per RFC.
1443 * If you choose not to send the alert messages, mbed TLS can still communicate
1444 * with other servers, only debugging of failures is harder.
1445 *
1446 * The advantage of not sending alert messages, is that no information is given
1447 * about reasons for failures thus preventing adversaries of gaining intel.
1448 *
1449 * Enable sending of all alert messages
1450 */
1451#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
1452
1453/**
1454 * \def MBEDTLS_SSL_RECORD_CHECKING
1455 *
1456 * Enable the function mbedtls_ssl_check_record() which can be used to check
1457 * the validity and authenticity of an incoming record, to verify that it has
1458 * not been seen before. These checks are performed without modifying the
1459 * externally visible state of the SSL context.
1460 *
1461 * See mbedtls_ssl_check_record() for more information.
1462 *
1463 * Uncomment to enable support for record checking.
1464 */
1465#define MBEDTLS_SSL_RECORD_CHECKING
1466
1467/**
1468 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID
1469 *
1470 * Enable support for the DTLS Connection ID extension
1471 * (version draft-ietf-tls-dtls-connection-id-05,
1472 * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05)
1473 * which allows to identify DTLS connections across changes
1474 * in the underlying transport.
1475 *
1476 * Setting this option enables the SSL APIs `mbedtls_ssl_set_cid()`,
1477 * `mbedtls_ssl_get_peer_cid()` and `mbedtls_ssl_conf_cid()`.
1478 * See the corresponding documentation for more information.
1479 *
1480 * \warning The Connection ID extension is still in draft state.
1481 * We make no stability promises for the availability
1482 * or the shape of the API controlled by this option.
1483 *
1484 * The maximum lengths of outgoing and incoming CIDs can be configured
1485 * through the options
1486 * - MBEDTLS_SSL_CID_OUT_LEN_MAX
1487 * - MBEDTLS_SSL_CID_IN_LEN_MAX.
1488 *
1489 * Requires: MBEDTLS_SSL_PROTO_DTLS
1490 *
1491 * Uncomment to enable the Connection ID extension.
1492 */
1493//#define MBEDTLS_SSL_DTLS_CONNECTION_ID
1494
1495/**
1496 * \def MBEDTLS_SSL_ASYNC_PRIVATE
1497 *
1498 * Enable asynchronous external private key operations in SSL. This allows
1499 * you to configure an SSL connection to call an external cryptographic
1500 * module to perform private key operations instead of performing the
1501 * operation inside the library.
1502 *
1503 */
1504//#define MBEDTLS_SSL_ASYNC_PRIVATE
1505
1506/**
1507 * \def MBEDTLS_SSL_CONTEXT_SERIALIZATION
1508 *
1509 * Enable serialization of the TLS context structures, through use of the
1510 * functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load().
1511 *
1512 * This pair of functions allows one side of a connection to serialize the
1513 * context associated with the connection, then free or re-use that context
1514 * while the serialized state is persisted elsewhere, and finally deserialize
1515 * that state to a live context for resuming read/write operations on the
1516 * connection. From a protocol perspective, the state of the connection is
1517 * unaffected, in particular this is entirely transparent to the peer.
1518 *
1519 * Note: this is distinct from TLS session resumption, which is part of the
1520 * protocol and fully visible by the peer. TLS session resumption enables
1521 * establishing new connections associated to a saved session with shorter,
1522 * lighter handshakes, while context serialization is a local optimization in
1523 * handling a single, potentially long-lived connection.
1524 *
1525 * Enabling these APIs makes some SSL structures larger, as 64 extra bytes are
1526 * saved after the handshake to allow for more efficient serialization, so if
1527 * you don't need this feature you'll save RAM by disabling it.
1528 *
1529 * Comment to disable the context serialization APIs.
1530 */
1531#define MBEDTLS_SSL_CONTEXT_SERIALIZATION
1532
1533/**
1534 * \def MBEDTLS_SSL_DEBUG_ALL
1535 *
1536 * Enable the debug messages in SSL module for all issues.
1537 * Debug messages have been disabled in some places to prevent timing
1538 * attacks due to (unbalanced) debugging function calls.
1539 *
1540 * If you need all error reporting you should enable this during debugging,
1541 * but remove this for production servers that should log as well.
1542 *
1543 * Uncomment this macro to report all debug messages on errors introducing
1544 * a timing side-channel.
1545 *
1546 */
1547//#define MBEDTLS_SSL_DEBUG_ALL
1548
1549/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
1550 *
1551 * Enable support for Encrypt-then-MAC, RFC 7366.
1552 *
1553 * This allows peers that both support it to use a more robust protection for
1554 * ciphersuites using CBC, providing deep resistance against timing attacks
1555 * on the padding or underlying cipher.
1556 *
1557 * This only affects CBC ciphersuites, and is useless if none is defined.
1558 *
1559 * Requires: MBEDTLS_SSL_PROTO_TLS1 or
1560 * MBEDTLS_SSL_PROTO_TLS1_1 or
1561 * MBEDTLS_SSL_PROTO_TLS1_2
1562 *
1563 * Comment this macro to disable support for Encrypt-then-MAC
1564 */
1565#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
1566
1567/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
1568 *
1569 * Enable support for RFC 7627: Session Hash and Extended Master Secret
1570 * Extension.
1571 *
1572 * This was introduced as "the proper fix" to the Triple Handshake familiy of
1573 * attacks, but it is recommended to always use it (even if you disable
1574 * renegotiation), since it actually fixes a more fundamental issue in the
1575 * original SSL/TLS design, and has implications beyond Triple Handshake.
1576 *
1577 * Requires: MBEDTLS_SSL_PROTO_TLS1 or
1578 * MBEDTLS_SSL_PROTO_TLS1_1 or
1579 * MBEDTLS_SSL_PROTO_TLS1_2
1580 *
1581 * Comment this macro to disable support for Extended Master Secret.
1582 */
1583#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
1584
1585/**
1586 * \def MBEDTLS_SSL_FALLBACK_SCSV
1587 *
1588 * Enable support for RFC 7507: Fallback Signaling Cipher Suite Value (SCSV)
1589 * for Preventing Protocol Downgrade Attacks.
1590 *
1591 * For servers, it is recommended to always enable this, unless you support
1592 * only one version of TLS, or know for sure that none of your clients
1593 * implements a fallback strategy.
1594 *
1595 * For clients, you only need this if you're using a fallback strategy, which
1596 * is not recommended in the first place, unless you absolutely need it to
1597 * interoperate with buggy (version-intolerant) servers.
1598 *
1599 * Comment this macro to disable support for FALLBACK_SCSV
1600 */
1601//#define MBEDTLS_SSL_FALLBACK_SCSV
1602
1603/**
1604 * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
1605 *
1606 * This option controls the availability of the API mbedtls_ssl_get_peer_cert()
1607 * giving access to the peer's certificate after completion of the handshake.
1608 *
1609 * Unless you need mbedtls_ssl_peer_cert() in your application, it is
1610 * recommended to disable this option for reduced RAM usage.
1611 *
1612 * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still
1613 * defined, but always returns \c NULL.
1614 *
1615 * \note This option has no influence on the protection against the
1616 * triple handshake attack. Even if it is disabled, Mbed TLS will
1617 * still ensure that certificates do not change during renegotiation,
1618 * for exaple by keeping a hash of the peer's certificate.
1619 *
1620 * Comment this macro to disable storing the peer's certificate
1621 * after the handshake.
1622 */
1623#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
1624
1625/**
1626 * \def MBEDTLS_SSL_HW_RECORD_ACCEL
1627 *
1628 * Enable hooking functions in SSL module for hardware acceleration of
1629 * individual records.
1630 *
1631 * \deprecated This option is deprecated and will be removed in a future
1632 * version of Mbed TLS.
1633 *
1634 * Uncomment this macro to enable hooking functions.
1635 */
1636//#define MBEDTLS_SSL_HW_RECORD_ACCEL
1637
1638/**
1639 * \def MBEDTLS_SSL_CBC_RECORD_SPLITTING
1640 *
1641 * Enable 1/n-1 record splitting for CBC mode in SSLv3 and TLS 1.0.
1642 *
1643 * This is a countermeasure to the BEAST attack, which also minimizes the risk
1644 * of interoperability issues compared to sending 0-length records.
1645 *
1646 * Comment this macro to disable 1/n-1 record splitting.
1647 */
1648//#define MBEDTLS_SSL_CBC_RECORD_SPLITTING
1649
1650/**
1651 * \def MBEDTLS_SSL_RENEGOTIATION
1652 *
1653 * Enable support for TLS renegotiation.
1654 *
1655 * The two main uses of renegotiation are (1) refresh keys on long-lived
1656 * connections and (2) client authentication after the initial handshake.
1657 * If you don't need renegotiation, it's probably better to disable it, since
1658 * it has been associated with security issues in the past and is easy to
1659 * misuse/misunderstand.
1660 *
1661 * Comment this to disable support for renegotiation.
1662 *
1663 * \note Even if this option is disabled, both client and server are aware
1664 * of the Renegotiation Indication Extension (RFC 5746) used to
1665 * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1).
1666 * (See \c mbedtls_ssl_conf_legacy_renegotiation for the
1667 * configuration of this extension).
1668 *
1669 */
1670#define MBEDTLS_SSL_RENEGOTIATION
1671
1672/**
1673 * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
1674 *
1675 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
1676 * SSL Server module (MBEDTLS_SSL_SRV_C).
1677 *
1678 * \deprecated This option is deprecated and will be removed in a future
1679 * version of Mbed TLS.
1680 *
1681 * Uncomment this macro to enable support for SSLv2 Client Hello messages.
1682 */
1683//#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
1684
1685/**
1686 * \def MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
1687 *
1688 * Pick the ciphersuite according to the client's preferences rather than ours
1689 * in the SSL Server module (MBEDTLS_SSL_SRV_C).
1690 *
1691 * Uncomment this macro to respect client's ciphersuite order
1692 */
1693//#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
1694
1695/**
1696 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
1697 *
1698 * Enable support for RFC 6066 max_fragment_length extension in SSL.
1699 *
1700 * Comment this macro to disable support for the max_fragment_length extension
1701 */
1702#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
1703
1704/**
1705 * \def MBEDTLS_SSL_PROTO_SSL3
1706 *
1707 * Enable support for SSL 3.0.
1708 *
1709 * Requires: MBEDTLS_MD5_C
1710 * MBEDTLS_SHA1_C
1711 *
1712 * \deprecated This option is deprecated and will be removed in a future
1713 * version of Mbed TLS.
1714 *
1715 * Comment this macro to disable support for SSL 3.0
1716 */
1717//#define MBEDTLS_SSL_PROTO_SSL3
1718
1719/**
1720 * \def MBEDTLS_SSL_PROTO_TLS1
1721 *
1722 * Enable support for TLS 1.0.
1723 *
1724 * Requires: MBEDTLS_MD5_C
1725 * MBEDTLS_SHA1_C
1726 *
1727 * Comment this macro to disable support for TLS 1.0
1728 */
1729//#define MBEDTLS_SSL_PROTO_TLS1
1730
1731/**
1732 * \def MBEDTLS_SSL_PROTO_TLS1_1
1733 *
1734 * Enable support for TLS 1.1 (and DTLS 1.0 if DTLS is enabled).
1735 *
1736 * Requires: MBEDTLS_MD5_C
1737 * MBEDTLS_SHA1_C
1738 *
1739 * Comment this macro to disable support for TLS 1.1 / DTLS 1.0
1740 */
1741//#define MBEDTLS_SSL_PROTO_TLS1_1
1742
1743/**
1744 * \def MBEDTLS_SSL_PROTO_TLS1_2
1745 *
1746 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
1747 *
1748 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
1749 * (Depends on ciphersuites)
1750 *
1751 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
1752 */
1753#define MBEDTLS_SSL_PROTO_TLS1_2
1754
1755/**
1756 * \def MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL
1757 *
1758 * This macro is used to selectively enable experimental parts
1759 * of the code that contribute to the ongoing development of
1760 * the prototype TLS 1.3 and DTLS 1.3 implementation, and provide
1761 * no other purpose.
1762 *
1763 * \warning TLS 1.3 and DTLS 1.3 aren't yet supported in Mbed TLS,
1764 * and no feature exposed through this macro is part of the
1765 * public API. In particular, features under the control
1766 * of this macro are experimental and don't come with any
1767 * stability guarantees.
1768 *
1769 * Uncomment this macro to enable experimental and partial
1770 * functionality specific to TLS 1.3.
1771 */
1772//#define MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL
1773
1774/**
1775 * \def MBEDTLS_SSL_PROTO_DTLS
1776 *
1777 * Enable support for DTLS (all available versions).
1778 *
1779 * Enable this and MBEDTLS_SSL_PROTO_TLS1_1 to enable DTLS 1.0,
1780 * and/or this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2.
1781 *
1782 * Requires: MBEDTLS_SSL_PROTO_TLS1_1
1783 * or MBEDTLS_SSL_PROTO_TLS1_2
1784 *
1785 * Comment this macro to disable support for DTLS
1786 */
1787#define MBEDTLS_SSL_PROTO_DTLS
1788
1789/**
1790 * \def MBEDTLS_SSL_ALPN
1791 *
1792 * Enable support for RFC 7301 Application Layer Protocol Negotiation.
1793 *
1794 * Comment this macro to disable support for ALPN.
1795 */
1796#define MBEDTLS_SSL_ALPN
1797
1798/**
1799 * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY
1800 *
1801 * Enable support for the anti-replay mechanism in DTLS.
1802 *
1803 * Requires: MBEDTLS_SSL_TLS_C
1804 * MBEDTLS_SSL_PROTO_DTLS
1805 *
1806 * \warning Disabling this is often a security risk!
1807 * See mbedtls_ssl_conf_dtls_anti_replay() for details.
1808 *
1809 * Comment this to disable anti-replay in DTLS.
1810 */
1811#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
1812
1813/**
1814 * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY
1815 *
1816 * Enable support for HelloVerifyRequest on DTLS servers.
1817 *
1818 * This feature is highly recommended to prevent DTLS servers being used as
1819 * amplifiers in DoS attacks against other hosts. It should always be enabled
1820 * unless you know for sure amplification cannot be a problem in the
1821 * environment in which your server operates.
1822 *
1823 * \warning Disabling this can ba a security risk! (see above)
1824 *
1825 * Requires: MBEDTLS_SSL_PROTO_DTLS
1826 *
1827 * Comment this to disable support for HelloVerifyRequest.
1828 */
1829#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
1830
1831/**
1832 * \def MBEDTLS_SSL_DTLS_SRTP
1833 *
1834 * Enable support for negotation of DTLS-SRTP (RFC 5764)
1835 * through the use_srtp extension.
1836 *
1837 * \note This feature provides the minimum functionality required
1838 * to negotiate the use of DTLS-SRTP and to allow the derivation of
1839 * the associated SRTP packet protection key material.
1840 * In particular, the SRTP packet protection itself, as well as the
1841 * demultiplexing of RTP and DTLS packets at the datagram layer
1842 * (see Section 5 of RFC 5764), are not handled by this feature.
1843 * Instead, after successful completion of a handshake negotiating
1844 * the use of DTLS-SRTP, the extended key exporter API
1845 * mbedtls_ssl_conf_export_keys_ext_cb() should be used to implement
1846 * the key exporter described in Section 4.2 of RFC 5764 and RFC 5705
1847 * (this is implemented in the SSL example programs).
1848 * The resulting key should then be passed to an SRTP stack.
1849 *
1850 * Setting this option enables the runtime API
1851 * mbedtls_ssl_conf_dtls_srtp_protection_profiles()
1852 * through which the supported DTLS-SRTP protection
1853 * profiles can be configured. You must call this API at
1854 * runtime if you wish to negotiate the use of DTLS-SRTP.
1855 *
1856 * Requires: MBEDTLS_SSL_PROTO_DTLS
1857 *
1858 * Uncomment this to enable support for use_srtp extension.
1859 */
1860//#define MBEDTLS_SSL_DTLS_SRTP
1861
1862/**
1863 * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
1864 *
1865 * Enable server-side support for clients that reconnect from the same port.
1866 *
1867 * Some clients unexpectedly close the connection and try to reconnect using the
1868 * same source port. This needs special support from the server to handle the
1869 * new connection securely, as described in section 4.2.8 of RFC 6347. This
1870 * flag enables that support.
1871 *
1872 * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY
1873 *
1874 * Comment this to disable support for clients reusing the source port.
1875 */
1876#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
1877
1878/**
1879 * \def MBEDTLS_SSL_DTLS_BADMAC_LIMIT
1880 *
1881 * Enable support for a limit of records with bad MAC.
1882 *
1883 * See mbedtls_ssl_conf_dtls_badmac_limit().
1884 *
1885 * Requires: MBEDTLS_SSL_PROTO_DTLS
1886 */
1887#define MBEDTLS_SSL_DTLS_BADMAC_LIMIT
1888
1889/**
1890 * \def MBEDTLS_SSL_SESSION_TICKETS
1891 *
1892 * Enable support for RFC 5077 session tickets in SSL.
1893 * Client-side, provides full support for session tickets (maintenance of a
1894 * session store remains the responsibility of the application, though).
1895 * Server-side, you also need to provide callbacks for writing and parsing
1896 * tickets, including authenticated encryption and key management. Example
1897 * callbacks are provided by MBEDTLS_SSL_TICKET_C.
1898 *
1899 * Comment this macro to disable support for SSL session tickets
1900 */
1901#define MBEDTLS_SSL_SESSION_TICKETS
1902
1903/**
1904 * \def MBEDTLS_SSL_EXPORT_KEYS
1905 *
1906 * Enable support for exporting key block and master secret.
1907 * This is required for certain users of TLS, e.g. EAP-TLS.
1908 *
1909 * Comment this macro to disable support for key export
1910 */
1911#define MBEDTLS_SSL_EXPORT_KEYS
1912
1913/**
1914 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
1915 *
1916 * Enable support for RFC 6066 server name indication (SNI) in SSL.
1917 *
1918 * Requires: MBEDTLS_X509_CRT_PARSE_C
1919 *
1920 * Comment this macro to disable support for server name indication in SSL
1921 */
1922#define MBEDTLS_SSL_SERVER_NAME_INDICATION
1923
1924/**
1925 * \def MBEDTLS_SSL_TRUNCATED_HMAC
1926 *
1927 * Enable support for RFC 6066 truncated HMAC in SSL.
1928 *
1929 * Comment this macro to disable support for truncated HMAC in SSL
1930 */
1931//#define MBEDTLS_SSL_TRUNCATED_HMAC
1932
1933/**
1934 * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT
1935 *
1936 * Fallback to old (pre-2.7), non-conforming implementation of the truncated
1937 * HMAC extension which also truncates the HMAC key. Note that this option is
1938 * only meant for a transitory upgrade period and will be removed in a future
1939 * version of the library.
1940 *
1941 * \warning The old implementation is non-compliant and has a security weakness
1942 * (2^80 brute force attack on the HMAC key used for a single,
1943 * uninterrupted connection). This should only be enabled temporarily
1944 * when (1) the use of truncated HMAC is essential in order to save
1945 * bandwidth, and (2) the peer is an Mbed TLS stack that doesn't use
1946 * the fixed implementation yet (pre-2.7).
1947 *
1948 * \deprecated This option is deprecated and will be removed in a
1949 * future version of Mbed TLS.
1950 *
1951 * Uncomment to fallback to old, non-compliant truncated HMAC implementation.
1952 *
1953 * Requires: MBEDTLS_SSL_TRUNCATED_HMAC
1954 */
1955//#define MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT
1956
1957/**
1958 * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
1959 *
1960 * Enable modifying the maximum I/O buffer size.
1961 */
1962//#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
1963
1964/**
1965 * \def MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
1966 *
1967 * Enable testing of the constant-flow nature of some sensitive functions with
1968 * clang's MemorySanitizer. This causes some existing tests to also test
1969 * this non-functional property of the code under test.
1970 *
1971 * This setting requires compiling with clang -fsanitize=memory. The test
1972 * suites can then be run normally.
1973 *
1974 * \warning This macro is only used for extended testing; it is not considered
1975 * part of the library's API, so it may change or disappear at any time.
1976 *
1977 * Uncomment to enable testing of the constant-flow nature of selected code.
1978 */
1979//#define MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
1980
1981/**
1982 * \def MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND
1983 *
1984 * Enable testing of the constant-flow nature of some sensitive functions with
1985 * valgrind's memcheck tool. This causes some existing tests to also test
1986 * this non-functional property of the code under test.
1987 *
1988 * This setting requires valgrind headers for building, and is only useful for
1989 * testing if the tests suites are run with valgrind's memcheck. This can be
1990 * done for an individual test suite with 'valgrind ./test_suite_xxx', or when
1991 * using CMake, this can be done for all test suites with 'make memcheck'.
1992 *
1993 * \warning This macro is only used for extended testing; it is not considered
1994 * part of the library's API, so it may change or disappear at any time.
1995 *
1996 * Uncomment to enable testing of the constant-flow nature of selected code.
1997 */
1998//#define MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND
1999
2000/**
2001 * \def MBEDTLS_TEST_HOOKS
2002 *
2003 * Enable features for invasive testing such as introspection functions and
2004 * hooks for fault injection. This enables additional unit tests.
2005 *
2006 * Merely enabling this feature should not change the behavior of the product.
2007 * It only adds new code, and new branching points where the default behavior
2008 * is the same as when this feature is disabled.
2009 * However, this feature increases the attack surface: there is an added
2010 * risk of vulnerabilities, and more gadgets that can make exploits easier.
2011 * Therefore this feature must never be enabled in production.
2012 *
2013 * See `docs/architecture/testing/mbed-crypto-invasive-testing.md` for more
2014 * information.
2015 *
2016 * Uncomment to enable invasive tests.
2017 */
2018//#define MBEDTLS_TEST_HOOKS
2019
2020/**
2021 * \def MBEDTLS_THREADING_ALT
2022 *
2023 * Provide your own alternate threading implementation.
2024 *
2025 * Requires: MBEDTLS_THREADING_C
2026 *
2027 * Uncomment this to allow your own alternate threading implementation.
2028 */
2029//#define MBEDTLS_THREADING_ALT
2030
2031/**
2032 * \def MBEDTLS_THREADING_PTHREAD
2033 *
2034 * Enable the pthread wrapper layer for the threading layer.
2035 *
2036 * Requires: MBEDTLS_THREADING_C
2037 *
2038 * Uncomment this to enable pthread mutexes.
2039 */
2040//#define MBEDTLS_THREADING_PTHREAD
2041
2042/**
2043 * \def MBEDTLS_USE_PSA_CRYPTO
2044 *
2045 * Make the X.509 and TLS library use PSA for cryptographic operations, and
2046 * enable new APIs for using keys handled by PSA Crypto.
2047 *
2048 * \note Development of this option is currently in progress, and parts of Mbed
2049 * TLS's X.509 and TLS modules are not ported to PSA yet. However, these parts
2050 * will still continue to work as usual, so enabling this option should not
2051 * break backwards compatibility.
2052 *
2053 * \warning The PSA Crypto API is in beta stage. While you're welcome to
2054 * experiment using it, incompatible API changes are still possible, and some
2055 * parts may not have reached the same quality as the rest of Mbed TLS yet.
2056 *
2057 * \warning This option enables new Mbed TLS APIs that are dependent on the
2058 * PSA Crypto API, so can't come with the same stability guarantees as the
2059 * rest of the Mbed TLS APIs. You're welcome to experiment with them, but for
2060 * now, access to these APIs is opt-in (via enabling the present option), in
2061 * order to clearly differentiate them from the stable Mbed TLS APIs.
2062 *
2063 * Requires: MBEDTLS_PSA_CRYPTO_C.
2064 *
2065 * Uncomment this to enable internal use of PSA Crypto and new associated APIs.
2066 */
2067//#define MBEDTLS_USE_PSA_CRYPTO
2068
2069/**
2070 * \def MBEDTLS_PSA_CRYPTO_CONFIG
2071 *
2072 * This setting allows support for cryptographic mechanisms through the PSA
2073 * API to be configured separately from support through the mbedtls API.
2074 *
2075 * Uncomment this to enable use of PSA Crypto configuration settings which
2076 * can be found in include/psa/crypto_config.h.
2077 *
2078 * If you enable this option and write your own configuration file, you must
2079 * include mbedtls/config_psa.h in your configuration file. The default
2080 * provided mbedtls/config.h contains the necessary inclusion.
2081 *
2082 * This feature is still experimental and is not ready for production since
2083 * it is not completed.
2084 */
2085//#define MBEDTLS_PSA_CRYPTO_CONFIG
2086
2087/**
2088 * \def MBEDTLS_VERSION_FEATURES
2089 *
2090 * Allow run-time checking of compile-time enabled features. Thus allowing users
2091 * to check at run-time if the library is for instance compiled with threading
2092 * support via mbedtls_version_check_feature().
2093 *
2094 * Requires: MBEDTLS_VERSION_C
2095 *
2096 * Comment this to disable run-time checking and save ROM space
2097 */
2098#define MBEDTLS_VERSION_FEATURES
2099
2100/**
2101 * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
2102 *
2103 * If set, the X509 parser will not break-off when parsing an X509 certificate
2104 * and encountering an extension in a v1 or v2 certificate.
2105 *
2106 * Uncomment to prevent an error.
2107 */
2108//#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
2109
2110/**
2111 * \def MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
2112 *
2113 * If set, the X509 parser will not break-off when parsing an X509 certificate
2114 * and encountering an unknown critical extension.
2115 *
2116 * \warning Depending on your PKI use, enabling this can be a security risk!
2117 *
2118 * Uncomment to prevent an error.
2119 */
2120//#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
2121
2122/**
2123 * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
2124 *
2125 * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()`
2126 * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure
2127 * the set of trusted certificates through a callback instead of a linked
2128 * list.
2129 *
2130 * This is useful for example in environments where a large number of trusted
2131 * certificates is present and storing them in a linked list isn't efficient
2132 * enough, or when the set of trusted certificates changes frequently.
2133 *
2134 * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and
2135 * `mbedtls_ssl_conf_ca_cb()` for more information.
2136 *
2137 * Uncomment to enable trusted certificate callbacks.
2138 */
2139//#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
2140
2141/**
2142 * \def MBEDTLS_X509_CHECK_KEY_USAGE
2143 *
2144 * Enable verification of the keyUsage extension (CA and leaf certificates).
2145 *
2146 * Disabling this avoids problems with mis-issued and/or misused
2147 * (intermediate) CA and leaf certificates.
2148 *
2149 * \warning Depending on your PKI use, disabling this can be a security risk!
2150 *
2151 * Comment to skip keyUsage checking for both CA and leaf certificates.
2152 */
2153#define MBEDTLS_X509_CHECK_KEY_USAGE
2154
2155/**
2156 * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
2157 *
2158 * Enable verification of the extendedKeyUsage extension (leaf certificates).
2159 *
2160 * Disabling this avoids problems with mis-issued and/or misused certificates.
2161 *
2162 * \warning Depending on your PKI use, disabling this can be a security risk!
2163 *
2164 * Comment to skip extendedKeyUsage checking for certificates.
2165 */
2166#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
2167
2168/**
2169 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
2170 *
2171 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
2172 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
2173 *
2174 * Comment this macro to disallow using RSASSA-PSS in certificates.
2175 */
2176//#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
2177
2178/**
2179 * \def MBEDTLS_ZLIB_SUPPORT
2180 *
2181 * If set, the SSL/TLS module uses ZLIB to support compression and
2182 * decompression of packet data.
2183 *
2184 * \warning TLS-level compression MAY REDUCE SECURITY! See for example the
2185 * CRIME attack. Before enabling this option, you should examine with care if
2186 * CRIME or similar exploits may be applicable to your use case.
2187 *
2188 * \note Currently compression can't be used with DTLS.
2189 *
2190 * \deprecated This feature is deprecated and will be removed
2191 * in the next major revision of the library.
2192 *
2193 * Used in: library/ssl_tls.c
2194 * library/ssl_cli.c
2195 * library/ssl_srv.c
2196 *
2197 * This feature requires zlib library and headers to be present.
2198 *
2199 * Uncomment to enable use of ZLIB
2200 */
2201//#define MBEDTLS_ZLIB_SUPPORT
2202/* \} name SECTION: mbed TLS feature support */
2203
2204/**
2205 * \name SECTION: mbed TLS modules
2206 *
2207 * This section enables or disables entire modules in mbed TLS
2208 * \{
2209 */
2210
2211/**
2212 * \def MBEDTLS_AESNI_C
2213 *
2214 * Enable AES-NI support on x86-64.
2215 *
2216 * Module: library/aesni.c
2217 * Caller: library/aes.c
2218 *
2219 * Requires: MBEDTLS_HAVE_ASM
2220 *
2221 * This modules adds support for the AES-NI instructions on x86-64
2222 */
2223//#define MBEDTLS_AESNI_C
2224
2225/**
2226 * \def MBEDTLS_AES_C
2227 *
2228 * Enable the AES block cipher.
2229 *
2230 * Module: library/aes.c
2231 * Caller: library/cipher.c
2232 * library/pem.c
2233 * library/ctr_drbg.c
2234 *
2235 * This module enables the following ciphersuites (if other requisites are
2236 * enabled as well):
2237 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
2238 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
2239 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
2240 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
2241 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
2242 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
2243 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
2244 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
2245 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
2246 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
2247 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
2248 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
2249 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
2250 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
2251 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
2252 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
2253 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
2254 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
2255 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
2256 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
2257 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
2258 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
2259 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
2260 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
2261 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
2262 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
2263 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
2264 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
2265 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
2266 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
2267 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
2268 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
2269 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
2270 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
2271 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
2272 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
2273 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
2274 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
2275 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
2276 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
2277 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
2278 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
2279 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
2280 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
2281 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
2282 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
2283 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
2284 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
2285 * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
2286 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
2287 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
2288 * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
2289 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
2290 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
2291 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
2292 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
2293 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
2294 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
2295 *
2296 * PEM_PARSE uses AES for decrypting encrypted keys.
2297 */
2298#define MBEDTLS_AES_C
2299
2300/**
2301 * \def MBEDTLS_ARC4_C
2302 *
2303 * Enable the ARCFOUR stream cipher.
2304 *
2305 * Module: library/arc4.c
2306 * Caller: library/cipher.c
2307 *
2308 * This module enables the following ciphersuites (if other requisites are
2309 * enabled as well):
2310 * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
2311 * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
2312 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
2313 * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
2314 * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
2315 * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
2316 * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
2317 * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
2318 * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
2319 * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
2320 *
2321 * \warning ARC4 is considered a weak cipher and its use constitutes a
2322 * security risk. If possible, we recommend avoidng dependencies on
2323 * it, and considering stronger ciphers instead.
2324 *
2325 */
2326//#define MBEDTLS_ARC4_C
2327
2328/**
2329 * \def MBEDTLS_ASN1_PARSE_C
2330 *
2331 * Enable the generic ASN1 parser.
2332 *
2333 * Module: library/asn1.c
2334 * Caller: library/x509.c
2335 * library/dhm.c
2336 * library/pkcs12.c
2337 * library/pkcs5.c
2338 * library/pkparse.c
2339 */
2340#define MBEDTLS_ASN1_PARSE_C
2341
2342/**
2343 * \def MBEDTLS_ASN1_WRITE_C
2344 *
2345 * Enable the generic ASN1 writer.
2346 *
2347 * Module: library/asn1write.c
2348 * Caller: library/ecdsa.c
2349 * library/pkwrite.c
2350 * library/x509_create.c
2351 * library/x509write_crt.c
2352 * library/x509write_csr.c
2353 */
2354#define MBEDTLS_ASN1_WRITE_C
2355
2356/**
2357 * \def MBEDTLS_BASE64_C
2358 *
2359 * Enable the Base64 module.
2360 *
2361 * Module: library/base64.c
2362 * Caller: library/pem.c
2363 *
2364 * This module is required for PEM support (required by X.509).
2365 */
2366#define MBEDTLS_BASE64_C
2367
2368/**
2369 * \def MBEDTLS_BIGNUM_C
2370 *
2371 * Enable the multi-precision integer library.
2372 *
2373 * Module: library/bignum.c
2374 * Caller: library/dhm.c
2375 * library/ecp.c
2376 * library/ecdsa.c
2377 * library/rsa.c
2378 * library/rsa_internal.c
2379 * library/ssl_tls.c
2380 *
2381 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
2382 */
2383#define MBEDTLS_BIGNUM_C
2384
2385/**
2386 * \def MBEDTLS_BLOWFISH_C
2387 *
2388 * Enable the Blowfish block cipher.
2389 *
2390 * Module: library/blowfish.c
2391 */
2392//#define MBEDTLS_BLOWFISH_C
2393
2394/**
2395 * \def MBEDTLS_CAMELLIA_C
2396 *
2397 * Enable the Camellia block cipher.
2398 *
2399 * Module: library/camellia.c
2400 * Caller: library/cipher.c
2401 *
2402 * This module enables the following ciphersuites (if other requisites are
2403 * enabled as well):
2404 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
2405 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
2406 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
2407 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
2408 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
2409 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
2410 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
2411 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
2412 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
2413 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
2414 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
2415 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
2416 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
2417 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
2418 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
2419 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
2420 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
2421 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
2422 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
2423 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
2424 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
2425 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
2426 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
2427 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
2428 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
2429 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
2430 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
2431 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
2432 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
2433 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
2434 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
2435 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
2436 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
2437 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
2438 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384
2439 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384
2440 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256
2441 * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
2442 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
2443 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
2444 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
2445 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
2446 */
2447//#define MBEDTLS_CAMELLIA_C
2448
2449/**
2450 * \def MBEDTLS_ARIA_C
2451 *
2452 * Enable the ARIA block cipher.
2453 *
2454 * Module: library/aria.c
2455 * Caller: library/cipher.c
2456 *
2457 * This module enables the following ciphersuites (if other requisites are
2458 * enabled as well):
2459 *
2460 * MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256
2461 * MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384
2462 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256
2463 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384
2464 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256
2465 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384
2466 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256
2467 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384
2468 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256
2469 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384
2470 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256
2471 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384
2472 * MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256
2473 * MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384
2474 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256
2475 * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384
2476 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256
2477 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384
2478 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256
2479 * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384
2480 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256
2481 * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384
2482 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256
2483 * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384
2484 * MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256
2485 * MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384
2486 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256
2487 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384
2488 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256
2489 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384
2490 * MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256
2491 * MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384
2492 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256
2493 * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384
2494 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256
2495 * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384
2496 * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256
2497 * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384
2498 */
2499//#define MBEDTLS_ARIA_C
2500
2501/**
2502 * \def MBEDTLS_CCM_C
2503 *
2504 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
2505 *
2506 * Module: library/ccm.c
2507 *
2508 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
2509 *
2510 * This module enables the AES-CCM ciphersuites, if other requisites are
2511 * enabled as well.
2512 */
2513#define MBEDTLS_CCM_C
2514
2515/**
2516 * \def MBEDTLS_CERTS_C
2517 *
2518 * Enable the test certificates.
2519 *
2520 * Module: library/certs.c
2521 * Caller:
2522 *
2523 * This module is used for testing (ssl_client/server).
2524 */
2525#define MBEDTLS_CERTS_C
2526
2527/**
2528 * \def MBEDTLS_CHACHA20_C
2529 *
2530 * Enable the ChaCha20 stream cipher.
2531 *
2532 * Module: library/chacha20.c
2533 */
2534#define MBEDTLS_CHACHA20_C
2535
2536/**
2537 * \def MBEDTLS_CHACHAPOLY_C
2538 *
2539 * Enable the ChaCha20-Poly1305 AEAD algorithm.
2540 *
2541 * Module: library/chachapoly.c
2542 *
2543 * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C
2544 */
2545#define MBEDTLS_CHACHAPOLY_C
2546
2547/**
2548 * \def MBEDTLS_CIPHER_C
2549 *
2550 * Enable the generic cipher layer.
2551 *
2552 * Module: library/cipher.c
2553 * Caller: library/ssl_tls.c
2554 *
2555 * Uncomment to enable generic cipher wrappers.
2556 */
2557#define MBEDTLS_CIPHER_C
2558
2559/**
2560 * \def MBEDTLS_CMAC_C
2561 *
2562 * Enable the CMAC (Cipher-based Message Authentication Code) mode for block
2563 * ciphers.
2564 *
2565 * Module: library/cmac.c
2566 *
2567 * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C
2568 *
2569 */
2570#define MBEDTLS_CMAC_C
2571
2572/**
2573 * \def MBEDTLS_CTR_DRBG_C
2574 *
2575 * Enable the CTR_DRBG AES-based random generator.
2576 * The CTR_DRBG generator uses AES-256 by default.
2577 * To use AES-128 instead, enable \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY above.
2578 *
2579 * \note To achieve a 256-bit security strength with CTR_DRBG,
2580 * you must use AES-256 *and* use sufficient entropy.
2581 * See ctr_drbg.h for more details.
2582 *
2583 * Module: library/ctr_drbg.c
2584 * Caller:
2585 *
2586 * Requires: MBEDTLS_AES_C
2587 *
2588 * This module provides the CTR_DRBG AES random number generator.
2589 */
2590#define MBEDTLS_CTR_DRBG_C
2591
2592/**
2593 * \def MBEDTLS_DEBUG_C
2594 *
2595 * Enable the debug functions.
2596 *
2597 * Module: library/debug.c
2598 * Caller: library/ssl_cli.c
2599 * library/ssl_srv.c
2600 * library/ssl_tls.c
2601 *
2602 * This module provides debugging functions.
2603 */
2604#define MBEDTLS_DEBUG_C
2605
2606/**
2607 * \def MBEDTLS_DES_C
2608 *
2609 * Enable the DES block cipher.
2610 *
2611 * Module: library/des.c
2612 * Caller: library/pem.c
2613 * library/cipher.c
2614 *
2615 * This module enables the following ciphersuites (if other requisites are
2616 * enabled as well):
2617 * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
2618 * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
2619 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
2620 * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
2621 * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
2622 * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
2623 * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
2624 * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
2625 * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
2626 * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
2627 *
2628 * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
2629 *
2630 * \warning DES is considered a weak cipher and its use constitutes a
2631 * security risk. We recommend considering stronger ciphers instead.
2632 */
2633//#define MBEDTLS_DES_C
2634
2635/**
2636 * \def MBEDTLS_DHM_C
2637 *
2638 * Enable the Diffie-Hellman-Merkle module.
2639 *
2640 * Module: library/dhm.c
2641 * Caller: library/ssl_cli.c
2642 * library/ssl_srv.c
2643 *
2644 * This module is used by the following key exchanges:
2645 * DHE-RSA, DHE-PSK
2646 *
2647 * \warning Using DHE constitutes a security risk as it
2648 * is not possible to validate custom DH parameters.
2649 * If possible, it is recommended users should consider
2650 * preferring other methods of key exchange.
2651 * See dhm.h for more details.
2652 *
2653 */
2654//#define MBEDTLS_DHM_C
2655
2656/**
2657 * \def MBEDTLS_ECDH_C
2658 *
2659 * Enable the elliptic curve Diffie-Hellman library.
2660 *
2661 * Module: library/ecdh.c
2662 * Caller: library/ssl_cli.c
2663 * library/ssl_srv.c
2664 *
2665 * This module is used by the following key exchanges:
2666 * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
2667 *
2668 * Requires: MBEDTLS_ECP_C
2669 */
2670#define MBEDTLS_ECDH_C
2671
2672/**
2673 * \def MBEDTLS_ECDSA_C
2674 *
2675 * Enable the elliptic curve DSA library.
2676 *
2677 * Module: library/ecdsa.c
2678 * Caller:
2679 *
2680 * This module is used by the following key exchanges:
2681 * ECDHE-ECDSA
2682 *
2683 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C,
2684 * and at least one MBEDTLS_ECP_DP_XXX_ENABLED for a
2685 * short Weierstrass curve.
2686 */
2687#define MBEDTLS_ECDSA_C
2688
2689/**
2690 * \def MBEDTLS_ECJPAKE_C
2691 *
2692 * Enable the elliptic curve J-PAKE library.
2693 *
2694 * \warning This is currently experimental. EC J-PAKE support is based on the
2695 * Thread v1.0.0 specification; incompatible changes to the specification
2696 * might still happen. For this reason, this is disabled by default.
2697 *
2698 * Module: library/ecjpake.c
2699 * Caller:
2700 *
2701 * This module is used by the following key exchanges:
2702 * ECJPAKE
2703 *
2704 * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C
2705 */
2706//#define MBEDTLS_ECJPAKE_C
2707
2708/**
2709 * \def MBEDTLS_ECP_C
2710 *
2711 * Enable the elliptic curve over GF(p) library.
2712 *
2713 * Module: library/ecp.c
2714 * Caller: library/ecdh.c
2715 * library/ecdsa.c
2716 * library/ecjpake.c
2717 *
2718 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
2719 */
2720#define MBEDTLS_ECP_C
2721
2722/**
2723 * \def MBEDTLS_ENTROPY_C
2724 *
2725 * Enable the platform-specific entropy code.
2726 *
2727 * Module: library/entropy.c
2728 * Caller:
2729 *
2730 * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
2731 *
2732 * This module provides a generic entropy pool
2733 */
2734#define MBEDTLS_ENTROPY_C
2735
2736/**
2737 * \def MBEDTLS_ERROR_C
2738 *
2739 * Enable error code to error string conversion.
2740 *
2741 * Module: library/error.c
2742 * Caller:
2743 *
2744 * This module enables mbedtls_strerror().
2745 */
2746#define MBEDTLS_ERROR_C
2747
2748/**
2749 * \def MBEDTLS_GCM_C
2750 *
2751 * Enable the Galois/Counter Mode (GCM).
2752 *
2753 * Module: library/gcm.c
2754 *
2755 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or MBEDTLS_ARIA_C
2756 *
2757 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
2758 * requisites are enabled as well.
2759 */
2760#define MBEDTLS_GCM_C
2761
2762/**
2763 * \def MBEDTLS_HAVEGE_C
2764 *
2765 * Enable the HAVEGE random generator.
2766 *
2767 * Warning: the HAVEGE random generator is not suitable for virtualized
2768 * environments
2769 *
2770 * Warning: the HAVEGE random generator is dependent on timing and specific
2771 * processor traits. It is therefore not advised to use HAVEGE as
2772 * your applications primary random generator or primary entropy pool
2773 * input. As a secondary input to your entropy pool, it IS able add
2774 * the (limited) extra entropy it provides.
2775 *
2776 * Module: library/havege.c
2777 * Caller:
2778 *
2779 * Requires: MBEDTLS_TIMING_C
2780 *
2781 * Uncomment to enable the HAVEGE random generator.
2782 */
2783//#define MBEDTLS_HAVEGE_C
2784
2785/**
2786 * \def MBEDTLS_HKDF_C
2787 *
2788 * Enable the HKDF algorithm (RFC 5869).
2789 *
2790 * Module: library/hkdf.c
2791 * Caller:
2792 *
2793 * Requires: MBEDTLS_MD_C
2794 *
2795 * This module adds support for the Hashed Message Authentication Code
2796 * (HMAC)-based key derivation function (HKDF).
2797 */
2798#define MBEDTLS_HKDF_C
2799
2800/**
2801 * \def MBEDTLS_HMAC_DRBG_C
2802 *
2803 * Enable the HMAC_DRBG random generator.
2804 *
2805 * Module: library/hmac_drbg.c
2806 * Caller:
2807 *
2808 * Requires: MBEDTLS_MD_C
2809 *
2810 * Uncomment to enable the HMAC_DRBG random number geerator.
2811 */
2812#define MBEDTLS_HMAC_DRBG_C
2813
2814/**
2815 * \def MBEDTLS_NIST_KW_C
2816 *
2817 * Enable the Key Wrapping mode for 128-bit block ciphers,
2818 * as defined in NIST SP 800-38F. Only KW and KWP modes
2819 * are supported. At the moment, only AES is approved by NIST.
2820 *
2821 * Module: library/nist_kw.c
2822 *
2823 * Requires: MBEDTLS_AES_C and MBEDTLS_CIPHER_C
2824 */
2825//#define MBEDTLS_NIST_KW_C
2826
2827/**
2828 * \def MBEDTLS_MD_C
2829 *
2830 * Enable the generic message digest layer.
2831 *
2832 * Module: library/md.c
2833 * Caller:
2834 *
2835 * Uncomment to enable generic message digest wrappers.
2836 */
2837#define MBEDTLS_MD_C
2838
2839/**
2840 * \def MBEDTLS_MD2_C
2841 *
2842 * Enable the MD2 hash algorithm.
2843 *
2844 * Module: library/md2.c
2845 * Caller:
2846 *
2847 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
2848 *
2849 * \warning MD2 is considered a weak message digest and its use constitutes a
2850 * security risk. If possible, we recommend avoiding dependencies on
2851 * it, and considering stronger message digests instead.
2852 *
2853 */
2854//#define MBEDTLS_MD2_C
2855
2856/**
2857 * \def MBEDTLS_MD4_C
2858 *
2859 * Enable the MD4 hash algorithm.
2860 *
2861 * Module: library/md4.c
2862 * Caller:
2863 *
2864 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
2865 *
2866 * \warning MD4 is considered a weak message digest and its use constitutes a
2867 * security risk. If possible, we recommend avoiding dependencies on
2868 * it, and considering stronger message digests instead.
2869 *
2870 */
2871//#define MBEDTLS_MD4_C
2872
2873/**
2874 * \def MBEDTLS_MD5_C
2875 *
2876 * Enable the MD5 hash algorithm.
2877 *
2878 * Module: library/md5.c
2879 * Caller: library/md.c
2880 * library/pem.c
2881 * library/ssl_tls.c
2882 *
2883 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
2884 * depending on the handshake parameters. Further, it is used for checking
2885 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
2886 * encrypted keys.
2887 *
2888 * \warning MD5 is considered a weak message digest and its use constitutes a
2889 * security risk. If possible, we recommend avoiding dependencies on
2890 * it, and considering stronger message digests instead.
2891 *
2892 */
2893//#define MBEDTLS_MD5_C
2894
2895/**
2896 * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
2897 *
2898 * Enable the buffer allocator implementation that makes use of a (stack)
2899 * based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
2900 * calls)
2901 *
2902 * Module: library/memory_buffer_alloc.c
2903 *
2904 * Requires: MBEDTLS_PLATFORM_C
2905 * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS)
2906 *
2907 * Enable this module to enable the buffer memory allocator.
2908 */
2909//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
2910
2911/**
2912 * \def MBEDTLS_NET_C
2913 *
2914 * Enable the TCP and UDP over IPv6/IPv4 networking routines.
2915 *
2916 * \note This module only works on POSIX/Unix (including Linux, BSD and OS X)
2917 * and Windows. For other platforms, you'll want to disable it, and write your
2918 * own networking callbacks to be passed to \c mbedtls_ssl_set_bio().
2919 *
2920 * \note See also our Knowledge Base article about porting to a new
2921 * environment:
2922 * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
2923 *
2924 * Module: library/net_sockets.c
2925 *
2926 * This module provides networking routines.
2927 */
2928//#define MBEDTLS_NET_C
2929
2930/**
2931 * \def MBEDTLS_OID_C
2932 *
2933 * Enable the OID database.
2934 *
2935 * Module: library/oid.c
2936 * Caller: library/asn1write.c
2937 * library/pkcs5.c
2938 * library/pkparse.c
2939 * library/pkwrite.c
2940 * library/rsa.c
2941 * library/x509.c
2942 * library/x509_create.c
2943 * library/x509_crl.c
2944 * library/x509_crt.c
2945 * library/x509_csr.c
2946 * library/x509write_crt.c
2947 * library/x509write_csr.c
2948 *
2949 * This modules translates between OIDs and internal values.
2950 */
2951#define MBEDTLS_OID_C
2952
2953/**
2954 * \def MBEDTLS_PADLOCK_C
2955 *
2956 * Enable VIA Padlock support on x86.
2957 *
2958 * Module: library/padlock.c
2959 * Caller: library/aes.c
2960 *
2961 * Requires: MBEDTLS_HAVE_ASM
2962 *
2963 * This modules adds support for the VIA PadLock on x86.
2964 */
2965//#define MBEDTLS_PADLOCK_C
2966
2967/**
2968 * \def MBEDTLS_PEM_PARSE_C
2969 *
2970 * Enable PEM decoding / parsing.
2971 *
2972 * Module: library/pem.c
2973 * Caller: library/dhm.c
2974 * library/pkparse.c
2975 * library/x509_crl.c
2976 * library/x509_crt.c
2977 * library/x509_csr.c
2978 *
2979 * Requires: MBEDTLS_BASE64_C
2980 *
2981 * This modules adds support for decoding / parsing PEM files.
2982 */
2983#define MBEDTLS_PEM_PARSE_C
2984
2985/**
2986 * \def MBEDTLS_PEM_WRITE_C
2987 *
2988 * Enable PEM encoding / writing.
2989 *
2990 * Module: library/pem.c
2991 * Caller: library/pkwrite.c
2992 * library/x509write_crt.c
2993 * library/x509write_csr.c
2994 *
2995 * Requires: MBEDTLS_BASE64_C
2996 *
2997 * This modules adds support for encoding / writing PEM files.
2998 */
2999//#define MBEDTLS_PEM_WRITE_C
3000
3001/**
3002 * \def MBEDTLS_PK_C
3003 *
3004 * Enable the generic public (asymetric) key layer.
3005 *
3006 * Module: library/pk.c
3007 * Caller: library/ssl_tls.c
3008 * library/ssl_cli.c
3009 * library/ssl_srv.c
3010 *
3011 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
3012 *
3013 * Uncomment to enable generic public key wrappers.
3014 */
3015#define MBEDTLS_PK_C
3016
3017/**
3018 * \def MBEDTLS_PK_PARSE_C
3019 *
3020 * Enable the generic public (asymetric) key parser.
3021 *
3022 * Module: library/pkparse.c
3023 * Caller: library/x509_crt.c
3024 * library/x509_csr.c
3025 *
3026 * Requires: MBEDTLS_PK_C
3027 *
3028 * Uncomment to enable generic public key parse functions.
3029 */
3030#define MBEDTLS_PK_PARSE_C
3031
3032/**
3033 * \def MBEDTLS_PK_WRITE_C
3034 *
3035 * Enable the generic public (asymetric) key writer.
3036 *
3037 * Module: library/pkwrite.c
3038 * Caller: library/x509write.c
3039 *
3040 * Requires: MBEDTLS_PK_C
3041 *
3042 * Uncomment to enable generic public key write functions.
3043 */
3044#define MBEDTLS_PK_WRITE_C
3045
3046/**
3047 * \def MBEDTLS_PKCS5_C
3048 *
3049 * Enable PKCS#5 functions.
3050 *
3051 * Module: library/pkcs5.c
3052 *
3053 * Requires: MBEDTLS_MD_C
3054 *
3055 * This module adds support for the PKCS#5 functions.
3056 */
3057//#define MBEDTLS_PKCS5_C
3058
3059/**
3060 * \def MBEDTLS_PKCS11_C
3061 *
3062 * Enable wrapper for PKCS#11 smartcard support via the pkcs11-helper library.
3063 *
3064 * \deprecated This option is deprecated and will be removed in a future
3065 * version of Mbed TLS.
3066 *
3067 * Module: library/pkcs11.c
3068 * Caller: library/pk.c
3069 *
3070 * Requires: MBEDTLS_PK_C
3071 *
3072 * This module enables SSL/TLS PKCS #11 smartcard support.
3073 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
3074 */
3075//#define MBEDTLS_PKCS11_C
3076
3077/**
3078 * \def MBEDTLS_PKCS12_C
3079 *
3080 * Enable PKCS#12 PBE functions.
3081 * Adds algorithms for parsing PKCS#8 encrypted private keys
3082 *
3083 * Module: library/pkcs12.c
3084 * Caller: library/pkparse.c
3085 *
3086 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
3087 * Can use: MBEDTLS_ARC4_C
3088 *
3089 * This module enables PKCS#12 functions.
3090 */
3091//#define MBEDTLS_PKCS12_C
3092
3093/**
3094 * \def MBEDTLS_PLATFORM_C
3095 *
3096 * Enable the platform abstraction layer that allows you to re-assign
3097 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
3098 *
3099 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
3100 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
3101 * above to be specified at runtime or compile time respectively.
3102 *
3103 * \note This abstraction layer must be enabled on Windows (including MSYS2)
3104 * as other module rely on it for a fixed snprintf implementation.
3105 *
3106 * Module: library/platform.c
3107 * Caller: Most other .c files
3108 *
3109 * This module enables abstraction of common (libc) functions.
3110 */
3111#define MBEDTLS_PLATFORM_C
3112
3113/**
3114 * \def MBEDTLS_POLY1305_C
3115 *
3116 * Enable the Poly1305 MAC algorithm.
3117 *
3118 * Module: library/poly1305.c
3119 * Caller: library/chachapoly.c
3120 */
3121#define MBEDTLS_POLY1305_C
3122
3123/**
3124 * \def MBEDTLS_PSA_CRYPTO_C
3125 *
3126 * Enable the Platform Security Architecture cryptography API.
3127 *
3128 * \warning The PSA Crypto API is still beta status. While you're welcome to
3129 * experiment using it, incompatible API changes are still possible, and some
3130 * parts may not have reached the same quality as the rest of Mbed TLS yet.
3131 *
3132 * Module: library/psa_crypto.c
3133 *
3134 * Requires: MBEDTLS_CTR_DRBG_C, MBEDTLS_ENTROPY_C
3135 *
3136 */
3137#define MBEDTLS_PSA_CRYPTO_C
3138
3139/**
3140 * \def MBEDTLS_PSA_CRYPTO_SE_C
3141 *
3142 * Enable secure element support in the Platform Security Architecture
3143 * cryptography API.
3144 *
3145 * \warning This feature is not yet suitable for production. It is provided
3146 * for API evaluation and testing purposes only.
3147 *
3148 * Module: library/psa_crypto_se.c
3149 *
3150 * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_PSA_CRYPTO_STORAGE_C
3151 *
3152 */
3153//#define MBEDTLS_PSA_CRYPTO_SE_C
3154
3155/**
3156 * \def MBEDTLS_PSA_CRYPTO_STORAGE_C
3157 *
3158 * Enable the Platform Security Architecture persistent key storage.
3159 *
3160 * Module: library/psa_crypto_storage.c
3161 *
3162 * Requires: MBEDTLS_PSA_CRYPTO_C,
3163 * either MBEDTLS_PSA_ITS_FILE_C or a native implementation of
3164 * the PSA ITS interface
3165 */
3166//#define MBEDTLS_PSA_CRYPTO_STORAGE_C
3167
3168/**
3169 * \def MBEDTLS_PSA_ITS_FILE_C
3170 *
3171 * Enable the emulation of the Platform Security Architecture
3172 * Internal Trusted Storage (PSA ITS) over files.
3173 *
3174 * Module: library/psa_its_file.c
3175 *
3176 * Requires: MBEDTLS_FS_IO
3177 */
3178//#define MBEDTLS_PSA_ITS_FILE_C
3179
3180/**
3181 * \def MBEDTLS_RIPEMD160_C
3182 *
3183 * Enable the RIPEMD-160 hash algorithm.
3184 *
3185 * Module: library/ripemd160.c
3186 * Caller: library/md.c
3187 *
3188 */
3189//#define MBEDTLS_RIPEMD160_C
3190
3191/**
3192 * \def MBEDTLS_RSA_C
3193 *
3194 * Enable the RSA public-key cryptosystem.
3195 *
3196 * Module: library/rsa.c
3197 * library/rsa_internal.c
3198 * Caller: library/ssl_cli.c
3199 * library/ssl_srv.c
3200 * library/ssl_tls.c
3201 * library/x509.c
3202 *
3203 * This module is used by the following key exchanges:
3204 * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
3205 *
3206 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
3207 */
3208#define MBEDTLS_RSA_C
3209
3210/**
3211 * \def MBEDTLS_SHA1_C
3212 *
3213 * Enable the SHA1 cryptographic hash algorithm.
3214 *
3215 * Module: library/sha1.c
3216 * Caller: library/md.c
3217 * library/ssl_cli.c
3218 * library/ssl_srv.c
3219 * library/ssl_tls.c
3220 * library/x509write_crt.c
3221 *
3222 * This module is required for SSL/TLS up to version 1.1, for TLS 1.2
3223 * depending on the handshake parameters, and for SHA1-signed certificates.
3224 *
3225 * \warning SHA-1 is considered a weak message digest and its use constitutes
3226 * a security risk. If possible, we recommend avoiding dependencies
3227 * on it, and considering stronger message digests instead.
3228 *
3229 */
3230#define MBEDTLS_SHA1_C
3231
3232/**
3233 * \def MBEDTLS_SHA256_C
3234 *
3235 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
3236 *
3237 * Module: library/sha256.c
3238 * Caller: library/entropy.c
3239 * library/md.c
3240 * library/ssl_cli.c
3241 * library/ssl_srv.c
3242 * library/ssl_tls.c
3243 *
3244 * This module adds support for SHA-224 and SHA-256.
3245 * This module is required for the SSL/TLS 1.2 PRF function.
3246 */
3247#define MBEDTLS_SHA256_C
3248
3249/**
3250 * \def MBEDTLS_SHA512_C
3251 *
3252 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
3253 *
3254 * Module: library/sha512.c
3255 * Caller: library/entropy.c
3256 * library/md.c
3257 * library/ssl_cli.c
3258 * library/ssl_srv.c
3259 *
3260 * This module adds support for SHA-384 and SHA-512.
3261 */
3262#define MBEDTLS_SHA512_C
3263
3264/**
3265 * \def MBEDTLS_SSL_CACHE_C
3266 *
3267 * Enable simple SSL cache implementation.
3268 *
3269 * Module: library/ssl_cache.c
3270 * Caller:
3271 *
3272 * Requires: MBEDTLS_SSL_CACHE_C
3273 */
3274#define MBEDTLS_SSL_CACHE_C
3275
3276/**
3277 * \def MBEDTLS_SSL_COOKIE_C
3278 *
3279 * Enable basic implementation of DTLS cookies for hello verification.
3280 *
3281 * Module: library/ssl_cookie.c
3282 * Caller:
3283 */
3284#define MBEDTLS_SSL_COOKIE_C
3285
3286/**
3287 * \def MBEDTLS_SSL_TICKET_C
3288 *
3289 * Enable an implementation of TLS server-side callbacks for session tickets.
3290 *
3291 * Module: library/ssl_ticket.c
3292 * Caller:
3293 *
3294 * Requires: MBEDTLS_CIPHER_C
3295 */
3296#define MBEDTLS_SSL_TICKET_C
3297
3298/**
3299 * \def MBEDTLS_SSL_CLI_C
3300 *
3301 * Enable the SSL/TLS client code.
3302 *
3303 * Module: library/ssl_cli.c
3304 * Caller:
3305 *
3306 * Requires: MBEDTLS_SSL_TLS_C
3307 *
3308 * This module is required for SSL/TLS client support.
3309 */
3310#define MBEDTLS_SSL_CLI_C
3311
3312/**
3313 * \def MBEDTLS_SSL_SRV_C
3314 *
3315 * Enable the SSL/TLS server code.
3316 *
3317 * Module: library/ssl_srv.c
3318 * Caller:
3319 *
3320 * Requires: MBEDTLS_SSL_TLS_C
3321 *
3322 * This module is required for SSL/TLS server support.
3323 */
3324#define MBEDTLS_SSL_SRV_C
3325
3326/**
3327 * \def MBEDTLS_SSL_TLS_C
3328 *
3329 * Enable the generic SSL/TLS code.
3330 *
3331 * Module: library/ssl_tls.c
3332 * Caller: library/ssl_cli.c
3333 * library/ssl_srv.c
3334 *
3335 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
3336 * and at least one of the MBEDTLS_SSL_PROTO_XXX defines
3337 *
3338 * This module is required for SSL/TLS.
3339 */
3340#define MBEDTLS_SSL_TLS_C
3341
3342/**
3343 * \def MBEDTLS_THREADING_C
3344 *
3345 * Enable the threading abstraction layer.
3346 * By default mbed TLS assumes it is used in a non-threaded environment or that
3347 * contexts are not shared between threads. If you do intend to use contexts
3348 * between threads, you will need to enable this layer to prevent race
3349 * conditions. See also our Knowledge Base article about threading:
3350 * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
3351 *
3352 * Module: library/threading.c
3353 *
3354 * This allows different threading implementations (self-implemented or
3355 * provided).
3356 *
3357 * You will have to enable either MBEDTLS_THREADING_ALT or
3358 * MBEDTLS_THREADING_PTHREAD.
3359 *
3360 * Enable this layer to allow use of mutexes within mbed TLS
3361 */
3362//#define MBEDTLS_THREADING_C
3363
3364/**
3365 * \def MBEDTLS_TIMING_C
3366 *
3367 * Enable the semi-portable timing interface.
3368 *
3369 * \note The provided implementation only works on POSIX/Unix (including Linux,
3370 * BSD and OS X) and Windows. On other platforms, you can either disable that
3371 * module and provide your own implementations of the callbacks needed by
3372 * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide
3373 * your own implementation of the whole module by setting
3374 * \c MBEDTLS_TIMING_ALT in the current file.
3375 *
3376 * \note See also our Knowledge Base article about porting to a new
3377 * environment:
3378 * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
3379 *
3380 * Module: library/timing.c
3381 * Caller: library/havege.c
3382 *
3383 * This module is used by the HAVEGE random number generator.
3384 */
3385//#define MBEDTLS_TIMING_C
3386
3387/**
3388 * \def MBEDTLS_VERSION_C
3389 *
3390 * Enable run-time version information.
3391 *
3392 * Module: library/version.c
3393 *
3394 * This module provides run-time version information.
3395 */
3396#define MBEDTLS_VERSION_C
3397
3398/**
3399 * \def MBEDTLS_X509_USE_C
3400 *
3401 * Enable X.509 core for using certificates.
3402 *
3403 * Module: library/x509.c
3404 * Caller: library/x509_crl.c
3405 * library/x509_crt.c
3406 * library/x509_csr.c
3407 *
3408 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
3409 * MBEDTLS_PK_PARSE_C
3410 *
3411 * This module is required for the X.509 parsing modules.
3412 */
3413#define MBEDTLS_X509_USE_C
3414
3415/**
3416 * \def MBEDTLS_X509_CRT_PARSE_C
3417 *
3418 * Enable X.509 certificate parsing.
3419 *
3420 * Module: library/x509_crt.c
3421 * Caller: library/ssl_cli.c
3422 * library/ssl_srv.c
3423 * library/ssl_tls.c
3424 *
3425 * Requires: MBEDTLS_X509_USE_C
3426 *
3427 * This module is required for X.509 certificate parsing.
3428 */
3429#define MBEDTLS_X509_CRT_PARSE_C
3430
3431/**
3432 * \def MBEDTLS_X509_CRL_PARSE_C
3433 *
3434 * Enable X.509 CRL parsing.
3435 *
3436 * Module: library/x509_crl.c
3437 * Caller: library/x509_crt.c
3438 *
3439 * Requires: MBEDTLS_X509_USE_C
3440 *
3441 * This module is required for X.509 CRL parsing.
3442 */
3443#define MBEDTLS_X509_CRL_PARSE_C
3444
3445/**
3446 * \def MBEDTLS_X509_CSR_PARSE_C
3447 *
3448 * Enable X.509 Certificate Signing Request (CSR) parsing.
3449 *
3450 * Module: library/x509_csr.c
3451 * Caller: library/x509_crt_write.c
3452 *
3453 * Requires: MBEDTLS_X509_USE_C
3454 *
3455 * This module is used for reading X.509 certificate request.
3456 */
3457//#define MBEDTLS_X509_CSR_PARSE_C
3458
3459/**
3460 * \def MBEDTLS_X509_CREATE_C
3461 *
3462 * Enable X.509 core for creating certificates.
3463 *
3464 * Module: library/x509_create.c
3465 *
3466 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C
3467 *
3468 * This module is the basis for creating X.509 certificates and CSRs.
3469 */
3470//#define MBEDTLS_X509_CREATE_C
3471
3472/**
3473 * \def MBEDTLS_X509_CRT_WRITE_C
3474 *
3475 * Enable creating X.509 certificates.
3476 *
3477 * Module: library/x509_crt_write.c
3478 *
3479 * Requires: MBEDTLS_X509_CREATE_C
3480 *
3481 * This module is required for X.509 certificate creation.
3482 */
3483//#define MBEDTLS_X509_CRT_WRITE_C
3484
3485/**
3486 * \def MBEDTLS_X509_CSR_WRITE_C
3487 *
3488 * Enable creating X.509 Certificate Signing Requests (CSR).
3489 *
3490 * Module: library/x509_csr_write.c
3491 *
3492 * Requires: MBEDTLS_X509_CREATE_C
3493 *
3494 * This module is required for X.509 certificate request writing.
3495 */
3496//#define MBEDTLS_X509_CSR_WRITE_C
3497
3498/**
3499 * \def MBEDTLS_XTEA_C
3500 *
3501 * Enable the XTEA block cipher.
3502 *
3503 * Module: library/xtea.c
3504 * Caller:
3505 */
3506//#define MBEDTLS_XTEA_C
3507
3508/* \} name SECTION: mbed TLS modules */
3509
3510/**
3511 * \name SECTION: Module configuration options
3512 *
3513 * This section allows for the setting of module specific sizes and
3514 * configuration options. The default values are already present in the
3515 * relevant header files and should suffice for the regular use cases.
3516 *
3517 * Our advice is to enable options and change their values here
3518 * only if you have a good reason and know the consequences.
3519 *
3520 * Please check the respective header file for documentation on these
3521 * parameters (to prevent duplicate documentation).
3522 * \{
3523 */
3524
3525/* MPI / BIGNUM options */
3526//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum window size used. */
3527#define MBEDTLS_MPI_MAX_SIZE 512
3528
3529/* CTR_DRBG options */
3530//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
3531//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
3532//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
3533//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
3534//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
3535
3536/* HMAC_DRBG options */
3537//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
3538//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
3539//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
3540//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
3541
3542/* ECP options */
3543//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */
3544//#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */
3545//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */
3546
3547/* Entropy options */
3548//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
3549//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
3550//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */
3551
3552/* Memory buffer allocator options */
3553//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
3554
3555/* Platform options */
3556//#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. */
3557//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */
3558//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
3559//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
3560//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
3561//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
3562//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
3563/* Note: your snprintf must correctly zero-terminate the buffer! */
3564//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
3565//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */
3566//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */
3567//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
3568//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
3569//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */
3570
3571/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
3572/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
3573//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */
3574//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
3575//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
3576//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
3577//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */
3578//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
3579//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
3580/* Note: your snprintf must correctly zero-terminate the buffer! */
3581//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
3582//#define MBEDTLS_PLATFORM_VSNPRINTF_MACRO vsnprintf /**< Default vsnprintf macro to use, can be undefined */
3583//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */
3584//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */
3585
3586/**
3587 * \brief This macro is invoked by the library when an invalid parameter
3588 * is detected that is only checked with #MBEDTLS_CHECK_PARAMS
3589 * (see the documentation of that option for context).
3590 *
3591 * When you leave this undefined here, the library provides
3592 * a default definition. If the macro #MBEDTLS_CHECK_PARAMS_ASSERT
3593 * is defined, the default definition is `assert(cond)`,
3594 * otherwise the default definition calls a function
3595 * mbedtls_param_failed(). This function is declared in
3596 * `platform_util.h` for the benefit of the library, but
3597 * you need to define in your application.
3598 *
3599 * When you define this here, this replaces the default
3600 * definition in platform_util.h (which no longer declares the
3601 * function mbedtls_param_failed()) and it is your responsibility
3602 * to make sure this macro expands to something suitable (in
3603 * particular, that all the necessary declarations are visible
3604 * from within the library - you can ensure that by providing
3605 * them in this file next to the macro definition).
3606 * If you define this macro to call `assert`, also define
3607 * #MBEDTLS_CHECK_PARAMS_ASSERT so that library source files
3608 * include `<assert.h>`.
3609 *
3610 * Note that you may define this macro to expand to nothing, in
3611 * which case you don't have to worry about declarations or
3612 * definitions. However, you will then be notified about invalid
3613 * parameters only in non-void functions, and void function will
3614 * just silently return early on invalid parameters, which
3615 * partially negates the benefits of enabling
3616 * #MBEDTLS_CHECK_PARAMS in the first place, so is discouraged.
3617 *
3618 * \param cond The expression that should evaluate to true, but doesn't.
3619 */
3620//#define MBEDTLS_PARAM_FAILED( cond ) assert( cond )
3621
3622/* SSL Cache options */
3623//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
3624//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
3625
3626/* SSL options */
3627
3628/** \def MBEDTLS_SSL_MAX_CONTENT_LEN
3629 *
3630 * Maximum length (in bytes) of incoming and outgoing plaintext fragments.
3631 *
3632 * This determines the size of both the incoming and outgoing TLS I/O buffers
3633 * in such a way that both are capable of holding the specified amount of
3634 * plaintext data, regardless of the protection mechanism used.
3635 *
3636 * To configure incoming and outgoing I/O buffers separately, use
3637 * #MBEDTLS_SSL_IN_CONTENT_LEN and #MBEDTLS_SSL_OUT_CONTENT_LEN,
3638 * which overwrite the value set by this option.
3639 *
3640 * \note When using a value less than the default of 16KB on the client, it is
3641 * recommended to use the Maximum Fragment Length (MFL) extension to
3642 * inform the server about this limitation. On the server, there
3643 * is no supported, standardized way of informing the client about
3644 * restriction on the maximum size of incoming messages, and unless
3645 * the limitation has been communicated by other means, it is recommended
3646 * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN
3647 * while keeping the default value of 16KB for the incoming buffer.
3648 *
3649 * Uncomment to set the maximum plaintext size of both
3650 * incoming and outgoing I/O buffers.
3651 */
3652//#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384
3653
3654/** \def MBEDTLS_SSL_IN_CONTENT_LEN
3655 *
3656 * Maximum length (in bytes) of incoming plaintext fragments.
3657 *
3658 * This determines the size of the incoming TLS I/O buffer in such a way
3659 * that it is capable of holding the specified amount of plaintext data,
3660 * regardless of the protection mechanism used.
3661 *
3662 * If this option is undefined, it inherits its value from
3663 * #MBEDTLS_SSL_MAX_CONTENT_LEN.
3664 *
3665 * \note When using a value less than the default of 16KB on the client, it is
3666 * recommended to use the Maximum Fragment Length (MFL) extension to
3667 * inform the server about this limitation. On the server, there
3668 * is no supported, standardized way of informing the client about
3669 * restriction on the maximum size of incoming messages, and unless
3670 * the limitation has been communicated by other means, it is recommended
3671 * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN
3672 * while keeping the default value of 16KB for the incoming buffer.
3673 *
3674 * Uncomment to set the maximum plaintext size of the incoming I/O buffer
3675 * independently of the outgoing I/O buffer.
3676 */
3677//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384
3678
3679/** \def MBEDTLS_SSL_CID_IN_LEN_MAX
3680 *
3681 * The maximum length of CIDs used for incoming DTLS messages.
3682 *
3683 */
3684//#define MBEDTLS_SSL_CID_IN_LEN_MAX 32
3685
3686/** \def MBEDTLS_SSL_CID_OUT_LEN_MAX
3687 *
3688 * The maximum length of CIDs used for outgoing DTLS messages.
3689 *
3690 */
3691//#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32
3692
3693/** \def MBEDTLS_SSL_CID_PADDING_GRANULARITY
3694 *
3695 * This option controls the use of record plaintext padding
3696 * when using the Connection ID extension in DTLS 1.2.
3697 *
3698 * The padding will always be chosen so that the length of the
3699 * padded plaintext is a multiple of the value of this option.
3700 *
3701 * Note: A value of \c 1 means that no padding will be used
3702 * for outgoing records.
3703 *
3704 * Note: On systems lacking division instructions,
3705 * a power of two should be preferred.
3706 *
3707 */
3708//#define MBEDTLS_SSL_CID_PADDING_GRANULARITY 16
3709
3710/** \def MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY
3711 *
3712 * This option controls the use of record plaintext padding
3713 * in TLS 1.3.
3714 *
3715 * The padding will always be chosen so that the length of the
3716 * padded plaintext is a multiple of the value of this option.
3717 *
3718 * Note: A value of \c 1 means that no padding will be used
3719 * for outgoing records.
3720 *
3721 * Note: On systems lacking division instructions,
3722 * a power of two should be preferred.
3723 */
3724//#define MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY 1
3725
3726/** \def MBEDTLS_SSL_OUT_CONTENT_LEN
3727 *
3728 * Maximum length (in bytes) of outgoing plaintext fragments.
3729 *
3730 * This determines the size of the outgoing TLS I/O buffer in such a way
3731 * that it is capable of holding the specified amount of plaintext data,
3732 * regardless of the protection mechanism used.
3733 *
3734 * If this option undefined, it inherits its value from
3735 * #MBEDTLS_SSL_MAX_CONTENT_LEN.
3736 *
3737 * It is possible to save RAM by setting a smaller outward buffer, while keeping
3738 * the default inward 16384 byte buffer to conform to the TLS specification.
3739 *
3740 * The minimum required outward buffer size is determined by the handshake
3741 * protocol's usage. Handshaking will fail if the outward buffer is too small.
3742 * The specific size requirement depends on the configured ciphers and any
3743 * certificate data which is sent during the handshake.
3744 *
3745 * Uncomment to set the maximum plaintext size of the outgoing I/O buffer
3746 * independently of the incoming I/O buffer.
3747 */
3748//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384
3749
3750/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING
3751 *
3752 * Maximum number of heap-allocated bytes for the purpose of
3753 * DTLS handshake message reassembly and future message buffering.
3754 *
3755 * This should be at least 9/8 * MBEDTLSSL_IN_CONTENT_LEN
3756 * to account for a reassembled handshake message of maximum size,
3757 * together with its reassembly bitmap.
3758 *
3759 * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default)
3760 * should be sufficient for all practical situations as it allows
3761 * to reassembly a large handshake message (such as a certificate)
3762 * while buffering multiple smaller handshake messages.
3763 *
3764 */
3765//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768
3766
3767//#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
3768//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */
3769//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
3770
3771/**
3772 * Complete list of ciphersuites to use, in order of preference.
3773 *
3774 * \warning No dependency checking is done on that field! This option can only
3775 * be used to restrict the set of available ciphersuites. It is your
3776 * responsibility to make sure the needed modules are active.
3777 *
3778 * Use this to save a few hundred bytes of ROM (default ordering of all
3779 * available ciphersuites) and a few to a few hundred bytes of RAM.
3780 *
3781 * The value below is only an example, not the default.
3782 */
3783//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
3784
3785/* X509 options */
3786//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
3787//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
3788
3789/**
3790 * Allow SHA-1 in the default TLS configuration for certificate signing.
3791 * Without this build-time option, SHA-1 support must be activated explicitly
3792 * through mbedtls_ssl_conf_cert_profile. Turning on this option is not
3793 * recommended because of it is possible to generate SHA-1 collisions, however
3794 * this may be safe for legacy infrastructure where additional controls apply.
3795 *
3796 * \warning SHA-1 is considered a weak message digest and its use constitutes
3797 * a security risk. If possible, we recommend avoiding dependencies
3798 * on it, and considering stronger message digests instead.
3799 *
3800 */
3801//#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
3802
3803/**
3804 * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
3805 * signature and ciphersuite selection. Without this build-time option, SHA-1
3806 * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes.
3807 * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by
3808 * default. At the time of writing, there is no practical attack on the use
3809 * of SHA-1 in handshake signatures, hence this option is turned on by default
3810 * to preserve compatibility with existing peers, but the general
3811 * warning applies nonetheless:
3812 *
3813 * \warning SHA-1 is considered a weak message digest and its use constitutes
3814 * a security risk. If possible, we recommend avoiding dependencies
3815 * on it, and considering stronger message digests instead.
3816 *
3817 */
3818#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
3819
3820/**
3821 * Uncomment the macro to let mbed TLS use your alternate implementation of
3822 * mbedtls_platform_zeroize(). This replaces the default implementation in
3823 * platform_util.c.
3824 *
3825 * mbedtls_platform_zeroize() is a widely used function across the library to
3826 * zero a block of memory. The implementation is expected to be secure in the
3827 * sense that it has been written to prevent the compiler from removing calls
3828 * to mbedtls_platform_zeroize() as part of redundant code elimination
3829 * optimizations. However, it is difficult to guarantee that calls to
3830 * mbedtls_platform_zeroize() will not be optimized by the compiler as older
3831 * versions of the C language standards do not provide a secure implementation
3832 * of memset(). Therefore, MBEDTLS_PLATFORM_ZEROIZE_ALT enables users to
3833 * configure their own implementation of mbedtls_platform_zeroize(), for
3834 * example by using directives specific to their compiler, features from newer
3835 * C standards (e.g using memset_s() in C11) or calling a secure memset() from
3836 * their system (e.g explicit_bzero() in BSD).
3837 */
3838//#define MBEDTLS_PLATFORM_ZEROIZE_ALT
3839
3840/**
3841 * Uncomment the macro to let Mbed TLS use your alternate implementation of
3842 * mbedtls_platform_gmtime_r(). This replaces the default implementation in
3843 * platform_util.c.
3844 *
3845 * gmtime() is not a thread-safe function as defined in the C standard. The
3846 * library will try to use safer implementations of this function, such as
3847 * gmtime_r() when available. However, if Mbed TLS cannot identify the target
3848 * system, the implementation of mbedtls_platform_gmtime_r() will default to
3849 * using the standard gmtime(). In this case, calls from the library to
3850 * gmtime() will be guarded by the global mutex mbedtls_threading_gmtime_mutex
3851 * if MBEDTLS_THREADING_C is enabled. We recommend that calls from outside the
3852 * library are also guarded with this mutex to avoid race conditions. However,
3853 * if the macro MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, Mbed TLS will
3854 * unconditionally use the implementation for mbedtls_platform_gmtime_r()
3855 * supplied at compile time.
3856 */
3857//#define MBEDTLS_PLATFORM_GMTIME_R_ALT
3858
3859/**
3860 * Enable the verified implementations of ECDH primitives from Project Everest
3861 * (currently only Curve25519). This feature changes the layout of ECDH
3862 * contexts and therefore is a compatibility break for applications that access
3863 * fields of a mbedtls_ecdh_context structure directly. See also
3864 * MBEDTLS_ECDH_LEGACY_CONTEXT in include/mbedtls/ecdh.h.
3865 */
3866//#define MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED
3867
3868/* \} name SECTION: Customisation configuration options */
3869
3870/* Target and application specific configurations
3871 *
3872 * Allow user to override any previous default.
3873 *
3874 */
3875#if defined(MBEDTLS_USER_CONFIG_FILE)
3876#include MBEDTLS_USER_CONFIG_FILE
3877#endif
3878
3879#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
3880#include "mbedtls/config_psa.h"
3881#endif
3882
3883#include "mbedtls/check_config.h"
3884
3885
3886#endif /* !MBEDTLS_ENTROPY_HARDWARE_ALT && !MBEDTLS_TEST_NULL_ENTROPY && !MBEDTLS_ENTROPY_NV_SEED */
3887
3888#if defined(MBEDTLS_TEST_NULL_ENTROPY)
3889#warning "MBEDTLS_TEST_NULL_ENTROPY has been enabled. This " \
3890 "configuration is not secure and is not suitable for production use"
3891#endif
3892
3893#if defined(MBEDTLS_SSL_TLS_C) && !defined(MBEDTLS_TEST_NULL_ENTROPY) && \
3894 !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && !defined(MBEDTLS_ENTROPY_NV_SEED)
3895#error "No entropy source was found at build time, so TLS " \
3896 "functionality is not available"
3897#endif
3898
3899#if defined(FEATURE_EXPERIMENTAL_API) && defined(FEATURE_PSA)
3900 #define MBEDTLS_PSA_HAS_ITS_IO
3901 #define MBEDTLS_USE_PSA_CRYPTO
3902#endif
3903
3904#endif /* MBEDTLS_CONFIG_H */
Consistency checks for configuration options.
Minimal configuration of features that do not require an entropy source.
PSA crypto configuration options (set of defines)