blob: eb2fecd8deb3c8c5482fa6ee8bbda566e265b766 [file] [log] [blame]
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +02001/**
2 * \file check_config.h
3 *
4 * \brief Consistency checks for configuration options
5 *
Manuel Pégourié-Gonnarda658a402015-01-23 09:45:19 +00006 * Copyright (C) 2006-2014, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +02007 *
Manuel Pégourié-Gonnard860b5162015-01-28 17:12:07 +00008 * This file is part of mbed TLS (https://polarssl.org)
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +02009 *
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020010 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 */
24
25/*
26 * It is recommended to include this file from your config.h
27 * in order to catch dependency issues early.
28 */
29
30#ifndef POLARSSL_CHECK_CONFIG_H
31#define POLARSSL_CHECK_CONFIG_H
32
33#if defined(POLARSSL_AESNI_C) && !defined(POLARSSL_HAVE_ASM)
34#error "POLARSSL_AESNI_C defined, but not all prerequisites"
35#endif
36
37#if defined(POLARSSL_CERTS_C) && !defined(POLARSSL_PEM_PARSE_C)
38#error "POLARSSL_CERTS_C defined, but not all prerequisites"
39#endif
40
41#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
42#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
43#endif
44
45#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
46#error "POLARSSL_DHM_C defined, but not all prerequisites"
47#endif
48
49#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
50#error "POLARSSL_ECDH_C defined, but not all prerequisites"
51#endif
52
53#if defined(POLARSSL_ECDSA_C) && \
54 ( !defined(POLARSSL_ECP_C) || \
55 !defined(POLARSSL_ASN1_PARSE_C) || \
56 !defined(POLARSSL_ASN1_WRITE_C) )
57#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
58#endif
59
60#if defined(POLARSSL_ECDSA_DETERMINISTIC) && !defined(POLARSSL_HMAC_DRBG_C)
61#error "POLARSSL_ECDSA_DETERMINISTIC defined, but not all prerequisites"
62#endif
63
64#if defined(POLARSSL_ECP_C) && ( !defined(POLARSSL_BIGNUM_C) || ( \
65 !defined(POLARSSL_ECP_DP_SECP192R1_ENABLED) && \
66 !defined(POLARSSL_ECP_DP_SECP224R1_ENABLED) && \
67 !defined(POLARSSL_ECP_DP_SECP256R1_ENABLED) && \
68 !defined(POLARSSL_ECP_DP_SECP384R1_ENABLED) && \
69 !defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) && \
70 !defined(POLARSSL_ECP_DP_BP256R1_ENABLED) && \
71 !defined(POLARSSL_ECP_DP_BP384R1_ENABLED) && \
72 !defined(POLARSSL_ECP_DP_BP512R1_ENABLED) && \
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020073 !defined(POLARSSL_ECP_DP_SECP192K1_ENABLED) && \
74 !defined(POLARSSL_ECP_DP_SECP224K1_ENABLED) && \
75 !defined(POLARSSL_ECP_DP_SECP256K1_ENABLED) ) )
76#error "POLARSSL_ECP_C defined, but not all prerequisites"
77#endif
78
79#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
80 !defined(POLARSSL_SHA256_C))
81#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
82#endif
83#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
Paul Bakker770268f2014-05-05 11:40:14 +020084 defined(CTR_DRBG_ENTROPY_LEN) && (CTR_DRBG_ENTROPY_LEN > 64)
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020085#error "CTR_DRBG_ENTROPY_LEN value too high"
86#endif
87#if defined(POLARSSL_ENTROPY_C) && \
88 ( !defined(POLARSSL_SHA512_C) || defined(POLARSSL_ENTROPY_FORCE_SHA256) ) \
Paul Bakker770268f2014-05-05 11:40:14 +020089 && defined(CTR_DRBG_ENTROPY_LEN) && (CTR_DRBG_ENTROPY_LEN > 32)
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020090#error "CTR_DRBG_ENTROPY_LEN value too high"
91#endif
92#if defined(POLARSSL_ENTROPY_C) && \
93 defined(POLARSSL_ENTROPY_FORCE_SHA256) && !defined(POLARSSL_SHA256_C)
94#error "POLARSSL_ENTROPY_FORCE_SHA256 defined, but not all prerequisites"
95#endif
96
97#if defined(POLARSSL_GCM_C) && ( \
98 !defined(POLARSSL_AES_C) && !defined(POLARSSL_CAMELLIA_C) )
99#error "POLARSSL_GCM_C defined, but not all prerequisites"
100#endif
101
102#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
103#error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
104#endif
105
106#if defined(POLARSSL_HMAC_DRBG) && !defined(POLARSSL_MD_C)
107#error "POLARSSL_HMAC_DRBG_C defined, but not all prerequisites"
108#endif
109
110#if defined(POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \
111 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) )
112#error "POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites"
113#endif
114
115#if defined(POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \
116 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) )
117#error "POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites"
118#endif
119
120#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
121#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
122#endif
123
124#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \
125 !defined(POLARSSL_ECDH_C)
126#error "POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites"
127#endif
128
129#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
130 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
131 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
132#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
133#endif
134
135#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
136 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
137 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
138#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
139#endif
140
141#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
142 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \
143 !defined(POLARSSL_X509_CRT_PARSE_C) )
144#error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
145#endif
146
147#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
148 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
149 !defined(POLARSSL_PKCS1_V15) )
150#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
151#endif
152
153#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
154 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
155 !defined(POLARSSL_PKCS1_V15) )
156#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
157#endif
158
Manuel Pégourié-Gonnard0a155b82015-01-23 17:28:27 +0000159#if defined(POLARSSL_MEMORY_C) && !defined(POLARSSL_PLATFORM_C)
160#error "POLARSSL_MEMORY_C defined, but not all prerequisites"
161#endif
162
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200163#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && \
164 ( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) )
165#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
166#endif
167
168#if defined(POLARSSL_PADLOCK_C) && !defined(POLARSSL_HAVE_ASM)
169#error "POLARSSL_PADLOCK_C defined, but not all prerequisites"
170#endif
171
172#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
173#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
174#endif
175
176#if defined(POLARSSL_PEM_PARSE_C) && !defined(POLARSSL_BASE64_C)
177#error "POLARSSL_PEM_PARSE_C defined, but not all prerequisites"
178#endif
179
180#if defined(POLARSSL_PEM_WRITE_C) && !defined(POLARSSL_BASE64_C)
181#error "POLARSSL_PEM_WRITE_C defined, but not all prerequisites"
182#endif
183
Manuel Pégourié-Gonnard94de3312015-01-28 16:32:36 +0000184#if defined(POLARSSL_PK_C) && \
185 ( !defined(POLARSSL_RSA_C) && !defined(POLARSSL_ECP_C) )
186#error "POLARSSL_PK_C defined, but not all prerequisites"
187#endif
188
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200189#if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C)
190#error "POLARSSL_PK_PARSE_C defined, but not all prerequisites"
191#endif
192
193#if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C)
194#error "POLARSSL_PK_WRITE_C defined, but not all prerequisites"
195#endif
196
197#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
198#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
199#endif
200
Rich Evans4cc8a222015-02-03 11:26:31 +0000201#if defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) &&\
202 !defined(POLARSSL_PLATFORM_C)
203#error "POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS defined, but not prerequisites"
204#endif
205
Rich Evansc0b6da32015-02-03 10:58:06 +0000206#if defined(POLARSSL_PLATFORM_EXIT_ALT) && !defined(POLARSSL_PLATFORM_C)
207#error "POLARSSL_PLATFORM_EXIT_ALT defined, but not all prerequisites"
208#endif
209
Rich Evans4cc8a222015-02-03 11:26:31 +0000210#if defined(POLARSSL_PLATFORM_EXIT_MACRO) &&\
211 ( !defined(POLARSSL_PLATFORM_C) ||\
212 !defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
213#error "POLARSSL_PLATFORM_EXIT_MACRO defined, but not all prerequisites"
214#endif
215
216#if defined(POLARSSL_PLATFORM_EXIT_MACRO) &&\
217 ( defined(POLARSSL_PLATFORM_STD_EXIT) ||\
218 defined(POLARSSL_PLATFORM_EXIT_ALT) )
219#error "POLARSSL_PLATFORM_EXIT_MACRO and POLARSSL_PLATFORM_STD_EXIT/POLARSSL_PLATFORM_EXIT_ALT cannot be defined simultaneously"
220#endif
221
Rich Evansc0b6da32015-02-03 10:58:06 +0000222#if defined(POLARSSL_PLATFORM_FPRINTF_ALT) && !defined(POLARSSL_PLATFORM_C)
223#error "POLARSSL_PLATFORM_FPRINTF_ALT defined, but not all prerequisites"
224#endif
225
Rich Evans4cc8a222015-02-03 11:26:31 +0000226#if defined(POLARSSL_PLATFORM_FPRINTF_MACRO) &&\
227 ( !defined(POLARSSL_PLATFORM_C) ||\
228 !defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
229#error "POLARSSL_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites"
230#endif
231
232#if defined(POLARSSL_PLATFORM_FPRINTF_MACRO) &&\
233 ( defined(POLARSSL_PLATFORM_STD_FPRINTF) ||\
234 defined(POLARSSL_PLATFORM_FPRINTF_ALT) )
235#error "POLARSSL_PLATFORM_FPRINTF_MACRO and POLARSSL_PLATFORM_STD_FPRINTF/POLARSSL_PLATFORM_FPRINTF_ALT cannot be defined simultaneously"
236#endif
237
238#if defined(POLARSSL_PLATFORM_FREE_MACRO) &&\
239 ( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) ||\
240 !defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
241#error "POLARSSL_PLATFORM_FREE_MACRO defined, but not all prerequisites"
242#endif
243
244#if defined(POLARSSL_PLATFORM_FREE_MACRO) &&\
245 defined(POLARSSL_PLATFORM_STD_FREE)
246#error "POLARSSL_PLATFORM_FREE_MACRO and POLARSSL_PLATFORM_STD_FREE cannot be defined simultaneously"
247#endif
248
249#if defined(POLARSSL_PLATFORM_MALLOC_MACRO) &&\
250 ( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) ||\
251 !defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
252#error "POLARSSL_PLATFORM_MALLOC_MACRO defined, but not all prerequisites"
253#endif
254
255#if defined(POLARSSL_PLATFORM_MALLOC_MACRO) &&\
256 defined(POLARSSL_PLATFORM_STD_MALLOC)
257#error "POLARSSL_PLATFORM_MALLOC_MACRO and POLARSSL_PLATFORM_STD_MALLOC cannot be defined simultaneously"
258#endif
259
Rich Evansc0b6da32015-02-03 10:58:06 +0000260#if defined(POLARSSL_PLATFORM_MEMORY) && !defined(POLARSSL_PLATFORM_C)
261#error "POLARSSL_PLATFORM_MEMORY defined, but not all prerequisites"
262#endif
263
264#if defined(POLARSSL_PLATFORM_PRINTF_ALT) && !defined(POLARSSL_PLATFORM_C)
265#error "POLARSSL_PLATFORM_PRINTF_ALT defined, but not all prerequisites"
266#endif
267
Rich Evans4cc8a222015-02-03 11:26:31 +0000268#if defined(POLARSSL_PLATFORM_PRINTF_MACRO) &&\
269 ( !defined(POLARSSL_PLATFORM_C) ||\
270 !defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
271#error "POLARSSL_PLATFORM_PRINTF_MACRO defined, but not all prerequisites"
272#endif
273
274#if defined(POLARSSL_PLATFORM_PRINTF_MACRO) &&\
275 ( defined(POLARSSL_PLATFORM_STD_PRINTF) ||\
276 defined(POLARSSL_PLATFORM_PRINTF_ALT) )
277#error "POLARSSL_PLATFORM_PRINTF_MACRO and POLARSSL_PLATFORM_STD_PRINTF/POLARSSL_PLATFORM_PRINTF_ALT cannot be defined simultaneously"
278#endif
279
Rich Evansc0b6da32015-02-03 10:58:06 +0000280#if defined(POLARSSL_PLATFORM_SNPRINTF_ALT) && !defined(POLARSSL_PLATFORM_C)
281#error "POLARSSL_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites"
282#endif
283
Rich Evans46b0a8d2015-01-30 10:47:32 +0000284#if defined(POLARSSL_PLATFORM_SNPRINTF_ALT) && ( defined(_WIN32)\
285 && !defined(EFIX64) && !defined(EFI32) )
286#error "POLARSSL_PLATFORM_SNPRINTF_ALT defined but not available on Windows"
287#endif
288
Rich Evans4cc8a222015-02-03 11:26:31 +0000289#if defined(POLARSSL_PLATFORM_SNPRINTF_MACRO) &&\
290 ( !defined(POLARSSL_PLATFORM_C) ||\
291 !defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
292#error "POLARSSL_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites"
293#endif
294
295#if defined(POLARSSL_PLATFORM_SNPRINTF_MACRO) &&\
296 ( defined(POLARSSL_PLATFORM_STD_SNPRINTF) ||\
297 defined(POLARSSL_PLATFORM_SNPRINTF_ALT) )
298#error "POLARSSL_PLATFORM_SNPRINTF_MACRO and POLARSSL_PLATFORM_STD_SNPRINTF/POLARSSL_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously"
299#endif
300
Rich Evansc0b6da32015-02-03 10:58:06 +0000301#if defined(POLARSSL_PLATFORM_STD_MEM_HDR) &&\
302 !defined(POLARSSL_PLATFORM_NO_STD_FUNCTIONS)
303#error "POLARSSL_PLATFORM_STD_MEM_HDR defined, but not all prerequisites"
304#endif
305
306#if defined(POLARSSL_PLATFORM_STD_MALLOC) && !defined(POLARSSL_PLATFORM_MEMORY)
307#error "POLARSSL_PLATFORM_STD_MALLOC defined, but not all prerequisites"
308#endif
309
310#if defined(POLARSSL_PLATFORM_STD_MALLOC) && !defined(POLARSSL_PLATFORM_MEMORY)
311#error "POLARSSL_PLATFORM_STD_MALLOC defined, but not all prerequisites"
312#endif
313
314#if defined(POLARSSL_PLATFORM_STD_FREE) && !defined(POLARSSL_PLATFORM_MEMORY)
315#error "POLARSSL_PLATFORM_STD_FREE defined, but not all prerequisites"
316#endif
317
318#if defined(POLARSSL_PLATFORM_STD_EXIT) &&\
319 !defined(POLARSSL_PLATFORM_EXIT_ALT)
320#error "POLARSSL_PLATFORM_STD_EXIT defined, but not all prerequisites"
321#endif
322
323#if defined(POLARSSL_PLATFORM_STD_FPRINTF) &&\
324 !defined(POLARSSL_PLATFORM_FPRINTF_ALT)
325#error "POLARSSL_PLATFORM_STD_FPRINTF defined, but not all prerequisites"
326#endif
327
328#if defined(POLARSSL_PLATFORM_STD_PRINTF) &&\
329 !defined(POLARSSL_PLATFORM_PRINTF_ALT)
330#error "POLARSSL_PLATFORM_STD_PRINTF defined, but not all prerequisites"
331#endif
332
333#if defined(POLARSSL_PLATFORM_STD_SNPRINTF) &&\
334 !defined(POLARSSL_PLATFORM_SNPRINTF_ALT)
335#error "POLARSSL_PLATFORM_STD_SNPRINTF defined, but not all prerequisites"
336#endif
337
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200338#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
339 !defined(POLARSSL_OID_C) )
340#error "POLARSSL_RSA_C defined, but not all prerequisites"
341#endif
342
Manuel Pégourié-Gonnardd1539b12014-06-06 16:42:37 +0200343#if defined(POLARSSL_X509_RSASSA_PSS_SUPPORT) && \
Manuel Pégourié-Gonnard9df5c962014-01-24 14:37:29 +0100344 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_PKCS1_V21) )
Manuel Pégourié-Gonnardd1539b12014-06-06 16:42:37 +0200345#error "POLARSSL_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites"
Manuel Pégourié-Gonnard9df5c962014-01-24 14:37:29 +0100346#endif
347
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200348#if defined(POLARSSL_SSL_PROTO_SSL3) && ( !defined(POLARSSL_MD5_C) || \
349 !defined(POLARSSL_SHA1_C) )
350#error "POLARSSL_SSL_PROTO_SSL3 defined, but not all prerequisites"
351#endif
352
353#if defined(POLARSSL_SSL_PROTO_TLS1) && ( !defined(POLARSSL_MD5_C) || \
354 !defined(POLARSSL_SHA1_C) )
355#error "POLARSSL_SSL_PROTO_TLS1 defined, but not all prerequisites"
356#endif
357
358#if defined(POLARSSL_SSL_PROTO_TLS1_1) && ( !defined(POLARSSL_MD5_C) || \
359 !defined(POLARSSL_SHA1_C) )
360#error "POLARSSL_SSL_PROTO_TLS1_1 defined, but not all prerequisites"
361#endif
362
363#if defined(POLARSSL_SSL_PROTO_TLS1_2) && ( !defined(POLARSSL_SHA1_C) && \
364 !defined(POLARSSL_SHA256_C) && !defined(POLARSSL_SHA512_C) )
365#error "POLARSSL_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
366#endif
367
368#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
369#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
370#endif
371
372#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \
373 !defined(POLARSSL_MD_C) )
374#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
375#endif
376
377#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
378#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
379#endif
380
381#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
382 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
383 !defined(POLARSSL_SSL_PROTO_TLS1_2))
384#error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
385#endif
386
387#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
388 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
389#error "Illegal protocol selection"
390#endif
391
392#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
393 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
394#error "Illegal protocol selection"
395#endif
396
397#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
398 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
399 !defined(POLARSSL_SSL_PROTO_TLS1_1)))
400#error "Illegal protocol selection"
401#endif
402
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100403#if defined(POLARSSL_SSL_ENCRYPT_THEN_MAC) && \
404 !defined(POLARSSL_SSL_PROTO_TLS1) && \
405 !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
406 !defined(POLARSSL_SSL_PROTO_TLS1_2)
407#error "POLARSSL_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites"
408#endif
409
Manuel Pégourié-Gonnard769c6b62014-10-28 14:13:55 +0100410#if defined(POLARSSL_SSL_EXTENDED_MASTER_SECRET) && \
411 !defined(POLARSSL_SSL_PROTO_TLS1) && \
412 !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
413 !defined(POLARSSL_SSL_PROTO_TLS1_2)
414#error "POLARSSL_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites"
415#endif
416
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200417#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
418 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) || \
419 !defined(POLARSSL_CIPHER_MODE_CBC) )
420#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
421#endif
422
Manuel Pégourié-Gonnardd76314c2015-01-07 12:39:44 +0100423#if defined(POLARSSL_SSL_CBC_RECORD_SPLITTING) && \
424 !defined(POLARSSL_SSL_PROTO_SSL3) && !defined(POLARSSL_SSL_PROTO_TLS1)
425#error "POLARSSL_SSL_CBC_RECORD_SPLITTING defined, but not all prerequisites"
426#endif
427
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200428#if defined(POLARSSL_SSL_SERVER_NAME_INDICATION) && \
429 !defined(POLARSSL_X509_CRT_PARSE_C)
430#error "POLARSSL_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites"
431#endif
432
433#if defined(POLARSSL_THREADING_PTHREAD)
434#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
435#error "POLARSSL_THREADING_PTHREAD defined, but not all prerequisites"
436#endif
437#define POLARSSL_THREADING_IMPL
438#endif
439
440#if defined(POLARSSL_THREADING_ALT)
441#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
442#error "POLARSSL_THREADING_ALT defined, but not all prerequisites"
443#endif
444#define POLARSSL_THREADING_IMPL
445#endif
446
447#if defined(POLARSSL_THREADING_C) && !defined(POLARSSL_THREADING_IMPL)
448#error "POLARSSL_THREADING_C defined, single threading implementation required"
449#endif
450#undef POLARSSL_THREADING_IMPL
451
452#if defined(POLARSSL_VERSION_FEATURES) && !defined(POLARSSL_VERSION_C)
453#error "POLARSSL_VERSION_FEATURES defined, but not all prerequisites"
454#endif
455
456#if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
457 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
458 !defined(POLARSSL_PK_PARSE_C) )
459#error "POLARSSL_X509_USE_C defined, but not all prerequisites"
460#endif
461
462#if defined(POLARSSL_X509_CREATE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
463 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
464 !defined(POLARSSL_PK_WRITE_C) )
465#error "POLARSSL_X509_CREATE_C defined, but not all prerequisites"
466#endif
467
468#if defined(POLARSSL_X509_CRT_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
469#error "POLARSSL_X509_CRT_PARSE_C defined, but not all prerequisites"
470#endif
471
472#if defined(POLARSSL_X509_CRL_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
473#error "POLARSSL_X509_CRL_PARSE_C defined, but not all prerequisites"
474#endif
475
476#if defined(POLARSSL_X509_CSR_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
477#error "POLARSSL_X509_CSR_PARSE_C defined, but not all prerequisites"
478#endif
479
480#if defined(POLARSSL_X509_CRT_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
481#error "POLARSSL_X509_CRT_WRITE_C defined, but not all prerequisites"
482#endif
483
484#if defined(POLARSSL_X509_CSR_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
485#error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites"
486#endif
487
488#endif /* POLARSSL_CHECK_CONFIG_H */