PolarSSL v1.3.8
check_config.h
Go to the documentation of this file.
1 
28 /*
29  * It is recommended to include this file from your config.h
30  * in order to catch dependency issues early.
31  */
32 
33 #ifndef POLARSSL_CHECK_CONFIG_H
34 #define POLARSSL_CHECK_CONFIG_H
35 
36 #if defined(POLARSSL_AESNI_C) && !defined(POLARSSL_HAVE_ASM)
37 #error "POLARSSL_AESNI_C defined, but not all prerequisites"
38 #endif
39 
40 #if defined(POLARSSL_CERTS_C) && !defined(POLARSSL_PEM_PARSE_C)
41 #error "POLARSSL_CERTS_C defined, but not all prerequisites"
42 #endif
43 
44 #if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
45 #error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
46 #endif
47 
48 #if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
49 #error "POLARSSL_DHM_C defined, but not all prerequisites"
50 #endif
51 
52 #if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
53 #error "POLARSSL_ECDH_C defined, but not all prerequisites"
54 #endif
55 
56 #if defined(POLARSSL_ECDSA_C) && \
57  ( !defined(POLARSSL_ECP_C) || \
58  !defined(POLARSSL_ASN1_PARSE_C) || \
59  !defined(POLARSSL_ASN1_WRITE_C) )
60 #error "POLARSSL_ECDSA_C defined, but not all prerequisites"
61 #endif
62 
63 #if defined(POLARSSL_ECDSA_DETERMINISTIC) && !defined(POLARSSL_HMAC_DRBG_C)
64 #error "POLARSSL_ECDSA_DETERMINISTIC defined, but not all prerequisites"
65 #endif
66 
67 #if defined(POLARSSL_ECP_C) && ( !defined(POLARSSL_BIGNUM_C) || ( \
68  !defined(POLARSSL_ECP_DP_SECP192R1_ENABLED) && \
69  !defined(POLARSSL_ECP_DP_SECP224R1_ENABLED) && \
70  !defined(POLARSSL_ECP_DP_SECP256R1_ENABLED) && \
71  !defined(POLARSSL_ECP_DP_SECP384R1_ENABLED) && \
72  !defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) && \
73  !defined(POLARSSL_ECP_DP_BP256R1_ENABLED) && \
74  !defined(POLARSSL_ECP_DP_BP384R1_ENABLED) && \
75  !defined(POLARSSL_ECP_DP_BP512R1_ENABLED) && \
76  !defined(POLARSSL_ECP_DP_SECP192K1_ENABLED) && \
77  !defined(POLARSSL_ECP_DP_SECP224K1_ENABLED) && \
78  !defined(POLARSSL_ECP_DP_SECP256K1_ENABLED) ) )
79 #error "POLARSSL_ECP_C defined, but not all prerequisites"
80 #endif
81 
82 #if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
83  !defined(POLARSSL_SHA256_C))
84 #error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
85 #endif
86 #if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
87  defined(CTR_DRBG_ENTROPY_LEN) && (CTR_DRBG_ENTROPY_LEN > 64)
88 #error "CTR_DRBG_ENTROPY_LEN value too high"
89 #endif
90 #if defined(POLARSSL_ENTROPY_C) && \
91  ( !defined(POLARSSL_SHA512_C) || defined(POLARSSL_ENTROPY_FORCE_SHA256) ) \
92  && defined(CTR_DRBG_ENTROPY_LEN) && (CTR_DRBG_ENTROPY_LEN > 32)
93 #error "CTR_DRBG_ENTROPY_LEN value too high"
94 #endif
95 #if defined(POLARSSL_ENTROPY_C) && \
96  defined(POLARSSL_ENTROPY_FORCE_SHA256) && !defined(POLARSSL_SHA256_C)
97 #error "POLARSSL_ENTROPY_FORCE_SHA256 defined, but not all prerequisites"
98 #endif
99 
100 #if defined(POLARSSL_GCM_C) && ( \
101  !defined(POLARSSL_AES_C) && !defined(POLARSSL_CAMELLIA_C) )
102 #error "POLARSSL_GCM_C defined, but not all prerequisites"
103 #endif
104 
105 #if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
106 #error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
107 #endif
108 
109 #if defined(POLARSSL_HMAC_DRBG) && !defined(POLARSSL_MD_C)
110 #error "POLARSSL_HMAC_DRBG_C defined, but not all prerequisites"
111 #endif
112 
113 #if defined(POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \
114  ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) )
115 #error "POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites"
116 #endif
117 
118 #if defined(POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \
119  ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) )
120 #error "POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites"
121 #endif
122 
123 #if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
124 #error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
125 #endif
126 
127 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \
128  !defined(POLARSSL_ECDH_C)
129 #error "POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites"
130 #endif
131 
132 #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
133  ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
134  !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
135 #error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
136 #endif
137 
138 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
139  ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
140  !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
141 #error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
142 #endif
143 
144 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
145  ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \
146  !defined(POLARSSL_X509_CRT_PARSE_C) )
147 #error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
148 #endif
149 
150 #if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
151  ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
152  !defined(POLARSSL_PKCS1_V15) )
153 #error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
154 #endif
155 
156 #if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
157  ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
158  !defined(POLARSSL_PKCS1_V15) )
159 #error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
160 #endif
161 
162 #if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && \
163  ( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) )
164 #error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
165 #endif
166 
167 #if defined(POLARSSL_PADLOCK_C) && !defined(POLARSSL_HAVE_ASM)
168 #error "POLARSSL_PADLOCK_C defined, but not all prerequisites"
169 #endif
170 
171 #if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
172 #error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
173 #endif
174 
175 #if defined(POLARSSL_PEM_PARSE_C) && !defined(POLARSSL_BASE64_C)
176 #error "POLARSSL_PEM_PARSE_C defined, but not all prerequisites"
177 #endif
178 
179 #if defined(POLARSSL_PEM_WRITE_C) && !defined(POLARSSL_BASE64_C)
180 #error "POLARSSL_PEM_WRITE_C defined, but not all prerequisites"
181 #endif
182 
183 #if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C)
184 #error "POLARSSL_PK_PARSE_C defined, but not all prerequisites"
185 #endif
186 
187 #if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C)
188 #error "POLARSSL_PK_WRITE_C defined, but not all prerequisites"
189 #endif
190 
191 #if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
192 #error "POLARSSL_PKCS11_C defined, but not all prerequisites"
193 #endif
194 
195 #if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
196  !defined(POLARSSL_OID_C) )
197 #error "POLARSSL_RSA_C defined, but not all prerequisites"
198 #endif
199 
200 #if defined(POLARSSL_X509_RSASSA_PSS_SUPPORT) && \
201  ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_PKCS1_V21) )
202 #error "POLARSSL_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites"
203 #endif
204 
205 #if defined(POLARSSL_SSL_PROTO_SSL3) && ( !defined(POLARSSL_MD5_C) || \
206  !defined(POLARSSL_SHA1_C) )
207 #error "POLARSSL_SSL_PROTO_SSL3 defined, but not all prerequisites"
208 #endif
209 
210 #if defined(POLARSSL_SSL_PROTO_TLS1) && ( !defined(POLARSSL_MD5_C) || \
211  !defined(POLARSSL_SHA1_C) )
212 #error "POLARSSL_SSL_PROTO_TLS1 defined, but not all prerequisites"
213 #endif
214 
215 #if defined(POLARSSL_SSL_PROTO_TLS1_1) && ( !defined(POLARSSL_MD5_C) || \
216  !defined(POLARSSL_SHA1_C) )
217 #error "POLARSSL_SSL_PROTO_TLS1_1 defined, but not all prerequisites"
218 #endif
219 
220 #if defined(POLARSSL_SSL_PROTO_TLS1_2) && ( !defined(POLARSSL_SHA1_C) && \
221  !defined(POLARSSL_SHA256_C) && !defined(POLARSSL_SHA512_C) )
222 #error "POLARSSL_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
223 #endif
224 
225 #if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
226 #error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
227 #endif
228 
229 #if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \
230  !defined(POLARSSL_MD_C) )
231 #error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
232 #endif
233 
234 #if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
235 #error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
236 #endif
237 
238 #if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
239  !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
240  !defined(POLARSSL_SSL_PROTO_TLS1_2))
241 #error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
242 #endif
243 
244 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
245  defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
246 #error "Illegal protocol selection"
247 #endif
248 
249 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
250  defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
251 #error "Illegal protocol selection"
252 #endif
253 
254 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
255  defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
256  !defined(POLARSSL_SSL_PROTO_TLS1_1)))
257 #error "Illegal protocol selection"
258 #endif
259 
260 #if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
261  ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) || \
262  !defined(POLARSSL_CIPHER_MODE_CBC) )
263 #error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
264 #endif
265 
266 #if defined(POLARSSL_SSL_SERVER_NAME_INDICATION) && \
267  !defined(POLARSSL_X509_CRT_PARSE_C)
268 #error "POLARSSL_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites"
269 #endif
270 
271 #if defined(POLARSSL_THREADING_PTHREAD)
272 #if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
273 #error "POLARSSL_THREADING_PTHREAD defined, but not all prerequisites"
274 #endif
275 #define POLARSSL_THREADING_IMPL
276 #endif
277 
278 #if defined(POLARSSL_THREADING_ALT)
279 #if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
280 #error "POLARSSL_THREADING_ALT defined, but not all prerequisites"
281 #endif
282 #define POLARSSL_THREADING_IMPL
283 #endif
284 
285 #if defined(POLARSSL_THREADING_C) && !defined(POLARSSL_THREADING_IMPL)
286 #error "POLARSSL_THREADING_C defined, single threading implementation required"
287 #endif
288 #undef POLARSSL_THREADING_IMPL
289 
290 #if defined(POLARSSL_VERSION_FEATURES) && !defined(POLARSSL_VERSION_C)
291 #error "POLARSSL_VERSION_FEATURES defined, but not all prerequisites"
292 #endif
293 
294 #if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
295  !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
296  !defined(POLARSSL_PK_PARSE_C) )
297 #error "POLARSSL_X509_USE_C defined, but not all prerequisites"
298 #endif
299 
300 #if defined(POLARSSL_X509_CREATE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
301  !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
302  !defined(POLARSSL_PK_WRITE_C) )
303 #error "POLARSSL_X509_CREATE_C defined, but not all prerequisites"
304 #endif
305 
306 #if defined(POLARSSL_X509_CRT_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
307 #error "POLARSSL_X509_CRT_PARSE_C defined, but not all prerequisites"
308 #endif
309 
310 #if defined(POLARSSL_X509_CRL_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
311 #error "POLARSSL_X509_CRL_PARSE_C defined, but not all prerequisites"
312 #endif
313 
314 #if defined(POLARSSL_X509_CSR_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
315 #error "POLARSSL_X509_CSR_PARSE_C defined, but not all prerequisites"
316 #endif
317 
318 #if defined(POLARSSL_X509_CRT_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
319 #error "POLARSSL_X509_CRT_WRITE_C defined, but not all prerequisites"
320 #endif
321 
322 #if defined(POLARSSL_X509_CSR_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
323 #error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites"
324 #endif
325 
326 #endif /* POLARSSL_CHECK_CONFIG_H */