blob: 0c4702513cdd5a396ccc7170f7d059de28aecdaf [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 *
92 * This section sets configuration options
93 * that do not belong in any of the other categories.
94 * \{
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 *
189 * This section sets TLS options.
190 * \{
191 */
192
193/**
194 * \def MBEDTLS_DEBUG_C
195 *
196 * Enable the debug functions.
197 *
198 * Module: library/debug.c
199 * Caller: library/ssl_msg.c
200 * library/ssl_tls.c
201 * library/ssl_tls12_*.c
202 * library/ssl_tls13_*.c
203 *
204 * This module provides debugging functions.
205 */
206#define MBEDTLS_DEBUG_C
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200207
208/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200209 * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200210 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200211 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200212 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200213 * Requires: MBEDTLS_DHM_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200214 *
215 * This enables the following ciphersuites (if other requisites are
216 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200217 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
218 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
219 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
220 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
221 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
222 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
223 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
224 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
225 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
226 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
Hanno Beckera2f6b722017-09-28 10:33:29 +0100227 *
Hanno Beckerf9734b32017-10-03 12:09:22 +0100228 * \warning Using DHE constitutes a security risk as it
229 * is not possible to validate custom DH parameters.
230 * If possible, it is recommended users should consider
231 * preferring other methods of key exchange.
232 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +0100233 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200234 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200235#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200236
Paul Bakkere07f41d2013-04-19 09:08:57 +0200237
238/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200239 * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200240 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200241 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200242 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200243 * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
244 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200245 *
246 * This enables the following ciphersuites (if other requisites are
247 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200248 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
249 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
250 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
251 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
252 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
253 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
254 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
255 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
256 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
257 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
258 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
259 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
Hanno Beckera2f6b722017-09-28 10:33:29 +0100260 *
Hanno Beckerf9734b32017-10-03 12:09:22 +0100261 * \warning Using DHE constitutes a security risk as it
262 * is not possible to validate custom DH parameters.
263 * If possible, it is recommended users should consider
264 * preferring other methods of key exchange.
265 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +0100266 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200267 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200268#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200269
270/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000271 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
272 *
273 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
274 *
275 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
276 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
277 * MBEDTLS_X509_CRT_PARSE_C
278 *
279 * This enables the following ciphersuites (if other requisites are
280 * enabled as well):
281 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
282 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
283 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
284 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
285 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
286 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
287 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
288 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
289 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
290 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
291 */
292#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
293
294/**
295 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
296 *
297 * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
298 *
299 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
300 *
301 * This enables the following ciphersuites (if other requisites are
302 * enabled as well):
303 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
304 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
305 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
306 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
307 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
308 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
309 */
310#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
311
312/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200313 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200314 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200315 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200316 *
Janos Follath277bba82024-11-19 16:14:00 +0000317 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200318 * MBEDTLS_RSA_C
319 * MBEDTLS_PKCS1_V15
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200320 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200321 *
322 * This enables the following ciphersuites (if other requisites are
323 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200324 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
325 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
326 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
327 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
328 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
329 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
330 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
331 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
332 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
333 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakkere07f41d2013-04-19 09:08:57 +0200334 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200335#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200336
337/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200338 * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100339 *
340 * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
341 *
Janos Follath277bba82024-11-19 16:14:00 +0000342 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
343 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200344 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100345 *
346 * This enables the following ciphersuites (if other requisites are
347 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200348 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
349 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
350 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
351 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
352 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
353 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
354 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
355 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
356 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
357 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100358 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200359#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100360
361/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200362 * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100363 *
364 * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS.
365 *
Janos Follath277bba82024-11-19 16:14:00 +0000366 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200367 * MBEDTLS_RSA_C
368 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100369 *
370 * This enables the following ciphersuites (if other requisites are
371 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200372 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
373 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
374 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
375 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
376 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
377 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
378 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
379 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
380 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
381 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100382 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200383#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100384
385/**
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200386 * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
387 *
388 * Enable the ECJPAKE based ciphersuite modes in SSL / TLS.
389 *
Manuel Pégourié-Gonnard75df9022015-09-16 23:21:01 +0200390 * \warning This is currently experimental. EC J-PAKE support is based on the
391 * Thread v1.0.0 specification; incompatible changes to the specification
392 * might still happen. For this reason, this is disabled by default.
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200393 *
Janos Follath277bba82024-11-19 16:14:00 +0000394 * Requires: MBEDTLS_ECJPAKE_C or PSA_WANT_ALG_JPAKE
Manuel Pégourié-Gonnard41bc8b62023-03-14 23:59:24 +0100395 * SHA-256 (via MBEDTLS_SHA256_C or a PSA driver)
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200396 * MBEDTLS_ECP_DP_SECP256R1_ENABLED
397 *
398 * This enables the following ciphersuites (if other requisites are
399 * enabled as well):
400 * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
401 */
Manuel Pégourié-Gonnardcf828932015-10-20 14:57:00 +0200402//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200403
404/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000405 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100406 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000407 * Enable the PSK based ciphersuite modes in SSL / TLS.
Manuel Pégourié-Gonnarddc16aa72014-06-25 12:55:12 +0200408 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000409 * This enables the following ciphersuites (if other requisites are
410 * enabled as well):
411 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
412 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
413 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
414 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
415 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
416 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
417 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
418 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
419 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
420 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100421 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000422#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
423
424/**
425 * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
426 *
427 * Enable the RSA-only based ciphersuite modes in SSL / TLS.
428 *
429 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
430 * MBEDTLS_X509_CRT_PARSE_C
431 *
432 * This enables the following ciphersuites (if other requisites are
433 * enabled as well):
434 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
435 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
436 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
437 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
438 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
439 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
440 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
441 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
442 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
443 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
444 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
445 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
446 */
447#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100448
449/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200450 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
Paul Bakker40865c82013-01-31 17:13:13 +0100451 *
452 * Enable sending of alert messages in case of encountered errors as per RFC.
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200453 * If you choose not to send the alert messages, Mbed TLS can still communicate
Paul Bakker40865c82013-01-31 17:13:13 +0100454 * with other servers, only debugging of failures is harder.
455 *
456 * The advantage of not sending alert messages, is that no information is given
457 * about reasons for failures thus preventing adversaries of gaining intel.
458 *
459 * Enable sending of all alert messages
460 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200461#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
Paul Bakker40865c82013-01-31 17:13:13 +0100462
463/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000464 * \def MBEDTLS_SSL_ALPN
Gilles Peskined3d02902020-03-04 21:35:27 +0100465 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000466 * Enable support for RFC 7301 Application Layer Protocol Negotiation.
Gilles Peskined3d02902020-03-04 21:35:27 +0100467 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000468 * Comment this macro to disable support for ALPN.
Gilles Peskined3d02902020-03-04 21:35:27 +0100469 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000470#define MBEDTLS_SSL_ALPN
Gilles Peskined3d02902020-03-04 21:35:27 +0100471
472/**
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200473 * \def MBEDTLS_SSL_ASYNC_PRIVATE
474 *
475 * Enable asynchronous external private key operations in SSL. This allows
476 * you to configure an SSL connection to call an external cryptographic
477 * module to perform private key operations instead of performing the
478 * operation inside the library.
479 *
Valerio Setti8841d6b2023-01-05 08:40:24 +0100480 * Requires: MBEDTLS_X509_CRT_PARSE_C
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200481 */
Jaeden Amerod9c71da2018-06-15 20:31:26 +0100482//#define MBEDTLS_SSL_ASYNC_PRIVATE
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200483
484/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000485 * \def MBEDTLS_SSL_CACHE_C
486 *
487 * Enable simple SSL cache implementation.
488 *
489 * Module: library/ssl_cache.c
490 * Caller:
491 *
492 * Requires: MBEDTLS_SSL_CACHE_C
493 */
494#define MBEDTLS_SSL_CACHE_C
495
496/**
497 * \def MBEDTLS_SSL_CLI_C
498 *
499 * Enable the SSL/TLS client code.
500 *
501 * Module: library/ssl*_client.c
502 * Caller:
503 *
504 * Requires: MBEDTLS_SSL_TLS_C
505 *
506 * \warning You must call psa_crypto_init() before doing any TLS operations.
507 *
508 * This module is required for SSL/TLS client support.
509 */
510#define MBEDTLS_SSL_CLI_C
511
512/**
Gilles Peskined3d02902020-03-04 21:35:27 +0100513 * \def MBEDTLS_SSL_CONTEXT_SERIALIZATION
514 *
515 * Enable serialization of the TLS context structures, through use of the
516 * functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load().
517 *
518 * This pair of functions allows one side of a connection to serialize the
519 * context associated with the connection, then free or re-use that context
520 * while the serialized state is persisted elsewhere, and finally deserialize
521 * that state to a live context for resuming read/write operations on the
522 * connection. From a protocol perspective, the state of the connection is
523 * unaffected, in particular this is entirely transparent to the peer.
524 *
525 * Note: this is distinct from TLS session resumption, which is part of the
526 * protocol and fully visible by the peer. TLS session resumption enables
527 * establishing new connections associated to a saved session with shorter,
528 * lighter handshakes, while context serialization is a local optimization in
529 * handling a single, potentially long-lived connection.
530 *
531 * Enabling these APIs makes some SSL structures larger, as 64 extra bytes are
532 * saved after the handshake to allow for more efficient serialization, so if
533 * you don't need this feature you'll save RAM by disabling it.
534 *
Przemek Stekiel460192e2022-10-03 08:55:29 +0200535 * Requires: MBEDTLS_GCM_C or MBEDTLS_CCM_C or MBEDTLS_CHACHAPOLY_C
536 *
Gilles Peskined3d02902020-03-04 21:35:27 +0100537 * Comment to disable the context serialization APIs.
538 */
539#define MBEDTLS_SSL_CONTEXT_SERIALIZATION
540
541/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000542 * \def MBEDTLS_SSL_COOKIE_C
543 *
544 * Enable basic implementation of DTLS cookies for hello verification.
545 *
546 * Module: library/ssl_cookie.c
547 * Caller:
548 */
549#define MBEDTLS_SSL_COOKIE_C
550
551/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200552 * \def MBEDTLS_SSL_DEBUG_ALL
Paul Bakkerd66f0702013-01-31 16:57:45 +0100553 *
554 * Enable the debug messages in SSL module for all issues.
555 * Debug messages have been disabled in some places to prevent timing
556 * attacks due to (unbalanced) debugging function calls.
557 *
558 * If you need all error reporting you should enable this during debugging,
559 * but remove this for production servers that should log as well.
560 *
561 * Uncomment this macro to report all debug messages on errors introducing
562 * a timing side-channel.
563 *
Paul Bakkerd66f0702013-01-31 16:57:45 +0100564 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200565//#define MBEDTLS_SSL_DEBUG_ALL
Paul Bakkerd66f0702013-01-31 16:57:45 +0100566
Minos Galanakis80e76b62024-12-12 15:46:29 +0000567/**
568 * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY
569 *
570 * Enable support for the anti-replay mechanism in DTLS.
571 *
572 * Requires: MBEDTLS_SSL_TLS_C
573 * MBEDTLS_SSL_PROTO_DTLS
574 *
575 * \warning Disabling this is often a security risk!
576 * See mbedtls_ssl_conf_dtls_anti_replay() for details.
577 *
578 * Comment this to disable anti-replay in DTLS.
579 */
580#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
581
582/**
583 * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
584 *
585 * Enable server-side support for clients that reconnect from the same port.
586 *
587 * Some clients unexpectedly close the connection and try to reconnect using the
588 * same source port. This needs special support from the server to handle the
589 * new connection securely, as described in section 4.2.8 of RFC 6347. This
590 * flag enables that support.
591 *
592 * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY
593 *
594 * Comment this to disable support for clients reusing the source port.
595 */
596#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
597
598/**
599 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID
600 *
601 * Enable support for the DTLS Connection ID (CID) extension,
602 * which allows to identify DTLS connections across changes
603 * in the underlying transport. The CID functionality is described
604 * in RFC 9146.
605 *
606 * Setting this option enables the SSL APIs `mbedtls_ssl_set_cid()`,
607 * mbedtls_ssl_get_own_cid()`, `mbedtls_ssl_get_peer_cid()` and
608 * `mbedtls_ssl_conf_cid()`. See the corresponding documentation for
609 * more information.
610 *
611 * The maximum lengths of outgoing and incoming CIDs can be configured
612 * through the options
613 * - MBEDTLS_SSL_CID_OUT_LEN_MAX
614 * - MBEDTLS_SSL_CID_IN_LEN_MAX.
615 *
616 * Requires: MBEDTLS_SSL_PROTO_DTLS
617 *
618 * Uncomment to enable the Connection ID extension.
619 */
620#define MBEDTLS_SSL_DTLS_CONNECTION_ID
621
622/**
623 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT
624 *
625 * Defines whether RFC 9146 (default) or the legacy version
626 * (version draft-ietf-tls-dtls-connection-id-05,
627 * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05)
628 * is used.
629 *
630 * Set the value to 0 for the standard version, and
631 * 1 for the legacy draft version.
632 *
633 * \deprecated Support for the legacy version of the DTLS
634 * Connection ID feature is deprecated. Please
635 * switch to the standardized version defined
636 * in RFC 9146 enabled by utilizing
637 * MBEDTLS_SSL_DTLS_CONNECTION_ID without use
638 * of MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT.
639 *
640 * Requires: MBEDTLS_SSL_DTLS_CONNECTION_ID
641 */
642#define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 0
643
644/**
645 * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY
646 *
647 * Enable support for HelloVerifyRequest on DTLS servers.
648 *
649 * This feature is highly recommended to prevent DTLS servers being used as
650 * amplifiers in DoS attacks against other hosts. It should always be enabled
651 * unless you know for sure amplification cannot be a problem in the
652 * environment in which your server operates.
653 *
654 * \warning Disabling this can be a security risk! (see above)
655 *
656 * Requires: MBEDTLS_SSL_PROTO_DTLS
657 *
658 * Comment this to disable support for HelloVerifyRequest.
659 */
660#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
661
662/**
663 * \def MBEDTLS_SSL_DTLS_SRTP
664 *
665 * Enable support for negotiation of DTLS-SRTP (RFC 5764)
666 * through the use_srtp extension.
667 *
668 * \note This feature provides the minimum functionality required
669 * to negotiate the use of DTLS-SRTP and to allow the derivation of
670 * the associated SRTP packet protection key material.
671 * In particular, the SRTP packet protection itself, as well as the
672 * demultiplexing of RTP and DTLS packets at the datagram layer
673 * (see Section 5 of RFC 5764), are not handled by this feature.
674 * Instead, after successful completion of a handshake negotiating
675 * the use of DTLS-SRTP, the extended key exporter API
676 * mbedtls_ssl_conf_export_keys_cb() should be used to implement
677 * the key exporter described in Section 4.2 of RFC 5764 and RFC 5705
678 * (this is implemented in the SSL example programs).
679 * The resulting key should then be passed to an SRTP stack.
680 *
681 * Setting this option enables the runtime API
682 * mbedtls_ssl_conf_dtls_srtp_protection_profiles()
683 * through which the supported DTLS-SRTP protection
684 * profiles can be configured. You must call this API at
685 * runtime if you wish to negotiate the use of DTLS-SRTP.
686 *
687 * Requires: MBEDTLS_SSL_PROTO_DTLS
688 *
689 * Uncomment this to enable support for use_srtp extension.
690 */
691//#define MBEDTLS_SSL_DTLS_SRTP
692
693/**
694 * \def MBEDTLS_SSL_EARLY_DATA
695 *
696 * Enable support for RFC 8446 TLS 1.3 early data.
697 *
698 * Requires: MBEDTLS_SSL_SESSION_TICKETS and either
699 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED or
700 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
701 *
702 * Comment this to disable support for early data. If MBEDTLS_SSL_PROTO_TLS1_3
703 * is not enabled, this option does not have any effect on the build.
704 *
705 * \note The maximum amount of early data can be set with
706 * MBEDTLS_SSL_MAX_EARLY_DATA_SIZE.
707 *
708 */
709//#define MBEDTLS_SSL_EARLY_DATA
710
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200711/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100712 *
713 * Enable support for Encrypt-then-MAC, RFC 7366.
714 *
715 * This allows peers that both support it to use a more robust protection for
716 * ciphersuites using CBC, providing deep resistance against timing attacks
717 * on the padding or underlying cipher.
718 *
719 * This only affects CBC ciphersuites, and is useless if none is defined.
720 *
TRodziewicz0f82ec62021-05-12 17:49:18 +0200721 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100722 *
723 * Comment this macro to disable support for Encrypt-then-MAC
724 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200725#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100726
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200727/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200728 *
Manuel Pégourié-Gonnardbca8aa02020-03-24 12:11:49 +0100729 * Enable support for RFC 7627: Session Hash and Extended Master Secret
730 * Extension.
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200731 *
Shaun Case8b0ecbc2021-12-20 21:14:10 -0800732 * This was introduced as "the proper fix" to the Triple Handshake family of
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200733 * attacks, but it is recommended to always use it (even if you disable
734 * renegotiation), since it actually fixes a more fundamental issue in the
735 * original SSL/TLS design, and has implications beyond Triple Handshake.
736 *
TRodziewicz0f82ec62021-05-12 17:49:18 +0200737 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard769c6b62014-10-28 14:13:55 +0100738 *
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200739 * Comment this macro to disable support for Extended Master Secret.
740 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200741#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200742
Paul Bakkerd66f0702013-01-31 16:57:45 +0100743/**
Hanno Beckerbb278f52019-02-05 17:04:00 +0000744 * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
745 *
Hanno Beckerfd7f2982019-02-25 10:13:33 +0000746 * This option controls the availability of the API mbedtls_ssl_get_peer_cert()
Hanno Beckerbb278f52019-02-05 17:04:00 +0000747 * giving access to the peer's certificate after completion of the handshake.
748 *
749 * Unless you need mbedtls_ssl_peer_cert() in your application, it is
750 * recommended to disable this option for reduced RAM usage.
751 *
752 * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still
753 * defined, but always returns \c NULL.
754 *
755 * \note This option has no influence on the protection against the
756 * triple handshake attack. Even if it is disabled, Mbed TLS will
757 * still ensure that certificates do not change during renegotiation,
Shaun Case8b0ecbc2021-12-20 21:14:10 -0800758 * for example by keeping a hash of the peer's certificate.
Hanno Beckerbb278f52019-02-05 17:04:00 +0000759 *
Tom Cosgroveafb2fe12022-06-29 16:36:12 +0100760 * \note This option is required if MBEDTLS_SSL_PROTO_TLS1_3 is set.
Hanno Beckerbb278f52019-02-05 17:04:00 +0000761 *
762 * Comment this macro to disable storing the peer's certificate
763 * after the handshake.
764 */
765#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
766
767/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200768 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakker05decb22013-08-15 13:33:48 +0200769 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200770 * Enable support for RFC 6066 max_fragment_length extension in SSL.
Paul Bakker05decb22013-08-15 13:33:48 +0200771 *
772 * Comment this macro to disable support for the max_fragment_length extension
773 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200774#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakker05decb22013-08-15 13:33:48 +0200775
776/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000777 * \def MBEDTLS_SSL_PROTO_DTLS
Jan Bruckner151f6422023-02-10 12:45:19 +0100778 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000779 * Enable support for DTLS (all available versions).
Jan Bruckner151f6422023-02-10 12:45:19 +0100780 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000781 * Enable this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2.
Jan Bruckner151f6422023-02-10 12:45:19 +0100782 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000783 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
784 *
785 * Comment this macro to disable support for DTLS
Jan Bruckner151f6422023-02-10 12:45:19 +0100786 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000787#define MBEDTLS_SSL_PROTO_DTLS
Jan Bruckner151f6422023-02-10 12:45:19 +0100788
789/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200790 * \def MBEDTLS_SSL_PROTO_TLS1_2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200791 *
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100792 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200793 *
Janos Follath277bba82024-11-19 16:14:00 +0000794 * Requires: PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_384
Andrzej Kureke02da812022-08-17 17:04:49 -0400795 *
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100796 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200797 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200798#define MBEDTLS_SSL_PROTO_TLS1_2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200799
800/**
Ronald Cron6f135e12021-12-08 16:57:54 +0100801 * \def MBEDTLS_SSL_PROTO_TLS1_3
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100802 *
Ronald Cron6f135e12021-12-08 16:57:54 +0100803 * Enable support for TLS 1.3.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100804 *
Gilles Peskineda69eaa2023-09-05 20:54:17 +0200805 * \note See docs/architecture/tls13-support.md for a description of the TLS
Ronald Cron6f135e12021-12-08 16:57:54 +0100806 * 1.3 support that this option enables.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100807 *
Tom Cosgroveafb2fe12022-06-29 16:36:12 +0100808 * Requires: MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
Manuel Pégourié-Gonnard3e830982022-05-11 13:27:44 +0200809 * Requires: MBEDTLS_PSA_CRYPTO_C
Ronald Cron6f135e12021-12-08 16:57:54 +0100810 *
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100811 * Uncomment this macro to enable the support for TLS 1.3.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100812 */
Ronald Cron27eb68d2024-03-15 16:13:37 +0100813#define MBEDTLS_SSL_PROTO_TLS1_3
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100814
815/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000816 * \def MBEDTLS_SSL_RECORD_SIZE_LIMIT
817 *
818 * Enable support for RFC 8449 record_size_limit extension in SSL (TLS 1.3 only).
819 *
820 * Requires: MBEDTLS_SSL_PROTO_TLS1_3
821 *
822 * Uncomment this macro to enable support for the record_size_limit extension
823 */
824//#define MBEDTLS_SSL_RECORD_SIZE_LIMIT
825
826/**
827 * \def MBEDTLS_SSL_RENEGOTIATION
828 *
829 * Enable support for TLS renegotiation.
830 *
831 * The two main uses of renegotiation are (1) refresh keys on long-lived
832 * connections and (2) client authentication after the initial handshake.
833 * If you don't need renegotiation, it's probably better to disable it, since
834 * it has been associated with security issues in the past and is easy to
835 * misuse/misunderstand.
836 *
837 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
838 *
839 * Comment this to disable support for renegotiation.
840 *
841 * \note Even if this option is disabled, both client and server are aware
842 * of the Renegotiation Indication Extension (RFC 5746) used to
843 * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1).
844 * (See \c mbedtls_ssl_conf_legacy_renegotiation for the
845 * configuration of this extension).
846 *
847 */
848#define MBEDTLS_SSL_RENEGOTIATION
849
850/**
851 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
852 *
853 * Enable support for RFC 6066 server name indication (SNI) in SSL.
854 *
855 * Requires: MBEDTLS_X509_CRT_PARSE_C
856 *
857 * Comment this macro to disable support for server name indication in SSL
858 */
859#define MBEDTLS_SSL_SERVER_NAME_INDICATION
860
861/**
862 * \def MBEDTLS_SSL_SESSION_TICKETS
863 *
864 * Enable support for RFC 5077 session tickets in SSL.
865 * Client-side, provides full support for session tickets (maintenance of a
866 * session store remains the responsibility of the application, though).
867 * Server-side, you also need to provide callbacks for writing and parsing
868 * tickets, including authenticated encryption and key management. Example
869 * callbacks are provided by MBEDTLS_SSL_TICKET_C.
870 *
871 * Comment this macro to disable support for SSL session tickets
872 */
873#define MBEDTLS_SSL_SESSION_TICKETS
874
875/**
876 * \def MBEDTLS_SSL_SRV_C
877 *
878 * Enable the SSL/TLS server code.
879 *
880 * Module: library/ssl*_server.c
881 * Caller:
882 *
883 * Requires: MBEDTLS_SSL_TLS_C
884 *
885 * \warning You must call psa_crypto_init() before doing any TLS operations.
886 *
887 * This module is required for SSL/TLS server support.
888 */
889#define MBEDTLS_SSL_SRV_C
890
891/**
892 * \def MBEDTLS_SSL_TICKET_C
893 *
894 * Enable an implementation of TLS server-side callbacks for session tickets.
895 *
896 * Module: library/ssl_ticket.c
897 * Caller:
898 *
899 * Requires: (MBEDTLS_CIPHER_C || MBEDTLS_USE_PSA_CRYPTO) &&
900 * (MBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C)
901 */
902#define MBEDTLS_SSL_TICKET_C
903
904/**
Ronald Cronab65c522021-11-24 10:47:20 +0100905 * \def MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
906 *
907 * Enable TLS 1.3 middlebox compatibility mode.
908 *
909 * As specified in Section D.4 of RFC 8446, TLS 1.3 offers a compatibility
910 * mode to make a TLS 1.3 connection more likely to pass through middle boxes
911 * expecting TLS 1.2 traffic.
912 *
913 * Turning on the compatibility mode comes at the cost of a few added bytes
914 * on the wire, but it doesn't affect compatibility with TLS 1.3 implementations
915 * that don't use it. Therefore, unless transmission bandwidth is critical and
916 * you know that middlebox compatibility issues won't occur, it is therefore
917 * recommended to set this option.
918 *
919 * Comment to disable compatibility mode for TLS 1.3. If
Ronald Cron6f135e12021-12-08 16:57:54 +0100920 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
921 * effect on the build.
Ronald Cronab65c522021-11-24 10:47:20 +0100922 *
923 */
Ronald Cron27eb68d2024-03-15 16:13:37 +0100924#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
Ronald Cronab65c522021-11-24 10:47:20 +0100925
926/**
Ronald Crond8d2ea52022-10-04 15:48:06 +0200927 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
928 *
929 * Enable TLS 1.3 ephemeral key exchange mode.
930 *
Przemek Stekielce05f542023-06-15 16:44:08 +0200931 * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200932 * MBEDTLS_X509_CRT_PARSE_C
933 * and at least one of:
Janos Follath277bba82024-11-19 16:14:00 +0000934 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200935 * MBEDTLS_PKCS1_V21
Ronald Crond8d2ea52022-10-04 15:48:06 +0200936 *
937 * Comment to disable support for the ephemeral key exchange mode in TLS 1.3.
938 * If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
939 * effect on the build.
940 *
941 */
942#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
943
944/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000945 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
946 *
947 * Enable TLS 1.3 PSK key exchange mode.
948 *
949 * Comment to disable support for the PSK key exchange mode in TLS 1.3. If
950 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
951 * effect on the build.
952 *
953 */
954#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
955
956/**
Ronald Crond8d2ea52022-10-04 15:48:06 +0200957 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
958 *
959 * Enable TLS 1.3 PSK ephemeral key exchange mode.
960 *
Przemek Stekielce05f542023-06-15 16:44:08 +0200961 * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH
Ronald Crond8d2ea52022-10-04 15:48:06 +0200962 *
963 * Comment to disable support for the PSK ephemeral key exchange mode in
964 * TLS 1.3. If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not
965 * have any effect on the build.
966 *
967 */
968#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
969
970/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200971 * \def MBEDTLS_SSL_TLS_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000972 *
Paul Bakkere29ab062011-05-18 13:26:54 +0000973 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000974 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000975 * Module: library/ssl_tls.c
Ronald Cronde1adee2022-03-07 16:20:30 +0100976 * Caller: library/ssl*_client.c
977 * library/ssl*_server.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000978 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200979 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
980 * and at least one of the MBEDTLS_SSL_PROTO_XXX defines
Paul Bakker5690efc2011-05-26 13:16:06 +0000981 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000982 * This module is required for SSL/TLS.
983 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200984#define MBEDTLS_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000985
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000986/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000987 * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000988 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000989 * When this option is enabled, the SSL buffer will be resized automatically
990 * based on the negotiated maximum fragment length in each direction.
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +0100991 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000992 * Requires: MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakkerecd54fb2013-07-03 14:48:29 +0200993 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000994//#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
Paul Bakker5121ce52009-01-03 21:22:43 +0000995
Minos Galanakis80e76b62024-12-12 15:46:29 +0000996//#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 +0200997//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000998//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
Angus Grattond8213d02016-05-25 20:56:48 +1000999
Gilles Peskined3d02902020-03-04 21:35:27 +01001000/** \def MBEDTLS_SSL_CID_IN_LEN_MAX
1001 *
1002 * The maximum length of CIDs used for incoming DTLS messages.
1003 *
1004 */
1005//#define MBEDTLS_SSL_CID_IN_LEN_MAX 32
1006
1007/** \def MBEDTLS_SSL_CID_OUT_LEN_MAX
1008 *
1009 * The maximum length of CIDs used for outgoing DTLS messages.
1010 *
1011 */
1012//#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32
1013
TRodziewicze8dd7092021-05-12 14:19:11 +02001014/** \def MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY
Gilles Peskined3d02902020-03-04 21:35:27 +01001015 *
1016 * This option controls the use of record plaintext padding
TRodziewicz1e660ed2021-05-26 17:08:54 +02001017 * in TLS 1.3 and when using the Connection ID extension in DTLS 1.2.
Hanno Becker13996922020-05-28 16:15:19 +01001018 *
1019 * The padding will always be chosen so that the length of the
1020 * padded plaintext is a multiple of the value of this option.
1021 *
1022 * Note: A value of \c 1 means that no padding will be used
1023 * for outgoing records.
1024 *
1025 * Note: On systems lacking division instructions,
1026 * a power of two should be preferred.
1027 */
TRodziewicze8dd7092021-05-12 14:19:11 +02001028//#define MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY 16
Hanno Becker13996922020-05-28 16:15:19 +01001029
Minos Galanakis80e76b62024-12-12 15:46:29 +00001030/**
1031 * Complete list of ciphersuites to use, in order of preference.
1032 *
1033 * \warning No dependency checking is done on that field! This option can only
1034 * be used to restrict the set of available ciphersuites. It is your
1035 * responsibility to make sure the needed modules are active.
1036 *
1037 * Use this to save a few hundred bytes of ROM (default ordering of all
1038 * available ciphersuites) and a few to a few hundred bytes of RAM.
1039 *
1040 * The value below is only an example, not the default.
1041 */
1042//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
1043
1044//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
1045
1046/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING
1047 *
1048 * Maximum number of heap-allocated bytes for the purpose of
1049 * DTLS handshake message reassembly and future message buffering.
1050 *
1051 * This should be at least 9/8 * MBEDTLS_SSL_IN_CONTENT_LEN
1052 * to account for a reassembled handshake message of maximum size,
1053 * together with its reassembly bitmap.
1054 *
1055 * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default)
1056 * should be sufficient for all practical situations as it allows
1057 * to reassembly a large handshake message (such as a certificate)
1058 * while buffering multiple smaller handshake messages.
1059 *
1060 */
1061//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768
1062
1063/** \def MBEDTLS_SSL_IN_CONTENT_LEN
1064 *
1065 * Maximum length (in bytes) of incoming plaintext fragments.
1066 *
1067 * This determines the size of the incoming TLS I/O buffer in such a way
1068 * that it is capable of holding the specified amount of plaintext data,
1069 * regardless of the protection mechanism used.
1070 *
1071 * \note When using a value less than the default of 16KB on the client, it is
1072 * recommended to use the Maximum Fragment Length (MFL) extension to
1073 * inform the server about this limitation. On the server, there
1074 * is no supported, standardized way of informing the client about
1075 * restriction on the maximum size of incoming messages, and unless
1076 * the limitation has been communicated by other means, it is recommended
1077 * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN
1078 * while keeping the default value of 16KB for the incoming buffer.
1079 *
1080 * Uncomment to set the maximum plaintext size of the incoming I/O buffer.
1081 */
1082//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384
1083
1084/**
1085 * \def MBEDTLS_SSL_MAX_EARLY_DATA_SIZE
1086 *
1087 * The default maximum amount of 0-RTT data. See the documentation of
1088 * \c mbedtls_ssl_conf_max_early_data_size() for more information.
1089 *
1090 * It must be positive and smaller than UINT32_MAX.
1091 *
1092 * If MBEDTLS_SSL_EARLY_DATA is not defined, this default value does not
1093 * have any impact on the build.
1094 */
1095//#define MBEDTLS_SSL_MAX_EARLY_DATA_SIZE 1024
1096
Angus Grattond8213d02016-05-25 20:56:48 +10001097/** \def MBEDTLS_SSL_OUT_CONTENT_LEN
1098 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001099 * Maximum length (in bytes) of outgoing plaintext fragments.
Angus Grattond8213d02016-05-25 20:56:48 +10001100 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001101 * This determines the size of the outgoing TLS I/O buffer in such a way
1102 * that it is capable of holding the specified amount of plaintext data,
1103 * regardless of the protection mechanism used.
1104 *
Angus Grattond8213d02016-05-25 20:56:48 +10001105 * It is possible to save RAM by setting a smaller outward buffer, while keeping
1106 * the default inward 16384 byte buffer to conform to the TLS specification.
1107 *
1108 * The minimum required outward buffer size is determined by the handshake
1109 * protocol's usage. Handshaking will fail if the outward buffer is too small.
1110 * The specific size requirement depends on the configured ciphers and any
1111 * certificate data which is sent during the handshake.
1112 *
David Horstmann95d516f2021-05-04 18:36:56 +01001113 * Uncomment to set the maximum plaintext size of the outgoing I/O buffer.
Angus Grattond8213d02016-05-25 20:56:48 +10001114 */
1115//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384
1116
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001117/**
Minos Galanakis80e76b62024-12-12 15:46:29 +00001118 * \def MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001119 *
Minos Galanakis80e76b62024-12-12 15:46:29 +00001120 * Default number of NewSessionTicket messages to be sent by a TLS 1.3 server
1121 * after handshake completion. This is not used in TLS 1.2 and relevant only if
1122 * the MBEDTLS_SSL_SESSION_TICKETS option is enabled.
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001123 *
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001124 */
Minos Galanakis80e76b62024-12-12 15:46:29 +00001125//#define MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS 1
Tom Cosgrovea63775b2023-09-14 13:31:19 +01001126
1127/**
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001128 * \def MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE
1129 *
Jerry Yucf913512023-11-14 11:06:52 +08001130 * Maximum allowed ticket age difference in milliseconds tolerated between
Jerry Yu034a8b72023-11-10 12:20:19 +08001131 * server and client. Default value is 6000. This is not used in TLS 1.2.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001132 *
Jerry Yu034a8b72023-11-10 12:20:19 +08001133 * - The client ticket age is the time difference between the time when the
1134 * client proposes to the server to use the ticket and the time the client
1135 * received the ticket from the server.
1136 * - The server ticket age is the time difference between the time when the
1137 * server receives a proposition from the client to use the ticket and the
1138 * time when the ticket was created by the server.
1139 *
Jerry Yucf913512023-11-14 11:06:52 +08001140 * The ages might be different due to the client and server clocks not running
1141 * at the same pace. The typical accuracy of an RTC crystal is ±100 to ±20 parts
1142 * per million (360 to 72 milliseconds per hour). Default tolerance window is
1143 * 6s, thus in the worst case clients and servers must sync up their system time
1144 * every 6000/360/2~=8 hours.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001145 *
Jerry Yu04fceb72023-11-15 09:52:46 +08001146 * See section 8.3 of the TLS 1.3 specification(RFC 8446) for more information.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001147 */
Gilles Peskined65ea422023-09-05 21:07:32 +02001148//#define MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE 6000
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001149
Minos Galanakis80e76b62024-12-12 15:46:29 +00001150/** \} name SECTION: TLS feature selection */
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001164
1165/**
Minos Galanakis80e76b62024-12-12 15:46:29 +00001166 * \name SECTION: X.509 feature selection
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001167 *
Minos Galanakis80e76b62024-12-12 15:46:29 +00001168 * This section sets Certificate related options.
1169 * \{
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001170 */
Minos Galanakis80e76b62024-12-12 15:46:29 +00001171
1172/**
1173 * \def MBEDTLS_PKCS7_C
1174 *
1175 * Enable PKCS #7 core for using PKCS #7-formatted signatures.
1176 * RFC Link - https://tools.ietf.org/html/rfc2315
1177 *
1178 * Module: library/pkcs7.c
1179 *
1180 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C,
1181 * MBEDTLS_X509_CRT_PARSE_C MBEDTLS_X509_CRL_PARSE_C,
1182 * MBEDTLS_BIGNUM_C, MBEDTLS_MD_C
1183 *
1184 * This module is required for the PKCS #7 parsing modules.
1185 */
1186#define MBEDTLS_PKCS7_C
1187
1188/**
1189 * \def MBEDTLS_X509_CREATE_C
1190 *
1191 * Enable X.509 core for creating certificates.
1192 *
1193 * Module: library/x509_create.c
1194 *
1195 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C,
1196 *
1197 * \warning You must call psa_crypto_init() before doing any X.509 operation.
1198 *
1199 * This module is the basis for creating X.509 certificates and CSRs.
1200 */
1201#define MBEDTLS_X509_CREATE_C
1202
1203/**
1204 * \def MBEDTLS_X509_CRL_PARSE_C
1205 *
1206 * Enable X.509 CRL parsing.
1207 *
1208 * Module: library/x509_crl.c
1209 * Caller: library/x509_crt.c
1210 *
1211 * Requires: MBEDTLS_X509_USE_C
1212 *
1213 * This module is required for X.509 CRL parsing.
1214 */
1215#define MBEDTLS_X509_CRL_PARSE_C
1216
1217/**
1218 * \def MBEDTLS_X509_CRT_PARSE_C
1219 *
1220 * Enable X.509 certificate parsing.
1221 *
1222 * Module: library/x509_crt.c
1223 * Caller: library/ssl_tls.c
1224 * library/ssl*_client.c
1225 * library/ssl*_server.c
1226 *
1227 * Requires: MBEDTLS_X509_USE_C
1228 *
1229 * This module is required for X.509 certificate parsing.
1230 */
1231#define MBEDTLS_X509_CRT_PARSE_C
1232
1233/**
1234 * \def MBEDTLS_X509_CRT_WRITE_C
1235 *
1236 * Enable creating X.509 certificates.
1237 *
1238 * Module: library/x509_crt_write.c
1239 *
1240 * Requires: MBEDTLS_X509_CREATE_C
1241 *
1242 * This module is required for X.509 certificate creation.
1243 */
1244#define MBEDTLS_X509_CRT_WRITE_C
1245
1246/**
1247 * \def MBEDTLS_X509_CSR_PARSE_C
1248 *
1249 * Enable X.509 Certificate Signing Request (CSR) parsing.
1250 *
1251 * Module: library/x509_csr.c
1252 * Caller: library/x509_crt_write.c
1253 *
1254 * Requires: MBEDTLS_X509_USE_C
1255 *
1256 * This module is used for reading X.509 certificate request.
1257 */
1258#define MBEDTLS_X509_CSR_PARSE_C
1259
1260/**
1261 * \def MBEDTLS_X509_CSR_WRITE_C
1262 *
1263 * Enable creating X.509 Certificate Signing Requests (CSR).
1264 *
1265 * Module: library/x509_csr_write.c
1266 *
1267 * Requires: MBEDTLS_X509_CREATE_C
1268 *
1269 * This module is required for X.509 certificate request writing.
1270 */
1271#define MBEDTLS_X509_CSR_WRITE_C
1272
1273/**
1274 * \def MBEDTLS_X509_REMOVE_INFO
1275 *
1276 * Disable mbedtls_x509_*_info() and related APIs.
1277 *
1278 * Uncomment to omit mbedtls_x509_*_info(), as well as mbedtls_debug_print_crt()
1279 * and other functions/constants only used by these functions, thus reducing
1280 * the code footprint by several KB.
1281 */
1282//#define MBEDTLS_X509_REMOVE_INFO
1283
1284/**
1285 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
1286 *
1287 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
1288 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
1289 *
1290 * Requires: MBEDTLS_PKCS1_V21
1291 *
1292 * Comment this macro to disallow using RSASSA-PSS in certificates.
1293 */
1294#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
1295
1296/**
1297 * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1298 *
1299 * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()`
1300 * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure
1301 * the set of trusted certificates through a callback instead of a linked
1302 * list.
1303 *
1304 * This is useful for example in environments where a large number of trusted
1305 * certificates is present and storing them in a linked list isn't efficient
1306 * enough, or when the set of trusted certificates changes frequently.
1307 *
1308 * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and
1309 * `mbedtls_ssl_conf_ca_cb()` for more information.
1310 *
1311 * Requires: MBEDTLS_X509_CRT_PARSE_C
1312 *
1313 * Uncomment to enable trusted certificate callbacks.
1314 */
1315//#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1316
1317/**
1318 * \def MBEDTLS_X509_USE_C
1319 *
1320 * Enable X.509 core for using certificates.
1321 *
1322 * Module: library/x509.c
1323 * Caller: library/x509_crl.c
1324 * library/x509_crt.c
1325 * library/x509_csr.c
1326 *
1327 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C
1328 *
1329 * \warning You must call psa_crypto_init() before doing any X.509 operation.
1330 *
1331 * This module is required for the X.509 parsing modules.
1332 */
1333#define MBEDTLS_X509_USE_C
1334
1335//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
1336//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
1337
1338/** \} name SECTION: X.509 feature selection */
1339
1340/**
1341 * \name SECTION: Mbed TLS feature support
1342 *
1343 * This section sets support for features that are or are not needed
1344 * within the modules that are enabled.
1345 * \{
1346 */
1347
1348/** \} name SECTION: Mbed TLS feature support */
1349
1350/**
1351 * \name SECTION: Mbed TLS modules
1352 *
1353 * This section enables or disables entire modules in Mbed TLS
1354 * \{
1355 */
1356
1357/** \} name SECTION: Mbed TLS modules */
1358
1359/**
1360 * \name SECTION: General configuration options
1361 *
1362 * This section contains Mbed TLS build settings that are not associated
1363 * with a particular module.
1364 *
1365 * \{
1366 */
1367
1368
1369
1370/** \} name SECTION: General configuration options */
1371
1372/**
1373 * \name SECTION: Module configuration options
1374 *
1375 * This section allows for the setting of module specific sizes and
1376 * configuration options. The default values are already present in the
1377 * relevant header files and should suffice for the regular use cases.
1378 *
1379 * Our advice is to enable options and change their values here
1380 * only if you have a good reason and know the consequences.
1381 * \{
1382 */
1383/* The Doxygen documentation here is used when a user comments out a
1384 * setting and runs doxygen themselves. On the other hand, when we typeset
1385 * the full documentation including disabled settings, the documentation
1386 * in specific modules' header files is used if present. When editing this
1387 * file, make sure that each option is documented in exactly one place,
1388 * plus optionally a same-line Doxygen comment here if there is a Doxygen
1389 * comment in the specific module. */
1390
1391/* SSL Cache options */
1392
1393
1394
1395/* SSL options */
1396
1397
1398
1399
1400
1401
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001402
Manuel Pégourié-Gonnardfd6c85c2014-11-20 16:34:20 +01001403/* X509 options */
Gilles Peskine611179c2022-04-13 23:04:48 +02001404/** \} name SECTION: Module configuration options */