• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * \file check_config.h
3  *
4  * \brief Consistency checks for configuration options
5  */
6 /*
7  *  Copyright The Mbed TLS Contributors
8  *  SPDX-License-Identifier: Apache-2.0
9  *
10  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
11  *  not use this file except in compliance with the License.
12  *  You may obtain a copy of the License at
13  *
14  *  http://www.apache.org/licenses/LICENSE-2.0
15  *
16  *  Unless required by applicable law or agreed to in writing, software
17  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  *  See the License for the specific language governing permissions and
20  *  limitations under the License.
21  */
22 
23 #ifndef MBEDTLS_CHECK_CONFIG_H
24 #define MBEDTLS_CHECK_CONFIG_H
25 
26 /*
27  * We assume CHAR_BIT is 8 in many places. In practice, this is true on our
28  * target platforms, so not an issue, but let's just be extra sure.
29  */
30 #include <limits.h>
31 #if CHAR_BIT != 8
32 #error "mbed TLS requires a platform with 8-bit chars"
33 #endif
34 
35 #if defined(_WIN32)
36 #if !defined(MBEDTLS_PLATFORM_C)
37 #error "MBEDTLS_PLATFORM_C is required on Windows"
38 #endif
39 
40 /* Fix the config here. Not convenient to put an #ifdef _WIN32 in mbedtls_config.h as
41  * it would confuse config.py. */
42 #if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
43     !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
44 #define MBEDTLS_PLATFORM_SNPRINTF_ALT
45 #endif
46 
47 #if !defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) && \
48     !defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO)
49 #define MBEDTLS_PLATFORM_VSNPRINTF_ALT
50 #endif
51 #endif /* _WIN32 */
52 
53 #if defined(TARGET_LIKE_MBED) && defined(MBEDTLS_NET_C)
54 #error "The NET module is not available for mbed OS - please use the network functions provided by Mbed OS"
55 #endif
56 
57 #if defined(MBEDTLS_DEPRECATED_WARNING) && \
58     !defined(__GNUC__) && !defined(__clang__)
59 #error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang"
60 #endif
61 
62 #if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME)
63 #error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense"
64 #endif
65 
66 #if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM)
67 #error "MBEDTLS_AESNI_C defined, but not all prerequisites"
68 #endif
69 
70 #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C)
71 #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites"
72 #endif
73 
74 #if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C)
75 #error "MBEDTLS_DHM_C defined, but not all prerequisites"
76 #endif
77 
78 #if defined(MBEDTLS_CMAC_C) && \
79     !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C)
80 #error "MBEDTLS_CMAC_C defined, but not all prerequisites"
81 #endif
82 
83 #if defined(MBEDTLS_NIST_KW_C) && \
84     ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) )
85 #error "MBEDTLS_NIST_KW_C defined, but not all prerequisites"
86 #endif
87 
88 #if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C)
89 #error "MBEDTLS_ECDH_C defined, but not all prerequisites"
90 #endif
91 
92 #if defined(MBEDTLS_ECDSA_C) &&            \
93     ( !defined(MBEDTLS_ECP_C) ||           \
94       !( defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) || \
95          defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) || \
96          defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) || \
97          defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) || \
98          defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) || \
99          defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) || \
100          defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) || \
101          defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) || \
102          defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) ||   \
103          defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) ||   \
104          defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) ) || \
105       !defined(MBEDTLS_ASN1_PARSE_C) ||    \
106       !defined(MBEDTLS_ASN1_WRITE_C) )
107 #error "MBEDTLS_ECDSA_C defined, but not all prerequisites"
108 #endif
109 
110 #if defined(MBEDTLS_ECJPAKE_C) &&           \
111     ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) )
112 #error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites"
113 #endif
114 
115 #if defined(MBEDTLS_ECP_RESTARTABLE)           && \
116     ( defined(MBEDTLS_USE_PSA_CRYPTO)          || \
117       defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \
118       defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT)     || \
119       defined(MBEDTLS_ECDSA_SIGN_ALT)          || \
120       defined(MBEDTLS_ECDSA_VERIFY_ALT)        || \
121       defined(MBEDTLS_ECDSA_GENKEY_ALT)        || \
122       defined(MBEDTLS_ECP_INTERNAL_ALT)        || \
123       defined(MBEDTLS_ECP_ALT) )
124 #error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative or PSA-based ECP implementation"
125 #endif
126 
127 #if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C)
128 #error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites"
129 #endif
130 
131 #if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || (    \
132     !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) &&                  \
133     !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) &&                  \
134     !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) &&                  \
135     !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) &&                  \
136     !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) &&                  \
137     !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED)   &&                  \
138     !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED)   &&                  \
139     !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED)   &&                  \
140     !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) &&                  \
141     !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) &&                  \
142     !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) &&                  \
143     !defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) &&                 \
144     !defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) ) )
145 #error "MBEDTLS_ECP_C defined, but not all prerequisites"
146 #endif
147 
148 #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C)
149 #error "MBEDTLS_PK_PARSE_C defined, but not all prerequesites"
150 #endif
151 
152 #if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) &&      \
153                                     !defined(MBEDTLS_SHA256_C))
154 #error "MBEDTLS_ENTROPY_C defined, but not all prerequisites"
155 #endif
156 #if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) &&         \
157     defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64)
158 #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
159 #endif
160 #if defined(MBEDTLS_ENTROPY_C) &&                                            \
161     ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \
162     && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32)
163 #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
164 #endif
165 #if defined(MBEDTLS_ENTROPY_C) && \
166     defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C)
167 #error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites"
168 #endif
169 
170 #if defined(__has_feature)
171 #if __has_feature(memory_sanitizer)
172 #define MBEDTLS_HAS_MEMSAN
173 #endif
174 #endif
175 #if defined(MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN) &&  !defined(MBEDTLS_HAS_MEMSAN)
176 #error "MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN requires building with MemorySanitizer"
177 #endif
178 #undef MBEDTLS_HAS_MEMSAN
179 
180 #if defined(MBEDTLS_GCM_C) && (                                        \
181         !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) && !defined(MBEDTLS_ARIA_C) )
182 #error "MBEDTLS_GCM_C defined, but not all prerequisites"
183 #endif
184 
185 #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
186 #error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites"
187 #endif
188 
189 #if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
190 #error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites"
191 #endif
192 
193 #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
194 #error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites"
195 #endif
196 
197 #if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
198 #error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites"
199 #endif
200 
201 #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
202 #error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites"
203 #endif
204 
205 #if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
206 #error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites"
207 #endif
208 
209 #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
210 #error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites"
211 #endif
212 
213 #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
214 #error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites"
215 #endif
216 
217 #if defined(MBEDTLS_ECP_NO_FALLBACK) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
218 #error "MBEDTLS_ECP_NO_FALLBACK defined, but no alternative implementation enabled"
219 #endif
220 
221 #if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C)
222 #error "MBEDTLS_HKDF_C defined, but not all prerequisites"
223 #endif
224 
225 #if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C)
226 #error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites"
227 #endif
228 
229 #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) &&                 \
230     ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) ||          \
231       !defined(MBEDTLS_X509_CRT_PARSE_C) )
232 #error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites"
233 #endif
234 
235 #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) &&                 \
236     ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) ||          \
237       !defined(MBEDTLS_X509_CRT_PARSE_C) )
238 #error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites"
239 #endif
240 
241 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C)
242 #error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
243 #endif
244 
245 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) &&                     \
246     !defined(MBEDTLS_ECDH_C)
247 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites"
248 #endif
249 
250 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) &&                   \
251     ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) ||           \
252       !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) )
253 #error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
254 #endif
255 
256 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) &&                 \
257     ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) ||          \
258       !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) )
259 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
260 #endif
261 
262 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) &&                 \
263     ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) ||          \
264       !defined(MBEDTLS_X509_CRT_PARSE_C) )
265 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
266 #endif
267 
268 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) &&                   \
269     ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
270       !defined(MBEDTLS_PKCS1_V15) )
271 #error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
272 #endif
273 
274 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) &&                       \
275     ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
276       !defined(MBEDTLS_PKCS1_V15) )
277 #error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
278 #endif
279 
280 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) &&                    \
281     ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) ||      \
282       !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) )
283 #error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites"
284 #endif
285 
286 #if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) &&        \
287     !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) &&              \
288     ( !defined(MBEDTLS_SHA256_C) &&                             \
289       !defined(MBEDTLS_SHA512_C) &&                             \
290       !defined(MBEDTLS_SHA1_C) )
291 #error "!MBEDTLS_SSL_KEEP_PEER_CERTIFICATE requires MBEDTLS_SHA512_C, MBEDTLS_SHA256_C or MBEDTLS_SHA1_C"
292 #endif
293 
294 #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) &&                          \
295     ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
296 #error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
297 #endif
298 
299 #if defined(MBEDTLS_MEMORY_BACKTRACE) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
300 #error "MBEDTLS_MEMORY_BACKTRACE defined, but not all prerequesites"
301 #endif
302 
303 #if defined(MBEDTLS_MEMORY_DEBUG) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
304 #error "MBEDTLS_MEMORY_DEBUG defined, but not all prerequesites"
305 #endif
306 
307 #if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM)
308 #error "MBEDTLS_PADLOCK_C defined, but not all prerequisites"
309 #endif
310 
311 #if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C)
312 #error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites"
313 #endif
314 
315 #if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C)
316 #error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites"
317 #endif
318 
319 #if defined(MBEDTLS_PK_C) && \
320     ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) )
321 #error "MBEDTLS_PK_C defined, but not all prerequisites"
322 #endif
323 
324 #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C)
325 #error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites"
326 #endif
327 
328 #if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C)
329 #error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites"
330 #endif
331 
332 #if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C)
333 #error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites"
334 #endif
335 
336 #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C)
337 #error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites"
338 #endif
339 
340 #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\
341     ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\
342         defined(MBEDTLS_PLATFORM_EXIT_ALT) )
343 #error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously"
344 #endif
345 
346 #if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\
347     ( !defined(MBEDTLS_PLATFORM_C) ||\
348         !defined(MBEDTLS_HAVE_TIME) )
349 #error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites"
350 #endif
351 
352 #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\
353     ( !defined(MBEDTLS_PLATFORM_C) ||\
354         !defined(MBEDTLS_HAVE_TIME) )
355 #error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites"
356 #endif
357 
358 #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\
359     ( !defined(MBEDTLS_PLATFORM_C) ||\
360         !defined(MBEDTLS_HAVE_TIME) )
361 #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites"
362 #endif
363 
364 #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\
365     ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\
366         defined(MBEDTLS_PLATFORM_TIME_ALT) )
367 #error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously"
368 #endif
369 
370 #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\
371     ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\
372         defined(MBEDTLS_PLATFORM_TIME_ALT) )
373 #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously"
374 #endif
375 
376 #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
377 #error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites"
378 #endif
379 
380 #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
381 #error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites"
382 #endif
383 
384 #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\
385     ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\
386         defined(MBEDTLS_PLATFORM_FPRINTF_ALT) )
387 #error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously"
388 #endif
389 
390 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
391     ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
392 #error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites"
393 #endif
394 
395 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
396     defined(MBEDTLS_PLATFORM_STD_FREE)
397 #error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously"
398 #endif
399 
400 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO)
401 #error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is"
402 #endif
403 
404 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
405     ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
406 #error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites"
407 #endif
408 
409 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
410     defined(MBEDTLS_PLATFORM_STD_CALLOC)
411 #error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously"
412 #endif
413 
414 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO)
415 #error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is"
416 #endif
417 
418 #if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C)
419 #error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites"
420 #endif
421 
422 #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
423 #error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites"
424 #endif
425 
426 #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
427 #error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites"
428 #endif
429 
430 #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\
431     ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\
432         defined(MBEDTLS_PLATFORM_PRINTF_ALT) )
433 #error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously"
434 #endif
435 
436 #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
437 #error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites"
438 #endif
439 
440 #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
441 #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites"
442 #endif
443 
444 #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\
445     ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\
446         defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) )
447 #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously"
448 #endif
449 
450 #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\
451     !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS)
452 #error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites"
453 #endif
454 
455 #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY)
456 #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites"
457 #endif
458 
459 #if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY)
460 #error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites"
461 #endif
462 
463 #if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\
464     !defined(MBEDTLS_PLATFORM_EXIT_ALT)
465 #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites"
466 #endif
467 
468 #if defined(MBEDTLS_PLATFORM_STD_TIME) &&\
469     ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\
470         !defined(MBEDTLS_HAVE_TIME) )
471 #error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites"
472 #endif
473 
474 #if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\
475     !defined(MBEDTLS_PLATFORM_FPRINTF_ALT)
476 #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites"
477 #endif
478 
479 #if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\
480     !defined(MBEDTLS_PLATFORM_PRINTF_ALT)
481 #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites"
482 #endif
483 
484 #if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\
485     !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT)
486 #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites"
487 #endif
488 
489 #if defined(MBEDTLS_ENTROPY_NV_SEED) &&\
490     ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) )
491 #error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites"
492 #endif
493 
494 #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\
495     !defined(MBEDTLS_ENTROPY_NV_SEED)
496 #error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites"
497 #endif
498 
499 #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\
500     !defined(MBEDTLS_PLATFORM_NV_SEED_ALT)
501 #error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites"
502 #endif
503 
504 #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\
505     !defined(MBEDTLS_PLATFORM_NV_SEED_ALT)
506 #error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites"
507 #endif
508 
509 #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\
510     ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\
511       defined(MBEDTLS_PLATFORM_NV_SEED_ALT) )
512 #error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously"
513 #endif
514 
515 #if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\
516     ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\
517       defined(MBEDTLS_PLATFORM_NV_SEED_ALT) )
518 #error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously"
519 #endif
520 
521 #if defined(MBEDTLS_PSA_CRYPTO_C) &&                                    \
522     !( ( ( defined(MBEDTLS_CTR_DRBG_C) || defined(MBEDTLS_HMAC_DRBG_C) ) && \
523          defined(MBEDTLS_ENTROPY_C) ) ||                                \
524        defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) )
525 #error "MBEDTLS_PSA_CRYPTO_C defined, but not all prerequisites (missing RNG)"
526 #endif
527 
528 #if defined(MBEDTLS_PSA_CRYPTO_SPM) && !defined(MBEDTLS_PSA_CRYPTO_C)
529 #error "MBEDTLS_PSA_CRYPTO_SPM defined, but not all prerequisites"
530 #endif
531 
532 #if defined(MBEDTLS_PSA_CRYPTO_SE_C) &&    \
533     ! ( defined(MBEDTLS_PSA_CRYPTO_C) && \
534         defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) )
535 #error "MBEDTLS_PSA_CRYPTO_SE_C defined, but not all prerequisites"
536 #endif
537 
538 #if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) &&            \
539     ! defined(MBEDTLS_PSA_CRYPTO_C)
540 #error "MBEDTLS_PSA_CRYPTO_STORAGE_C defined, but not all prerequisites"
541 #endif
542 
543 #if defined(MBEDTLS_PSA_INJECT_ENTROPY) &&      \
544     !( defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \
545        defined(MBEDTLS_ENTROPY_NV_SEED) )
546 #error "MBEDTLS_PSA_INJECT_ENTROPY defined, but not all prerequisites"
547 #endif
548 
549 #if defined(MBEDTLS_PSA_INJECT_ENTROPY) &&              \
550     !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES)
551 #error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with actual entropy sources"
552 #endif
553 
554 #if defined(MBEDTLS_PSA_INJECT_ENTROPY) &&              \
555     defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)
556 #error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG"
557 #endif
558 
559 #if defined(MBEDTLS_PSA_ITS_FILE_C) && \
560     !defined(MBEDTLS_FS_IO)
561 #error "MBEDTLS_PSA_ITS_FILE_C defined, but not all prerequisites"
562 #endif
563 
564 #if defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER) && \
565     defined(MBEDTLS_USE_PSA_CRYPTO)
566 #error "MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER defined, but it cannot coexist with MBEDTLS_USE_PSA_CRYPTO."
567 #endif
568 
569 #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) ||         \
570     !defined(MBEDTLS_OID_C) )
571 #error "MBEDTLS_RSA_C defined, but not all prerequisites"
572 #endif
573 
574 #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) &&         \
575     !defined(MBEDTLS_PKCS1_V15) )
576 #error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled"
577 #endif
578 
579 #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) &&                        \
580     ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) )
581 #error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites"
582 #endif
583 
584 #if defined(MBEDTLS_SHA384_C) && !defined(MBEDTLS_SHA512_C)
585 #error "MBEDTLS_SHA384_C defined without MBEDTLS_SHA512_C"
586 #endif
587 
588 #if defined(MBEDTLS_SHA224_C) && !defined(MBEDTLS_SHA256_C)
589 #error "MBEDTLS_SHA224_C defined without MBEDTLS_SHA256_C"
590 #endif
591 
592 #if defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA224_C)
593 #error "MBEDTLS_SHA256_C defined without MBEDTLS_SHA224_C"
594 #endif
595 
596 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) &&     \
597     !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) )
598 #error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
599 #endif
600 
601 /*
602  * HKDF is mandatory for TLS 1.3.
603  * Otherwise support for at least one ciphersuite mandates either SHA_256 or
604  * SHA_384.
605  */
606 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) && \
607     ( ( !defined(MBEDTLS_HKDF_C) ) || \
608       ( !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA384_C) ) || \
609       ( !defined(MBEDTLS_PSA_CRYPTO_C) ) )
610 #error "MBEDTLS_SSL_PROTO_TLS1_3 defined, but not all prerequisites"
611 #endif
612 
613 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) &&                                    \
614     !(defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) ||                          \
615       defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) ||                      \
616       defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) ||                    \
617       defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) ||                  \
618       defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) ||                     \
619       defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) ||                   \
620       defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) ||                          \
621       defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) ||                      \
622       defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) ||                      \
623       defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) ||                    \
624       defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) )
625 #error "One or more versions of the TLS protocol are enabled " \
626         "but no key exchange methods defined with MBEDTLS_KEY_EXCHANGE_xxxx"
627 #endif
628 
629 #if defined(MBEDTLS_SSL_PROTO_DTLS)     && \
630     !defined(MBEDTLS_SSL_PROTO_TLS1_2)
631 #error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites"
632 #endif
633 
634 #if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C)
635 #error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites"
636 #endif
637 
638 #if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) ||     \
639     !defined(MBEDTLS_MD_C) )
640 #error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites"
641 #endif
642 
643 #if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C)
644 #error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites"
645 #endif
646 
647 #if defined(MBEDTLS_SSL_TLS_C) && !defined(MBEDTLS_SSL_PROTO_TLS1_2)
648 #error "MBEDTLS_SSL_TLS_C defined, but no protocols are active"
649 #endif
650 
651 #if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS)
652 #error "MBEDTLS_SSL_DTLS_HELLO_VERIFY  defined, but not all prerequisites"
653 #endif
654 
655 #if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \
656     !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
657 #error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE  defined, but not all prerequisites"
658 #endif
659 
660 #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) &&                              \
661     ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
662 #error "MBEDTLS_SSL_DTLS_ANTI_REPLAY  defined, but not all prerequisites"
663 #endif
664 
665 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) &&                              \
666     ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
667 #error "MBEDTLS_SSL_DTLS_CONNECTION_ID  defined, but not all prerequisites"
668 #endif
669 
670 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)            &&                 \
671     defined(MBEDTLS_SSL_CID_IN_LEN_MAX) &&                 \
672     MBEDTLS_SSL_CID_IN_LEN_MAX > 255
673 #error "MBEDTLS_SSL_CID_IN_LEN_MAX too large (max 255)"
674 #endif
675 
676 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)            &&                  \
677     defined(MBEDTLS_SSL_CID_OUT_LEN_MAX) &&                 \
678     MBEDTLS_SSL_CID_OUT_LEN_MAX > 255
679 #error "MBEDTLS_SSL_CID_OUT_LEN_MAX too large (max 255)"
680 #endif
681 
682 #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) &&   \
683     !defined(MBEDTLS_SSL_PROTO_TLS1_2)
684 #error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites"
685 #endif
686 
687 #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \
688     !defined(MBEDTLS_SSL_PROTO_TLS1_2)
689 #error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites"
690 #endif
691 
692 #if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C)
693 #error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites"
694 #endif
695 
696 #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \
697         !defined(MBEDTLS_X509_CRT_PARSE_C)
698 #error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites"
699 #endif
700 
701 #if defined(MBEDTLS_THREADING_PTHREAD)
702 #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
703 #error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites"
704 #endif
705 #define MBEDTLS_THREADING_IMPL
706 #endif
707 
708 #if defined(MBEDTLS_THREADING_ALT)
709 #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
710 #error "MBEDTLS_THREADING_ALT defined, but not all prerequisites"
711 #endif
712 #define MBEDTLS_THREADING_IMPL
713 #endif
714 
715 #if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL)
716 #error "MBEDTLS_THREADING_C defined, single threading implementation required"
717 #endif
718 #undef MBEDTLS_THREADING_IMPL
719 
720 #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_PSA_CRYPTO_C)
721 #error "MBEDTLS_USE_PSA_CRYPTO defined, but not all prerequisites"
722 #endif
723 
724 #if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C)
725 #error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites"
726 #endif
727 
728 #if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) ||  \
729     !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) ||      \
730     !defined(MBEDTLS_PK_PARSE_C) )
731 #error "MBEDTLS_X509_USE_C defined, but not all prerequisites"
732 #endif
733 
734 #if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) ||  \
735     !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) ||       \
736     !defined(MBEDTLS_PK_WRITE_C) )
737 #error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites"
738 #endif
739 
740 #if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
741 #error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites"
742 #endif
743 
744 #if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
745 #error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites"
746 #endif
747 
748 #if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
749 #error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites"
750 #endif
751 
752 #if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
753 #error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites"
754 #endif
755 
756 #if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
757 #error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites"
758 #endif
759 
760 #if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64)
761 #error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously"
762 #endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */
763 
764 #if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \
765     defined(MBEDTLS_HAVE_ASM)
766 #error "MBEDTLS_HAVE_INT32/MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously"
767 #endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */
768 
769 #if defined(MBEDTLS_SSL_DTLS_SRTP) && ( !defined(MBEDTLS_SSL_PROTO_DTLS) )
770 #error "MBEDTLS_SSL_DTLS_SRTP defined, but not all prerequisites"
771 #endif
772 
773 #if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH) && ( !defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) )
774 #error "MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH defined, but not all prerequisites"
775 #endif
776 
777 
778 
779 /* Reject attempts to enable options that have been removed and that could
780  * cause a build to succeed but with features removed. */
781 
782 #if defined(MBEDTLS_HAVEGE_C) //no-check-names
783 #error "MBEDTLS_HAVEGE_C was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/2599"
784 #endif
785 
786 #if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) //no-check-names
787 #error "MBEDTLS_SSL_HW_RECORD_ACCEL was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4031"
788 #endif
789 
790 #if defined(MBEDTLS_SSL_PROTO_SSL3) //no-check-names
791 #error "MBEDTLS_SSL_PROTO_SSL3 (SSL v3.0 support) was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4031"
792 #endif
793 
794 #if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO) //no-check-names
795 #error "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO (SSL v2 ClientHello support) was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4031"
796 #endif
797 
798 #if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) //no-check-names
799 #error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT (compatibility with the buggy implementation of truncated HMAC in Mbed TLS up to 2.7) was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4031"
800 #endif
801 
802 #if defined(MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES) //no-check-names
803 #error "MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES was removed in Mbed TLS 3.0. See the ChangeLog entry if you really need SHA-1-signed certificates."
804 #endif
805 
806 #if defined(MBEDTLS_ZLIB_SUPPORT) //no-check-names
807 #error "MBEDTLS_ZLIB_SUPPORT was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4031"
808 #endif
809 
810 #if defined(MBEDTLS_CHECK_PARAMS) //no-check-names
811 #error "MBEDTLS_CHECK_PARAMS was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4313"
812 #endif
813 
814 #if defined(MBEDTLS_SSL_CID_PADDING_GRANULARITY) //no-check-names
815 #error "MBEDTLS_SSL_CID_PADDING_GRANULARITY was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4335"
816 #endif
817 
818 #if defined(MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY) //no-check-names
819 #error "MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4335"
820 #endif
821 
822 #if defined(MBEDTLS_SSL_TRUNCATED_HMAC) //no-check-names
823 #error "MBEDTLS_SSL_TRUNCATED_HMAC was removed in Mbed TLS 3.0. See https://github.com/ARMmbed/mbedtls/issues/4341"
824 #endif
825 
826 /*
827  * Avoid warning from -pedantic. This is a convenient place for this
828  * workaround since this is included by every single file before the
829  * #if defined(MBEDTLS_xxx_C) that results in empty translation units.
830  */
831 typedef int mbedtls_iso_c_forbids_empty_translation_units;
832 
833 #endif /* MBEDTLS_CHECK_CONFIG_H */
834