blob: 64bf7eeaadd2537ce261e30ac9901027c1684468 [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/**
Bence Szépkútibb0cfeb2021-05-28 09:42:25 +02002 * \file mbedtls_config.h
Paul Bakker5121ce52009-01-03 21:22:43 +00003 *
Paul Bakker37ca75d2011-01-06 12:28:03 +00004 * \brief Configuration options (set of defines)
5 *
Simon Butcher5b331b92016-01-03 16:14:14 +00006 * This set of compile-time options may be used to enable
7 * or disable features selectively, and reduce the global
8 * memory footprint.
Darryl Greena40a1012018-01-05 15:33:17 +00009 */
10/*
Bence Szépkúti1e148272020-08-07 13:07:28 +020011 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +000012 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Manuel Pégourié-Gonnarde2b0efe2015-08-11 10:38:37 +020013 */
14
Bence Szépkúti2bb74562021-06-21 16:19:00 +020015/**
Tom Cosgrove1e211442022-05-26 11:51:00 +010016 * This is an optional version symbol that enables compatibility handling of
Bence Szépkúti2bb74562021-06-21 16:19:00 +020017 * config files.
18 *
Bence Szépkúti1b2a8832021-06-28 10:26:11 +010019 * It is equal to the #MBEDTLS_VERSION_NUMBER of the Mbed TLS version that
Bence Szépkúti2bb74562021-06-21 16:19:00 +020020 * introduced the config format we want to be compatible with.
21 */
Bence Szépkúti1cafe5c2021-06-22 09:30:08 +020022//#define MBEDTLS_CONFIG_VERSION 0x03000000
Bence Szépkútiba7248a2021-05-31 16:53:56 +020023
Paul Bakkerf3b86c12011-01-27 15:24:17 +000024/**
Minos Galanakisacd560f2024-12-12 15:30:05 +000025 * \name SECTION: Platform abstraction layer
26 *
27 * This section sets platform specific settings.
28 * \{
29 */
30
Minos Galanakisacd560f2024-12-12 15:30:05 +000031/**
Minos Galanakis80e76b62024-12-12 15:46:29 +000032 * \def MBEDTLS_NET_C
Minos Galanakisacd560f2024-12-12 15:30:05 +000033 *
Minos Galanakis80e76b62024-12-12 15:46:29 +000034 * Enable the TCP and UDP over IPv6/IPv4 networking routines.
Minos Galanakisacd560f2024-12-12 15:30:05 +000035 *
Minos Galanakis80e76b62024-12-12 15:46:29 +000036 * \note This module only works on POSIX/Unix (including Linux, BSD and OS X)
37 * and Windows. For other platforms, you'll want to disable it, and write your
38 * own networking callbacks to be passed to \c mbedtls_ssl_set_bio().
Minos Galanakisacd560f2024-12-12 15:30:05 +000039 *
Minos Galanakis80e76b62024-12-12 15:46:29 +000040 * \note See also our Knowledge Base article about porting to a new
41 * environment:
42 * https://mbed-tls.readthedocs.io/en/latest/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
Paul Bakker0a62cd12011-01-21 11:00:08 +000043 *
Minos Galanakis80e76b62024-12-12 15:46:29 +000044 * Module: library/net_sockets.c
45 *
46 * This module provides networking routines.
Paul Bakker0a62cd12011-01-21 11:00:08 +000047 */
Minos Galanakis80e76b62024-12-12 15:46:29 +000048#define MBEDTLS_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +000049
Paul Bakkerf3b86c12011-01-27 15:24:17 +000050/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020051 * \def MBEDTLS_TIMING_ALT
Paul Bakkerf2561b32014-02-06 15:11:55 +010052 *
TRodziewiczd8540832021-06-10 15:16:50 +020053 * Uncomment to provide your own alternate implementation for
Manuel Pégourié-Gonnarda63bc942015-05-14 18:22:47 +020054 * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay()
Paul Bakkerf2561b32014-02-06 15:11:55 +010055 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020056 * Only works if you have MBEDTLS_TIMING_C enabled.
Paul Bakkerf2561b32014-02-06 15:11:55 +010057 *
58 * You will need to provide a header "timing_alt.h" and an implementation at
59 * compile time.
60 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020061//#define MBEDTLS_TIMING_ALT
Paul Bakkerf2561b32014-02-06 15:11:55 +010062
Paul Bakker90995b52013-06-24 19:20:35 +020063/**
Minos Galanakis80e76b62024-12-12 15:46:29 +000064 * \def MBEDTLS_TIMING_C
Paul Bakkerd4a56ec2013-04-16 18:05:29 +020065 *
Minos Galanakis80e76b62024-12-12 15:46:29 +000066 * Enable the semi-portable timing interface.
Paul Bakkerd4a56ec2013-04-16 18:05:29 +020067 *
Minos Galanakis80e76b62024-12-12 15:46:29 +000068 * \note The provided implementation only works on POSIX/Unix (including Linux,
69 * BSD and OS X) and Windows. On other platforms, you can either disable that
70 * module and provide your own implementations of the callbacks needed by
71 * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide
72 * your own implementation of the whole module by setting
73 * \c MBEDTLS_TIMING_ALT in the current file.
74 *
75 * \note The timing module will include time.h on suitable platforms
76 * regardless of the setting of MBEDTLS_HAVE_TIME, unless
77 * MBEDTLS_TIMING_ALT is used. See timing.c for more information.
78 *
79 * \note See also our Knowledge Base article about porting to a new
80 * environment:
81 * https://mbed-tls.readthedocs.io/en/latest/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
82 *
83 * Module: library/timing.c
Paul Bakkerd4a56ec2013-04-16 18:05:29 +020084 */
Minos Galanakis80e76b62024-12-12 15:46:29 +000085#define MBEDTLS_TIMING_C
86
87/** \} name SECTION: Platform abstraction layer */
88
89/**
90 * \name SECTION: General configuration options
91 *
Minos Galanakis1bf85a82024-12-12 16:29:38 +000092 * This section contains Mbed TLS build settings that are not associated
93 * with a particular module.
Minos Galanakis80e76b62024-12-12 15:46:29 +000094 * \{
95 */
96
97/**
98 * \def MBEDTLS_ERROR_C
99 *
100 * Enable error code to error string conversion.
101 *
102 * Module: library/error.c
103 * Caller:
104 *
105 * This module enables mbedtls_strerror().
106 */
107#define MBEDTLS_ERROR_C
108
109/**
110 * \def MBEDTLS_ERROR_STRERROR_DUMMY
111 *
112 * Enable a dummy error function to make use of mbedtls_strerror() in
113 * third party libraries easier when MBEDTLS_ERROR_C is disabled
114 * (no effect when MBEDTLS_ERROR_C is enabled).
115 *
116 * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're
117 * not using mbedtls_strerror() or error_strerror() in your application.
118 *
119 * Disable if you run into name conflicts and want to really remove the
120 * mbedtls_strerror()
121 */
122#define MBEDTLS_ERROR_STRERROR_DUMMY
123
124/**
125 * \def MBEDTLS_VERSION_C
126 *
127 * Enable run-time version information.
128 *
129 * Module: library/version.c
130 *
131 * This module provides run-time version information.
132 */
133#define MBEDTLS_VERSION_C
134
135/**
136 * \def MBEDTLS_VERSION_FEATURES
137 *
138 * Allow run-time checking of compile-time enabled features. Thus allowing users
139 * to check at run-time if the library is for instance compiled with threading
140 * support via mbedtls_version_check_feature().
141 *
142 * Requires: MBEDTLS_VERSION_C
143 *
144 * Comment this to disable run-time checking and save ROM space
145 */
146#define MBEDTLS_VERSION_FEATURES
147
148/**
149 * \def MBEDTLS_CONFIG_FILE
150 *
151 * If defined, this is a header which will be included instead of
152 * `"mbedtls/mbedtls_config.h"`.
153 * This header file specifies the compile-time configuration of Mbed TLS.
154 * Unlike other configuration options, this one must be defined on the
155 * compiler command line: a definition in `mbedtls_config.h` would have
156 * no effect.
157 *
158 * This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
159 * non-standard feature of the C language, so this feature is only available
160 * with compilers that perform macro expansion on an <tt>\#include</tt> line.
161 *
162 * The value of this symbol is typically a path in double quotes, either
163 * absolute or relative to a directory on the include search path.
164 */
165//#define MBEDTLS_CONFIG_FILE "mbedtls/mbedtls_config.h"
166
167/**
168 * \def MBEDTLS_USER_CONFIG_FILE
169 *
170 * If defined, this is a header which will be included after
171 * `"mbedtls/mbedtls_config.h"` or #MBEDTLS_CONFIG_FILE.
172 * This allows you to modify the default configuration, including the ability
173 * to undefine options that are enabled by default.
174 *
175 * This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
176 * non-standard feature of the C language, so this feature is only available
177 * with compilers that perform macro expansion on an <tt>\#include</tt> line.
178 *
179 * The value of this symbol is typically a path in double quotes, either
180 * absolute or relative to a directory on the include search path.
181 */
182//#define MBEDTLS_USER_CONFIG_FILE "/dev/null"
183
184/** \} name SECTION: General configuration options */
185
186/**
187 * \name SECTION: TLS feature selection
188 *
Minos Galanakis1bf85a82024-12-12 16:29:38 +0000189 * This section sets support for features that are or are not needed
190 * within the modules that are enabled.
Minos Galanakis80e76b62024-12-12 15:46:29 +0000191 * \{
192 */
193
194/**
195 * \def MBEDTLS_DEBUG_C
196 *
197 * Enable the debug functions.
198 *
199 * Module: library/debug.c
200 * Caller: library/ssl_msg.c
201 * library/ssl_tls.c
202 * library/ssl_tls12_*.c
203 * library/ssl_tls13_*.c
204 *
205 * This module provides debugging functions.
206 */
207#define MBEDTLS_DEBUG_C
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200208
209/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200210 * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200211 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200212 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200213 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200214 * Requires: MBEDTLS_DHM_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200215 *
216 * This enables the following ciphersuites (if other requisites are
217 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200218 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
219 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
220 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
221 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
222 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
223 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
224 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
225 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
226 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
227 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
Hanno Beckera2f6b722017-09-28 10:33:29 +0100228 *
Hanno Beckerf9734b32017-10-03 12:09:22 +0100229 * \warning Using DHE constitutes a security risk as it
230 * is not possible to validate custom DH parameters.
231 * If possible, it is recommended users should consider
232 * preferring other methods of key exchange.
233 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +0100234 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200235 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200236#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200237
Paul Bakkere07f41d2013-04-19 09:08:57 +0200238
239/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200240 * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200241 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200242 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200243 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200244 * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
245 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200246 *
247 * This enables the following ciphersuites (if other requisites are
248 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200249 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
250 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
251 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
252 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
253 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
254 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
255 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
256 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
257 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
258 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
259 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
260 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
Hanno Beckera2f6b722017-09-28 10:33:29 +0100261 *
Hanno Beckerf9734b32017-10-03 12:09:22 +0100262 * \warning Using DHE constitutes a security risk as it
263 * is not possible to validate custom DH parameters.
264 * If possible, it is recommended users should consider
265 * preferring other methods of key exchange.
266 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +0100267 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200268 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200269#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200270
271/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000272 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
273 *
274 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
275 *
276 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
277 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
278 * MBEDTLS_X509_CRT_PARSE_C
279 *
280 * This enables the following ciphersuites (if other requisites are
281 * enabled as well):
282 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
283 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
284 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
285 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
286 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
287 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
288 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
289 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
290 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
291 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
292 */
293#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
294
295/**
296 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
297 *
298 * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
299 *
300 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
301 *
302 * This enables the following ciphersuites (if other requisites are
303 * enabled as well):
304 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
305 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
306 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
307 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
308 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
309 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
310 */
311#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
312
313/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200314 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200315 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200316 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200317 *
Janos Follath277bba82024-11-19 16:14:00 +0000318 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200319 * MBEDTLS_RSA_C
320 * MBEDTLS_PKCS1_V15
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200321 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200322 *
323 * This enables the following ciphersuites (if other requisites are
324 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200325 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
326 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
327 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
328 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
329 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
330 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
331 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
332 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
333 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
334 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakkere07f41d2013-04-19 09:08:57 +0200335 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200336#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200337
338/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200339 * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100340 *
341 * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
342 *
Janos Follath277bba82024-11-19 16:14:00 +0000343 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
344 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200345 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100346 *
347 * This enables the following ciphersuites (if other requisites are
348 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200349 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
350 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
351 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
352 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
353 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
354 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
355 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
356 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
357 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
358 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100359 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200360#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100361
362/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200363 * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100364 *
365 * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS.
366 *
Janos Follath277bba82024-11-19 16:14:00 +0000367 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200368 * MBEDTLS_RSA_C
369 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100370 *
371 * This enables the following ciphersuites (if other requisites are
372 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200373 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
374 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
375 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
376 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
377 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
378 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
379 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
380 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
381 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
382 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100383 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200384#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100385
386/**
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200387 * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
388 *
389 * Enable the ECJPAKE based ciphersuite modes in SSL / TLS.
390 *
Manuel Pégourié-Gonnard75df9022015-09-16 23:21:01 +0200391 * \warning This is currently experimental. EC J-PAKE support is based on the
392 * Thread v1.0.0 specification; incompatible changes to the specification
393 * might still happen. For this reason, this is disabled by default.
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200394 *
Janos Follath277bba82024-11-19 16:14:00 +0000395 * Requires: MBEDTLS_ECJPAKE_C or PSA_WANT_ALG_JPAKE
Manuel Pégourié-Gonnard41bc8b62023-03-14 23:59:24 +0100396 * SHA-256 (via MBEDTLS_SHA256_C or a PSA driver)
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200397 * MBEDTLS_ECP_DP_SECP256R1_ENABLED
398 *
399 * This enables the following ciphersuites (if other requisites are
400 * enabled as well):
401 * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
402 */
Manuel Pégourié-Gonnardcf828932015-10-20 14:57:00 +0200403//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200404
405/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000406 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100407 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000408 * Enable the PSK based ciphersuite modes in SSL / TLS.
Manuel Pégourié-Gonnarddc16aa72014-06-25 12:55:12 +0200409 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000410 * This enables the following ciphersuites (if other requisites are
411 * enabled as well):
412 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
413 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
414 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
415 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
416 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
417 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
418 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
419 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
420 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
421 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100422 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000423#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
424
425/**
426 * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
427 *
428 * Enable the RSA-only based ciphersuite modes in SSL / TLS.
429 *
430 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
431 * MBEDTLS_X509_CRT_PARSE_C
432 *
433 * This enables the following ciphersuites (if other requisites are
434 * enabled as well):
435 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
436 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
437 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
438 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
439 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
440 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
441 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
442 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
443 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
444 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
445 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
446 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
447 */
448#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100449
450/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200451 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
Paul Bakker40865c82013-01-31 17:13:13 +0100452 *
453 * Enable sending of alert messages in case of encountered errors as per RFC.
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200454 * If you choose not to send the alert messages, Mbed TLS can still communicate
Paul Bakker40865c82013-01-31 17:13:13 +0100455 * with other servers, only debugging of failures is harder.
456 *
457 * The advantage of not sending alert messages, is that no information is given
458 * about reasons for failures thus preventing adversaries of gaining intel.
459 *
460 * Enable sending of all alert messages
461 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200462#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
Paul Bakker40865c82013-01-31 17:13:13 +0100463
464/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000465 * \def MBEDTLS_SSL_ALPN
Gilles Peskined3d02902020-03-04 21:35:27 +0100466 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000467 * Enable support for RFC 7301 Application Layer Protocol Negotiation.
Gilles Peskined3d02902020-03-04 21:35:27 +0100468 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000469 * Comment this macro to disable support for ALPN.
Gilles Peskined3d02902020-03-04 21:35:27 +0100470 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000471#define MBEDTLS_SSL_ALPN
Gilles Peskined3d02902020-03-04 21:35:27 +0100472
473/**
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200474 * \def MBEDTLS_SSL_ASYNC_PRIVATE
475 *
476 * Enable asynchronous external private key operations in SSL. This allows
477 * you to configure an SSL connection to call an external cryptographic
478 * module to perform private key operations instead of performing the
479 * operation inside the library.
480 *
Valerio Setti8841d6b2023-01-05 08:40:24 +0100481 * Requires: MBEDTLS_X509_CRT_PARSE_C
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200482 */
Jaeden Amerod9c71da2018-06-15 20:31:26 +0100483//#define MBEDTLS_SSL_ASYNC_PRIVATE
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200484
485/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000486 * \def MBEDTLS_SSL_CACHE_C
487 *
488 * Enable simple SSL cache implementation.
489 *
490 * Module: library/ssl_cache.c
491 * Caller:
492 *
493 * Requires: MBEDTLS_SSL_CACHE_C
494 */
495#define MBEDTLS_SSL_CACHE_C
496
497/**
498 * \def MBEDTLS_SSL_CLI_C
499 *
500 * Enable the SSL/TLS client code.
501 *
502 * Module: library/ssl*_client.c
503 * Caller:
504 *
505 * Requires: MBEDTLS_SSL_TLS_C
506 *
507 * \warning You must call psa_crypto_init() before doing any TLS operations.
508 *
509 * This module is required for SSL/TLS client support.
510 */
511#define MBEDTLS_SSL_CLI_C
512
513/**
Gilles Peskined3d02902020-03-04 21:35:27 +0100514 * \def MBEDTLS_SSL_CONTEXT_SERIALIZATION
515 *
516 * Enable serialization of the TLS context structures, through use of the
517 * functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load().
518 *
519 * This pair of functions allows one side of a connection to serialize the
520 * context associated with the connection, then free or re-use that context
521 * while the serialized state is persisted elsewhere, and finally deserialize
522 * that state to a live context for resuming read/write operations on the
523 * connection. From a protocol perspective, the state of the connection is
524 * unaffected, in particular this is entirely transparent to the peer.
525 *
526 * Note: this is distinct from TLS session resumption, which is part of the
527 * protocol and fully visible by the peer. TLS session resumption enables
528 * establishing new connections associated to a saved session with shorter,
529 * lighter handshakes, while context serialization is a local optimization in
530 * handling a single, potentially long-lived connection.
531 *
532 * Enabling these APIs makes some SSL structures larger, as 64 extra bytes are
533 * saved after the handshake to allow for more efficient serialization, so if
534 * you don't need this feature you'll save RAM by disabling it.
535 *
Przemek Stekiel460192e2022-10-03 08:55:29 +0200536 * Requires: MBEDTLS_GCM_C or MBEDTLS_CCM_C or MBEDTLS_CHACHAPOLY_C
537 *
Gilles Peskined3d02902020-03-04 21:35:27 +0100538 * Comment to disable the context serialization APIs.
539 */
540#define MBEDTLS_SSL_CONTEXT_SERIALIZATION
541
542/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000543 * \def MBEDTLS_SSL_COOKIE_C
544 *
545 * Enable basic implementation of DTLS cookies for hello verification.
546 *
547 * Module: library/ssl_cookie.c
548 * Caller:
549 */
550#define MBEDTLS_SSL_COOKIE_C
551
552/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200553 * \def MBEDTLS_SSL_DEBUG_ALL
Paul Bakkerd66f0702013-01-31 16:57:45 +0100554 *
555 * Enable the debug messages in SSL module for all issues.
556 * Debug messages have been disabled in some places to prevent timing
557 * attacks due to (unbalanced) debugging function calls.
558 *
559 * If you need all error reporting you should enable this during debugging,
560 * but remove this for production servers that should log as well.
561 *
562 * Uncomment this macro to report all debug messages on errors introducing
563 * a timing side-channel.
564 *
Paul Bakkerd66f0702013-01-31 16:57:45 +0100565 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200566//#define MBEDTLS_SSL_DEBUG_ALL
Paul Bakkerd66f0702013-01-31 16:57:45 +0100567
Minos Galanakis80e76b62024-12-12 15:46:29 +0000568/**
569 * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY
570 *
571 * Enable support for the anti-replay mechanism in DTLS.
572 *
573 * Requires: MBEDTLS_SSL_TLS_C
574 * MBEDTLS_SSL_PROTO_DTLS
575 *
576 * \warning Disabling this is often a security risk!
577 * See mbedtls_ssl_conf_dtls_anti_replay() for details.
578 *
579 * Comment this to disable anti-replay in DTLS.
580 */
581#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
582
583/**
584 * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
585 *
586 * Enable server-side support for clients that reconnect from the same port.
587 *
588 * Some clients unexpectedly close the connection and try to reconnect using the
589 * same source port. This needs special support from the server to handle the
590 * new connection securely, as described in section 4.2.8 of RFC 6347. This
591 * flag enables that support.
592 *
593 * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY
594 *
595 * Comment this to disable support for clients reusing the source port.
596 */
597#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
598
599/**
600 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID
601 *
602 * Enable support for the DTLS Connection ID (CID) extension,
603 * which allows to identify DTLS connections across changes
604 * in the underlying transport. The CID functionality is described
605 * in RFC 9146.
606 *
607 * Setting this option enables the SSL APIs `mbedtls_ssl_set_cid()`,
608 * mbedtls_ssl_get_own_cid()`, `mbedtls_ssl_get_peer_cid()` and
609 * `mbedtls_ssl_conf_cid()`. See the corresponding documentation for
610 * more information.
611 *
612 * The maximum lengths of outgoing and incoming CIDs can be configured
613 * through the options
614 * - MBEDTLS_SSL_CID_OUT_LEN_MAX
615 * - MBEDTLS_SSL_CID_IN_LEN_MAX.
616 *
617 * Requires: MBEDTLS_SSL_PROTO_DTLS
618 *
619 * Uncomment to enable the Connection ID extension.
620 */
621#define MBEDTLS_SSL_DTLS_CONNECTION_ID
622
623/**
624 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT
625 *
626 * Defines whether RFC 9146 (default) or the legacy version
627 * (version draft-ietf-tls-dtls-connection-id-05,
628 * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05)
629 * is used.
630 *
631 * Set the value to 0 for the standard version, and
632 * 1 for the legacy draft version.
633 *
634 * \deprecated Support for the legacy version of the DTLS
635 * Connection ID feature is deprecated. Please
636 * switch to the standardized version defined
637 * in RFC 9146 enabled by utilizing
638 * MBEDTLS_SSL_DTLS_CONNECTION_ID without use
639 * of MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT.
640 *
641 * Requires: MBEDTLS_SSL_DTLS_CONNECTION_ID
642 */
643#define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 0
644
645/**
646 * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY
647 *
648 * Enable support for HelloVerifyRequest on DTLS servers.
649 *
650 * This feature is highly recommended to prevent DTLS servers being used as
651 * amplifiers in DoS attacks against other hosts. It should always be enabled
652 * unless you know for sure amplification cannot be a problem in the
653 * environment in which your server operates.
654 *
655 * \warning Disabling this can be a security risk! (see above)
656 *
657 * Requires: MBEDTLS_SSL_PROTO_DTLS
658 *
659 * Comment this to disable support for HelloVerifyRequest.
660 */
661#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
662
663/**
664 * \def MBEDTLS_SSL_DTLS_SRTP
665 *
666 * Enable support for negotiation of DTLS-SRTP (RFC 5764)
667 * through the use_srtp extension.
668 *
669 * \note This feature provides the minimum functionality required
670 * to negotiate the use of DTLS-SRTP and to allow the derivation of
671 * the associated SRTP packet protection key material.
672 * In particular, the SRTP packet protection itself, as well as the
673 * demultiplexing of RTP and DTLS packets at the datagram layer
674 * (see Section 5 of RFC 5764), are not handled by this feature.
675 * Instead, after successful completion of a handshake negotiating
676 * the use of DTLS-SRTP, the extended key exporter API
677 * mbedtls_ssl_conf_export_keys_cb() should be used to implement
678 * the key exporter described in Section 4.2 of RFC 5764 and RFC 5705
679 * (this is implemented in the SSL example programs).
680 * The resulting key should then be passed to an SRTP stack.
681 *
682 * Setting this option enables the runtime API
683 * mbedtls_ssl_conf_dtls_srtp_protection_profiles()
684 * through which the supported DTLS-SRTP protection
685 * profiles can be configured. You must call this API at
686 * runtime if you wish to negotiate the use of DTLS-SRTP.
687 *
688 * Requires: MBEDTLS_SSL_PROTO_DTLS
689 *
690 * Uncomment this to enable support for use_srtp extension.
691 */
692//#define MBEDTLS_SSL_DTLS_SRTP
693
694/**
695 * \def MBEDTLS_SSL_EARLY_DATA
696 *
697 * Enable support for RFC 8446 TLS 1.3 early data.
698 *
699 * Requires: MBEDTLS_SSL_SESSION_TICKETS and either
700 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED or
701 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
702 *
703 * Comment this to disable support for early data. If MBEDTLS_SSL_PROTO_TLS1_3
704 * is not enabled, this option does not have any effect on the build.
705 *
706 * \note The maximum amount of early data can be set with
707 * MBEDTLS_SSL_MAX_EARLY_DATA_SIZE.
708 *
709 */
710//#define MBEDTLS_SSL_EARLY_DATA
711
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200712/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100713 *
714 * Enable support for Encrypt-then-MAC, RFC 7366.
715 *
716 * This allows peers that both support it to use a more robust protection for
717 * ciphersuites using CBC, providing deep resistance against timing attacks
718 * on the padding or underlying cipher.
719 *
720 * This only affects CBC ciphersuites, and is useless if none is defined.
721 *
TRodziewicz0f82ec62021-05-12 17:49:18 +0200722 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100723 *
724 * Comment this macro to disable support for Encrypt-then-MAC
725 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200726#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100727
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200728/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200729 *
Manuel Pégourié-Gonnardbca8aa02020-03-24 12:11:49 +0100730 * Enable support for RFC 7627: Session Hash and Extended Master Secret
731 * Extension.
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200732 *
Shaun Case8b0ecbc2021-12-20 21:14:10 -0800733 * This was introduced as "the proper fix" to the Triple Handshake family of
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200734 * attacks, but it is recommended to always use it (even if you disable
735 * renegotiation), since it actually fixes a more fundamental issue in the
736 * original SSL/TLS design, and has implications beyond Triple Handshake.
737 *
TRodziewicz0f82ec62021-05-12 17:49:18 +0200738 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard769c6b62014-10-28 14:13:55 +0100739 *
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200740 * Comment this macro to disable support for Extended Master Secret.
741 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200742#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200743
Paul Bakkerd66f0702013-01-31 16:57:45 +0100744/**
Hanno Beckerbb278f52019-02-05 17:04:00 +0000745 * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
746 *
Hanno Beckerfd7f2982019-02-25 10:13:33 +0000747 * This option controls the availability of the API mbedtls_ssl_get_peer_cert()
Hanno Beckerbb278f52019-02-05 17:04:00 +0000748 * giving access to the peer's certificate after completion of the handshake.
749 *
750 * Unless you need mbedtls_ssl_peer_cert() in your application, it is
751 * recommended to disable this option for reduced RAM usage.
752 *
753 * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still
754 * defined, but always returns \c NULL.
755 *
756 * \note This option has no influence on the protection against the
757 * triple handshake attack. Even if it is disabled, Mbed TLS will
758 * still ensure that certificates do not change during renegotiation,
Shaun Case8b0ecbc2021-12-20 21:14:10 -0800759 * for example by keeping a hash of the peer's certificate.
Hanno Beckerbb278f52019-02-05 17:04:00 +0000760 *
Tom Cosgroveafb2fe12022-06-29 16:36:12 +0100761 * \note This option is required if MBEDTLS_SSL_PROTO_TLS1_3 is set.
Hanno Beckerbb278f52019-02-05 17:04:00 +0000762 *
763 * Comment this macro to disable storing the peer's certificate
764 * after the handshake.
765 */
766#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
767
768/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200769 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakker05decb22013-08-15 13:33:48 +0200770 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200771 * Enable support for RFC 6066 max_fragment_length extension in SSL.
Paul Bakker05decb22013-08-15 13:33:48 +0200772 *
773 * Comment this macro to disable support for the max_fragment_length extension
774 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200775#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakker05decb22013-08-15 13:33:48 +0200776
777/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000778 * \def MBEDTLS_SSL_PROTO_DTLS
Jan Bruckner151f6422023-02-10 12:45:19 +0100779 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000780 * Enable support for DTLS (all available versions).
Jan Bruckner151f6422023-02-10 12:45:19 +0100781 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000782 * Enable this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2.
Jan Bruckner151f6422023-02-10 12:45:19 +0100783 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000784 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
785 *
786 * Comment this macro to disable support for DTLS
Jan Bruckner151f6422023-02-10 12:45:19 +0100787 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000788#define MBEDTLS_SSL_PROTO_DTLS
Jan Bruckner151f6422023-02-10 12:45:19 +0100789
790/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200791 * \def MBEDTLS_SSL_PROTO_TLS1_2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200792 *
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100793 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200794 *
Janos Follath277bba82024-11-19 16:14:00 +0000795 * Requires: PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_384
Andrzej Kureke02da812022-08-17 17:04:49 -0400796 *
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100797 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200798 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200799#define MBEDTLS_SSL_PROTO_TLS1_2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200800
801/**
Ronald Cron6f135e12021-12-08 16:57:54 +0100802 * \def MBEDTLS_SSL_PROTO_TLS1_3
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100803 *
Ronald Cron6f135e12021-12-08 16:57:54 +0100804 * Enable support for TLS 1.3.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100805 *
Gilles Peskineda69eaa2023-09-05 20:54:17 +0200806 * \note See docs/architecture/tls13-support.md for a description of the TLS
Ronald Cron6f135e12021-12-08 16:57:54 +0100807 * 1.3 support that this option enables.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100808 *
Tom Cosgroveafb2fe12022-06-29 16:36:12 +0100809 * Requires: MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
Manuel Pégourié-Gonnard3e830982022-05-11 13:27:44 +0200810 * Requires: MBEDTLS_PSA_CRYPTO_C
Ronald Cron6f135e12021-12-08 16:57:54 +0100811 *
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100812 * Uncomment this macro to enable the support for TLS 1.3.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100813 */
Ronald Cron27eb68d2024-03-15 16:13:37 +0100814#define MBEDTLS_SSL_PROTO_TLS1_3
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100815
816/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000817 * \def MBEDTLS_SSL_RECORD_SIZE_LIMIT
818 *
819 * Enable support for RFC 8449 record_size_limit extension in SSL (TLS 1.3 only).
820 *
821 * Requires: MBEDTLS_SSL_PROTO_TLS1_3
822 *
823 * Uncomment this macro to enable support for the record_size_limit extension
824 */
825//#define MBEDTLS_SSL_RECORD_SIZE_LIMIT
826
827/**
828 * \def MBEDTLS_SSL_RENEGOTIATION
829 *
830 * Enable support for TLS renegotiation.
831 *
832 * The two main uses of renegotiation are (1) refresh keys on long-lived
833 * connections and (2) client authentication after the initial handshake.
834 * If you don't need renegotiation, it's probably better to disable it, since
835 * it has been associated with security issues in the past and is easy to
836 * misuse/misunderstand.
837 *
838 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
839 *
840 * Comment this to disable support for renegotiation.
841 *
842 * \note Even if this option is disabled, both client and server are aware
843 * of the Renegotiation Indication Extension (RFC 5746) used to
844 * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1).
845 * (See \c mbedtls_ssl_conf_legacy_renegotiation for the
846 * configuration of this extension).
847 *
848 */
849#define MBEDTLS_SSL_RENEGOTIATION
850
851/**
852 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
853 *
854 * Enable support for RFC 6066 server name indication (SNI) in SSL.
855 *
856 * Requires: MBEDTLS_X509_CRT_PARSE_C
857 *
858 * Comment this macro to disable support for server name indication in SSL
859 */
860#define MBEDTLS_SSL_SERVER_NAME_INDICATION
861
862/**
863 * \def MBEDTLS_SSL_SESSION_TICKETS
864 *
865 * Enable support for RFC 5077 session tickets in SSL.
866 * Client-side, provides full support for session tickets (maintenance of a
867 * session store remains the responsibility of the application, though).
868 * Server-side, you also need to provide callbacks for writing and parsing
869 * tickets, including authenticated encryption and key management. Example
870 * callbacks are provided by MBEDTLS_SSL_TICKET_C.
871 *
872 * Comment this macro to disable support for SSL session tickets
873 */
874#define MBEDTLS_SSL_SESSION_TICKETS
875
876/**
877 * \def MBEDTLS_SSL_SRV_C
878 *
879 * Enable the SSL/TLS server code.
880 *
881 * Module: library/ssl*_server.c
882 * Caller:
883 *
884 * Requires: MBEDTLS_SSL_TLS_C
885 *
886 * \warning You must call psa_crypto_init() before doing any TLS operations.
887 *
888 * This module is required for SSL/TLS server support.
889 */
890#define MBEDTLS_SSL_SRV_C
891
892/**
893 * \def MBEDTLS_SSL_TICKET_C
894 *
895 * Enable an implementation of TLS server-side callbacks for session tickets.
896 *
897 * Module: library/ssl_ticket.c
898 * Caller:
899 *
900 * Requires: (MBEDTLS_CIPHER_C || MBEDTLS_USE_PSA_CRYPTO) &&
901 * (MBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C)
902 */
903#define MBEDTLS_SSL_TICKET_C
904
905/**
Ronald Cronab65c522021-11-24 10:47:20 +0100906 * \def MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
907 *
908 * Enable TLS 1.3 middlebox compatibility mode.
909 *
910 * As specified in Section D.4 of RFC 8446, TLS 1.3 offers a compatibility
911 * mode to make a TLS 1.3 connection more likely to pass through middle boxes
912 * expecting TLS 1.2 traffic.
913 *
914 * Turning on the compatibility mode comes at the cost of a few added bytes
915 * on the wire, but it doesn't affect compatibility with TLS 1.3 implementations
916 * that don't use it. Therefore, unless transmission bandwidth is critical and
917 * you know that middlebox compatibility issues won't occur, it is therefore
918 * recommended to set this option.
919 *
920 * Comment to disable compatibility mode for TLS 1.3. If
Ronald Cron6f135e12021-12-08 16:57:54 +0100921 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
922 * effect on the build.
Ronald Cronab65c522021-11-24 10:47:20 +0100923 *
924 */
Ronald Cron27eb68d2024-03-15 16:13:37 +0100925#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
Ronald Cronab65c522021-11-24 10:47:20 +0100926
927/**
Ronald Crond8d2ea52022-10-04 15:48:06 +0200928 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
929 *
930 * Enable TLS 1.3 ephemeral key exchange mode.
931 *
Przemek Stekielce05f542023-06-15 16:44:08 +0200932 * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200933 * MBEDTLS_X509_CRT_PARSE_C
934 * and at least one of:
Janos Follath277bba82024-11-19 16:14:00 +0000935 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200936 * MBEDTLS_PKCS1_V21
Ronald Crond8d2ea52022-10-04 15:48:06 +0200937 *
938 * Comment to disable support for the ephemeral key exchange mode in TLS 1.3.
939 * If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
940 * effect on the build.
941 *
942 */
943#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
944
945/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000946 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
947 *
948 * Enable TLS 1.3 PSK key exchange mode.
949 *
950 * Comment to disable support for the PSK key exchange mode in TLS 1.3. If
951 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
952 * effect on the build.
953 *
954 */
955#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
956
957/**
Ronald Crond8d2ea52022-10-04 15:48:06 +0200958 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
959 *
960 * Enable TLS 1.3 PSK ephemeral key exchange mode.
961 *
Przemek Stekielce05f542023-06-15 16:44:08 +0200962 * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH
Ronald Crond8d2ea52022-10-04 15:48:06 +0200963 *
964 * Comment to disable support for the PSK ephemeral key exchange mode in
965 * TLS 1.3. If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not
966 * have any effect on the build.
967 *
968 */
969#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
970
971/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200972 * \def MBEDTLS_SSL_TLS_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000973 *
Paul Bakkere29ab062011-05-18 13:26:54 +0000974 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000975 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000976 * Module: library/ssl_tls.c
Ronald Cronde1adee2022-03-07 16:20:30 +0100977 * Caller: library/ssl*_client.c
978 * library/ssl*_server.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000979 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200980 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
981 * and at least one of the MBEDTLS_SSL_PROTO_XXX defines
Paul Bakker5690efc2011-05-26 13:16:06 +0000982 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000983 * This module is required for SSL/TLS.
984 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200985#define MBEDTLS_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000986
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000987/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000988 * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000989 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000990 * When this option is enabled, the SSL buffer will be resized automatically
991 * based on the negotiated maximum fragment length in each direction.
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +0100992 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000993 * Requires: MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakkerecd54fb2013-07-03 14:48:29 +0200994 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000995//#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
Paul Bakker5121ce52009-01-03 21:22:43 +0000996
Minos Galanakis80e76b62024-12-12 15:46:29 +0000997//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 or 384 bits) */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200998//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000999//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
Angus Grattond8213d02016-05-25 20:56:48 +10001000
Gilles Peskined3d02902020-03-04 21:35:27 +01001001/** \def MBEDTLS_SSL_CID_IN_LEN_MAX
1002 *
1003 * The maximum length of CIDs used for incoming DTLS messages.
1004 *
1005 */
1006//#define MBEDTLS_SSL_CID_IN_LEN_MAX 32
1007
1008/** \def MBEDTLS_SSL_CID_OUT_LEN_MAX
1009 *
1010 * The maximum length of CIDs used for outgoing DTLS messages.
1011 *
1012 */
1013//#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32
1014
TRodziewicze8dd7092021-05-12 14:19:11 +02001015/** \def MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY
Gilles Peskined3d02902020-03-04 21:35:27 +01001016 *
1017 * This option controls the use of record plaintext padding
TRodziewicz1e660ed2021-05-26 17:08:54 +02001018 * in TLS 1.3 and when using the Connection ID extension in DTLS 1.2.
Hanno Becker13996922020-05-28 16:15:19 +01001019 *
1020 * The padding will always be chosen so that the length of the
1021 * padded plaintext is a multiple of the value of this option.
1022 *
1023 * Note: A value of \c 1 means that no padding will be used
1024 * for outgoing records.
1025 *
1026 * Note: On systems lacking division instructions,
1027 * a power of two should be preferred.
1028 */
TRodziewicze8dd7092021-05-12 14:19:11 +02001029//#define MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY 16
Hanno Becker13996922020-05-28 16:15:19 +01001030
Minos Galanakis80e76b62024-12-12 15:46:29 +00001031/**
1032 * Complete list of ciphersuites to use, in order of preference.
1033 *
1034 * \warning No dependency checking is done on that field! This option can only
1035 * be used to restrict the set of available ciphersuites. It is your
1036 * responsibility to make sure the needed modules are active.
1037 *
1038 * Use this to save a few hundred bytes of ROM (default ordering of all
1039 * available ciphersuites) and a few to a few hundred bytes of RAM.
1040 *
1041 * The value below is only an example, not the default.
1042 */
1043//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
1044
1045//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
1046
1047/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING
1048 *
1049 * Maximum number of heap-allocated bytes for the purpose of
1050 * DTLS handshake message reassembly and future message buffering.
1051 *
1052 * This should be at least 9/8 * MBEDTLS_SSL_IN_CONTENT_LEN
1053 * to account for a reassembled handshake message of maximum size,
1054 * together with its reassembly bitmap.
1055 *
1056 * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default)
1057 * should be sufficient for all practical situations as it allows
1058 * to reassembly a large handshake message (such as a certificate)
1059 * while buffering multiple smaller handshake messages.
1060 *
1061 */
1062//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768
1063
1064/** \def MBEDTLS_SSL_IN_CONTENT_LEN
1065 *
1066 * Maximum length (in bytes) of incoming plaintext fragments.
1067 *
1068 * This determines the size of the incoming TLS I/O buffer in such a way
1069 * that it is capable of holding the specified amount of plaintext data,
1070 * regardless of the protection mechanism used.
1071 *
1072 * \note When using a value less than the default of 16KB on the client, it is
1073 * recommended to use the Maximum Fragment Length (MFL) extension to
1074 * inform the server about this limitation. On the server, there
1075 * is no supported, standardized way of informing the client about
1076 * restriction on the maximum size of incoming messages, and unless
1077 * the limitation has been communicated by other means, it is recommended
1078 * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN
1079 * while keeping the default value of 16KB for the incoming buffer.
1080 *
1081 * Uncomment to set the maximum plaintext size of the incoming I/O buffer.
1082 */
1083//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384
1084
1085/**
1086 * \def MBEDTLS_SSL_MAX_EARLY_DATA_SIZE
1087 *
1088 * The default maximum amount of 0-RTT data. See the documentation of
1089 * \c mbedtls_ssl_conf_max_early_data_size() for more information.
1090 *
1091 * It must be positive and smaller than UINT32_MAX.
1092 *
1093 * If MBEDTLS_SSL_EARLY_DATA is not defined, this default value does not
1094 * have any impact on the build.
1095 */
1096//#define MBEDTLS_SSL_MAX_EARLY_DATA_SIZE 1024
1097
Angus Grattond8213d02016-05-25 20:56:48 +10001098/** \def MBEDTLS_SSL_OUT_CONTENT_LEN
1099 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001100 * Maximum length (in bytes) of outgoing plaintext fragments.
Angus Grattond8213d02016-05-25 20:56:48 +10001101 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001102 * This determines the size of the outgoing TLS I/O buffer in such a way
1103 * that it is capable of holding the specified amount of plaintext data,
1104 * regardless of the protection mechanism used.
1105 *
Angus Grattond8213d02016-05-25 20:56:48 +10001106 * It is possible to save RAM by setting a smaller outward buffer, while keeping
1107 * the default inward 16384 byte buffer to conform to the TLS specification.
1108 *
1109 * The minimum required outward buffer size is determined by the handshake
1110 * protocol's usage. Handshaking will fail if the outward buffer is too small.
1111 * The specific size requirement depends on the configured ciphers and any
1112 * certificate data which is sent during the handshake.
1113 *
David Horstmann95d516f2021-05-04 18:36:56 +01001114 * Uncomment to set the maximum plaintext size of the outgoing I/O buffer.
Angus Grattond8213d02016-05-25 20:56:48 +10001115 */
1116//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384
1117
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001118/**
Minos Galanakis80e76b62024-12-12 15:46:29 +00001119 * \def MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001120 *
Minos Galanakis80e76b62024-12-12 15:46:29 +00001121 * Default number of NewSessionTicket messages to be sent by a TLS 1.3 server
1122 * after handshake completion. This is not used in TLS 1.2 and relevant only if
1123 * the MBEDTLS_SSL_SESSION_TICKETS option is enabled.
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001124 *
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001125 */
Minos Galanakis80e76b62024-12-12 15:46:29 +00001126//#define MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS 1
Tom Cosgrovea63775b2023-09-14 13:31:19 +01001127
1128/**
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001129 * \def MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE
1130 *
Jerry Yucf913512023-11-14 11:06:52 +08001131 * Maximum allowed ticket age difference in milliseconds tolerated between
Jerry Yu034a8b72023-11-10 12:20:19 +08001132 * server and client. Default value is 6000. This is not used in TLS 1.2.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001133 *
Jerry Yu034a8b72023-11-10 12:20:19 +08001134 * - The client ticket age is the time difference between the time when the
1135 * client proposes to the server to use the ticket and the time the client
1136 * received the ticket from the server.
1137 * - The server ticket age is the time difference between the time when the
1138 * server receives a proposition from the client to use the ticket and the
1139 * time when the ticket was created by the server.
1140 *
Jerry Yucf913512023-11-14 11:06:52 +08001141 * The ages might be different due to the client and server clocks not running
1142 * at the same pace. The typical accuracy of an RTC crystal is ±100 to ±20 parts
1143 * per million (360 to 72 milliseconds per hour). Default tolerance window is
1144 * 6s, thus in the worst case clients and servers must sync up their system time
1145 * every 6000/360/2~=8 hours.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001146 *
Jerry Yu04fceb72023-11-15 09:52:46 +08001147 * See section 8.3 of the TLS 1.3 specification(RFC 8446) for more information.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001148 */
Gilles Peskined65ea422023-09-05 21:07:32 +02001149//#define MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE 6000
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001150
Minos Galanakis1bf85a82024-12-12 16:29:38 +00001151/**
1152 * \def MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH
1153 *
1154 * Size in bytes of a ticket nonce. This is not used in TLS 1.2.
1155 *
1156 * This must be less than 256.
1157 */
1158//#define MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH 32
1159
Minos Galanakis80e76b62024-12-12 15:46:29 +00001160/** \} name SECTION: TLS feature selection */
1161
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001162/**
Minos Galanakis80e76b62024-12-12 15:46:29 +00001163 * \name SECTION: X.509 feature selection
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001164 *
Minos Galanakis80e76b62024-12-12 15:46:29 +00001165 * This section sets Certificate related options.
1166 * \{
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001167 */
Minos Galanakis80e76b62024-12-12 15:46:29 +00001168
1169/**
1170 * \def MBEDTLS_PKCS7_C
1171 *
1172 * Enable PKCS #7 core for using PKCS #7-formatted signatures.
1173 * RFC Link - https://tools.ietf.org/html/rfc2315
1174 *
1175 * Module: library/pkcs7.c
1176 *
1177 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C,
1178 * MBEDTLS_X509_CRT_PARSE_C MBEDTLS_X509_CRL_PARSE_C,
1179 * MBEDTLS_BIGNUM_C, MBEDTLS_MD_C
1180 *
1181 * This module is required for the PKCS #7 parsing modules.
1182 */
1183#define MBEDTLS_PKCS7_C
1184
1185/**
1186 * \def MBEDTLS_X509_CREATE_C
1187 *
1188 * Enable X.509 core for creating certificates.
1189 *
1190 * Module: library/x509_create.c
1191 *
1192 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C,
1193 *
1194 * \warning You must call psa_crypto_init() before doing any X.509 operation.
1195 *
1196 * This module is the basis for creating X.509 certificates and CSRs.
1197 */
1198#define MBEDTLS_X509_CREATE_C
1199
1200/**
1201 * \def MBEDTLS_X509_CRL_PARSE_C
1202 *
1203 * Enable X.509 CRL parsing.
1204 *
1205 * Module: library/x509_crl.c
1206 * Caller: library/x509_crt.c
1207 *
1208 * Requires: MBEDTLS_X509_USE_C
1209 *
1210 * This module is required for X.509 CRL parsing.
1211 */
1212#define MBEDTLS_X509_CRL_PARSE_C
1213
1214/**
1215 * \def MBEDTLS_X509_CRT_PARSE_C
1216 *
1217 * Enable X.509 certificate parsing.
1218 *
1219 * Module: library/x509_crt.c
1220 * Caller: library/ssl_tls.c
1221 * library/ssl*_client.c
1222 * library/ssl*_server.c
1223 *
1224 * Requires: MBEDTLS_X509_USE_C
1225 *
1226 * This module is required for X.509 certificate parsing.
1227 */
1228#define MBEDTLS_X509_CRT_PARSE_C
1229
1230/**
1231 * \def MBEDTLS_X509_CRT_WRITE_C
1232 *
1233 * Enable creating X.509 certificates.
1234 *
1235 * Module: library/x509_crt_write.c
1236 *
1237 * Requires: MBEDTLS_X509_CREATE_C
1238 *
1239 * This module is required for X.509 certificate creation.
1240 */
1241#define MBEDTLS_X509_CRT_WRITE_C
1242
1243/**
1244 * \def MBEDTLS_X509_CSR_PARSE_C
1245 *
1246 * Enable X.509 Certificate Signing Request (CSR) parsing.
1247 *
1248 * Module: library/x509_csr.c
1249 * Caller: library/x509_crt_write.c
1250 *
1251 * Requires: MBEDTLS_X509_USE_C
1252 *
1253 * This module is used for reading X.509 certificate request.
1254 */
1255#define MBEDTLS_X509_CSR_PARSE_C
1256
1257/**
1258 * \def MBEDTLS_X509_CSR_WRITE_C
1259 *
1260 * Enable creating X.509 Certificate Signing Requests (CSR).
1261 *
1262 * Module: library/x509_csr_write.c
1263 *
1264 * Requires: MBEDTLS_X509_CREATE_C
1265 *
1266 * This module is required for X.509 certificate request writing.
1267 */
1268#define MBEDTLS_X509_CSR_WRITE_C
1269
1270/**
1271 * \def MBEDTLS_X509_REMOVE_INFO
1272 *
1273 * Disable mbedtls_x509_*_info() and related APIs.
1274 *
1275 * Uncomment to omit mbedtls_x509_*_info(), as well as mbedtls_debug_print_crt()
1276 * and other functions/constants only used by these functions, thus reducing
1277 * the code footprint by several KB.
1278 */
1279//#define MBEDTLS_X509_REMOVE_INFO
1280
1281/**
1282 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
1283 *
1284 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
1285 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
1286 *
1287 * Requires: MBEDTLS_PKCS1_V21
1288 *
1289 * Comment this macro to disallow using RSASSA-PSS in certificates.
1290 */
1291#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
1292
1293/**
1294 * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1295 *
1296 * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()`
1297 * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure
1298 * the set of trusted certificates through a callback instead of a linked
1299 * list.
1300 *
1301 * This is useful for example in environments where a large number of trusted
1302 * certificates is present and storing them in a linked list isn't efficient
1303 * enough, or when the set of trusted certificates changes frequently.
1304 *
1305 * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and
1306 * `mbedtls_ssl_conf_ca_cb()` for more information.
1307 *
1308 * Requires: MBEDTLS_X509_CRT_PARSE_C
1309 *
1310 * Uncomment to enable trusted certificate callbacks.
1311 */
1312//#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1313
1314/**
1315 * \def MBEDTLS_X509_USE_C
1316 *
1317 * Enable X.509 core for using certificates.
1318 *
1319 * Module: library/x509.c
1320 * Caller: library/x509_crl.c
1321 * library/x509_crt.c
1322 * library/x509_csr.c
1323 *
1324 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C
1325 *
1326 * \warning You must call psa_crypto_init() before doing any X.509 operation.
1327 *
1328 * This module is required for the X.509 parsing modules.
1329 */
1330#define MBEDTLS_X509_USE_C
1331
1332//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
1333//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
1334
1335/** \} name SECTION: X.509 feature selection */