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