mbed TLS v2.2.0
check_config.h
Go to the documentation of this file.
1 
24 /*
25  * It is recommended to include this file from your config.h
26  * in order to catch dependency issues early.
27  */
28 
29 #ifndef MBEDTLS_CHECK_CONFIG_H
30 #define MBEDTLS_CHECK_CONFIG_H
31 
32 /*
33  * We assume CHAR_BIT is 8 in many places. In practice, this is true on our
34  * target platforms, so not an issue, but let's just be extra sure.
35  */
36 #include <limits.h>
37 #if CHAR_BIT != 8
38 #error "mbed TLS requires a platform with 8-bit chars"
39 #endif
40 
41 #if defined(_WIN32)
42 #if !defined(MBEDTLS_PLATFORM_C)
43 #error "MBEDTLS_PLATFORM_C is required on Windows"
44 #endif
45 
46 /* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as
47  * it would confuse config.pl. */
48 #if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
49  !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
50 #define MBEDTLS_PLATFORM_SNPRINTF_ALT
51 #endif
52 #endif /* _WIN32 */
53 
54 #if defined(TARGET_LIKE_MBED) && \
55  ( defined(MBEDTLS_NET_C) || defined(MBEDTLS_TIMING_C) )
56 #error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS"
57 #endif
58 
59 #if defined(MBEDTLS_DEPRECATED_WARNING) && \
60  !defined(__GNUC__) && !defined(__clang__)
61 #error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang"
62 #endif
63 
64 #if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME)
65 #error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense"
66 #endif
67 
68 #if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM)
69 #error "MBEDTLS_AESNI_C defined, but not all prerequisites"
70 #endif
71 
72 #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C)
73 #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites"
74 #endif
75 
76 #if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C)
77 #error "MBEDTLS_DHM_C defined, but not all prerequisites"
78 #endif
79 
80 #if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C)
81 #error "MBEDTLS_ECDH_C defined, but not all prerequisites"
82 #endif
83 
84 #if defined(MBEDTLS_ECDSA_C) && \
85  ( !defined(MBEDTLS_ECP_C) || \
86  !defined(MBEDTLS_ASN1_PARSE_C) || \
87  !defined(MBEDTLS_ASN1_WRITE_C) )
88 #error "MBEDTLS_ECDSA_C defined, but not all prerequisites"
89 #endif
90 
91 #if defined(MBEDTLS_ECJPAKE_C) && \
92  ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) )
93 #error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites"
94 #endif
95 
96 #if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C)
97 #error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites"
98 #endif
99 
100 #if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \
101  !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \
102  !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \
103  !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \
104  !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \
105  !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \
106  !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \
107  !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \
108  !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \
109  !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \
110  !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \
111  !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) ) )
112 #error "MBEDTLS_ECP_C defined, but not all prerequisites"
113 #endif
114 
115 #if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \
116  !defined(MBEDTLS_SHA256_C))
117 #error "MBEDTLS_ENTROPY_C defined, but not all prerequisites"
118 #endif
119 #if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \
120  defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64)
121 #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
122 #endif
123 #if defined(MBEDTLS_ENTROPY_C) && \
124  ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \
125  && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32)
126 #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
127 #endif
128 #if defined(MBEDTLS_ENTROPY_C) && \
129  defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C)
130 #error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites"
131 #endif
132 
133 #if defined(MBEDTLS_GCM_C) && ( \
134  !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) )
135 #error "MBEDTLS_GCM_C defined, but not all prerequisites"
136 #endif
137 
138 #if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C)
139 #error "MBEDTLS_HAVEGE_C defined, but not all prerequisites"
140 #endif
141 
142 #if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C)
143 #error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites"
144 #endif
145 
146 #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \
147  ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) )
148 #error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites"
149 #endif
150 
151 #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \
152  ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) )
153 #error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites"
154 #endif
155 
156 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C)
157 #error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
158 #endif
159 
160 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \
161  !defined(MBEDTLS_ECDH_C)
162 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites"
163 #endif
164 
165 #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
166  ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \
167  !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) )
168 #error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
169 #endif
170 
171 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
172  ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \
173  !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) )
174 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
175 #endif
176 
177 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
178  ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \
179  !defined(MBEDTLS_X509_CRT_PARSE_C) )
180 #error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
181 #endif
182 
183 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
184  ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
185  !defined(MBEDTLS_PKCS1_V15) )
186 #error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
187 #endif
188 
189 #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \
190  ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
191  !defined(MBEDTLS_PKCS1_V15) )
192 #error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
193 #endif
194 
195 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \
196  ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) || \
197  !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) )
198 #error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites"
199 #endif
200 
201 #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \
202  ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
203 #error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
204 #endif
205 
206 #if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM)
207 #error "MBEDTLS_PADLOCK_C defined, but not all prerequisites"
208 #endif
209 
210 #if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C)
211 #error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites"
212 #endif
213 
214 #if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C)
215 #error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites"
216 #endif
217 
218 #if defined(MBEDTLS_PK_C) && \
219  ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) )
220 #error "MBEDTLS_PK_C defined, but not all prerequisites"
221 #endif
222 
223 #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C)
224 #error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites"
225 #endif
226 
227 #if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C)
228 #error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites"
229 #endif
230 
231 #if defined(MBEDTLS_PKCS11_C) && !defined(MBEDTLS_PK_C)
232 #error "MBEDTLS_PKCS11_C defined, but not all prerequisites"
233 #endif
234 
235 #if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C)
236 #error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites"
237 #endif
238 
239 #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C)
240 #error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites"
241 #endif
242 
243 #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\
244  ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\
245  defined(MBEDTLS_PLATFORM_EXIT_ALT) )
246 #error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously"
247 #endif
248 
249 #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
250 #error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites"
251 #endif
252 
253 #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
254 #error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites"
255 #endif
256 
257 #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\
258  ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\
259  defined(MBEDTLS_PLATFORM_FPRINTF_ALT) )
260 #error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously"
261 #endif
262 
263 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
264  ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
265 #error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites"
266 #endif
267 
268 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
269  defined(MBEDTLS_PLATFORM_STD_FREE)
270 #error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously"
271 #endif
272 
273 #if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO)
274 #error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is"
275 #endif
276 
277 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
278  ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
279 #error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites"
280 #endif
281 
282 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
283  defined(MBEDTLS_PLATFORM_STD_CALLOC)
284 #error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously"
285 #endif
286 
287 #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO)
288 #error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is"
289 #endif
290 
291 #if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C)
292 #error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites"
293 #endif
294 
295 #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
296 #error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites"
297 #endif
298 
299 #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
300 #error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites"
301 #endif
302 
303 #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\
304  ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\
305  defined(MBEDTLS_PLATFORM_PRINTF_ALT) )
306 #error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously"
307 #endif
308 
309 #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
310 #error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites"
311 #endif
312 
313 #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
314 #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites"
315 #endif
316 
317 #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\
318  ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\
319  defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) )
320 #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously"
321 #endif
322 
323 #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\
324  !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS)
325 #error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites"
326 #endif
327 
328 #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY)
329 #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites"
330 #endif
331 
332 #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY)
333 #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites"
334 #endif
335 
336 #if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY)
337 #error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites"
338 #endif
339 
340 #if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\
341  !defined(MBEDTLS_PLATFORM_EXIT_ALT)
342 #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites"
343 #endif
344 
345 #if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\
346  !defined(MBEDTLS_PLATFORM_FPRINTF_ALT)
347 #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites"
348 #endif
349 
350 #if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\
351  !defined(MBEDTLS_PLATFORM_PRINTF_ALT)
352 #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites"
353 #endif
354 
355 #if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\
356  !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT)
357 #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites"
358 #endif
359 
360 #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
361  !defined(MBEDTLS_OID_C) )
362 #error "MBEDTLS_RSA_C defined, but not all prerequisites"
363 #endif
364 
365 #if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \
366  ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) )
367 #error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites"
368 #endif
369 
370 #if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) || \
371  !defined(MBEDTLS_SHA1_C) )
372 #error "MBEDTLS_SSL_PROTO_SSL3 defined, but not all prerequisites"
373 #endif
374 
375 #if defined(MBEDTLS_SSL_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) || \
376  !defined(MBEDTLS_SHA1_C) )
377 #error "MBEDTLS_SSL_PROTO_TLS1 defined, but not all prerequisites"
378 #endif
379 
380 #if defined(MBEDTLS_SSL_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) || \
381  !defined(MBEDTLS_SHA1_C) )
382 #error "MBEDTLS_SSL_PROTO_TLS1_1 defined, but not all prerequisites"
383 #endif
384 
385 #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \
386  !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) )
387 #error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
388 #endif
389 
390 #if defined(MBEDTLS_SSL_PROTO_DTLS) && \
391  !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
392  !defined(MBEDTLS_SSL_PROTO_TLS1_2)
393 #error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites"
394 #endif
395 
396 #if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C)
397 #error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites"
398 #endif
399 
400 #if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \
401  !defined(MBEDTLS_MD_C) )
402 #error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites"
403 #endif
404 
405 #if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C)
406 #error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites"
407 #endif
408 
409 #if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \
410  !defined(MBEDTLS_SSL_PROTO_TLS1) && !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
411  !defined(MBEDTLS_SSL_PROTO_TLS1_2))
412 #error "MBEDTLS_SSL_TLS_C defined, but no protocols are active"
413 #endif
414 
415 #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \
416  defined(MBEDTLS_SSL_PROTO_TLS1_1) && !defined(MBEDTLS_SSL_PROTO_TLS1))
417 #error "Illegal protocol selection"
418 #endif
419 
420 #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \
421  defined(MBEDTLS_SSL_PROTO_TLS1_2) && !defined(MBEDTLS_SSL_PROTO_TLS1_1))
422 #error "Illegal protocol selection"
423 #endif
424 
425 #if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \
426  defined(MBEDTLS_SSL_PROTO_TLS1_2) && (!defined(MBEDTLS_SSL_PROTO_TLS1) || \
427  !defined(MBEDTLS_SSL_PROTO_TLS1_1)))
428 #error "Illegal protocol selection"
429 #endif
430 
431 #if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS)
432 #error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites"
433 #endif
434 
435 #if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \
436  !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
437 #error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites"
438 #endif
439 
440 #if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \
441  ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
442 #error "MBEDTLS_SSL_DTLS_ANTI_REPLAY defined, but not all prerequisites"
443 #endif
444 
445 #if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) && \
446  ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
447 #error "MBEDTLS_SSL_DTLS_BADMAC_LIMIT defined, but not all prerequisites"
448 #endif
449 
450 #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \
451  !defined(MBEDTLS_SSL_PROTO_TLS1) && \
452  !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
453  !defined(MBEDTLS_SSL_PROTO_TLS1_2)
454 #error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites"
455 #endif
456 
457 #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \
458  !defined(MBEDTLS_SSL_PROTO_TLS1) && \
459  !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
460  !defined(MBEDTLS_SSL_PROTO_TLS1_2)
461 #error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites"
462 #endif
463 
464 #if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C)
465 #error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites"
466 #endif
467 
468 #if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) && \
469  !defined(MBEDTLS_SSL_PROTO_SSL3) && !defined(MBEDTLS_SSL_PROTO_TLS1)
470 #error "MBEDTLS_SSL_CBC_RECORD_SPLITTING defined, but not all prerequisites"
471 #endif
472 
473 #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \
474  !defined(MBEDTLS_X509_CRT_PARSE_C)
475 #error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites"
476 #endif
477 
478 #if defined(MBEDTLS_THREADING_PTHREAD)
479 #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
480 #error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites"
481 #endif
482 #define MBEDTLS_THREADING_IMPL
483 #endif
484 
485 #if defined(MBEDTLS_THREADING_ALT)
486 #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
487 #error "MBEDTLS_THREADING_ALT defined, but not all prerequisites"
488 #endif
489 #define MBEDTLS_THREADING_IMPL
490 #endif
491 
492 #if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL)
493 #error "MBEDTLS_THREADING_C defined, single threading implementation required"
494 #endif
495 #undef MBEDTLS_THREADING_IMPL
496 
497 #if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C)
498 #error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites"
499 #endif
500 
501 #if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
502  !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \
503  !defined(MBEDTLS_PK_PARSE_C) )
504 #error "MBEDTLS_X509_USE_C defined, but not all prerequisites"
505 #endif
506 
507 #if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
508  !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \
509  !defined(MBEDTLS_PK_WRITE_C) )
510 #error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites"
511 #endif
512 
513 #if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
514 #error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites"
515 #endif
516 
517 #if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
518 #error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites"
519 #endif
520 
521 #if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
522 #error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites"
523 #endif
524 
525 #if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
526 #error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites"
527 #endif
528 
529 #if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
530 #error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites"
531 #endif
532 
533 /*
534  * Avoid warning from -pedantic. This is a convenient place for this
535  * workaround since this is included by every single file before the
536  * #if defined(MBEDTLS_xxx_C) that results in emtpy translation units.
537  */
539 
540 #endif /* MBEDTLS_CHECK_CONFIG_H */
int mbedtls_iso_c_forbids_empty_translation_units
Definition: check_config.h:538