blob: be38c6d71ca59ae7e27329ad1c71894dde8224f7 [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_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200211 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200212 * Enable the DHE-RSA 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, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
215 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200216 *
217 * This enables the following ciphersuites (if other requisites are
218 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200219 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
220 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
221 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
222 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
223 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
224 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
225 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
226 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
227 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
228 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
229 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
230 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
Hanno Beckera2f6b722017-09-28 10:33:29 +0100231 *
Hanno Beckerf9734b32017-10-03 12:09:22 +0100232 * \warning Using DHE constitutes a security risk as it
233 * is not possible to validate custom DH parameters.
234 * If possible, it is recommended users should consider
235 * preferring other methods of key exchange.
236 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +0100237 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200238 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200239#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200240
241/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000242 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
243 *
244 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
245 *
246 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
247 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
248 * MBEDTLS_X509_CRT_PARSE_C
249 *
250 * This enables the following ciphersuites (if other requisites are
251 * enabled as well):
252 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
253 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
254 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
255 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
256 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
257 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
258 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
259 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
260 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
261 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
262 */
263#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
264
265/**
266 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
267 *
268 * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
269 *
270 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
271 *
272 * This enables the following ciphersuites (if other requisites are
273 * enabled as well):
274 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
275 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
276 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
277 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
278 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
279 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
280 */
281#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
282
283/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200284 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200285 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200286 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200287 *
Janos Follath277bba82024-11-19 16:14:00 +0000288 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200289 * MBEDTLS_RSA_C
290 * MBEDTLS_PKCS1_V15
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200291 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200292 *
293 * This enables the following ciphersuites (if other requisites are
294 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200295 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
296 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
297 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
298 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
299 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
300 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
301 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
302 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
303 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
304 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakkere07f41d2013-04-19 09:08:57 +0200305 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200306#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200307
308/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200309 * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100310 *
311 * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
312 *
Janos Follath277bba82024-11-19 16:14:00 +0000313 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
314 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200315 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100316 *
317 * This enables the following ciphersuites (if other requisites are
318 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200319 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
320 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
321 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
322 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
323 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
324 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
325 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
326 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
327 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
328 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100329 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200330#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100331
332/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200333 * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100334 *
335 * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS.
336 *
Janos Follath277bba82024-11-19 16:14:00 +0000337 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200338 * MBEDTLS_RSA_C
339 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100340 *
341 * This enables the following ciphersuites (if other requisites are
342 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200343 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
344 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
345 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
346 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
347 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
348 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
349 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
350 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
351 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
352 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100353 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200354#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100355
356/**
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200357 * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
358 *
359 * Enable the ECJPAKE based ciphersuite modes in SSL / TLS.
360 *
Manuel Pégourié-Gonnard75df9022015-09-16 23:21:01 +0200361 * \warning This is currently experimental. EC J-PAKE support is based on the
362 * Thread v1.0.0 specification; incompatible changes to the specification
363 * might still happen. For this reason, this is disabled by default.
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200364 *
Janos Follath277bba82024-11-19 16:14:00 +0000365 * Requires: MBEDTLS_ECJPAKE_C or PSA_WANT_ALG_JPAKE
Manuel Pégourié-Gonnard41bc8b62023-03-14 23:59:24 +0100366 * SHA-256 (via MBEDTLS_SHA256_C or a PSA driver)
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200367 * MBEDTLS_ECP_DP_SECP256R1_ENABLED
368 *
369 * This enables the following ciphersuites (if other requisites are
370 * enabled as well):
371 * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
372 */
Manuel Pégourié-Gonnardcf828932015-10-20 14:57:00 +0200373//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200374
375/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000376 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100377 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000378 * Enable the PSK based ciphersuite modes in SSL / TLS.
Manuel Pégourié-Gonnarddc16aa72014-06-25 12:55:12 +0200379 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000380 * This enables the following ciphersuites (if other requisites are
381 * enabled as well):
382 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
383 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
384 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
385 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
386 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
387 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
388 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
389 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
390 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
391 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100392 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000393#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
394
395/**
396 * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
397 *
398 * Enable the RSA-only based ciphersuite modes in SSL / TLS.
399 *
400 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
401 * MBEDTLS_X509_CRT_PARSE_C
402 *
403 * This enables the following ciphersuites (if other requisites are
404 * enabled as well):
405 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
406 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
407 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
408 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
409 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
410 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
411 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
412 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
413 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
414 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
415 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
416 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
417 */
418#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100419
420/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200421 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
Paul Bakker40865c82013-01-31 17:13:13 +0100422 *
423 * Enable sending of alert messages in case of encountered errors as per RFC.
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200424 * If you choose not to send the alert messages, Mbed TLS can still communicate
Paul Bakker40865c82013-01-31 17:13:13 +0100425 * with other servers, only debugging of failures is harder.
426 *
427 * The advantage of not sending alert messages, is that no information is given
428 * about reasons for failures thus preventing adversaries of gaining intel.
429 *
430 * Enable sending of all alert messages
431 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200432#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
Paul Bakker40865c82013-01-31 17:13:13 +0100433
434/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000435 * \def MBEDTLS_SSL_ALPN
Gilles Peskined3d02902020-03-04 21:35:27 +0100436 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000437 * Enable support for RFC 7301 Application Layer Protocol Negotiation.
Gilles Peskined3d02902020-03-04 21:35:27 +0100438 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000439 * Comment this macro to disable support for ALPN.
Gilles Peskined3d02902020-03-04 21:35:27 +0100440 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000441#define MBEDTLS_SSL_ALPN
Gilles Peskined3d02902020-03-04 21:35:27 +0100442
443/**
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200444 * \def MBEDTLS_SSL_ASYNC_PRIVATE
445 *
446 * Enable asynchronous external private key operations in SSL. This allows
447 * you to configure an SSL connection to call an external cryptographic
448 * module to perform private key operations instead of performing the
449 * operation inside the library.
450 *
Valerio Setti8841d6b2023-01-05 08:40:24 +0100451 * Requires: MBEDTLS_X509_CRT_PARSE_C
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200452 */
Jaeden Amerod9c71da2018-06-15 20:31:26 +0100453//#define MBEDTLS_SSL_ASYNC_PRIVATE
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200454
455/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000456 * \def MBEDTLS_SSL_CACHE_C
457 *
458 * Enable simple SSL cache implementation.
459 *
460 * Module: library/ssl_cache.c
461 * Caller:
462 *
463 * Requires: MBEDTLS_SSL_CACHE_C
464 */
465#define MBEDTLS_SSL_CACHE_C
466
467/**
468 * \def MBEDTLS_SSL_CLI_C
469 *
470 * Enable the SSL/TLS client code.
471 *
472 * Module: library/ssl*_client.c
473 * Caller:
474 *
475 * Requires: MBEDTLS_SSL_TLS_C
476 *
477 * \warning You must call psa_crypto_init() before doing any TLS operations.
478 *
479 * This module is required for SSL/TLS client support.
480 */
481#define MBEDTLS_SSL_CLI_C
482
483/**
Gilles Peskined3d02902020-03-04 21:35:27 +0100484 * \def MBEDTLS_SSL_CONTEXT_SERIALIZATION
485 *
486 * Enable serialization of the TLS context structures, through use of the
487 * functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load().
488 *
489 * This pair of functions allows one side of a connection to serialize the
490 * context associated with the connection, then free or re-use that context
491 * while the serialized state is persisted elsewhere, and finally deserialize
492 * that state to a live context for resuming read/write operations on the
493 * connection. From a protocol perspective, the state of the connection is
494 * unaffected, in particular this is entirely transparent to the peer.
495 *
496 * Note: this is distinct from TLS session resumption, which is part of the
497 * protocol and fully visible by the peer. TLS session resumption enables
498 * establishing new connections associated to a saved session with shorter,
499 * lighter handshakes, while context serialization is a local optimization in
500 * handling a single, potentially long-lived connection.
501 *
502 * Enabling these APIs makes some SSL structures larger, as 64 extra bytes are
503 * saved after the handshake to allow for more efficient serialization, so if
504 * you don't need this feature you'll save RAM by disabling it.
505 *
Przemek Stekiel460192e2022-10-03 08:55:29 +0200506 * Requires: MBEDTLS_GCM_C or MBEDTLS_CCM_C or MBEDTLS_CHACHAPOLY_C
507 *
Gilles Peskined3d02902020-03-04 21:35:27 +0100508 * Comment to disable the context serialization APIs.
509 */
510#define MBEDTLS_SSL_CONTEXT_SERIALIZATION
511
512/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000513 * \def MBEDTLS_SSL_COOKIE_C
514 *
515 * Enable basic implementation of DTLS cookies for hello verification.
516 *
517 * Module: library/ssl_cookie.c
518 * Caller:
519 */
520#define MBEDTLS_SSL_COOKIE_C
521
522/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200523 * \def MBEDTLS_SSL_DEBUG_ALL
Paul Bakkerd66f0702013-01-31 16:57:45 +0100524 *
525 * Enable the debug messages in SSL module for all issues.
526 * Debug messages have been disabled in some places to prevent timing
527 * attacks due to (unbalanced) debugging function calls.
528 *
529 * If you need all error reporting you should enable this during debugging,
530 * but remove this for production servers that should log as well.
531 *
532 * Uncomment this macro to report all debug messages on errors introducing
533 * a timing side-channel.
534 *
Paul Bakkerd66f0702013-01-31 16:57:45 +0100535 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200536//#define MBEDTLS_SSL_DEBUG_ALL
Paul Bakkerd66f0702013-01-31 16:57:45 +0100537
Minos Galanakis80e76b62024-12-12 15:46:29 +0000538/**
539 * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY
540 *
541 * Enable support for the anti-replay mechanism in DTLS.
542 *
543 * Requires: MBEDTLS_SSL_TLS_C
544 * MBEDTLS_SSL_PROTO_DTLS
545 *
546 * \warning Disabling this is often a security risk!
547 * See mbedtls_ssl_conf_dtls_anti_replay() for details.
548 *
549 * Comment this to disable anti-replay in DTLS.
550 */
551#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
552
553/**
554 * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
555 *
556 * Enable server-side support for clients that reconnect from the same port.
557 *
558 * Some clients unexpectedly close the connection and try to reconnect using the
559 * same source port. This needs special support from the server to handle the
560 * new connection securely, as described in section 4.2.8 of RFC 6347. This
561 * flag enables that support.
562 *
563 * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY
564 *
565 * Comment this to disable support for clients reusing the source port.
566 */
567#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
568
569/**
570 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID
571 *
572 * Enable support for the DTLS Connection ID (CID) extension,
573 * which allows to identify DTLS connections across changes
574 * in the underlying transport. The CID functionality is described
575 * in RFC 9146.
576 *
577 * Setting this option enables the SSL APIs `mbedtls_ssl_set_cid()`,
578 * mbedtls_ssl_get_own_cid()`, `mbedtls_ssl_get_peer_cid()` and
579 * `mbedtls_ssl_conf_cid()`. See the corresponding documentation for
580 * more information.
581 *
582 * The maximum lengths of outgoing and incoming CIDs can be configured
583 * through the options
584 * - MBEDTLS_SSL_CID_OUT_LEN_MAX
585 * - MBEDTLS_SSL_CID_IN_LEN_MAX.
586 *
587 * Requires: MBEDTLS_SSL_PROTO_DTLS
588 *
589 * Uncomment to enable the Connection ID extension.
590 */
591#define MBEDTLS_SSL_DTLS_CONNECTION_ID
592
593/**
594 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT
595 *
596 * Defines whether RFC 9146 (default) or the legacy version
597 * (version draft-ietf-tls-dtls-connection-id-05,
598 * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05)
599 * is used.
600 *
601 * Set the value to 0 for the standard version, and
602 * 1 for the legacy draft version.
603 *
604 * \deprecated Support for the legacy version of the DTLS
605 * Connection ID feature is deprecated. Please
606 * switch to the standardized version defined
607 * in RFC 9146 enabled by utilizing
608 * MBEDTLS_SSL_DTLS_CONNECTION_ID without use
609 * of MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT.
610 *
611 * Requires: MBEDTLS_SSL_DTLS_CONNECTION_ID
612 */
613#define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 0
614
615/**
616 * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY
617 *
618 * Enable support for HelloVerifyRequest on DTLS servers.
619 *
620 * This feature is highly recommended to prevent DTLS servers being used as
621 * amplifiers in DoS attacks against other hosts. It should always be enabled
622 * unless you know for sure amplification cannot be a problem in the
623 * environment in which your server operates.
624 *
625 * \warning Disabling this can be a security risk! (see above)
626 *
627 * Requires: MBEDTLS_SSL_PROTO_DTLS
628 *
629 * Comment this to disable support for HelloVerifyRequest.
630 */
631#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
632
633/**
634 * \def MBEDTLS_SSL_DTLS_SRTP
635 *
636 * Enable support for negotiation of DTLS-SRTP (RFC 5764)
637 * through the use_srtp extension.
638 *
639 * \note This feature provides the minimum functionality required
640 * to negotiate the use of DTLS-SRTP and to allow the derivation of
641 * the associated SRTP packet protection key material.
642 * In particular, the SRTP packet protection itself, as well as the
643 * demultiplexing of RTP and DTLS packets at the datagram layer
644 * (see Section 5 of RFC 5764), are not handled by this feature.
645 * Instead, after successful completion of a handshake negotiating
646 * the use of DTLS-SRTP, the extended key exporter API
647 * mbedtls_ssl_conf_export_keys_cb() should be used to implement
648 * the key exporter described in Section 4.2 of RFC 5764 and RFC 5705
649 * (this is implemented in the SSL example programs).
650 * The resulting key should then be passed to an SRTP stack.
651 *
652 * Setting this option enables the runtime API
653 * mbedtls_ssl_conf_dtls_srtp_protection_profiles()
654 * through which the supported DTLS-SRTP protection
655 * profiles can be configured. You must call this API at
656 * runtime if you wish to negotiate the use of DTLS-SRTP.
657 *
658 * Requires: MBEDTLS_SSL_PROTO_DTLS
659 *
660 * Uncomment this to enable support for use_srtp extension.
661 */
662//#define MBEDTLS_SSL_DTLS_SRTP
663
664/**
665 * \def MBEDTLS_SSL_EARLY_DATA
666 *
667 * Enable support for RFC 8446 TLS 1.3 early data.
668 *
669 * Requires: MBEDTLS_SSL_SESSION_TICKETS and either
670 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED or
671 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
672 *
673 * Comment this to disable support for early data. If MBEDTLS_SSL_PROTO_TLS1_3
674 * is not enabled, this option does not have any effect on the build.
675 *
676 * \note The maximum amount of early data can be set with
677 * MBEDTLS_SSL_MAX_EARLY_DATA_SIZE.
678 *
679 */
680//#define MBEDTLS_SSL_EARLY_DATA
681
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200682/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100683 *
684 * Enable support for Encrypt-then-MAC, RFC 7366.
685 *
686 * This allows peers that both support it to use a more robust protection for
687 * ciphersuites using CBC, providing deep resistance against timing attacks
688 * on the padding or underlying cipher.
689 *
690 * This only affects CBC ciphersuites, and is useless if none is defined.
691 *
TRodziewicz0f82ec62021-05-12 17:49:18 +0200692 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100693 *
694 * Comment this macro to disable support for Encrypt-then-MAC
695 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200696#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100697
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200698/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200699 *
Manuel Pégourié-Gonnardbca8aa02020-03-24 12:11:49 +0100700 * Enable support for RFC 7627: Session Hash and Extended Master Secret
701 * Extension.
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200702 *
Shaun Case8b0ecbc2021-12-20 21:14:10 -0800703 * This was introduced as "the proper fix" to the Triple Handshake family of
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200704 * attacks, but it is recommended to always use it (even if you disable
705 * renegotiation), since it actually fixes a more fundamental issue in the
706 * original SSL/TLS design, and has implications beyond Triple Handshake.
707 *
TRodziewicz0f82ec62021-05-12 17:49:18 +0200708 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard769c6b62014-10-28 14:13:55 +0100709 *
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200710 * Comment this macro to disable support for Extended Master Secret.
711 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200712#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200713
Paul Bakkerd66f0702013-01-31 16:57:45 +0100714/**
Hanno Beckerbb278f52019-02-05 17:04:00 +0000715 * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
716 *
Hanno Beckerfd7f2982019-02-25 10:13:33 +0000717 * This option controls the availability of the API mbedtls_ssl_get_peer_cert()
Hanno Beckerbb278f52019-02-05 17:04:00 +0000718 * giving access to the peer's certificate after completion of the handshake.
719 *
720 * Unless you need mbedtls_ssl_peer_cert() in your application, it is
721 * recommended to disable this option for reduced RAM usage.
722 *
723 * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still
724 * defined, but always returns \c NULL.
725 *
726 * \note This option has no influence on the protection against the
727 * triple handshake attack. Even if it is disabled, Mbed TLS will
728 * still ensure that certificates do not change during renegotiation,
Shaun Case8b0ecbc2021-12-20 21:14:10 -0800729 * for example by keeping a hash of the peer's certificate.
Hanno Beckerbb278f52019-02-05 17:04:00 +0000730 *
Tom Cosgroveafb2fe12022-06-29 16:36:12 +0100731 * \note This option is required if MBEDTLS_SSL_PROTO_TLS1_3 is set.
Hanno Beckerbb278f52019-02-05 17:04:00 +0000732 *
733 * Comment this macro to disable storing the peer's certificate
734 * after the handshake.
735 */
736#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
737
738/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200739 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakker05decb22013-08-15 13:33:48 +0200740 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200741 * Enable support for RFC 6066 max_fragment_length extension in SSL.
Paul Bakker05decb22013-08-15 13:33:48 +0200742 *
743 * Comment this macro to disable support for the max_fragment_length extension
744 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200745#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakker05decb22013-08-15 13:33:48 +0200746
747/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000748 * \def MBEDTLS_SSL_PROTO_DTLS
Jan Bruckner151f6422023-02-10 12:45:19 +0100749 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000750 * Enable support for DTLS (all available versions).
Jan Bruckner151f6422023-02-10 12:45:19 +0100751 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000752 * Enable this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2.
Jan Bruckner151f6422023-02-10 12:45:19 +0100753 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000754 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
755 *
756 * Comment this macro to disable support for DTLS
Jan Bruckner151f6422023-02-10 12:45:19 +0100757 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000758#define MBEDTLS_SSL_PROTO_DTLS
Jan Bruckner151f6422023-02-10 12:45:19 +0100759
760/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200761 * \def MBEDTLS_SSL_PROTO_TLS1_2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200762 *
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100763 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200764 *
Janos Follath277bba82024-11-19 16:14:00 +0000765 * Requires: PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_384
Andrzej Kureke02da812022-08-17 17:04:49 -0400766 *
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100767 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200768 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200769#define MBEDTLS_SSL_PROTO_TLS1_2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200770
771/**
Ronald Cron6f135e12021-12-08 16:57:54 +0100772 * \def MBEDTLS_SSL_PROTO_TLS1_3
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100773 *
Ronald Cron6f135e12021-12-08 16:57:54 +0100774 * Enable support for TLS 1.3.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100775 *
Gilles Peskineda69eaa2023-09-05 20:54:17 +0200776 * \note See docs/architecture/tls13-support.md for a description of the TLS
Ronald Cron6f135e12021-12-08 16:57:54 +0100777 * 1.3 support that this option enables.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100778 *
Tom Cosgroveafb2fe12022-06-29 16:36:12 +0100779 * Requires: MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
Manuel Pégourié-Gonnard3e830982022-05-11 13:27:44 +0200780 * Requires: MBEDTLS_PSA_CRYPTO_C
Ronald Cron6f135e12021-12-08 16:57:54 +0100781 *
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100782 * Uncomment this macro to enable the support for TLS 1.3.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100783 */
Ronald Cron27eb68d2024-03-15 16:13:37 +0100784#define MBEDTLS_SSL_PROTO_TLS1_3
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100785
786/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000787 * \def MBEDTLS_SSL_RECORD_SIZE_LIMIT
788 *
789 * Enable support for RFC 8449 record_size_limit extension in SSL (TLS 1.3 only).
790 *
791 * Requires: MBEDTLS_SSL_PROTO_TLS1_3
792 *
793 * Uncomment this macro to enable support for the record_size_limit extension
794 */
795//#define MBEDTLS_SSL_RECORD_SIZE_LIMIT
796
797/**
798 * \def MBEDTLS_SSL_RENEGOTIATION
799 *
800 * Enable support for TLS renegotiation.
801 *
802 * The two main uses of renegotiation are (1) refresh keys on long-lived
803 * connections and (2) client authentication after the initial handshake.
804 * If you don't need renegotiation, it's probably better to disable it, since
805 * it has been associated with security issues in the past and is easy to
806 * misuse/misunderstand.
807 *
808 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
809 *
810 * Comment this to disable support for renegotiation.
811 *
812 * \note Even if this option is disabled, both client and server are aware
813 * of the Renegotiation Indication Extension (RFC 5746) used to
814 * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1).
815 * (See \c mbedtls_ssl_conf_legacy_renegotiation for the
816 * configuration of this extension).
817 *
818 */
819#define MBEDTLS_SSL_RENEGOTIATION
820
821/**
822 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
823 *
824 * Enable support for RFC 6066 server name indication (SNI) in SSL.
825 *
826 * Requires: MBEDTLS_X509_CRT_PARSE_C
827 *
828 * Comment this macro to disable support for server name indication in SSL
829 */
830#define MBEDTLS_SSL_SERVER_NAME_INDICATION
831
832/**
833 * \def MBEDTLS_SSL_SESSION_TICKETS
834 *
835 * Enable support for RFC 5077 session tickets in SSL.
836 * Client-side, provides full support for session tickets (maintenance of a
837 * session store remains the responsibility of the application, though).
838 * Server-side, you also need to provide callbacks for writing and parsing
839 * tickets, including authenticated encryption and key management. Example
840 * callbacks are provided by MBEDTLS_SSL_TICKET_C.
841 *
842 * Comment this macro to disable support for SSL session tickets
843 */
844#define MBEDTLS_SSL_SESSION_TICKETS
845
846/**
847 * \def MBEDTLS_SSL_SRV_C
848 *
849 * Enable the SSL/TLS server code.
850 *
851 * Module: library/ssl*_server.c
852 * Caller:
853 *
854 * Requires: MBEDTLS_SSL_TLS_C
855 *
856 * \warning You must call psa_crypto_init() before doing any TLS operations.
857 *
858 * This module is required for SSL/TLS server support.
859 */
860#define MBEDTLS_SSL_SRV_C
861
862/**
863 * \def MBEDTLS_SSL_TICKET_C
864 *
865 * Enable an implementation of TLS server-side callbacks for session tickets.
866 *
867 * Module: library/ssl_ticket.c
868 * Caller:
869 *
Manuel Pégourié-Gonnard28905b72025-01-23 11:43:15 +0100870 * Requires: MBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C
Minos Galanakis80e76b62024-12-12 15:46:29 +0000871 */
872#define MBEDTLS_SSL_TICKET_C
873
874/**
Ronald Cronab65c522021-11-24 10:47:20 +0100875 * \def MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
876 *
877 * Enable TLS 1.3 middlebox compatibility mode.
878 *
879 * As specified in Section D.4 of RFC 8446, TLS 1.3 offers a compatibility
880 * mode to make a TLS 1.3 connection more likely to pass through middle boxes
881 * expecting TLS 1.2 traffic.
882 *
883 * Turning on the compatibility mode comes at the cost of a few added bytes
884 * on the wire, but it doesn't affect compatibility with TLS 1.3 implementations
885 * that don't use it. Therefore, unless transmission bandwidth is critical and
886 * you know that middlebox compatibility issues won't occur, it is therefore
887 * recommended to set this option.
888 *
889 * Comment to disable compatibility mode for TLS 1.3. If
Ronald Cron6f135e12021-12-08 16:57:54 +0100890 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
891 * effect on the build.
Ronald Cronab65c522021-11-24 10:47:20 +0100892 *
893 */
Ronald Cron27eb68d2024-03-15 16:13:37 +0100894#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
Ronald Cronab65c522021-11-24 10:47:20 +0100895
896/**
Ronald Crond8d2ea52022-10-04 15:48:06 +0200897 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
898 *
899 * Enable TLS 1.3 ephemeral key exchange mode.
900 *
Przemek Stekielce05f542023-06-15 16:44:08 +0200901 * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200902 * MBEDTLS_X509_CRT_PARSE_C
903 * and at least one of:
Janos Follath277bba82024-11-19 16:14:00 +0000904 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200905 * MBEDTLS_PKCS1_V21
Ronald Crond8d2ea52022-10-04 15:48:06 +0200906 *
907 * Comment to disable support for the ephemeral key exchange mode in TLS 1.3.
908 * If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
909 * effect on the build.
910 *
911 */
912#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
913
914/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000915 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
916 *
917 * Enable TLS 1.3 PSK key exchange mode.
918 *
919 * Comment to disable support for the PSK key exchange mode in TLS 1.3. If
920 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
921 * effect on the build.
922 *
923 */
924#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
925
926/**
Ronald Crond8d2ea52022-10-04 15:48:06 +0200927 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
928 *
929 * Enable TLS 1.3 PSK ephemeral key exchange mode.
930 *
Przemek Stekielce05f542023-06-15 16:44:08 +0200931 * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH
Ronald Crond8d2ea52022-10-04 15:48:06 +0200932 *
933 * Comment to disable support for the PSK ephemeral key exchange mode in
934 * TLS 1.3. If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not
935 * have any effect on the build.
936 *
937 */
938#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
939
940/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200941 * \def MBEDTLS_SSL_TLS_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000942 *
Paul Bakkere29ab062011-05-18 13:26:54 +0000943 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000944 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000945 * Module: library/ssl_tls.c
Ronald Cronde1adee2022-03-07 16:20:30 +0100946 * Caller: library/ssl*_client.c
947 * library/ssl*_server.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000948 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200949 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
950 * and at least one of the MBEDTLS_SSL_PROTO_XXX defines
Paul Bakker5690efc2011-05-26 13:16:06 +0000951 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000952 * This module is required for SSL/TLS.
953 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200954#define MBEDTLS_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000955
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000956/**
Minos Galanakis80e76b62024-12-12 15:46:29 +0000957 * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000958 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000959 * When this option is enabled, the SSL buffer will be resized automatically
960 * based on the negotiated maximum fragment length in each direction.
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +0100961 *
Minos Galanakis80e76b62024-12-12 15:46:29 +0000962 * Requires: MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakkerecd54fb2013-07-03 14:48:29 +0200963 */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000964//#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
Paul Bakker5121ce52009-01-03 21:22:43 +0000965
Minos Galanakis80e76b62024-12-12 15:46:29 +0000966//#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 +0200967//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
Minos Galanakis80e76b62024-12-12 15:46:29 +0000968//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
Angus Grattond8213d02016-05-25 20:56:48 +1000969
Gilles Peskined3d02902020-03-04 21:35:27 +0100970/** \def MBEDTLS_SSL_CID_IN_LEN_MAX
971 *
972 * The maximum length of CIDs used for incoming DTLS messages.
973 *
974 */
975//#define MBEDTLS_SSL_CID_IN_LEN_MAX 32
976
977/** \def MBEDTLS_SSL_CID_OUT_LEN_MAX
978 *
979 * The maximum length of CIDs used for outgoing DTLS messages.
980 *
981 */
982//#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32
983
TRodziewicze8dd7092021-05-12 14:19:11 +0200984/** \def MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY
Gilles Peskined3d02902020-03-04 21:35:27 +0100985 *
986 * This option controls the use of record plaintext padding
TRodziewicz1e660ed2021-05-26 17:08:54 +0200987 * in TLS 1.3 and when using the Connection ID extension in DTLS 1.2.
Hanno Becker13996922020-05-28 16:15:19 +0100988 *
989 * The padding will always be chosen so that the length of the
990 * padded plaintext is a multiple of the value of this option.
991 *
992 * Note: A value of \c 1 means that no padding will be used
993 * for outgoing records.
994 *
995 * Note: On systems lacking division instructions,
996 * a power of two should be preferred.
997 */
TRodziewicze8dd7092021-05-12 14:19:11 +0200998//#define MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY 16
Hanno Becker13996922020-05-28 16:15:19 +0100999
Minos Galanakis80e76b62024-12-12 15:46:29 +00001000/**
1001 * Complete list of ciphersuites to use, in order of preference.
1002 *
1003 * \warning No dependency checking is done on that field! This option can only
1004 * be used to restrict the set of available ciphersuites. It is your
1005 * responsibility to make sure the needed modules are active.
1006 *
1007 * Use this to save a few hundred bytes of ROM (default ordering of all
1008 * available ciphersuites) and a few to a few hundred bytes of RAM.
1009 *
1010 * The value below is only an example, not the default.
1011 */
1012//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
1013
1014//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
1015
1016/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING
1017 *
1018 * Maximum number of heap-allocated bytes for the purpose of
1019 * DTLS handshake message reassembly and future message buffering.
1020 *
1021 * This should be at least 9/8 * MBEDTLS_SSL_IN_CONTENT_LEN
1022 * to account for a reassembled handshake message of maximum size,
1023 * together with its reassembly bitmap.
1024 *
1025 * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default)
1026 * should be sufficient for all practical situations as it allows
1027 * to reassembly a large handshake message (such as a certificate)
1028 * while buffering multiple smaller handshake messages.
1029 *
1030 */
1031//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768
1032
1033/** \def MBEDTLS_SSL_IN_CONTENT_LEN
1034 *
1035 * Maximum length (in bytes) of incoming plaintext fragments.
1036 *
1037 * This determines the size of the incoming TLS I/O buffer in such a way
1038 * that it is capable of holding the specified amount of plaintext data,
1039 * regardless of the protection mechanism used.
1040 *
1041 * \note When using a value less than the default of 16KB on the client, it is
1042 * recommended to use the Maximum Fragment Length (MFL) extension to
1043 * inform the server about this limitation. On the server, there
1044 * is no supported, standardized way of informing the client about
1045 * restriction on the maximum size of incoming messages, and unless
1046 * the limitation has been communicated by other means, it is recommended
1047 * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN
1048 * while keeping the default value of 16KB for the incoming buffer.
1049 *
1050 * Uncomment to set the maximum plaintext size of the incoming I/O buffer.
1051 */
1052//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384
1053
1054/**
1055 * \def MBEDTLS_SSL_MAX_EARLY_DATA_SIZE
1056 *
1057 * The default maximum amount of 0-RTT data. See the documentation of
1058 * \c mbedtls_ssl_conf_max_early_data_size() for more information.
1059 *
1060 * It must be positive and smaller than UINT32_MAX.
1061 *
1062 * If MBEDTLS_SSL_EARLY_DATA is not defined, this default value does not
1063 * have any impact on the build.
1064 */
1065//#define MBEDTLS_SSL_MAX_EARLY_DATA_SIZE 1024
1066
Angus Grattond8213d02016-05-25 20:56:48 +10001067/** \def MBEDTLS_SSL_OUT_CONTENT_LEN
1068 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001069 * Maximum length (in bytes) of outgoing plaintext fragments.
Angus Grattond8213d02016-05-25 20:56:48 +10001070 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001071 * This determines the size of the outgoing TLS I/O buffer in such a way
1072 * that it is capable of holding the specified amount of plaintext data,
1073 * regardless of the protection mechanism used.
1074 *
Angus Grattond8213d02016-05-25 20:56:48 +10001075 * It is possible to save RAM by setting a smaller outward buffer, while keeping
1076 * the default inward 16384 byte buffer to conform to the TLS specification.
1077 *
1078 * The minimum required outward buffer size is determined by the handshake
1079 * protocol's usage. Handshaking will fail if the outward buffer is too small.
1080 * The specific size requirement depends on the configured ciphers and any
1081 * certificate data which is sent during the handshake.
1082 *
David Horstmann95d516f2021-05-04 18:36:56 +01001083 * Uncomment to set the maximum plaintext size of the outgoing I/O buffer.
Angus Grattond8213d02016-05-25 20:56:48 +10001084 */
1085//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384
1086
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001087/**
Minos Galanakis80e76b62024-12-12 15:46:29 +00001088 * \def MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001089 *
Minos Galanakis80e76b62024-12-12 15:46:29 +00001090 * Default number of NewSessionTicket messages to be sent by a TLS 1.3 server
1091 * after handshake completion. This is not used in TLS 1.2 and relevant only if
1092 * the MBEDTLS_SSL_SESSION_TICKETS option is enabled.
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001093 *
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001094 */
Minos Galanakis80e76b62024-12-12 15:46:29 +00001095//#define MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS 1
Tom Cosgrovea63775b2023-09-14 13:31:19 +01001096
1097/**
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001098 * \def MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE
1099 *
Jerry Yucf913512023-11-14 11:06:52 +08001100 * Maximum allowed ticket age difference in milliseconds tolerated between
Jerry Yu034a8b72023-11-10 12:20:19 +08001101 * server and client. Default value is 6000. This is not used in TLS 1.2.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001102 *
Jerry Yu034a8b72023-11-10 12:20:19 +08001103 * - The client ticket age is the time difference between the time when the
1104 * client proposes to the server to use the ticket and the time the client
1105 * received the ticket from the server.
1106 * - The server ticket age is the time difference between the time when the
1107 * server receives a proposition from the client to use the ticket and the
1108 * time when the ticket was created by the server.
1109 *
Jerry Yucf913512023-11-14 11:06:52 +08001110 * The ages might be different due to the client and server clocks not running
1111 * at the same pace. The typical accuracy of an RTC crystal is ±100 to ±20 parts
1112 * per million (360 to 72 milliseconds per hour). Default tolerance window is
1113 * 6s, thus in the worst case clients and servers must sync up their system time
1114 * every 6000/360/2~=8 hours.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001115 *
Jerry Yu04fceb72023-11-15 09:52:46 +08001116 * See section 8.3 of the TLS 1.3 specification(RFC 8446) for more information.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001117 */
Gilles Peskined65ea422023-09-05 21:07:32 +02001118//#define MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE 6000
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001119
Minos Galanakis1bf85a82024-12-12 16:29:38 +00001120/**
1121 * \def MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH
1122 *
1123 * Size in bytes of a ticket nonce. This is not used in TLS 1.2.
1124 *
1125 * This must be less than 256.
1126 */
1127//#define MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH 32
1128
Minos Galanakis80e76b62024-12-12 15:46:29 +00001129/** \} name SECTION: TLS feature selection */
1130
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001131/**
Minos Galanakis80e76b62024-12-12 15:46:29 +00001132 * \name SECTION: X.509 feature selection
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001133 *
Minos Galanakis80e76b62024-12-12 15:46:29 +00001134 * This section sets Certificate related options.
1135 * \{
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001136 */
Minos Galanakis80e76b62024-12-12 15:46:29 +00001137
1138/**
1139 * \def MBEDTLS_PKCS7_C
1140 *
1141 * Enable PKCS #7 core for using PKCS #7-formatted signatures.
1142 * RFC Link - https://tools.ietf.org/html/rfc2315
1143 *
1144 * Module: library/pkcs7.c
1145 *
1146 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C,
1147 * MBEDTLS_X509_CRT_PARSE_C MBEDTLS_X509_CRL_PARSE_C,
1148 * MBEDTLS_BIGNUM_C, MBEDTLS_MD_C
1149 *
1150 * This module is required for the PKCS #7 parsing modules.
1151 */
1152#define MBEDTLS_PKCS7_C
1153
1154/**
1155 * \def MBEDTLS_X509_CREATE_C
1156 *
1157 * Enable X.509 core for creating certificates.
1158 *
1159 * Module: library/x509_create.c
1160 *
1161 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C,
1162 *
1163 * \warning You must call psa_crypto_init() before doing any X.509 operation.
1164 *
1165 * This module is the basis for creating X.509 certificates and CSRs.
1166 */
1167#define MBEDTLS_X509_CREATE_C
1168
1169/**
1170 * \def MBEDTLS_X509_CRL_PARSE_C
1171 *
1172 * Enable X.509 CRL parsing.
1173 *
1174 * Module: library/x509_crl.c
1175 * Caller: library/x509_crt.c
1176 *
1177 * Requires: MBEDTLS_X509_USE_C
1178 *
1179 * This module is required for X.509 CRL parsing.
1180 */
1181#define MBEDTLS_X509_CRL_PARSE_C
1182
1183/**
1184 * \def MBEDTLS_X509_CRT_PARSE_C
1185 *
1186 * Enable X.509 certificate parsing.
1187 *
1188 * Module: library/x509_crt.c
1189 * Caller: library/ssl_tls.c
1190 * library/ssl*_client.c
1191 * library/ssl*_server.c
1192 *
1193 * Requires: MBEDTLS_X509_USE_C
1194 *
1195 * This module is required for X.509 certificate parsing.
1196 */
1197#define MBEDTLS_X509_CRT_PARSE_C
1198
1199/**
1200 * \def MBEDTLS_X509_CRT_WRITE_C
1201 *
1202 * Enable creating X.509 certificates.
1203 *
1204 * Module: library/x509_crt_write.c
1205 *
1206 * Requires: MBEDTLS_X509_CREATE_C
1207 *
1208 * This module is required for X.509 certificate creation.
1209 */
1210#define MBEDTLS_X509_CRT_WRITE_C
1211
1212/**
1213 * \def MBEDTLS_X509_CSR_PARSE_C
1214 *
1215 * Enable X.509 Certificate Signing Request (CSR) parsing.
1216 *
1217 * Module: library/x509_csr.c
1218 * Caller: library/x509_crt_write.c
1219 *
1220 * Requires: MBEDTLS_X509_USE_C
1221 *
1222 * This module is used for reading X.509 certificate request.
1223 */
1224#define MBEDTLS_X509_CSR_PARSE_C
1225
1226/**
1227 * \def MBEDTLS_X509_CSR_WRITE_C
1228 *
1229 * Enable creating X.509 Certificate Signing Requests (CSR).
1230 *
1231 * Module: library/x509_csr_write.c
1232 *
1233 * Requires: MBEDTLS_X509_CREATE_C
1234 *
1235 * This module is required for X.509 certificate request writing.
1236 */
1237#define MBEDTLS_X509_CSR_WRITE_C
1238
1239/**
1240 * \def MBEDTLS_X509_REMOVE_INFO
1241 *
1242 * Disable mbedtls_x509_*_info() and related APIs.
1243 *
1244 * Uncomment to omit mbedtls_x509_*_info(), as well as mbedtls_debug_print_crt()
1245 * and other functions/constants only used by these functions, thus reducing
1246 * the code footprint by several KB.
1247 */
1248//#define MBEDTLS_X509_REMOVE_INFO
1249
1250/**
1251 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
1252 *
1253 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
1254 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
1255 *
1256 * Requires: MBEDTLS_PKCS1_V21
1257 *
1258 * Comment this macro to disallow using RSASSA-PSS in certificates.
1259 */
1260#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
1261
1262/**
1263 * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1264 *
1265 * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()`
1266 * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure
1267 * the set of trusted certificates through a callback instead of a linked
1268 * list.
1269 *
1270 * This is useful for example in environments where a large number of trusted
1271 * certificates is present and storing them in a linked list isn't efficient
1272 * enough, or when the set of trusted certificates changes frequently.
1273 *
1274 * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and
1275 * `mbedtls_ssl_conf_ca_cb()` for more information.
1276 *
1277 * Requires: MBEDTLS_X509_CRT_PARSE_C
1278 *
1279 * Uncomment to enable trusted certificate callbacks.
1280 */
1281//#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
1282
1283/**
1284 * \def MBEDTLS_X509_USE_C
1285 *
1286 * Enable X.509 core for using certificates.
1287 *
1288 * Module: library/x509.c
1289 * Caller: library/x509_crl.c
1290 * library/x509_crt.c
1291 * library/x509_csr.c
1292 *
1293 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C
1294 *
1295 * \warning You must call psa_crypto_init() before doing any X.509 operation.
1296 *
1297 * This module is required for the X.509 parsing modules.
1298 */
1299#define MBEDTLS_X509_USE_C
1300
1301//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
1302//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
1303
1304/** \} name SECTION: X.509 feature selection */