blob: c4d62158be28530534ae17ebab3664b906774f02 [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/**
Paul Bakker0a62cd12011-01-21 11:00:08 +000025 * \name SECTION: System support
26 *
27 * This section sets system specific settings.
28 * \{
29 */
30
Paul Bakkerf3b86c12011-01-27 15:24:17 +000031/**
Gilles Peskinee820c0a2023-08-03 17:45:20 +020032 * \name SECTION: Mbed TLS feature support
Paul Bakker0a62cd12011-01-21 11:00:08 +000033 *
34 * This section sets support for features that are or are not needed
35 * within the modules that are enabled.
36 * \{
37 */
Paul Bakker5121ce52009-01-03 21:22:43 +000038
Paul Bakkerf3b86c12011-01-27 15:24:17 +000039/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020040 * \def MBEDTLS_TIMING_ALT
Paul Bakkerf2561b32014-02-06 15:11:55 +010041 *
TRodziewiczd8540832021-06-10 15:16:50 +020042 * Uncomment to provide your own alternate implementation for
Manuel Pégourié-Gonnarda63bc942015-05-14 18:22:47 +020043 * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay()
Paul Bakkerf2561b32014-02-06 15:11:55 +010044 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020045 * Only works if you have MBEDTLS_TIMING_C enabled.
Paul Bakkerf2561b32014-02-06 15:11:55 +010046 *
47 * You will need to provide a header "timing_alt.h" and an implementation at
48 * compile time.
49 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020050//#define MBEDTLS_TIMING_ALT
Paul Bakkerf2561b32014-02-06 15:11:55 +010051
Paul Bakker90995b52013-06-24 19:20:35 +020052/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020053 * \def MBEDTLS_CIPHER_NULL_CIPHER
Paul Bakkerfab5c822012-02-06 16:45:10 +000054 *
55 * Enable NULL cipher.
56 * Warning: Only do so when you know what you are doing. This allows for
57 * encryption or channels without any security!
58 *
Ronald Croncee42702021-04-26 11:34:44 +020059 * To enable the following ciphersuites:
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020060 * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA
61 * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA
62 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA
63 * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA
64 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384
65 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256
66 * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA
67 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384
68 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256
69 * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA
70 * MBEDTLS_TLS_RSA_WITH_NULL_SHA256
71 * MBEDTLS_TLS_RSA_WITH_NULL_SHA
72 * MBEDTLS_TLS_RSA_WITH_NULL_MD5
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020073 * MBEDTLS_TLS_PSK_WITH_NULL_SHA384
74 * MBEDTLS_TLS_PSK_WITH_NULL_SHA256
75 * MBEDTLS_TLS_PSK_WITH_NULL_SHA
Paul Bakkerfab5c822012-02-06 16:45:10 +000076 *
77 * Uncomment this macro to enable the NULL cipher and ciphersuites
Paul Bakkerfab5c822012-02-06 16:45:10 +000078 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020079//#define MBEDTLS_CIPHER_NULL_CIPHER
Paul Bakkerfab5c822012-02-06 16:45:10 +000080
81/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020082 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
Paul Bakkerd4a56ec2013-04-16 18:05:29 +020083 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +020084 * Enable the PSK based ciphersuite modes in SSL / TLS.
Paul Bakkerd4a56ec2013-04-16 18:05:29 +020085 *
Paul Bakkere07f41d2013-04-19 09:08:57 +020086 * This enables the following ciphersuites (if other requisites are
87 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020088 * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
89 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
90 * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
91 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
92 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
93 * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
94 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
95 * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
96 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
97 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakkerd4a56ec2013-04-16 18:05:29 +020098 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020099#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200100
101/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200102 * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200103 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200104 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200105 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200106 * Requires: MBEDTLS_DHM_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200107 *
108 * This enables the following ciphersuites (if other requisites are
109 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200110 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
111 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
112 * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
113 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384
114 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
115 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
116 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
117 * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
118 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256
119 * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
Hanno Beckera2f6b722017-09-28 10:33:29 +0100120 *
Hanno Beckerf9734b32017-10-03 12:09:22 +0100121 * \warning Using DHE constitutes a security risk as it
122 * is not possible to validate custom DH parameters.
123 * If possible, it is recommended users should consider
124 * preferring other methods of key exchange.
125 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +0100126 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200127 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200128#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200129
130/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200131 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
Manuel Pégourié-Gonnard3ce3bbd2013-10-11 16:53:50 +0200132 *
133 * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
134 *
Janos Follath277bba82024-11-19 16:14:00 +0000135 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard3ce3bbd2013-10-11 16:53:50 +0200136 *
137 * This enables the following ciphersuites (if other requisites are
138 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200139 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
140 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
141 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384
142 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
143 * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
144 * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
Manuel Pégourié-Gonnard3ce3bbd2013-10-11 16:53:50 +0200145 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200146#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
Manuel Pégourié-Gonnard3ce3bbd2013-10-11 16:53:50 +0200147
148/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200149 * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200150 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200151 * Enable the RSA-only based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200152 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200153 * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
154 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200155 *
156 * This enables the following ciphersuites (if other requisites are
157 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200158 * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
159 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
160 * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
161 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384
162 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
163 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
164 * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
165 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
166 * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
167 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256
168 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
169 * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
Paul Bakkere07f41d2013-04-19 09:08:57 +0200170 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200171#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200172
173/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200174 * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200175 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200176 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200177 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200178 * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
179 * MBEDTLS_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200180 *
181 * This enables the following ciphersuites (if other requisites are
182 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200183 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
184 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
185 * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
186 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
187 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
188 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
189 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
190 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
191 * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
192 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
193 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
194 * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
Hanno Beckera2f6b722017-09-28 10:33:29 +0100195 *
Hanno Beckerf9734b32017-10-03 12:09:22 +0100196 * \warning Using DHE constitutes a security risk as it
197 * is not possible to validate custom DH parameters.
198 * If possible, it is recommended users should consider
199 * preferring other methods of key exchange.
200 * See dhm.h for more details.
Hanno Beckera2f6b722017-09-28 10:33:29 +0100201 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200202 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200203#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200204
205/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200206 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200207 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200208 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200209 *
Janos Follath277bba82024-11-19 16:14:00 +0000210 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200211 * MBEDTLS_RSA_C
212 * MBEDTLS_PKCS1_V15
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200213 * MBEDTLS_X509_CRT_PARSE_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_ECDHE_RSA_WITH_AES_256_GCM_SHA384
218 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
219 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
220 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
221 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
222 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
223 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
224 * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
225 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
226 * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
Paul Bakkere07f41d2013-04-19 09:08:57 +0200227 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200228#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200229
230/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200231 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200232 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200233 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200234 *
Janos Follath277bba82024-11-19 16:14:00 +0000235 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
236 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200237 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200238 *
239 * This enables the following ciphersuites (if other requisites are
240 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200241 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
242 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
243 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
244 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
245 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
246 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
247 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
248 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
249 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
250 * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200251 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200252#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200253
254/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200255 * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100256 *
257 * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
258 *
Janos Follath277bba82024-11-19 16:14:00 +0000259 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
260 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200261 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100262 *
263 * This enables the following ciphersuites (if other requisites are
264 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200265 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
266 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
267 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
268 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
269 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
270 * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
271 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
272 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
273 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
274 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100275 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200276#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100277
278/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200279 * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100280 *
281 * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS.
282 *
Janos Follath277bba82024-11-19 16:14:00 +0000283 * Requires: MBEDTLS_ECDH_C or PSA_WANT_ALG_ECDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200284 * MBEDTLS_RSA_C
285 * MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100286 *
287 * This enables the following ciphersuites (if other requisites are
288 * enabled as well):
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200289 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
290 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
291 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
292 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
293 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
294 * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
295 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
296 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
297 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
298 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100299 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200300#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
Manuel Pégourié-Gonnard25781b22013-12-11 16:17:10 +0100301
302/**
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200303 * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
304 *
305 * Enable the ECJPAKE based ciphersuite modes in SSL / TLS.
306 *
Manuel Pégourié-Gonnard75df9022015-09-16 23:21:01 +0200307 * \warning This is currently experimental. EC J-PAKE support is based on the
308 * Thread v1.0.0 specification; incompatible changes to the specification
309 * might still happen. For this reason, this is disabled by default.
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200310 *
Janos Follath277bba82024-11-19 16:14:00 +0000311 * Requires: MBEDTLS_ECJPAKE_C or PSA_WANT_ALG_JPAKE
Manuel Pégourié-Gonnard41bc8b62023-03-14 23:59:24 +0100312 * SHA-256 (via MBEDTLS_SHA256_C or a PSA driver)
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200313 * MBEDTLS_ECP_DP_SECP256R1_ENABLED
314 *
315 * This enables the following ciphersuites (if other requisites are
316 * enabled as well):
317 * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
318 */
Manuel Pégourié-Gonnardcf828932015-10-20 14:57:00 +0200319//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200320
321/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200322 * \def MBEDTLS_ERROR_STRERROR_DUMMY
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100323 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200324 * Enable a dummy error function to make use of mbedtls_strerror() in
325 * third party libraries easier when MBEDTLS_ERROR_C is disabled
326 * (no effect when MBEDTLS_ERROR_C is enabled).
Manuel Pégourié-Gonnarddc16aa72014-06-25 12:55:12 +0200327 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200328 * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're
329 * not using mbedtls_strerror() or error_strerror() in your application.
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100330 *
331 * Disable if you run into name conflicts and want to really remove the
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200332 * mbedtls_strerror()
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100333 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200334#define MBEDTLS_ERROR_STRERROR_DUMMY
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100335
336/**
Gilles Peskine9e9e1f62024-05-31 18:38:36 +0200337 * \def MBEDTLS_PSA_KEY_STORE_DYNAMIC
338 *
339 * Dynamically resize the PSA key store to accommodate any number of
340 * volatile keys (until the heap memory is exhausted).
341 *
342 * If this option is disabled, the key store has a fixed size
343 * #MBEDTLS_PSA_KEY_SLOT_COUNT for volatile keys and loaded persistent keys
344 * together.
345 *
346 * This option has no effect when #MBEDTLS_PSA_CRYPTO_C is disabled.
347 *
348 * Module: library/psa_crypto.c
349 * Requires: MBEDTLS_PSA_CRYPTO_C
350 */
351#define MBEDTLS_PSA_KEY_STORE_DYNAMIC
352
353/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200354 * \def MBEDTLS_SELF_TEST
Paul Bakker15566e42011-04-24 21:19:15 +0000355 *
356 * Enable the checkup functions (*_self_test).
357 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200358#define MBEDTLS_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000359
360/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200361 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
Paul Bakker40865c82013-01-31 17:13:13 +0100362 *
363 * Enable sending of alert messages in case of encountered errors as per RFC.
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200364 * If you choose not to send the alert messages, Mbed TLS can still communicate
Paul Bakker40865c82013-01-31 17:13:13 +0100365 * with other servers, only debugging of failures is harder.
366 *
367 * The advantage of not sending alert messages, is that no information is given
368 * about reasons for failures thus preventing adversaries of gaining intel.
369 *
370 * Enable sending of all alert messages
371 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200372#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
Paul Bakker40865c82013-01-31 17:13:13 +0100373
374/**
Gilles Peskined3d02902020-03-04 21:35:27 +0100375 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID
376 *
Hannes Tschofenige2c46e02022-11-23 10:44:11 +0100377 * Enable support for the DTLS Connection ID (CID) extension,
Gilles Peskined3d02902020-03-04 21:35:27 +0100378 * which allows to identify DTLS connections across changes
Hannes Tschofenige2c46e02022-11-23 10:44:11 +0100379 * in the underlying transport. The CID functionality is described
380 * in RFC 9146.
Gilles Peskined3d02902020-03-04 21:35:27 +0100381 *
382 * Setting this option enables the SSL APIs `mbedtls_ssl_set_cid()`,
Paul Elliott0113cf12022-03-11 20:26:47 +0000383 * mbedtls_ssl_get_own_cid()`, `mbedtls_ssl_get_peer_cid()` and
384 * `mbedtls_ssl_conf_cid()`. See the corresponding documentation for
385 * more information.
Gilles Peskined3d02902020-03-04 21:35:27 +0100386 *
Gilles Peskined3d02902020-03-04 21:35:27 +0100387 * The maximum lengths of outgoing and incoming CIDs can be configured
388 * through the options
389 * - MBEDTLS_SSL_CID_OUT_LEN_MAX
390 * - MBEDTLS_SSL_CID_IN_LEN_MAX.
391 *
392 * Requires: MBEDTLS_SSL_PROTO_DTLS
393 *
394 * Uncomment to enable the Connection ID extension.
395 */
Hannes Tschofenigfd6cca42021-10-12 09:22:33 +0200396#define MBEDTLS_SSL_DTLS_CONNECTION_ID
397
398
399/**
400 * \def MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT
401 *
402 * Defines whether RFC 9146 (default) or the legacy version
403 * (version draft-ietf-tls-dtls-connection-id-05,
404 * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05)
405 * is used.
406 *
407 * Set the value to 0 for the standard version, and
408 * 1 for the legacy draft version.
409 *
Hannes Tschofenige2c46e02022-11-23 10:44:11 +0100410 * \deprecated Support for the legacy version of the DTLS
411 * Connection ID feature is deprecated. Please
412 * switch to the standardized version defined
413 * in RFC 9146 enabled by utilizing
414 * MBEDTLS_SSL_DTLS_CONNECTION_ID without use
415 * of MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT.
416 *
Hannes Tschofenigfd6cca42021-10-12 09:22:33 +0200417 * Requires: MBEDTLS_SSL_DTLS_CONNECTION_ID
418 */
419#define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 0
Gilles Peskined3d02902020-03-04 21:35:27 +0100420
421/**
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200422 * \def MBEDTLS_SSL_ASYNC_PRIVATE
423 *
424 * Enable asynchronous external private key operations in SSL. This allows
425 * you to configure an SSL connection to call an external cryptographic
426 * module to perform private key operations instead of performing the
427 * operation inside the library.
428 *
Valerio Setti8841d6b2023-01-05 08:40:24 +0100429 * Requires: MBEDTLS_X509_CRT_PARSE_C
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200430 */
Jaeden Amerod9c71da2018-06-15 20:31:26 +0100431//#define MBEDTLS_SSL_ASYNC_PRIVATE
Gilles Peskineb74a1c72018-04-24 13:09:22 +0200432
433/**
Gilles Peskined3d02902020-03-04 21:35:27 +0100434 * \def MBEDTLS_SSL_CONTEXT_SERIALIZATION
435 *
436 * Enable serialization of the TLS context structures, through use of the
437 * functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load().
438 *
439 * This pair of functions allows one side of a connection to serialize the
440 * context associated with the connection, then free or re-use that context
441 * while the serialized state is persisted elsewhere, and finally deserialize
442 * that state to a live context for resuming read/write operations on the
443 * connection. From a protocol perspective, the state of the connection is
444 * unaffected, in particular this is entirely transparent to the peer.
445 *
446 * Note: this is distinct from TLS session resumption, which is part of the
447 * protocol and fully visible by the peer. TLS session resumption enables
448 * establishing new connections associated to a saved session with shorter,
449 * lighter handshakes, while context serialization is a local optimization in
450 * handling a single, potentially long-lived connection.
451 *
452 * Enabling these APIs makes some SSL structures larger, as 64 extra bytes are
453 * saved after the handshake to allow for more efficient serialization, so if
454 * you don't need this feature you'll save RAM by disabling it.
455 *
Przemek Stekiel460192e2022-10-03 08:55:29 +0200456 * Requires: MBEDTLS_GCM_C or MBEDTLS_CCM_C or MBEDTLS_CHACHAPOLY_C
457 *
Gilles Peskined3d02902020-03-04 21:35:27 +0100458 * Comment to disable the context serialization APIs.
459 */
460#define MBEDTLS_SSL_CONTEXT_SERIALIZATION
461
462/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200463 * \def MBEDTLS_SSL_DEBUG_ALL
Paul Bakkerd66f0702013-01-31 16:57:45 +0100464 *
465 * Enable the debug messages in SSL module for all issues.
466 * Debug messages have been disabled in some places to prevent timing
467 * attacks due to (unbalanced) debugging function calls.
468 *
469 * If you need all error reporting you should enable this during debugging,
470 * but remove this for production servers that should log as well.
471 *
472 * Uncomment this macro to report all debug messages on errors introducing
473 * a timing side-channel.
474 *
Paul Bakkerd66f0702013-01-31 16:57:45 +0100475 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200476//#define MBEDTLS_SSL_DEBUG_ALL
Paul Bakkerd66f0702013-01-31 16:57:45 +0100477
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200478/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100479 *
480 * Enable support for Encrypt-then-MAC, RFC 7366.
481 *
482 * This allows peers that both support it to use a more robust protection for
483 * ciphersuites using CBC, providing deep resistance against timing attacks
484 * on the padding or underlying cipher.
485 *
486 * This only affects CBC ciphersuites, and is useless if none is defined.
487 *
TRodziewicz0f82ec62021-05-12 17:49:18 +0200488 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100489 *
490 * Comment this macro to disable support for Encrypt-then-MAC
491 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200492#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100493
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200494/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200495 *
Manuel Pégourié-Gonnardbca8aa02020-03-24 12:11:49 +0100496 * Enable support for RFC 7627: Session Hash and Extended Master Secret
497 * Extension.
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200498 *
Shaun Case8b0ecbc2021-12-20 21:14:10 -0800499 * This was introduced as "the proper fix" to the Triple Handshake family of
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200500 * attacks, but it is recommended to always use it (even if you disable
501 * renegotiation), since it actually fixes a more fundamental issue in the
502 * original SSL/TLS design, and has implications beyond Triple Handshake.
503 *
TRodziewicz0f82ec62021-05-12 17:49:18 +0200504 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard769c6b62014-10-28 14:13:55 +0100505 *
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200506 * Comment this macro to disable support for Extended Master Secret.
507 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200508#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Manuel Pégourié-Gonnard367381f2014-10-20 18:40:56 +0200509
Paul Bakkerd66f0702013-01-31 16:57:45 +0100510/**
Hanno Beckerbb278f52019-02-05 17:04:00 +0000511 * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
512 *
Hanno Beckerfd7f2982019-02-25 10:13:33 +0000513 * This option controls the availability of the API mbedtls_ssl_get_peer_cert()
Hanno Beckerbb278f52019-02-05 17:04:00 +0000514 * giving access to the peer's certificate after completion of the handshake.
515 *
516 * Unless you need mbedtls_ssl_peer_cert() in your application, it is
517 * recommended to disable this option for reduced RAM usage.
518 *
519 * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still
520 * defined, but always returns \c NULL.
521 *
522 * \note This option has no influence on the protection against the
523 * triple handshake attack. Even if it is disabled, Mbed TLS will
524 * still ensure that certificates do not change during renegotiation,
Shaun Case8b0ecbc2021-12-20 21:14:10 -0800525 * for example by keeping a hash of the peer's certificate.
Hanno Beckerbb278f52019-02-05 17:04:00 +0000526 *
Tom Cosgroveafb2fe12022-06-29 16:36:12 +0100527 * \note This option is required if MBEDTLS_SSL_PROTO_TLS1_3 is set.
Hanno Beckerbb278f52019-02-05 17:04:00 +0000528 *
529 * Comment this macro to disable storing the peer's certificate
530 * after the handshake.
531 */
532#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
533
534/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200535 * \def MBEDTLS_SSL_RENEGOTIATION
Manuel Pégourié-Gonnard615e6772014-11-03 08:23:14 +0100536 *
Hanno Becker0eb8fb82018-10-26 09:53:16 +0100537 * Enable support for TLS renegotiation.
Manuel Pégourié-Gonnard615e6772014-11-03 08:23:14 +0100538 *
539 * The two main uses of renegotiation are (1) refresh keys on long-lived
540 * connections and (2) client authentication after the initial handshake.
541 * If you don't need renegotiation, it's probably better to disable it, since
542 * it has been associated with security issues in the past and is easy to
543 * misuse/misunderstand.
Manuel Pégourié-Gonnard03717042014-11-04 19:52:10 +0100544 *
jnmeurisse83f0a652023-09-16 18:12:18 +0200545 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
546 *
Manuel Pégourié-Gonnard55f968b2015-03-09 16:23:15 +0000547 * Comment this to disable support for renegotiation.
Hanno Becker6851b102017-10-12 14:57:48 +0100548 *
549 * \note Even if this option is disabled, both client and server are aware
550 * of the Renegotiation Indication Extension (RFC 5746) used to
551 * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1).
552 * (See \c mbedtls_ssl_conf_legacy_renegotiation for the
553 * configuration of this extension).
554 *
Manuel Pégourié-Gonnard615e6772014-11-03 08:23:14 +0100555 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200556#define MBEDTLS_SSL_RENEGOTIATION
Manuel Pégourié-Gonnard615e6772014-11-03 08:23:14 +0100557
558/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200559 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakker05decb22013-08-15 13:33:48 +0200560 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200561 * Enable support for RFC 6066 max_fragment_length extension in SSL.
Paul Bakker05decb22013-08-15 13:33:48 +0200562 *
563 * Comment this macro to disable support for the max_fragment_length extension
564 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200565#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Paul Bakker05decb22013-08-15 13:33:48 +0200566
567/**
Jan Bruckner151f6422023-02-10 12:45:19 +0100568 * \def MBEDTLS_SSL_RECORD_SIZE_LIMIT
569 *
Jan Brucknera0589e72023-03-15 11:04:45 +0100570 * Enable support for RFC 8449 record_size_limit extension in SSL (TLS 1.3 only).
Jan Bruckner151f6422023-02-10 12:45:19 +0100571 *
Jan Bruckner151f6422023-02-10 12:45:19 +0100572 * Requires: MBEDTLS_SSL_PROTO_TLS1_3
573 *
574 * Uncomment this macro to enable support for the record_size_limit extension
575 */
576//#define MBEDTLS_SSL_RECORD_SIZE_LIMIT
577
578/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200579 * \def MBEDTLS_SSL_PROTO_TLS1_2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200580 *
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100581 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200582 *
Janos Follath277bba82024-11-19 16:14:00 +0000583 * Requires: PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_384
Andrzej Kureke02da812022-08-17 17:04:49 -0400584 *
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100585 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200586 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200587#define MBEDTLS_SSL_PROTO_TLS1_2
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200588
589/**
Ronald Cron6f135e12021-12-08 16:57:54 +0100590 * \def MBEDTLS_SSL_PROTO_TLS1_3
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100591 *
Ronald Cron6f135e12021-12-08 16:57:54 +0100592 * Enable support for TLS 1.3.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100593 *
Gilles Peskineda69eaa2023-09-05 20:54:17 +0200594 * \note See docs/architecture/tls13-support.md for a description of the TLS
Ronald Cron6f135e12021-12-08 16:57:54 +0100595 * 1.3 support that this option enables.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100596 *
Tom Cosgroveafb2fe12022-06-29 16:36:12 +0100597 * Requires: MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
Manuel Pégourié-Gonnard3e830982022-05-11 13:27:44 +0200598 * Requires: MBEDTLS_PSA_CRYPTO_C
Ronald Cron6f135e12021-12-08 16:57:54 +0100599 *
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100600 * Uncomment this macro to enable the support for TLS 1.3.
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100601 */
Ronald Cron27eb68d2024-03-15 16:13:37 +0100602#define MBEDTLS_SSL_PROTO_TLS1_3
Hanno Becker9fc15ea2020-05-04 12:00:47 +0100603
604/**
Ronald Cronab65c522021-11-24 10:47:20 +0100605 * \def MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
606 *
607 * Enable TLS 1.3 middlebox compatibility mode.
608 *
609 * As specified in Section D.4 of RFC 8446, TLS 1.3 offers a compatibility
610 * mode to make a TLS 1.3 connection more likely to pass through middle boxes
611 * expecting TLS 1.2 traffic.
612 *
613 * Turning on the compatibility mode comes at the cost of a few added bytes
614 * on the wire, but it doesn't affect compatibility with TLS 1.3 implementations
615 * that don't use it. Therefore, unless transmission bandwidth is critical and
616 * you know that middlebox compatibility issues won't occur, it is therefore
617 * recommended to set this option.
618 *
619 * Comment to disable compatibility mode for TLS 1.3. If
Ronald Cron6f135e12021-12-08 16:57:54 +0100620 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
621 * effect on the build.
Ronald Cronab65c522021-11-24 10:47:20 +0100622 *
623 */
Ronald Cron27eb68d2024-03-15 16:13:37 +0100624#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
Ronald Cronab65c522021-11-24 10:47:20 +0100625
626/**
Ronald Crond8d2ea52022-10-04 15:48:06 +0200627 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
628 *
629 * Enable TLS 1.3 PSK key exchange mode.
630 *
631 * Comment to disable support for the PSK key exchange mode in TLS 1.3. If
632 * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
633 * effect on the build.
634 *
635 */
636#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
637
638/**
639 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
640 *
641 * Enable TLS 1.3 ephemeral key exchange mode.
642 *
Przemek Stekielce05f542023-06-15 16:44:08 +0200643 * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200644 * MBEDTLS_X509_CRT_PARSE_C
645 * and at least one of:
Janos Follath277bba82024-11-19 16:14:00 +0000646 * MBEDTLS_ECDSA_C or PSA_WANT_ALG_ECDSA
Manuel Pégourié-Gonnard4fa702a2023-03-29 12:15:24 +0200647 * MBEDTLS_PKCS1_V21
Ronald Crond8d2ea52022-10-04 15:48:06 +0200648 *
649 * Comment to disable support for the ephemeral key exchange mode in TLS 1.3.
650 * If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any
651 * effect on the build.
652 *
653 */
654#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
655
656/**
657 * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
658 *
659 * Enable TLS 1.3 PSK ephemeral key exchange mode.
660 *
Przemek Stekielce05f542023-06-15 16:44:08 +0200661 * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH
Ronald Crond8d2ea52022-10-04 15:48:06 +0200662 *
663 * Comment to disable support for the PSK ephemeral key exchange mode in
664 * TLS 1.3. If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not
665 * have any effect on the build.
666 *
667 */
668#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
669
670/**
Gilles Peskine449bd832023-01-11 14:50:10 +0100671 * \def MBEDTLS_SSL_EARLY_DATA
672 *
673 * Enable support for RFC 8446 TLS 1.3 early data.
674 *
675 * Requires: MBEDTLS_SSL_SESSION_TICKETS and either
676 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED or
677 * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
678 *
679 * Comment this to disable support for early data. If MBEDTLS_SSL_PROTO_TLS1_3
680 * is not enabled, this option does not have any effect on the build.
681 *
Tom Cosgrovea63775b2023-09-14 13:31:19 +0100682 * \note The maximum amount of early data can be set with
683 * MBEDTLS_SSL_MAX_EARLY_DATA_SIZE.
684 *
Gilles Peskine449bd832023-01-11 14:50:10 +0100685 */
Ronald Cronc2e110f2022-11-22 09:01:46 +0100686//#define MBEDTLS_SSL_EARLY_DATA
Xiaokang Qian54413b12022-10-20 05:57:03 +0000687
688/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200689 * \def MBEDTLS_SSL_PROTO_DTLS
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100690 *
691 * Enable support for DTLS (all available versions).
692 *
TRodziewicz0f82ec62021-05-12 17:49:18 +0200693 * Enable this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2.
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100694 *
TRodziewicz0f82ec62021-05-12 17:49:18 +0200695 * Requires: MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100696 *
697 * Comment this macro to disable support for DTLS
698 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200699#define MBEDTLS_SSL_PROTO_DTLS
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100700
701/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200702 * \def MBEDTLS_SSL_ALPN
Manuel Pégourié-Gonnard7e250d42014-04-04 16:08:41 +0200703 *
Manuel Pégourié-Gonnard6b298e62014-11-20 18:28:50 +0100704 * Enable support for RFC 7301 Application Layer Protocol Negotiation.
Manuel Pégourié-Gonnard7e250d42014-04-04 16:08:41 +0200705 *
Paul Bakker27e36d32014-04-08 12:33:37 +0200706 * Comment this macro to disable support for ALPN.
Manuel Pégourié-Gonnard7e250d42014-04-04 16:08:41 +0200707 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200708#define MBEDTLS_SSL_ALPN
Manuel Pégourié-Gonnard7e250d42014-04-04 16:08:41 +0200709
710/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200711 * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY
Manuel Pégourié-Gonnard8464a462014-09-24 14:05:32 +0200712 *
713 * Enable support for the anti-replay mechanism in DTLS.
714 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200715 * Requires: MBEDTLS_SSL_TLS_C
716 * MBEDTLS_SSL_PROTO_DTLS
Manuel Pégourié-Gonnard8464a462014-09-24 14:05:32 +0200717 *
Manuel Pégourié-Gonnarda6fcffe2014-10-13 18:15:52 +0200718 * \warning Disabling this is often a security risk!
Manuel Pégourié-Gonnard6729e792015-05-11 09:50:24 +0200719 * See mbedtls_ssl_conf_dtls_anti_replay() for details.
Manuel Pégourié-Gonnarda6fcffe2014-10-13 18:15:52 +0200720 *
Manuel Pégourié-Gonnard8464a462014-09-24 14:05:32 +0200721 * Comment this to disable anti-replay in DTLS.
722 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200723#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
Manuel Pégourié-Gonnard8464a462014-09-24 14:05:32 +0200724
725/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200726 * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY
Manuel Pégourié-Gonnard82202f02014-07-23 00:28:58 +0200727 *
728 * Enable support for HelloVerifyRequest on DTLS servers.
729 *
730 * This feature is highly recommended to prevent DTLS servers being used as
731 * amplifiers in DoS attacks against other hosts. It should always be enabled
732 * unless you know for sure amplification cannot be a problem in the
733 * environment in which your server operates.
734 *
Andrzej Kurek5c65c572022-04-13 14:28:52 -0400735 * \warning Disabling this can be a security risk! (see above)
Manuel Pégourié-Gonnarda6fcffe2014-10-13 18:15:52 +0200736 *
Manuel Pégourié-Gonnarde057d3b2015-05-20 10:59:43 +0200737 * Requires: MBEDTLS_SSL_PROTO_DTLS
Manuel Pégourié-Gonnard82202f02014-07-23 00:28:58 +0200738 *
739 * Comment this to disable support for HelloVerifyRequest.
740 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200741#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
Manuel Pégourié-Gonnard82202f02014-07-23 00:28:58 +0200742
743/**
Johan Pascalb62bb512015-12-03 21:56:45 +0100744 * \def MBEDTLS_SSL_DTLS_SRTP
745 *
Tobias Nießen1e8ca122021-05-10 19:53:15 +0200746 * Enable support for negotiation of DTLS-SRTP (RFC 5764)
Johan Pascal842d6712020-09-23 13:34:40 +0200747 * through the use_srtp extension.
748 *
749 * \note This feature provides the minimum functionality required
750 * to negotiate the use of DTLS-SRTP and to allow the derivation of
751 * the associated SRTP packet protection key material.
752 * In particular, the SRTP packet protection itself, as well as the
753 * demultiplexing of RTP and DTLS packets at the datagram layer
754 * (see Section 5 of RFC 5764), are not handled by this feature.
755 * Instead, after successful completion of a handshake negotiating
756 * the use of DTLS-SRTP, the extended key exporter API
Hanno Becker2d6e6f82021-05-24 10:58:31 +0100757 * mbedtls_ssl_conf_export_keys_cb() should be used to implement
Johan Pascal842d6712020-09-23 13:34:40 +0200758 * the key exporter described in Section 4.2 of RFC 5764 and RFC 5705
759 * (this is implemented in the SSL example programs).
760 * The resulting key should then be passed to an SRTP stack.
761 *
762 * Setting this option enables the runtime API
763 * mbedtls_ssl_conf_dtls_srtp_protection_profiles()
764 * through which the supported DTLS-SRTP protection
765 * profiles can be configured. You must call this API at
766 * runtime if you wish to negotiate the use of DTLS-SRTP.
Johan Pascalb62bb512015-12-03 21:56:45 +0100767 *
768 * Requires: MBEDTLS_SSL_PROTO_DTLS
769 *
Ron Eldor9cfb5eb2018-12-10 15:30:14 +0200770 * Uncomment this to enable support for use_srtp extension.
Johan Pascalb62bb512015-12-03 21:56:45 +0100771 */
Ron Eldor9cfb5eb2018-12-10 15:30:14 +0200772//#define MBEDTLS_SSL_DTLS_SRTP
Johan Pascalb62bb512015-12-03 21:56:45 +0100773
774/**
Manuel Pégourié-Gonnard26d227d2015-09-04 10:53:25 +0200775 * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
776 *
777 * Enable server-side support for clients that reconnect from the same port.
778 *
779 * Some clients unexpectedly close the connection and try to reconnect using the
780 * same source port. This needs special support from the server to handle the
Simon Butcher4f6882a2015-09-11 17:12:46 +0100781 * new connection securely, as described in section 4.2.8 of RFC 6347. This
Manuel Pégourié-Gonnard26d227d2015-09-04 10:53:25 +0200782 * flag enables that support.
783 *
Manuel Pégourié-Gonnard62c74bb2015-09-08 17:50:29 +0200784 * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY
Manuel Pégourié-Gonnard62c74bb2015-09-08 17:50:29 +0200785 *
Manuel Pégourié-Gonnard26d227d2015-09-04 10:53:25 +0200786 * Comment this to disable support for clients reusing the source port.
787 */
788#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
789
790/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200791 * \def MBEDTLS_SSL_SESSION_TICKETS
Paul Bakkera503a632013-08-14 13:48:06 +0200792 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200793 * Enable support for RFC 5077 session tickets in SSL.
Antonin Décimo36e89b52019-01-23 15:24:37 +0100794 * Client-side, provides full support for session tickets (maintenance of a
Manuel Pégourié-Gonnard0c0f11f2015-05-20 09:55:50 +0200795 * session store remains the responsibility of the application, though).
796 * Server-side, you also need to provide callbacks for writing and parsing
797 * tickets, including authenticated encryption and key management. Example
798 * callbacks are provided by MBEDTLS_SSL_TICKET_C.
Paul Bakkera503a632013-08-14 13:48:06 +0200799 *
800 * Comment this macro to disable support for SSL session tickets
801 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200802#define MBEDTLS_SSL_SESSION_TICKETS
Paul Bakkera503a632013-08-14 13:48:06 +0200803
804/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200805 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
Paul Bakker0be444a2013-08-27 21:55:01 +0200806 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200807 * Enable support for RFC 6066 server name indication (SNI) in SSL.
Paul Bakker0be444a2013-08-27 21:55:01 +0200808 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200809 * Requires: MBEDTLS_X509_CRT_PARSE_C
Manuel Pégourié-Gonnardbbbb3cf2015-01-28 16:44:37 +0000810 *
Paul Bakker0be444a2013-08-27 21:55:01 +0200811 * Comment this macro to disable support for server name indication in SSL
812 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200813#define MBEDTLS_SSL_SERVER_NAME_INDICATION
Paul Bakker0be444a2013-08-27 21:55:01 +0200814
815/**
Gilles Peskinef03bd812020-03-23 18:13:58 +0100816 * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
817 *
Andrzej Kurek2a54a6f2021-01-07 08:13:49 -0500818 * When this option is enabled, the SSL buffer will be resized automatically
819 * based on the negotiated maximum fragment length in each direction.
Andrzej Kurek557289b2020-10-21 15:12:39 +0200820 *
821 * Requires: MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
Gilles Peskinef03bd812020-03-23 18:13:58 +0100822 */
823//#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
824
825/**
Manuel Pégourié-Gonnard6240def2020-07-10 09:35:54 +0200826 * \def MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
827 *
828 * Enable testing of the constant-flow nature of some sensitive functions with
829 * clang's MemorySanitizer. This causes some existing tests to also test
Manuel Pégourié-Gonnarddd00bfc2020-08-24 12:58:36 +0200830 * this non-functional property of the code under test.
Manuel Pégourié-Gonnard6240def2020-07-10 09:35:54 +0200831 *
Manuel Pégourié-Gonnarddd00bfc2020-08-24 12:58:36 +0200832 * This setting requires compiling with clang -fsanitize=memory. The test
833 * suites can then be run normally.
Manuel Pégourié-Gonnard6240def2020-07-10 09:35:54 +0200834 *
Manuel Pégourié-Gonnard8ff863b2020-07-31 12:59:34 +0200835 * \warning This macro is only used for extended testing; it is not considered
836 * part of the library's API, so it may change or disappear at any time.
837 *
Manuel Pégourié-Gonnard390fb4f2020-07-24 11:08:40 +0200838 * Uncomment to enable testing of the constant-flow nature of selected code.
Manuel Pégourié-Gonnard6240def2020-07-10 09:35:54 +0200839 */
840//#define MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN
841
842/**
Manuel Pégourié-Gonnard73afa372020-08-19 10:27:38 +0200843 * \def MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND
844 *
845 * Enable testing of the constant-flow nature of some sensitive functions with
846 * valgrind's memcheck tool. This causes some existing tests to also test
Manuel Pégourié-Gonnarddd00bfc2020-08-24 12:58:36 +0200847 * this non-functional property of the code under test.
Manuel Pégourié-Gonnard73afa372020-08-19 10:27:38 +0200848 *
849 * This setting requires valgrind headers for building, and is only useful for
Manuel Pégourié-Gonnarddd00bfc2020-08-24 12:58:36 +0200850 * testing if the tests suites are run with valgrind's memcheck. This can be
851 * done for an individual test suite with 'valgrind ./test_suite_xxx', or when
852 * using CMake, this can be done for all test suites with 'make memcheck'.
Manuel Pégourié-Gonnard73afa372020-08-19 10:27:38 +0200853 *
854 * \warning This macro is only used for extended testing; it is not considered
855 * part of the library's API, so it may change or disappear at any time.
856 *
857 * Uncomment to enable testing of the constant-flow nature of selected code.
858 */
859//#define MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND
860
861/**
Gilles Peskinefea6eaf2019-09-11 13:27:48 +0200862 * \def MBEDTLS_TEST_HOOKS
863 *
864 * Enable features for invasive testing such as introspection functions and
865 * hooks for fault injection. This enables additional unit tests.
866 *
867 * Merely enabling this feature should not change the behavior of the product.
868 * It only adds new code, and new branching points where the default behavior
869 * is the same as when this feature is disabled.
870 * However, this feature increases the attack surface: there is an added
871 * risk of vulnerabilities, and more gadgets that can make exploits easier.
872 * Therefore this feature must never be enabled in production.
873 *
874 * See `docs/architecture/testing/mbed-crypto-invasive-testing.md` for more
875 * information.
876 *
877 * Uncomment to enable invasive tests.
878 */
879//#define MBEDTLS_TEST_HOOKS
880
881/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200882 * \def MBEDTLS_VERSION_FEATURES
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200883 *
884 * Allow run-time checking of compile-time enabled features. Thus allowing users
885 * to check at run-time if the library is for instance compiled with threading
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200886 * support via mbedtls_version_check_feature().
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200887 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200888 * Requires: MBEDTLS_VERSION_C
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200889 *
890 * Comment this to disable run-time checking and save ROM space
891 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200892#define MBEDTLS_VERSION_FEATURES
Paul Bakker0f90d7d2014-04-30 11:49:44 +0200893
894/**
Hanno Becker288dedc2019-03-27 11:00:53 +0000895 * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
896 *
Jarno Lamsaf49fedc2019-04-01 14:58:30 +0300897 * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()`
Hanno Becker288dedc2019-03-27 11:00:53 +0000898 * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure
899 * the set of trusted certificates through a callback instead of a linked
900 * list.
901 *
902 * This is useful for example in environments where a large number of trusted
903 * certificates is present and storing them in a linked list isn't efficient
904 * enough, or when the set of trusted certificates changes frequently.
905 *
Jarno Lamsaf49fedc2019-04-01 14:58:30 +0300906 * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and
Hanno Becker288dedc2019-03-27 11:00:53 +0000907 * `mbedtls_ssl_conf_ca_cb()` for more information.
908 *
Valerio Setti8e45cdd2023-01-05 09:32:29 +0100909 * Requires: MBEDTLS_X509_CRT_PARSE_C
910 *
Hanno Becker288dedc2019-03-27 11:00:53 +0000911 * Uncomment to enable trusted certificate callbacks.
912 */
913//#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
914
915/**
Hanno Becker612a2f12020-10-09 09:19:39 +0100916 * \def MBEDTLS_X509_REMOVE_INFO
Peter Kolbus9a969b62018-12-11 13:55:56 -0600917 *
Chris Jones2c745862020-12-16 11:41:06 +0000918 * Disable mbedtls_x509_*_info() and related APIs.
Peter Kolbus9a969b62018-12-11 13:55:56 -0600919 *
Chris Jones2c745862020-12-16 11:41:06 +0000920 * Uncomment to omit mbedtls_x509_*_info(), as well as mbedtls_debug_print_crt()
Peter Kolbus9a969b62018-12-11 13:55:56 -0600921 * and other functions/constants only used by these functions, thus reducing
922 * the code footprint by several KB.
923 */
Chris Jones2c745862020-12-16 11:41:06 +0000924//#define MBEDTLS_X509_REMOVE_INFO
Peter Kolbus9a969b62018-12-11 13:55:56 -0600925
926/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200927 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
Manuel Pégourié-Gonnardd1539b12014-06-06 16:42:37 +0200928 *
929 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
930 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
931 *
Tomi Fontanillesa70b3c22023-07-16 12:06:13 +0300932 * Requires: MBEDTLS_PKCS1_V21
933 *
Manuel Pégourié-Gonnardd1539b12014-06-06 16:42:37 +0200934 * Comment this macro to disallow using RSASSA-PSS in certificates.
935 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200936#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200937/** \} name SECTION: Mbed TLS feature support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000938
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000939/**
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200940 * \name SECTION: Mbed TLS modules
Paul Bakker0a62cd12011-01-21 11:00:08 +0000941 *
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200942 * This section enables or disables entire modules in Mbed TLS
Paul Bakker0a62cd12011-01-21 11:00:08 +0000943 * \{
944 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000945
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000946/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200947 * \def MBEDTLS_DEBUG_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000948 *
949 * Enable the debug functions.
950 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000951 * Module: library/debug.c
Ronald Cronde1adee2022-03-07 16:20:30 +0100952 * Caller: library/ssl_msg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000953 * library/ssl_tls.c
Ronald Cronde1adee2022-03-07 16:20:30 +0100954 * library/ssl_tls12_*.c
955 * library/ssl_tls13_*.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000956 *
957 * This module provides debugging functions.
958 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200959#define MBEDTLS_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000960
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000961/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200962 * \def MBEDTLS_ERROR_C
Paul Bakker9d781402011-05-09 16:17:09 +0000963 *
964 * Enable error code to error string conversion.
965 *
966 * Module: library/error.c
967 * Caller:
968 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200969 * This module enables mbedtls_strerror().
Paul Bakker9d781402011-05-09 16:17:09 +0000970 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200971#define MBEDTLS_ERROR_C
Paul Bakker9d781402011-05-09 16:17:09 +0000972
973/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200974 * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200975 *
976 * Enable the buffer allocator implementation that makes use of a (stack)
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +0200977 * based buffer to 'allocate' dynamic memory. (replaces calloc() and free()
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200978 * calls)
Paul Bakker6e339b52013-07-03 13:37:05 +0200979 *
980 * Module: library/memory_buffer_alloc.c
981 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200982 * Requires: MBEDTLS_PLATFORM_C
Gilles Peskinee820c0a2023-08-03 17:45:20 +0200983 * MBEDTLS_PLATFORM_MEMORY (to use it within Mbed TLS)
Paul Bakker6e339b52013-07-03 13:37:05 +0200984 *
985 * Enable this module to enable the buffer memory allocator.
Paul Bakker6e339b52013-07-03 13:37:05 +0200986 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200987//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
Paul Bakker6e339b52013-07-03 13:37:05 +0200988
989/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200990 * \def MBEDTLS_NET_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000991 *
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +0100992 * Enable the TCP and UDP over IPv6/IPv4 networking routines.
993 *
Simon Butcherd567a232016-03-09 20:19:21 +0000994 * \note This module only works on POSIX/Unix (including Linux, BSD and OS X)
995 * and Windows. For other platforms, you'll want to disable it, and write your
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +0100996 * own networking callbacks to be passed to \c mbedtls_ssl_set_bio().
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000997 *
Manuel Pégourié-Gonnard02049dc2016-02-22 16:42:51 +0000998 * \note See also our Knowledge Base article about porting to a new
999 * environment:
Dave Rodgmanb3196842022-10-12 16:47:08 +01001000 * https://mbed-tls.readthedocs.io/en/latest/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
Manuel Pégourié-Gonnard02049dc2016-02-22 16:42:51 +00001001 *
Andres AG788aa4a2016-09-14 14:32:09 +01001002 * Module: library/net_sockets.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001003 *
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +01001004 * This module provides networking routines.
Paul Bakker5121ce52009-01-03 21:22:43 +00001005 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001006#define MBEDTLS_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001007
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001008/**
Nayna Jainc9deb182020-11-16 19:03:12 +00001009 * \def MBEDTLS_PKCS7_C
1010 *
Dave Rodgman3fe2abf2023-03-10 17:05:54 +00001011 * Enable PKCS #7 core for using PKCS #7-formatted signatures.
Nayna Jainc9deb182020-11-16 19:03:12 +00001012 * RFC Link - https://tools.ietf.org/html/rfc2315
1013 *
1014 * Module: library/pkcs7.c
1015 *
1016 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C,
Nick Child89e82e12022-11-09 10:36:10 -06001017 * MBEDTLS_X509_CRT_PARSE_C MBEDTLS_X509_CRL_PARSE_C,
1018 * MBEDTLS_BIGNUM_C, MBEDTLS_MD_C
Nayna Jainc9deb182020-11-16 19:03:12 +00001019 *
Dave Rodgmanefbc5f72023-03-13 12:15:49 +00001020 * This module is required for the PKCS #7 parsing modules.
Nayna Jainc9deb182020-11-16 19:03:12 +00001021 */
Dave Rodgman7c33b0c2023-03-10 15:07:15 +00001022#define MBEDTLS_PKCS7_C
Nayna Jainc9deb182020-11-16 19:03:12 +00001023
1024/**
Valerio Setti678e0fb2024-06-14 07:49:05 +02001025 * \def MBEDTLS_PSA_STATIC_KEY_SLOTS
1026 *
Valerio Setti933b7692024-08-13 11:08:26 +02001027 * Statically preallocate memory to store keys' material in PSA instead
1028 * of allocating it dynamically when required. This allows builds without a
1029 * heap, if none of the enabled cryptographic implementations or other features
1030 * require it.
1031 * This feature affects both volatile and persistent keys which means that
1032 * it's not possible to persistently store a key which is larger than
Valerio Settic2a6e8b2024-08-16 07:58:02 +02001033 * #MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE.
Valerio Setti678e0fb2024-06-14 07:49:05 +02001034 *
1035 * \note This feature comes with a (potentially) higher RAM usage since:
Valerio Setti83778d72024-10-04 13:46:37 +02001036 * - All the key slots are allocated no matter if they are used or not.
Valerio Settic2a6e8b2024-08-16 07:58:02 +02001037 * - Each key buffer's length is #MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE bytes.
Valerio Setti678e0fb2024-06-14 07:49:05 +02001038 *
1039 * Requires: MBEDTLS_PSA_CRYPTO_C
1040 *
1041 */
1042//#define MBEDTLS_PSA_STATIC_KEY_SLOTS
1043
1044/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001045 * \def MBEDTLS_SSL_CACHE_C
Paul Bakker0a597072012-09-25 21:55:46 +00001046 *
1047 * Enable simple SSL cache implementation.
1048 *
1049 * Module: library/ssl_cache.c
1050 * Caller:
1051 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001052 * Requires: MBEDTLS_SSL_CACHE_C
Paul Bakker0a597072012-09-25 21:55:46 +00001053 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001054#define MBEDTLS_SSL_CACHE_C
Paul Bakker0a597072012-09-25 21:55:46 +00001055
1056/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001057 * \def MBEDTLS_SSL_COOKIE_C
Manuel Pégourié-Gonnarda64acd42014-07-23 18:30:45 +02001058 *
1059 * Enable basic implementation of DTLS cookies for hello verification.
1060 *
1061 * Module: library/ssl_cookie.c
1062 * Caller:
Manuel Pégourié-Gonnarda64acd42014-07-23 18:30:45 +02001063 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001064#define MBEDTLS_SSL_COOKIE_C
Manuel Pégourié-Gonnarda64acd42014-07-23 18:30:45 +02001065
1066/**
Manuel Pégourié-Gonnardfd6d8972015-05-15 12:09:00 +02001067 * \def MBEDTLS_SSL_TICKET_C
1068 *
1069 * Enable an implementation of TLS server-side callbacks for session tickets.
1070 *
1071 * Module: library/ssl_ticket.c
1072 * Caller:
Manuel Pégourié-Gonnard0c0f11f2015-05-20 09:55:50 +02001073 *
Przemek Stekiel52a428b2022-10-10 08:47:13 +02001074 * Requires: (MBEDTLS_CIPHER_C || MBEDTLS_USE_PSA_CRYPTO) &&
1075 * (MBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C)
Manuel Pégourié-Gonnardfd6d8972015-05-15 12:09:00 +02001076 */
1077#define MBEDTLS_SSL_TICKET_C
1078
1079/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001080 * \def MBEDTLS_SSL_CLI_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001081 *
1082 * Enable the SSL/TLS client code.
1083 *
Ronald Cronde1adee2022-03-07 16:20:30 +01001084 * Module: library/ssl*_client.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001085 * Caller:
1086 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001087 * Requires: MBEDTLS_SSL_TLS_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001088 *
Janos Follath745e5612024-12-02 13:22:34 +00001089 * \warning You must call psa_crypto_init() before doing any TLS operations.
1090 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001091 * This module is required for SSL/TLS client support.
1092 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001093#define MBEDTLS_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001094
Paul Bakker9a736322012-11-14 12:39:52 +00001095/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001096 * \def MBEDTLS_SSL_SRV_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001097 *
1098 * Enable the SSL/TLS server code.
1099 *
Ronald Cronde1adee2022-03-07 16:20:30 +01001100 * Module: library/ssl*_server.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001101 * Caller:
1102 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001103 * Requires: MBEDTLS_SSL_TLS_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001104 *
Janos Follath745e5612024-12-02 13:22:34 +00001105 * \warning You must call psa_crypto_init() before doing any TLS operations.
1106 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001107 * This module is required for SSL/TLS server support.
1108 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001109#define MBEDTLS_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001110
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001111/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001112 * \def MBEDTLS_SSL_TLS_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001113 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001114 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001115 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001116 * Module: library/ssl_tls.c
Ronald Cronde1adee2022-03-07 16:20:30 +01001117 * Caller: library/ssl*_client.c
1118 * library/ssl*_server.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001119 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001120 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
1121 * and at least one of the MBEDTLS_SSL_PROTO_XXX defines
Paul Bakker5690efc2011-05-26 13:16:06 +00001122 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001123 * This module is required for SSL/TLS.
1124 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001125#define MBEDTLS_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001126
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001127/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001128 * \def MBEDTLS_TIMING_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001129 *
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +01001130 * Enable the semi-portable timing interface.
1131 *
Simon Butcherd567a232016-03-09 20:19:21 +00001132 * \note The provided implementation only works on POSIX/Unix (including Linux,
1133 * BSD and OS X) and Windows. On other platforms, you can either disable that
Manuel Pégourié-Gonnard325ce092016-02-22 10:33:34 +01001134 * module and provide your own implementations of the callbacks needed by
1135 * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide
1136 * your own implementation of the whole module by setting
1137 * \c MBEDTLS_TIMING_ALT in the current file.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001138 *
Andrzej Kurek57353692022-04-07 08:08:21 -04001139 * \note The timing module will include time.h on suitable platforms
1140 * regardless of the setting of MBEDTLS_HAVE_TIME, unless
1141 * MBEDTLS_TIMING_ALT is used. See timing.c for more information.
1142 *
Manuel Pégourié-Gonnard02049dc2016-02-22 16:42:51 +00001143 * \note See also our Knowledge Base article about porting to a new
1144 * environment:
Dave Rodgmanb3196842022-10-12 16:47:08 +01001145 * https://mbed-tls.readthedocs.io/en/latest/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
Manuel Pégourié-Gonnard02049dc2016-02-22 16:42:51 +00001146 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001147 * Module: library/timing.c
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001148 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001149#define MBEDTLS_TIMING_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001150
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001151/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001152 * \def MBEDTLS_VERSION_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001153 *
1154 * Enable run-time version information.
1155 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001156 * Module: library/version.c
1157 *
1158 * This module provides run-time version information.
1159 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001160#define MBEDTLS_VERSION_C
Paul Bakker0a62cd12011-01-21 11:00:08 +00001161
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001162/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001163 * \def MBEDTLS_X509_USE_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001164 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001165 * Enable X.509 core for using certificates.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001166 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001167 * Module: library/x509.c
Simon Butcher2cb47392016-11-04 12:23:11 +00001168 * Caller: library/x509_crl.c
1169 * library/x509_crt.c
1170 * library/x509_csr.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001171 *
Janos Follath277bba82024-11-19 16:14:00 +00001172 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C
Przemek Stekiel278b6672022-08-03 09:50:38 +02001173 *
Janos Follath277bba82024-11-19 16:14:00 +00001174 * \warning You must call psa_crypto_init() before doing any X.509 operation.
Paul Bakker5690efc2011-05-26 13:16:06 +00001175 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001176 * This module is required for the X.509 parsing modules.
Paul Bakker5121ce52009-01-03 21:22:43 +00001177 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001178#define MBEDTLS_X509_USE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001179
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001180/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001181 * \def MBEDTLS_X509_CRT_PARSE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001182 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001183 * Enable X.509 certificate parsing.
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001184 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001185 * Module: library/x509_crt.c
Ronald Cronde1adee2022-03-07 16:20:30 +01001186 * Caller: library/ssl_tls.c
1187 * library/ssl*_client.c
1188 * library/ssl*_server.c
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001189 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001190 * Requires: MBEDTLS_X509_USE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001191 *
1192 * This module is required for X.509 certificate parsing.
1193 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001194#define MBEDTLS_X509_CRT_PARSE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001195
1196/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001197 * \def MBEDTLS_X509_CRL_PARSE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001198 *
1199 * Enable X.509 CRL parsing.
1200 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001201 * Module: library/x509_crl.c
1202 * Caller: library/x509_crt.c
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001203 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001204 * Requires: MBEDTLS_X509_USE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001205 *
1206 * This module is required for X.509 CRL parsing.
1207 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001208#define MBEDTLS_X509_CRL_PARSE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001209
1210/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001211 * \def MBEDTLS_X509_CSR_PARSE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001212 *
1213 * Enable X.509 Certificate Signing Request (CSR) parsing.
1214 *
Simon Butcher2cb47392016-11-04 12:23:11 +00001215 * Module: library/x509_csr.c
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001216 * Caller: library/x509_crt_write.c
1217 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001218 * Requires: MBEDTLS_X509_USE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001219 *
1220 * This module is used for reading X.509 certificate request.
1221 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001222#define MBEDTLS_X509_CSR_PARSE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001223
1224/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001225 * \def MBEDTLS_X509_CREATE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001226 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001227 * Enable X.509 core for creating certificates.
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001228 *
1229 * Module: library/x509_create.c
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001230 *
Przemek Stekiel10836a02022-08-19 08:45:34 +02001231 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C,
Przemek Stekiel278b6672022-08-03 09:50:38 +02001232 *
Janos Follath277bba82024-11-19 16:14:00 +00001233 * \warning You must call psa_crypto_init() before doing any X.509 operation.
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001234 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001235 * This module is the basis for creating X.509 certificates and CSRs.
1236 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001237#define MBEDTLS_X509_CREATE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001238
1239/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001240 * \def MBEDTLS_X509_CRT_WRITE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001241 *
1242 * Enable creating X.509 certificates.
1243 *
1244 * Module: library/x509_crt_write.c
1245 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001246 * Requires: MBEDTLS_X509_CREATE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001247 *
1248 * This module is required for X.509 certificate creation.
1249 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001250#define MBEDTLS_X509_CRT_WRITE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001251
1252/**
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001253 * \def MBEDTLS_X509_CSR_WRITE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001254 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001255 * Enable creating X.509 Certificate Signing Requests (CSR).
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001256 *
1257 * Module: library/x509_csr_write.c
1258 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001259 * Requires: MBEDTLS_X509_CREATE_C
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001260 *
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001261 * This module is required for X.509 certificate request writing.
1262 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001263#define MBEDTLS_X509_CSR_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001264
Gilles Peskinee820c0a2023-08-03 17:45:20 +02001265/** \} name SECTION: Mbed TLS modules */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001266
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001267/**
Gilles Peskineba4162a2022-04-11 17:04:38 +02001268 * \name SECTION: General configuration options
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001269 *
Gilles Peskined5793ce2022-04-13 23:05:10 +02001270 * This section contains Mbed TLS build settings that are not associated
1271 * with a particular module.
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001272 *
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001273 * \{
1274 */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001275
Gilles Peskinea02c1242022-03-16 17:03:19 +01001276/**
1277 * \def MBEDTLS_CONFIG_FILE
1278 *
1279 * If defined, this is a header which will be included instead of
1280 * `"mbedtls/mbedtls_config.h"`.
1281 * This header file specifies the compile-time configuration of Mbed TLS.
Gilles Peskineefffd642022-04-26 18:13:01 +02001282 * Unlike other configuration options, this one must be defined on the
1283 * compiler command line: a definition in `mbedtls_config.h` would have
1284 * no effect.
Gilles Peskinea02c1242022-03-16 17:03:19 +01001285 *
Gilles Peskine6457ef92022-04-11 16:42:37 +02001286 * This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
Gilles Peskinea02c1242022-03-16 17:03:19 +01001287 * non-standard feature of the C language, so this feature is only available
Gilles Peskine6457ef92022-04-11 16:42:37 +02001288 * with compilers that perform macro expansion on an <tt>\#include</tt> line.
Gilles Peskinea02c1242022-03-16 17:03:19 +01001289 *
Gilles Peskine58ffcba2022-04-14 12:44:16 +02001290 * The value of this symbol is typically a path in double quotes, either
1291 * absolute or relative to a directory on the include search path.
Gilles Peskinea02c1242022-03-16 17:03:19 +01001292 */
1293//#define MBEDTLS_CONFIG_FILE "mbedtls/mbedtls_config.h"
1294
1295/**
1296 * \def MBEDTLS_USER_CONFIG_FILE
1297 *
1298 * If defined, this is a header which will be included after
1299 * `"mbedtls/mbedtls_config.h"` or #MBEDTLS_CONFIG_FILE.
Gilles Peskinef68f43a2022-04-13 23:22:20 +02001300 * This allows you to modify the default configuration, including the ability
1301 * to undefine options that are enabled by default.
Gilles Peskinea02c1242022-03-16 17:03:19 +01001302 *
Gilles Peskine6457ef92022-04-11 16:42:37 +02001303 * This macro is expanded after an <tt>\#include</tt> directive. This is a popular but
Gilles Peskinea02c1242022-03-16 17:03:19 +01001304 * non-standard feature of the C language, so this feature is only available
Gilles Peskine6457ef92022-04-11 16:42:37 +02001305 * with compilers that perform macro expansion on an <tt>\#include</tt> line.
Gilles Peskinea02c1242022-03-16 17:03:19 +01001306 *
Gilles Peskine58ffcba2022-04-14 12:44:16 +02001307 * The value of this symbol is typically a path in double quotes, either
1308 * absolute or relative to a directory on the include search path.
Gilles Peskinea02c1242022-03-16 17:03:19 +01001309 */
1310//#define MBEDTLS_USER_CONFIG_FILE "/dev/null"
1311
Gilles Peskineba4162a2022-04-11 17:04:38 +02001312/** \} name SECTION: General configuration options */
1313
1314/**
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001315 * \name SECTION: Module configuration options
1316 *
1317 * This section allows for the setting of module specific sizes and
1318 * configuration options. The default values are already present in the
1319 * relevant header files and should suffice for the regular use cases.
1320 *
1321 * Our advice is to enable options and change their values here
1322 * only if you have a good reason and know the consequences.
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001323 * \{
1324 */
Gilles Peskine3f49cc12022-04-13 23:21:16 +02001325/* The Doxygen documentation here is used when a user comments out a
1326 * setting and runs doxygen themselves. On the other hand, when we typeset
1327 * the full documentation including disabled settings, the documentation
1328 * in specific modules' header files is used if present. When editing this
1329 * file, make sure that each option is documented in exactly one place,
1330 * plus optionally a same-line Doxygen comment here if there is a Doxygen
1331 * comment in the specific module. */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001332
Valerio Settia7ce5892024-08-13 10:44:02 +02001333/**
Valerio Setti933b7692024-08-13 11:08:26 +02001334 * \def MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE
Valerio Settia7ce5892024-08-13 10:44:02 +02001335 *
Valerio Settic2a6e8b2024-08-16 07:58:02 +02001336 * Define the size (in bytes) of each static key buffer when
1337 * #MBEDTLS_PSA_STATIC_KEY_SLOTS is set. If not
1338 * explicitly defined then it's automatically guessed from available PSA keys
1339 * enabled in the build through PSA_WANT_xxx symbols.
Valerio Settia7ce5892024-08-13 10:44:02 +02001340 * If required by the application this parameter can be set to higher values
1341 * in order to store larger objects (ex: raw keys), but please note that this
1342 * will increase RAM usage.
Valerio Settia7ce5892024-08-13 10:44:02 +02001343 */
1344//#define MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE 256
1345
Paul Bakker088c5c52014-04-25 11:11:10 +02001346/* SSL Cache options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001347//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1348//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
Paul Bakker6e339b52013-07-03 13:37:05 +02001349
Paul Bakker088c5c52014-04-25 11:11:10 +02001350/* SSL options */
Angus Grattond8213d02016-05-25 20:56:48 +10001351
Angus Grattond8213d02016-05-25 20:56:48 +10001352/** \def MBEDTLS_SSL_IN_CONTENT_LEN
1353 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001354 * Maximum length (in bytes) of incoming plaintext fragments.
Angus Grattond8213d02016-05-25 20:56:48 +10001355 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001356 * This determines the size of the incoming TLS I/O buffer in such a way
1357 * that it is capable of holding the specified amount of plaintext data,
1358 * regardless of the protection mechanism used.
1359 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001360 * \note When using a value less than the default of 16KB on the client, it is
1361 * recommended to use the Maximum Fragment Length (MFL) extension to
1362 * inform the server about this limitation. On the server, there
1363 * is no supported, standardized way of informing the client about
1364 * restriction on the maximum size of incoming messages, and unless
1365 * the limitation has been communicated by other means, it is recommended
1366 * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN
1367 * while keeping the default value of 16KB for the incoming buffer.
1368 *
David Horstmann95d516f2021-05-04 18:36:56 +01001369 * Uncomment to set the maximum plaintext size of the incoming I/O buffer.
Angus Grattond8213d02016-05-25 20:56:48 +10001370 */
1371//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384
1372
Gilles Peskined3d02902020-03-04 21:35:27 +01001373/** \def MBEDTLS_SSL_CID_IN_LEN_MAX
1374 *
1375 * The maximum length of CIDs used for incoming DTLS messages.
1376 *
1377 */
1378//#define MBEDTLS_SSL_CID_IN_LEN_MAX 32
1379
1380/** \def MBEDTLS_SSL_CID_OUT_LEN_MAX
1381 *
1382 * The maximum length of CIDs used for outgoing DTLS messages.
1383 *
1384 */
1385//#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32
1386
TRodziewicze8dd7092021-05-12 14:19:11 +02001387/** \def MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY
Gilles Peskined3d02902020-03-04 21:35:27 +01001388 *
1389 * This option controls the use of record plaintext padding
TRodziewicz1e660ed2021-05-26 17:08:54 +02001390 * in TLS 1.3 and when using the Connection ID extension in DTLS 1.2.
Hanno Becker13996922020-05-28 16:15:19 +01001391 *
1392 * The padding will always be chosen so that the length of the
1393 * padded plaintext is a multiple of the value of this option.
1394 *
1395 * Note: A value of \c 1 means that no padding will be used
1396 * for outgoing records.
1397 *
1398 * Note: On systems lacking division instructions,
1399 * a power of two should be preferred.
1400 */
TRodziewicze8dd7092021-05-12 14:19:11 +02001401//#define MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY 16
Hanno Becker13996922020-05-28 16:15:19 +01001402
Angus Grattond8213d02016-05-25 20:56:48 +10001403/** \def MBEDTLS_SSL_OUT_CONTENT_LEN
1404 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001405 * Maximum length (in bytes) of outgoing plaintext fragments.
Angus Grattond8213d02016-05-25 20:56:48 +10001406 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -05001407 * This determines the size of the outgoing TLS I/O buffer in such a way
1408 * that it is capable of holding the specified amount of plaintext data,
1409 * regardless of the protection mechanism used.
1410 *
Angus Grattond8213d02016-05-25 20:56:48 +10001411 * It is possible to save RAM by setting a smaller outward buffer, while keeping
1412 * the default inward 16384 byte buffer to conform to the TLS specification.
1413 *
1414 * The minimum required outward buffer size is determined by the handshake
1415 * protocol's usage. Handshaking will fail if the outward buffer is too small.
1416 * The specific size requirement depends on the configured ciphers and any
1417 * certificate data which is sent during the handshake.
1418 *
David Horstmann95d516f2021-05-04 18:36:56 +01001419 * Uncomment to set the maximum plaintext size of the outgoing I/O buffer.
Angus Grattond8213d02016-05-25 20:56:48 +10001420 */
1421//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384
1422
Hanno Beckere0b150f2018-08-21 15:51:03 +01001423/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING
1424 *
1425 * Maximum number of heap-allocated bytes for the purpose of
1426 * DTLS handshake message reassembly and future message buffering.
1427 *
Yuto Takano7828ca22021-08-10 11:26:15 +01001428 * This should be at least 9/8 * MBEDTLS_SSL_IN_CONTENT_LEN
Hanno Becker28007512018-08-28 09:46:44 +01001429 * to account for a reassembled handshake message of maximum size,
1430 * together with its reassembly bitmap.
1431 *
Hanno Becker97a1c132018-08-28 14:42:15 +01001432 * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default)
Hanno Becker28007512018-08-28 09:46:44 +01001433 * should be sufficient for all practical situations as it allows
1434 * to reassembly a large handshake message (such as a certificate)
1435 * while buffering multiple smaller handshake messages.
1436 *
Hanno Beckere0b150f2018-08-21 15:51:03 +01001437 */
Hanno Becker159a37f2018-08-24 15:07:29 +01001438//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768
Hanno Beckere0b150f2018-08-21 15:51:03 +01001439
Ronald Cron1aa6e8d2023-02-23 09:46:54 +01001440//#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 +02001441//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001442
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001443/**
1444 * Complete list of ciphersuites to use, in order of preference.
1445 *
1446 * \warning No dependency checking is done on that field! This option can only
1447 * be used to restrict the set of available ciphersuites. It is your
1448 * responsibility to make sure the needed modules are active.
1449 *
1450 * Use this to save a few hundred bytes of ROM (default ordering of all
1451 * available ciphersuites) and a few to a few hundred bytes of RAM.
1452 *
1453 * The value below is only an example, not the default.
1454 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001455//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
Manuel Pégourié-Gonnarddfc7df02014-06-30 17:59:55 +02001456
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001457/**
Tom Cosgrovea63775b2023-09-14 13:31:19 +01001458 * \def MBEDTLS_SSL_MAX_EARLY_DATA_SIZE
1459 *
1460 * The default maximum amount of 0-RTT data. See the documentation of
Yanray Wang07517612023-11-07 11:47:36 +08001461 * \c mbedtls_ssl_conf_max_early_data_size() for more information.
Tom Cosgrovea63775b2023-09-14 13:31:19 +01001462 *
1463 * It must be positive and smaller than UINT32_MAX.
1464 *
1465 * If MBEDTLS_SSL_EARLY_DATA is not defined, this default value does not
1466 * have any impact on the build.
Tom Cosgrovea63775b2023-09-14 13:31:19 +01001467 */
1468//#define MBEDTLS_SSL_MAX_EARLY_DATA_SIZE 1024
1469
1470/**
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001471 * \def MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE
1472 *
Jerry Yucf913512023-11-14 11:06:52 +08001473 * Maximum allowed ticket age difference in milliseconds tolerated between
Jerry Yu034a8b72023-11-10 12:20:19 +08001474 * server and client. Default value is 6000. This is not used in TLS 1.2.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001475 *
Jerry Yu034a8b72023-11-10 12:20:19 +08001476 * - The client ticket age is the time difference between the time when the
1477 * client proposes to the server to use the ticket and the time the client
1478 * received the ticket from the server.
1479 * - The server ticket age is the time difference between the time when the
1480 * server receives a proposition from the client to use the ticket and the
1481 * time when the ticket was created by the server.
1482 *
Jerry Yucf913512023-11-14 11:06:52 +08001483 * The ages might be different due to the client and server clocks not running
1484 * at the same pace. The typical accuracy of an RTC crystal is ±100 to ±20 parts
1485 * per million (360 to 72 milliseconds per hour). Default tolerance window is
1486 * 6s, thus in the worst case clients and servers must sync up their system time
1487 * every 6000/360/2~=8 hours.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001488 *
Jerry Yu04fceb72023-11-15 09:52:46 +08001489 * See section 8.3 of the TLS 1.3 specification(RFC 8446) for more information.
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001490 */
Gilles Peskined65ea422023-09-05 21:07:32 +02001491//#define MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE 6000
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001492
1493/**
1494 * \def MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH
1495 *
1496 * Size in bytes of a ticket nonce. This is not used in TLS 1.2.
1497 *
1498 * This must be less than 256.
1499 */
Gilles Peskined65ea422023-09-05 21:07:32 +02001500//#define MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH 32
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001501
1502/**
1503 * \def MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS
1504 *
1505 * Default number of NewSessionTicket messages to be sent by a TLS 1.3 server
1506 * after handshake completion. This is not used in TLS 1.2 and relevant only if
1507 * the MBEDTLS_SSL_SESSION_TICKETS option is enabled.
1508 *
1509 */
Gilles Peskined65ea422023-09-05 21:07:32 +02001510//#define MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS 1
Gilles Peskinea8d7e432022-08-04 23:39:41 +02001511
Manuel Pégourié-Gonnardfd6c85c2014-11-20 16:34:20 +01001512/* X509 options */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02001513//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
Andres AGf9113192016-09-02 14:06:04 +01001514//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */
Manuel Pégourié-Gonnardfd6c85c2014-11-20 16:34:20 +01001515
Gilles Peskine611179c2022-04-13 23:04:48 +02001516/** \} name SECTION: Module configuration options */