blob: 9fc5458a76c034040853ba12e4965c23250f73c0 [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/**
2 * \file config.h
3 *
Paul Bakker37ca75d2011-01-06 12:28:03 +00004 * \brief Configuration options (set of defines)
5 *
Paul Bakker9bcf16c2013-06-24 19:31:17 +02006 * Copyright (C) 2006-2013, Brainspark B.V.
Paul Bakkerb96f1542010-07-18 20:36:00 +00007 *
8 * This file is part of PolarSSL (http://www.polarssl.org)
Paul Bakker84f12b72010-07-18 10:13:04 +00009 * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
Paul Bakkerb96f1542010-07-18 20:36:00 +000010 *
Paul Bakker77b385e2009-07-28 17:23:11 +000011 * All rights reserved.
Paul Bakkere0ccd0a2009-01-04 16:27:10 +000012 *
Paul Bakkere0ccd0a2009-01-04 16:27:10 +000013 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 *
Paul Bakker5121ce52009-01-03 21:22:43 +000027 * This set of compile-time options may be used to enable
28 * or disable features selectively, and reduce the global
29 * memory footprint.
30 */
Paul Bakker40e46942009-01-03 21:51:57 +000031#ifndef POLARSSL_CONFIG_H
32#define POLARSSL_CONFIG_H
Paul Bakker5121ce52009-01-03 21:22:43 +000033
Paul Bakkercce9d772011-11-18 14:26:47 +000034#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
Paul Bakker5121ce52009-01-03 21:22:43 +000035#define _CRT_SECURE_NO_DEPRECATE 1
36#endif
37
Paul Bakkerf3b86c12011-01-27 15:24:17 +000038/**
Paul Bakker0a62cd12011-01-21 11:00:08 +000039 * \name SECTION: System support
40 *
41 * This section sets system specific settings.
42 * \{
43 */
44
Paul Bakkerf3b86c12011-01-27 15:24:17 +000045/**
46 * \def POLARSSL_HAVE_INT8
Paul Bakker5121ce52009-01-03 21:22:43 +000047 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +000048 * The system uses 8-bit wide native integers.
49 *
50 * Uncomment if native integers are 8-bit wide.
Paul Bakker40e46942009-01-03 21:51:57 +000051#define POLARSSL_HAVE_INT8
Paul Bakker5121ce52009-01-03 21:22:43 +000052 */
53
Paul Bakkerf3b86c12011-01-27 15:24:17 +000054/**
55 * \def POLARSSL_HAVE_INT16
Paul Bakker5121ce52009-01-03 21:22:43 +000056 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +000057 * The system uses 16-bit wide native integers.
58 *
59 * Uncomment if native integers are 16-bit wide.
Paul Bakker40e46942009-01-03 21:51:57 +000060#define POLARSSL_HAVE_INT16
Paul Bakker5121ce52009-01-03 21:22:43 +000061 */
62
Paul Bakkerf3b86c12011-01-27 15:24:17 +000063/**
Paul Bakker62261d62012-10-02 12:19:31 +000064 * \def POLARSSL_HAVE_LONGLONG
Paul Bakker5121ce52009-01-03 21:22:43 +000065 *
Paul Bakker62261d62012-10-02 12:19:31 +000066 * The compiler supports the 'long long' type.
67 * (Only used on 32-bit platforms)
Paul Bakker5121ce52009-01-03 21:22:43 +000068 */
Paul Bakker62261d62012-10-02 12:19:31 +000069#define POLARSSL_HAVE_LONGLONG
Paul Bakker5121ce52009-01-03 21:22:43 +000070
Paul Bakkerf3b86c12011-01-27 15:24:17 +000071/**
72 * \def POLARSSL_HAVE_ASM
73 *
74 * The compiler has support for asm()
75 *
Paul Bakker5121ce52009-01-03 21:22:43 +000076 * Uncomment to enable the use of assembly code.
Paul Bakker68041ec2009-04-19 21:17:55 +000077 *
78 * Requires support for asm() in compiler.
79 *
80 * Used in:
81 * library/timing.c
82 * library/padlock.c
83 * include/polarssl/bn_mul.h
84 *
Paul Bakker5121ce52009-01-03 21:22:43 +000085 */
Paul Bakker40e46942009-01-03 21:51:57 +000086#define POLARSSL_HAVE_ASM
Paul Bakker5121ce52009-01-03 21:22:43 +000087
Paul Bakkerf3b86c12011-01-27 15:24:17 +000088/**
89 * \def POLARSSL_HAVE_SSE2
90 *
Paul Bakkere23c3152012-10-01 14:42:47 +000091 * CPU supports SSE2 instruction set.
Paul Bakkerf3b86c12011-01-27 15:24:17 +000092 *
Paul Bakker5121ce52009-01-03 21:22:43 +000093 * Uncomment if the CPU supports SSE2 (IA-32 specific).
94 *
Paul Bakker40e46942009-01-03 21:51:57 +000095#define POLARSSL_HAVE_SSE2
Paul Bakker5121ce52009-01-03 21:22:43 +000096 */
Paul Bakkerfa9b1002013-07-03 15:31:03 +020097
98/**
99 * \def POLARSSL_HAVE_TIME
100 *
101 * System has time.h and time() / localtime() / gettimeofday()
102 *
103 * Comment if your system does not support time functions
104 */
105#define POLARSSL_HAVE_TIME
Paul Bakker0a62cd12011-01-21 11:00:08 +0000106/* \} name */
107
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000108/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000109 * \name SECTION: PolarSSL feature support
110 *
111 * This section sets support for features that are or are not needed
112 * within the modules that are enabled.
113 * \{
114 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000115
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000116/**
Paul Bakker90995b52013-06-24 19:20:35 +0200117 * \def POLARSSL_XXX_ALT
118 *
119 * Uncomment a macro to let PolarSSL use your alternate core implementation of
120 * a symmetric or hash algorithm (e.g. platform specific assembly optimized
121 * implementations). Keep in mind that the function prototypes should remain
122 * the same.
123 *
124 * Example: In case you uncomment POLARSSL_AES_ALT, PolarSSL will no longer
125 * provide the "struct aes_context" definition and omit the base function
126 * declarations and implementations. "aes_alt.h" will be included from
127 * "aes.h" to include the new function definitions.
128 *
129 * Uncomment a macro to enable alternate implementation for core algorithm
130 * functions
131#define POLARSSL_AES_ALT
132#define POLARSSL_ARC4_ALT
133#define POLARSSL_BLOWFISH_ALT
134#define POLARSSL_CAMELLIA_ALT
135#define POLARSSL_DES_ALT
136#define POLARSSL_XTEA_ALT
137#define POLARSSL_MD2_ALT
138#define POLARSSL_MD4_ALT
139#define POLARSSL_MD5_ALT
140#define POLARSSL_SHA1_ALT
Paul Bakker9e36f042013-06-30 14:34:05 +0200141#define POLARSSL_SHA256_ALT
142#define POLARSSL_SHA512_ALT
Paul Bakker90995b52013-06-24 19:20:35 +0200143 */
144
145/**
Paul Bakker15566e42011-04-24 21:19:15 +0000146 * \def POLARSSL_AES_ROM_TABLES
147 *
148 * Store the AES tables in ROM.
149 *
150 * Uncomment this macro to store the AES tables in ROM.
151 *
152#define POLARSSL_AES_ROM_TABLES
153 */
154
155/**
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000156 * \def POLARSSL_CIPHER_MODE_CFB
157 *
158 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
159 */
160#define POLARSSL_CIPHER_MODE_CFB
161
162/**
163 * \def POLARSSL_CIPHER_MODE_CTR
164 *
165 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
166 */
167#define POLARSSL_CIPHER_MODE_CTR
168
169/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000170 * \def POLARSSL_CIPHER_NULL_CIPHER
171 *
172 * Enable NULL cipher.
173 * Warning: Only do so when you know what you are doing. This allows for
174 * encryption or channels without any security!
175 *
176 * Requires POLARSSL_ENABLE_WEAK_CIPHERSUITES as well to enable
177 * the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000178 * TLS_RSA_WITH_NULL_MD5
179 * TLS_RSA_WITH_NULL_SHA
180 * TLS_RSA_WITH_NULL_SHA256
Paul Bakker41c83d32013-03-20 14:39:14 +0100181 * TLS_ECDHE_RSA_WITH_NULL_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200182 * TLS_PSK_WITH_NULL
183 * TLS_PSK_WITH_NULL256
184 * TLS_PSK_WITH_NULL384
185 * TLS_DHE_PSK_WITH_NULL
186 * TLS_DHE_PSK_WITH_NULL256
187 * TLS_DHE_PSK_WITH_NULL384
188 * TLS_RSA_PSK_WITH_NULL
189 * TLS_RSA_PSK_WITH_NULL256
190 * TLS_RSA_PSK_WITH_NULL384
Paul Bakkerfab5c822012-02-06 16:45:10 +0000191 *
192 * Uncomment this macro to enable the NULL cipher and ciphersuites
193#define POLARSSL_CIPHER_NULL_CIPHER
194 */
195
196/**
Paul Bakker48e93c82013-08-14 12:21:18 +0200197 * \def POLARSSL_CIPHER_PADDING_XXX
198 *
199 * Uncomment or comment macros to add support for specific padding modes
200 * in the cipher layer with cipher modes that support padding (e.g. CBC)
201 *
202 * If you disable all padding modes, only full blocks can be used with CBC.
203 *
204 * Enable padding modes in the cipher layer.
205 */
206#define POLARSSL_CIPHER_PADDING_PKCS7
207#define POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS
208#define POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN
209#define POLARSSL_CIPHER_PADDING_ZEROS
210
211/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000212 * \def POLARSSL_ENABLE_WEAK_CIPHERSUITES
213 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000214 * Enable weak ciphersuites in SSL / TLS
Paul Bakkerfab5c822012-02-06 16:45:10 +0000215 * Warning: Only do so when you know what you are doing. This allows for
Paul Bakker9a736322012-11-14 12:39:52 +0000216 * channels with virtually no security at all!
Paul Bakkerfab5c822012-02-06 16:45:10 +0000217 *
218 * This enables the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000219 * TLS_RSA_WITH_DES_CBC_SHA
220 * TLS_DHE_RSA_WITH_DES_CBC_SHA
Paul Bakkerfab5c822012-02-06 16:45:10 +0000221 *
222 * Uncomment this macro to enable weak ciphersuites
223#define POLARSSL_ENABLE_WEAK_CIPHERSUITES
224 */
225
226/**
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200227 * \def POLARSSL_ECP_XXXX_ENABLED
228 *
229 * Enables specific curves within the Elliptic Curve module.
230 * By default all supported curves are enables.
231 *
232 * Comment macros to disable the curve and functions for it
233 */
234#define POLARSSL_ECP_DP_SECP192R1_ENABLED
235#define POLARSSL_ECP_DP_SECP224R1_ENABLED
236#define POLARSSL_ECP_DP_SECP256R1_ENABLED
237#define POLARSSL_ECP_DP_SECP384R1_ENABLED
238#define POLARSSL_ECP_DP_SECP521R1_ENABLED
239
240/**
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200241 * \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED
242 *
243 * Enable the PSK based ciphersuite modes in SSL / TLS
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200244 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200245 * This enables the following ciphersuites (if other requisites are
246 * enabled as well):
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200247 * TLS_PSK_WITH_RC4_128_SHA
248 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
249 * TLS_PSK_WITH_AES_128_CBC_SHA
250 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200251 * TLS_PSK_WITH_AES_128_CBC_SHA256
252 * TLS_PSK_WITH_AES_256_CBC_SHA384
253 * TLS_PSK_WITH_AES_128_GCM_SHA256
254 * TLS_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200255 */
256#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED
257
258/**
Paul Bakkere07f41d2013-04-19 09:08:57 +0200259 * \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
260 *
261 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS
262 *
263 * Requires: POLARSSL_DHM_C
264 *
265 * This enables the following ciphersuites (if other requisites are
266 * enabled as well):
267 * TLS_DHE_PSK_WITH_RC4_128_SHA
268 * TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
269 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA
270 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200271 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
272 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
273 * TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
274 * TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200275 */
Paul Bakker48f7a5d2013-04-19 14:30:58 +0200276#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200277
278/**
279 * \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
280 *
281 * Enable the RSA-PSK based ciphersuite modes in SSL / TLS
Paul Bakker45bda902013-04-19 22:28:21 +0200282 * (NOT YET IMPLEMENTED)
Paul Bakkere07f41d2013-04-19 09:08:57 +0200283 * Requires: POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
284 *
285 * This enables the following ciphersuites (if other requisites are
286 * enabled as well):
287 * TLS_RSA_PSK_WITH_RC4_128_SHA
288 * TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
289 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA
290 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200291 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
292 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
293 * TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
294 * TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200295#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
296 */
297
298/**
299 * \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED
300 *
301 * Enable the RSA-only based ciphersuite modes in SSL / TLS
302 *
303 * Requires: POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
304 *
305 * This enables the following ciphersuites (if other requisites are
306 * enabled as well):
307 * TLS_RSA_WITH_AES_128_CBC_SHA
308 * TLS_RSA_WITH_AES_256_CBC_SHA
309 * TLS_RSA_WITH_AES_128_CBC_SHA256
310 * TLS_RSA_WITH_AES_256_CBC_SHA256
311 * TLS_RSA_WITH_AES_128_GCM_SHA256
312 * TLS_RSA_WITH_AES_256_GCM_SHA384
313 * TLS_RSA_WITH_RC4_128_MD5
314 * TLS_RSA_WITH_RC4_128_SHA
315 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
316 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
317 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
318 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
319 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
320 */
321#define POLARSSL_KEY_EXCHANGE_RSA_ENABLED
322
323/**
324 * \def POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
325 *
326 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS
327 *
328 * Requires: POLARSSL_DHM_C, POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
329 *
330 * This enables the following ciphersuites (if other requisites are
331 * enabled as well):
332 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
333 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
334 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
335 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
336 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
337 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
338 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
339 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
340 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
341 */
342#define POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
343
344/**
345 * \def POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
346 *
347 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS
348 *
349 * Requires: POLARSSL_ECDH_C, POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
350 *
351 * This enables the following ciphersuites (if other requisites are
352 * enabled as well):
353 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
354 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
355 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
356 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
357 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
358 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
359 * TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
360 * TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
361 * TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
362 * TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
363 */
364#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
365
366/**
Paul Bakkere2ab84f2013-06-29 18:24:32 +0200367 * \def POLARSSL_ERROR_STRERROR_BC
368 *
369 * Make available the backward compatible error_strerror() next to the
370 * current polarssl_strerror().
371 *
372 * Disable if you run into name conflicts and want to really remove the
373 * error_strerror()
374 */
375#define POLARSSL_ERROR_STRERROR_BC
376
377/**
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100378 * \def POLARSSL_ERROR_STRERROR_DUMMY
379 *
380 * Enable a dummy error function to make use of error_strerror() in
381 * third party libraries easier.
382 *
383 * Disable if you run into name conflicts and want to really remove the
384 * error_strerror()
385 */
386#define POLARSSL_ERROR_STRERROR_DUMMY
387
388/**
Paul Bakker15566e42011-04-24 21:19:15 +0000389 * \def POLARSSL_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000390 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000391 * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C
392 *
Paul Bakker15566e42011-04-24 21:19:15 +0000393 * Enable the RSA prime-number generation code.
Paul Bakker5121ce52009-01-03 21:22:43 +0000394 */
Paul Bakker15566e42011-04-24 21:19:15 +0000395#define POLARSSL_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000396
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000397/**
Paul Bakker335db3f2011-04-25 15:28:35 +0000398 * \def POLARSSL_FS_IO
399 *
400 * Enable functions that use the filesystem.
401 */
402#define POLARSSL_FS_IO
403
404/**
Paul Bakker43655f42011-12-15 20:11:16 +0000405 * \def POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
406 *
407 * Do not add default entropy sources. These are the platform specific,
408 * hardclock and HAVEGE based poll functions.
409 *
410 * This is useful to have more control over the added entropy sources in an
411 * application.
412 *
413 * Uncomment this macro to prevent loading of default entropy functions.
414#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
415 */
416
417/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000418 * \def POLARSSL_NO_PLATFORM_ENTROPY
419 *
420 * Do not use built-in platform entropy functions.
421 * This is useful if your platform does not support
422 * standards like the /dev/urandom or Windows CryptoAPI.
423 *
424 * Uncomment this macro to disable the built-in platform entropy functions.
425#define POLARSSL_NO_PLATFORM_ENTROPY
426 */
427
428/**
Paul Bakker6e339b52013-07-03 13:37:05 +0200429 * \def POLARSSL_MEMORY_DEBUG
430 *
431 * Enable debugging of buffer allocator memory issues. Automatically prints
432 * (to stderr) all (fatal) messages on memory allocation issues. Enables
433 * function for 'debug output' of allocated memory.
434 *
435 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
436 * fprintf()
437 *
438 * Uncomment this macro to let the buffer allocator print out error messages.
439#define POLARSSL_MEMORY_DEBUG
440*/
441
442/**
443 * \def POLARSSL_MEMORY_BACKTRACE
444 *
445 * Include backtrace information with each allocated block.
446 *
447 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
448 * GLIBC-compatible backtrace() an backtrace_symbols() support
449 *
450 * Uncomment this macro to include backtrace information
451#define POLARSSL_MEMORY_BACKTRACE
452 */
453
454/**
Paul Bakker9dcc3222011-03-08 14:16:06 +0000455 * \def POLARSSL_PKCS1_V21
456 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000457 * Requires: POLARSSL_MD_C, POLARSSL_RSA_C
458 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000459 * Enable support for PKCS#1 v2.1 encoding.
460 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
461 */
462#define POLARSSL_PKCS1_V21
463
464/**
Paul Bakker0216cc12011-03-26 13:40:23 +0000465 * \def POLARSSL_RSA_NO_CRT
466 *
467 * Do not use the Chinese Remainder Theorem for the RSA private operation.
468 *
469 * Uncomment this macro to disable the use of CRT in RSA.
470 *
471#define POLARSSL_RSA_NO_CRT
472 */
Paul Bakker15566e42011-04-24 21:19:15 +0000473
474/**
475 * \def POLARSSL_SELF_TEST
476 *
477 * Enable the checkup functions (*_self_test).
478 */
479#define POLARSSL_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000480
481/**
Paul Bakker40865c82013-01-31 17:13:13 +0100482 * \def POLARSSL_SSL_ALL_ALERT_MESSAGES
483 *
484 * Enable sending of alert messages in case of encountered errors as per RFC.
485 * If you choose not to send the alert messages, PolarSSL can still communicate
486 * with other servers, only debugging of failures is harder.
487 *
488 * The advantage of not sending alert messages, is that no information is given
489 * about reasons for failures thus preventing adversaries of gaining intel.
490 *
491 * Enable sending of all alert messages
492 */
493#define POLARSSL_SSL_ALERT_MESSAGES
494
495/**
Paul Bakkerd66f0702013-01-31 16:57:45 +0100496 * \def POLARSSL_SSL_DEBUG_ALL
497 *
498 * Enable the debug messages in SSL module for all issues.
499 * Debug messages have been disabled in some places to prevent timing
500 * attacks due to (unbalanced) debugging function calls.
501 *
502 * If you need all error reporting you should enable this during debugging,
503 * but remove this for production servers that should log as well.
504 *
505 * Uncomment this macro to report all debug messages on errors introducing
506 * a timing side-channel.
507 *
508#define POLARSSL_SSL_DEBUG_ALL
509 */
510
511/**
Paul Bakker05ef8352012-05-08 09:17:57 +0000512 * \def POLARSSL_SSL_HW_RECORD_ACCEL
513 *
514 * Enable hooking functions in SSL module for hardware acceleration of
515 * individual records.
516 *
517 * Uncomment this macro to enable hooking functions.
518#define POLARSSL_SSL_HW_RECORD_ACCEL
519 */
520
521/**
Paul Bakker78a8c712013-03-06 17:01:52 +0100522 * \def POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
523 *
524 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
525 * SSL Server module (POLARSSL_SSL_SRV_C)
526 *
527 * Comment this macro to disable support for SSLv2 Client Hello messages.
528 */
529#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
530
531/**
Paul Bakker05decb22013-08-15 13:33:48 +0200532 * \def POLARSSL_SSL_MAX_FRAGMENT_LENGTH
533 *
534 * Enable support for RFC 6066 max_fragment_length extension in SSL
535 *
536 * Comment this macro to disable support for the max_fragment_length extension
537 */
538#define POLARSSL_SSL_MAX_FRAGMENT_LENGTH
539
540/**
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200541 * \def POLARSSL_SSL_PROTO_SSL3
542 *
543 * Enable support for SSL 3.0
544 *
545 * Requires: POLARSSL_MD5_C
546 * POLARSSL_SHA1_C
547 *
548 * Comment this macro to disable support for SSL 3.0
549 */
550#define POLARSSL_SSL_PROTO_SSL3
551
552/**
553 * \def POLARSSL_SSL_PROTO_TLS1
554 *
555 * Enable support for TLS 1.0
556 *
557 * Requires: POLARSSL_MD5_C
558 * POLARSSL_SHA1_C
559 *
560 * Comment this macro to disable support for TLS 1.0
561 */
562#define POLARSSL_SSL_PROTO_TLS1
563
564/**
565 * \def POLARSSL_SSL_PROTO_TLS1_1
566 *
567 * Enable support for TLS 1.1
568 *
569 * Requires: POLARSSL_MD5_C
570 * POLARSSL_SHA1_C
571 *
572 * Comment this macro to disable support for TLS 1.1
573 */
574#define POLARSSL_SSL_PROTO_TLS1_1
575
576/**
577 * \def POLARSSL_SSL_PROTO_TLS1_2
578 *
579 * Enable support for TLS 1.2
580 *
581 * Requires: POLARSSL_SHA256_C or POLARSSL_SHA512_C
582 * (Depends on ciphersuites)
583 *
584 * Comment this macro to disable support for TLS 1.2
585 */
586#define POLARSSL_SSL_PROTO_TLS1_2
587
588/**
Paul Bakkera503a632013-08-14 13:48:06 +0200589 * \def POLARSSL_SSL_SESSION_TICKETS
590 *
591 * Enable support for RFC 5077 session tickets in SSL
592 *
593 * Requires: POLARSSL_AES_C
594 * POLARSSL_SHA256_C
595 *
596 * Comment this macro to disable support for SSL session tickets
597 */
598#define POLARSSL_SSL_SESSION_TICKETS
599
600/**
Paul Bakker1f2bc622013-08-15 13:45:55 +0200601 * \def POLARSSL_SSL_TRUNCATED_HMAC
602 *
603 * Enable support for RFC 6066 truncated HMAC in SSL
604 *
605 * Comment this macro to disable support for truncated HMAC in SSL
606 */
607#define POLARSSL_SSL_TRUNCATED_HMAC
608
609/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000610 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
611 *
612 * If set, the X509 parser will not break-off when parsing an X509 certificate
613 * and encountering an unknown critical extension.
614 *
615 * Uncomment to prevent an error.
616 *
617#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
618 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000619
620/**
621 * \def POLARSSL_ZLIB_SUPPORT
622 *
623 * If set, the SSL/TLS module uses ZLIB to support compression and
624 * decompression of packet data.
625 *
626 * Used in: library/ssl_tls.c
627 * library/ssl_cli.c
628 * library/ssl_srv.c
629 *
630 * This feature requires zlib library and headers to be present.
631 *
632 * Uncomment to enable use of ZLIB
633#define POLARSSL_ZLIB_SUPPORT
634 */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000635/* \} name */
636
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000637/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000638 * \name SECTION: PolarSSL modules
639 *
640 * This section enables or disables entire modules in PolarSSL
641 * \{
642 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000643
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000644/**
645 * \def POLARSSL_AES_C
646 *
647 * Enable the AES block cipher.
648 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000649 * Module: library/aes.c
650 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000651 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000652 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000653 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000654 * This module enables the following ciphersuites (if other requisites are
655 * enabled as well):
656 * TLS_RSA_WITH_AES_128_CBC_SHA
657 * TLS_RSA_WITH_AES_256_CBC_SHA
658 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
659 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
660 * TLS_RSA_WITH_AES_128_CBC_SHA256
661 * TLS_RSA_WITH_AES_256_CBC_SHA256
662 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
663 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
664 * TLS_RSA_WITH_AES_128_GCM_SHA256
665 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100666 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
667 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200668 * TLS_PSK_WITH_AES_128_CBC_SHA
669 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100670 *
671 * PEM uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000672 */
Paul Bakker40e46942009-01-03 21:51:57 +0000673#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000674
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000675/**
676 * \def POLARSSL_ARC4_C
677 *
678 * Enable the ARCFOUR stream cipher.
679 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000680 * Module: library/arc4.c
681 * Caller: library/ssl_tls.c
682 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100683 * This module enables the following ciphersuites (if other requisites are
684 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000685 * TLS_RSA_WITH_RC4_128_MD5
686 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100687 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200688 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000689 */
Paul Bakker40e46942009-01-03 21:51:57 +0000690#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000691
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000692/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000693 * \def POLARSSL_ASN1_PARSE_C
694 *
695 * Enable the generic ASN1 parser.
696 *
697 * Module: library/asn1.c
698 * Caller: library/x509parse.c
699 */
700#define POLARSSL_ASN1_PARSE_C
701
702/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000703 * \def POLARSSL_ASN1_WRITE_C
704 *
705 * Enable the generic ASN1 writer.
706 *
707 * Module: library/asn1write.c
708 */
709#define POLARSSL_ASN1_WRITE_C
710
711/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000712 * \def POLARSSL_BASE64_C
713 *
714 * Enable the Base64 module.
715 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000716 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000717 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000718 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000719 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000720 */
Paul Bakker40e46942009-01-03 21:51:57 +0000721#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000722
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000723/**
724 * \def POLARSSL_BIGNUM_C
725 *
Paul Bakker9a736322012-11-14 12:39:52 +0000726 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000727 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000728 * Module: library/bignum.c
729 * Caller: library/dhm.c
730 * library/rsa.c
731 * library/ssl_tls.c
732 * library/x509parse.c
733 *
734 * This module is required for RSA and DHM support.
735 */
Paul Bakker40e46942009-01-03 21:51:57 +0000736#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000737
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000738/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000739 * \def POLARSSL_BLOWFISH_C
740 *
741 * Enable the Blowfish block cipher.
742 *
743 * Module: library/blowfish.c
744 */
745#define POLARSSL_BLOWFISH_C
746
747/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000748 * \def POLARSSL_CAMELLIA_C
749 *
750 * Enable the Camellia block cipher.
751 *
Paul Bakker38119b12009-01-10 23:31:23 +0000752 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000753 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000754 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000755 * This module enables the following ciphersuites (if other requisites are
756 * enabled as well):
757 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
758 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
759 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
760 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
761 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
762 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
763 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
764 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000765 */
766#define POLARSSL_CAMELLIA_C
767
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000768/**
769 * \def POLARSSL_CERTS_C
770 *
771 * Enable the test certificates.
772 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000773 * Module: library/certs.c
774 * Caller:
775 *
776 * This module is used for testing (ssl_client/server).
777 */
Paul Bakker40e46942009-01-03 21:51:57 +0000778#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000779
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000780/**
781 * \def POLARSSL_CIPHER_C
782 *
783 * Enable the generic cipher layer.
784 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000785 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +0200786 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +0000787 *
788 * Uncomment to enable generic cipher wrappers.
789 */
790#define POLARSSL_CIPHER_C
791
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000792/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000793 * \def POLARSSL_CTR_DRBG_C
794 *
795 * Enable the CTR_DRBG AES-256-based random generator
796 *
797 * Module: library/ctr_drbg.c
798 * Caller:
799 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000800 * Requires: POLARSSL_AES_C
801 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000802 * This module provides the CTR_DRBG AES-256 random number generator.
803 */
804#define POLARSSL_CTR_DRBG_C
805
806/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000807 * \def POLARSSL_DEBUG_C
808 *
809 * Enable the debug functions.
810 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000811 * Module: library/debug.c
812 * Caller: library/ssl_cli.c
813 * library/ssl_srv.c
814 * library/ssl_tls.c
815 *
816 * This module provides debugging functions.
817 */
Paul Bakker40e46942009-01-03 21:51:57 +0000818#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000819
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000820/**
821 * \def POLARSSL_DES_C
822 *
823 * Enable the DES block cipher.
824 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000825 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100826 * Caller: library/pem.c
827 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000828 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000829 * This module enables the following ciphersuites (if other requisites are
830 * enabled as well):
831 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
832 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100833 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200834 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100835 *
836 * PEM uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000837 */
Paul Bakker40e46942009-01-03 21:51:57 +0000838#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000839
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000840/**
841 * \def POLARSSL_DHM_C
842 *
843 * Enable the Diffie-Hellman-Merkle key exchange.
844 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000845 * Module: library/dhm.c
846 * Caller: library/ssl_cli.c
847 * library/ssl_srv.c
848 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000849 * This module enables the following ciphersuites (if other requisites are
850 * enabled as well):
851 * TLS_DHE_RSA_WITH_DES_CBC_SHA
852 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
853 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
854 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
855 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
856 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
857 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
858 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
859 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
860 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
861 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
862 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000863 */
Paul Bakker40e46942009-01-03 21:51:57 +0000864#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000865
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000866/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100867 * \def POLARSSL_ECDH_C
868 *
869 * Enable the elliptic curve Diffie-Hellman library.
870 *
871 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100872 * Caller: library/ssl_cli.c
873 * library/ssl_srv.c
874 *
875 * This module enables the following ciphersuites (if other requisites are
876 * enabled as well):
877 * TLS_ECDHE_RSA_WITH_NULL_SHA
878 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
879 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
880 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
881 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100882 *
883 * Requires: POLARSSL_ECP_C
884 */
885#define POLARSSL_ECDH_C
886
887/**
888 * \def POLARSSL_ECDSA_C
889 *
890 * Enable the elliptic curve DSA library.
891 *
892 * Module: library/ecdsa.c
893 * Caller:
894 *
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +0200895 * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100896 */
897#define POLARSSL_ECDSA_C
898
899/**
900 * \def POLARSSL_ECP_C
901 *
902 * Enable the elliptic curve over GF(p) library.
903 *
904 * Module: library/ecp.c
905 * Caller: library/ecdh.c
906 * library/ecdsa.c
907 *
908 * Requires: POLARSSL_BIGNUM_C
909 */
910#define POLARSSL_ECP_C
911
912/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000913 * \def POLARSSL_ENTROPY_C
914 *
915 * Enable the platform-specific entropy code.
916 *
917 * Module: library/entropy.c
918 * Caller:
919 *
Paul Bakker9e36f042013-06-30 14:34:05 +0200920 * Requires: POLARSSL_SHA512_C
Paul Bakker6083fd22011-12-03 21:45:14 +0000921 *
922 * This module provides a generic entropy pool
923 */
924#define POLARSSL_ENTROPY_C
925
926/**
Paul Bakker9d781402011-05-09 16:17:09 +0000927 * \def POLARSSL_ERROR_C
928 *
929 * Enable error code to error string conversion.
930 *
931 * Module: library/error.c
932 * Caller:
933 *
934 * This module enables err_strerror().
935 */
936#define POLARSSL_ERROR_C
937
938/**
Paul Bakker89e80c92012-03-20 13:50:09 +0000939 * \def POLARSSL_GCM_C
940 *
941 * Enable the Galois/Counter Mode (GCM) for AES
942 *
943 * Module: library/gcm.c
944 *
945 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +0000946 *
947 * This module enables the following ciphersuites (if other requisites are
948 * enabled as well):
949 * TLS_RSA_WITH_AES_128_GCM_SHA256
950 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +0000951 */
952#define POLARSSL_GCM_C
953
954/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000955 * \def POLARSSL_HAVEGE_C
956 *
957 * Enable the HAVEGE random generator.
958 *
Paul Bakker2a844242013-06-24 13:01:53 +0200959 * Warning: the HAVEGE random generator is not suitable for virtualized
960 * environments
961 *
962 * Warning: the HAVEGE random generator is dependent on timing and specific
963 * processor traits. It is therefore not advised to use HAVEGE as
964 * your applications primary random generator or primary entropy pool
965 * input. As a secondary input to your entropy pool, it IS able add
966 * the (limited) extra entropy it provides.
967 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000968 * Module: library/havege.c
969 * Caller:
970 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000971 * Requires: POLARSSL_TIMING_C
972 *
Paul Bakker2a844242013-06-24 13:01:53 +0200973 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +0000974#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +0200975 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000976
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000977/**
978 * \def POLARSSL_MD_C
979 *
980 * Enable the generic message digest layer.
981 *
Paul Bakker17373852011-01-06 14:20:01 +0000982 * Module: library/md.c
983 * Caller:
984 *
985 * Uncomment to enable generic message digest wrappers.
986 */
987#define POLARSSL_MD_C
988
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000989/**
990 * \def POLARSSL_MD2_C
991 *
992 * Enable the MD2 hash algorithm
993 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000994 * Module: library/md2.c
995 * Caller: library/x509parse.c
996 *
997 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
998 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000999#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001000 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001001
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001002/**
1003 * \def POLARSSL_MD4_C
1004 *
1005 * Enable the MD4 hash algorithm
1006 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001007 * Module: library/md4.c
1008 * Caller: library/x509parse.c
1009 *
1010 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1011 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001012#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001013 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001014
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001015/**
1016 * \def POLARSSL_MD5_C
1017 *
1018 * Enable the MD5 hash algorithm
1019 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001020 * Module: library/md5.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001021 * Caller: library/pem.c
1022 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001023 * library/x509parse.c
1024 *
1025 * This module is required for SSL/TLS and X.509.
Paul Bakker6deb37e2013-02-19 13:17:08 +01001026 * PEM uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +00001027 */
Paul Bakker40e46942009-01-03 21:51:57 +00001028#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001029
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001030/**
Paul Bakker6e339b52013-07-03 13:37:05 +02001031 * \def POLARSSL_MEMORY_C
1032 *
1033 * Enable the memory allocation layer.
1034 * By default PolarSSL uses the system-provided malloc() and free().
1035 * (As long as POLARSSL_MEMORY_STDMALLOC and POLARSSL_MEMORY_STDFREE
1036 * are defined and unmodified)
1037 *
1038 * This allows different allocators (self-implemented or provided)
1039 *
1040 * Enable this layer to allow use of alternative memory allocators.
1041#define POLARSSL_MEMORY_C
1042 */
1043
1044/**
1045 * The buffer allocator implementation that makes use of a (stack) based
1046 * buffer to 'allocate' dynamic memory. (replaces malloc() and free() calls)
1047 *
1048 * Module: library/memory_buffer_alloc.c
1049 *
1050 * Requires: POLARSSL_MEMORY_C
1051 *
1052 * Enable this module to enable the buffer memory allocator.
1053#define POLARSSL_MEMORY_BUFFER_ALLOC_C
1054 */
1055
1056/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001057 * \def POLARSSL_NET_C
1058 *
1059 * Enable the TCP/IP networking routines.
1060 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001061 * Module: library/net.c
1062 * Caller:
1063 *
1064 * This module provides TCP/IP networking routines.
1065 */
Paul Bakker40e46942009-01-03 21:51:57 +00001066#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001067
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001068/**
Paul Bakkerc70b9822013-04-07 22:00:46 +02001069 * \def POLARSSL_OID_C
1070 *
1071 * Enable the OID database
1072 *
1073 * Module: library/oid.c
1074 * Caller: library/rsa.c
1075 * library/x509parse.c
1076 * library/x509write.c
1077 *
1078 * This modules translates between OIDs and internal values.
1079 */
1080#define POLARSSL_OID_C
1081
1082/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001083 * \def POLARSSL_PADLOCK_C
1084 *
1085 * Enable VIA Padlock support on x86.
1086 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001087 * Module: library/padlock.c
1088 * Caller: library/aes.c
1089 *
1090 * This modules adds support for the VIA PadLock on x86.
1091 */
Paul Bakker40e46942009-01-03 21:51:57 +00001092#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001093
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001094/**
Paul Bakkerf518b162012-08-23 13:03:18 +00001095 * \def POLARSSL_PBKDF2_C
1096 *
1097 * Enable PKCS#5 PBKDF2 key derivation function
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001098 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +00001099 *
1100 * Module: library/pbkdf2.c
1101 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001102 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001103 *
1104 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +00001105 */
Paul Bakker370e90c2013-04-08 15:19:43 +02001106#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001107
1108/**
Paul Bakker96743fc2011-02-12 14:30:57 +00001109 * \def POLARSSL_PEM_C
1110 *
1111 * Enable PEM decoding
1112 *
1113 * Module: library/pem.c
1114 * Caller: library/x509parse.c
1115 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001116 * Requires: POLARSSL_BASE64_C
1117 *
Paul Bakker96743fc2011-02-12 14:30:57 +00001118 * This modules adds support for decoding PEM files.
1119 */
1120#define POLARSSL_PEM_C
1121
1122/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001123 * \def POLARSSL_PKCS5_C
1124 *
1125 * Enable PKCS#5 functions
1126 *
1127 * Module: library/pkcs5.c
1128 *
1129 * Requires: POLARSSL_MD_C
1130 *
1131 * This module adds support for the PKCS#5 functions.
1132 */
1133#define POLARSSL_PKCS5_C
1134
1135/**
Paul Bakker5690efc2011-05-26 13:16:06 +00001136 * \def POLARSSL_PKCS11_C
1137 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001138 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001139 *
1140 * Module: library/ssl_srv.c
1141 * Caller: library/ssl_cli.c
1142 * library/ssl_srv.c
1143 *
1144 * Requires: POLARSSL_SSL_TLS_C
1145 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001146 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001147 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1148#define POLARSSL_PKCS11_C
1149 */
1150
1151/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001152 * \def POLARSSL_PKCS12_C
1153 *
1154 * Enable PKCS#12 PBE functions
1155 * Adds algorithms for parsing PKCS#8 encrypted private keys
1156 *
1157 * Module: library/pkcs12.c
1158 * Caller: library/x509parse.c
1159 *
Paul Bakkerb0713c72013-06-24 19:34:08 +02001160 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
1161 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001162 *
1163 * This module enables PKCS#12 functions.
1164 */
1165#define POLARSSL_PKCS12_C
1166
1167/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001168 * \def POLARSSL_RSA_C
1169 *
1170 * Enable the RSA public-key cryptosystem.
1171 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001172 * Module: library/rsa.c
1173 * Caller: library/ssl_cli.c
1174 * library/ssl_srv.c
1175 * library/ssl_tls.c
1176 * library/x509.c
1177 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001178 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001179 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001180 * This module is required for SSL/TLS and MD5-signed certificates.
1181 */
Paul Bakker40e46942009-01-03 21:51:57 +00001182#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001183
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001184/**
1185 * \def POLARSSL_SHA1_C
1186 *
1187 * Enable the SHA1 cryptographic hash algorithm.
1188 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001189 * Module: library/sha1.c
1190 * Caller: library/ssl_cli.c
1191 * library/ssl_srv.c
1192 * library/ssl_tls.c
1193 * library/x509parse.c
1194 *
1195 * This module is required for SSL/TLS and SHA1-signed certificates.
1196 */
Paul Bakker40e46942009-01-03 21:51:57 +00001197#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001198
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001199/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001200 * \def POLARSSL_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001201 *
1202 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001203 * (Used to be POLARSSL_SHA2_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001204 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001205 * Module: library/sha256.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001206 * Caller: library/md_wrap.c
1207 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001208 *
1209 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001210 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001211 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001212#define POLARSSL_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001213
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001214/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001215 * \def POLARSSL_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001216 *
1217 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001218 * (Used to be POLARSSL_SHA4_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001219 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001220 * Module: library/sha512.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001221 * Caller: library/md_wrap.c
1222 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001223 *
1224 * This module adds support for SHA-384 and SHA-512.
1225 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001226#define POLARSSL_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001227
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001228/**
Paul Bakker0a597072012-09-25 21:55:46 +00001229 * \def POLARSSL_SSL_CACHE_C
1230 *
1231 * Enable simple SSL cache implementation.
1232 *
1233 * Module: library/ssl_cache.c
1234 * Caller:
1235 *
1236 * Requires: POLARSSL_SSL_CACHE_C
1237 */
1238#define POLARSSL_SSL_CACHE_C
1239
1240/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001241 * \def POLARSSL_SSL_CLI_C
1242 *
1243 * Enable the SSL/TLS client code.
1244 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001245 * Module: library/ssl_cli.c
1246 * Caller:
1247 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001248 * Requires: POLARSSL_SSL_TLS_C
1249 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001250 * This module is required for SSL/TLS client support.
1251 */
Paul Bakker40e46942009-01-03 21:51:57 +00001252#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001253
Paul Bakker9a736322012-11-14 12:39:52 +00001254/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001255 * \def POLARSSL_SSL_SRV_C
1256 *
1257 * Enable the SSL/TLS server code.
1258 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001259 * Module: library/ssl_srv.c
1260 * Caller:
1261 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001262 * Requires: POLARSSL_SSL_TLS_C
1263 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001264 * This module is required for SSL/TLS server support.
1265 */
Paul Bakker40e46942009-01-03 21:51:57 +00001266#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001267
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001268/**
1269 * \def POLARSSL_SSL_TLS_C
1270 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001271 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001272 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001273 * Module: library/ssl_tls.c
1274 * Caller: library/ssl_cli.c
1275 * library/ssl_srv.c
1276 *
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001277 * Requires: POLARSSL_CIPHER_C and at least one of the
1278 * POLARSSL_SSL_PROTO_* defines
Paul Bakker5690efc2011-05-26 13:16:06 +00001279 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001280 * This module is required for SSL/TLS.
1281 */
Paul Bakker40e46942009-01-03 21:51:57 +00001282#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001283
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001284/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001285 * \def POLARSSL_TIMING_C
1286 *
1287 * Enable the portable timing interface.
1288 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001289 * Module: library/timing.c
1290 * Caller: library/havege.c
1291 *
1292 * This module is used by the HAVEGE random number generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001293#define POLARSSL_TIMING_C
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001294 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001295
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001296/**
1297 * \def POLARSSL_VERSION_C
1298 *
1299 * Enable run-time version information.
1300 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001301 * Module: library/version.c
1302 *
1303 * This module provides run-time version information.
1304 */
1305#define POLARSSL_VERSION_C
1306
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001307/**
1308 * \def POLARSSL_X509_PARSE_C
1309 *
1310 * Enable X.509 certificate parsing.
1311 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001312 * Module: library/x509parse.c
1313 * Caller: library/ssl_cli.c
1314 * library/ssl_srv.c
1315 * library/ssl_tls.c
1316 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001317 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
1318 * POLARSSL_RSA_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001319 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001320 * This module is required for X.509 certificate parsing.
1321 */
Paul Bakker40e46942009-01-03 21:51:57 +00001322#define POLARSSL_X509_PARSE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001323
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001324/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001325 * \def POLARSSL_X509_WRITE_C
1326 *
1327 * Enable X.509 buffer writing.
1328 *
1329 * Module: library/x509write.c
1330 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001331 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_RSA_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001332 *
1333 * This module is required for X.509 certificate request writing.
1334 */
1335#define POLARSSL_X509_WRITE_C
1336
1337/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001338 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001339 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001340 * Enable the XTEA block cipher.
1341 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001342 * Module: library/xtea.c
1343 * Caller:
1344 */
1345#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001346
Paul Bakker0a62cd12011-01-21 11:00:08 +00001347/* \} name */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001348
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001349/**
1350 * \name SECTION: Module configuration options
1351 *
1352 * This section allows for the setting of module specific sizes and
1353 * configuration options. The default values are already present in the
1354 * relevant header files and should suffice for the regular use cases.
1355 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1356 * only if you have a good reason and know the consequences.
1357 *
1358 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1359 * header file take precedence.
1360 *
1361 * Please check the respective header file for documentation on these
1362 * parameters (to prevent duplicate documentation).
1363 *
1364 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1365 * \{
1366 */
1367//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1368
1369#if defined(POLARSSL_CONFIG_OPTIONS)
1370
1371// MPI / BIGNUM options
1372//
1373#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1374#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1375
1376// CTR_DRBG options
1377//
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001378#define CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001379#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1380#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1381#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1382#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1383
1384// Entropy options
1385//
1386#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1387#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1388
Paul Bakker6e339b52013-07-03 13:37:05 +02001389// Memory options
1390#define MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1391#define POLARSSL_MEMORY_STDMALLOC malloc /**< Default allocator to use, can be undefined */
1392#define POLARSSL_MEMORY_STDFREE free /**< Default free to use, can be undefined */
1393
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001394// SSL Cache options
1395//
1396#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1397#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1398
1399// SSL options
1400//
1401#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
Paul Bakker606b4ba2013-08-14 16:52:14 +02001402#define SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001403
1404#endif /* POLARSSL_CONFIG_OPTIONS */
1405
1406/* \} name */
1407
Paul Bakker7ad00f92013-04-18 23:05:25 +02001408/*
1409 * Sanity checks on defines and dependencies
1410 */
1411#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1412#error "POLARSSL_DHM_C defined, but not all prerequisites"
1413#endif
1414
1415#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1416#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1417#endif
1418
1419#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1420#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1421#endif
1422
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001423#if defined(POLARSSL_ECDSA_C) && \
1424 ( !defined(POLARSSL_ECP_C) || \
1425 !defined(POLARSSL_ASN1_PARSE_C) || \
1426 !defined(POLARSSL_ASN1_WRITE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001427#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1428#endif
1429
1430#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
1431#error "POLARSSL_ECP_C defined, but not all prerequisites"
1432#endif
1433
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001434#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
1435 !defined(POLARSSL_SHA256_C))
Paul Bakker7ad00f92013-04-18 23:05:25 +02001436#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1437#endif
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001438#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
1439 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
1440#error "CTR_DRBG_ENTROPY_LEN value too high"
1441#endif
1442#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA512_C) && \
1443 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
1444#error "CTR_DRBG_ENTROPY_LEN value too high"
1445#endif
Paul Bakker7ad00f92013-04-18 23:05:25 +02001446
1447#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1448#error "POLARSSL_GCM_C defined, but not all prerequisites"
1449#endif
1450
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001451#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
1452#error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
1453#endif
1454
Paul Bakkere07f41d2013-04-19 09:08:57 +02001455#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1456#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1457#endif
1458
1459#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1460 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
1461 !defined(POLARSSL_X509_PARSE_C) )
1462#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1463#endif
1464
1465#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1466 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
1467 !defined(POLARSSL_X509_PARSE_C) )
1468#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1469#endif
1470
1471#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
1472 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1473#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1474#endif
1475
1476#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
1477 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1478#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1479#endif
1480
Paul Bakker6e339b52013-07-03 13:37:05 +02001481#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && !defined(POLARSSL_MEMORY_C)
1482#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
1483#endif
1484
Paul Bakker7ad00f92013-04-18 23:05:25 +02001485#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1486#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1487#endif
1488
1489#if defined(POLARSSL_PEM_C) && !defined(POLARSSL_PEM_C)
1490#error "POLARSSL_PEM_C defined, but not all prerequisites"
1491#endif
1492
1493#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_SSL_TLS_C)
1494#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1495#endif
1496
1497#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1498 !defined(POLARSSL_OID_C) )
1499#error "POLARSSL_RSA_C defined, but not all prerequisites"
1500#endif
1501
1502#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1503#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1504#endif
1505
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001506#if defined(POLARSSL_SSL_TLS_C) && !defined(POLARSSL_CIPHER_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001507#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1508#endif
1509
1510#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1511#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1512#endif
1513
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001514#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
1515 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
1516 !defined(POLARSSL_SSL_PROTO_TLS1_2))
1517#error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
1518#endif
1519
1520#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1521 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
1522#error "Illegal protocol selection"
1523#endif
1524
1525#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
1526 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
1527#error "Illegal protocol selection"
1528#endif
1529
1530#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1531 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
1532 !defined(POLARSSL_SSL_PROTO_TLS1_1)))
1533#error "Illegal protocol selection"
1534#endif
1535
Paul Bakker59da0a42013-08-19 13:27:17 +02001536#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
1537 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) )
1538#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
1539#endif
1540
Paul Bakker7ad00f92013-04-18 23:05:25 +02001541#if defined(POLARSSL_X509_PARSE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1542 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
1543 !defined(POLARSSL_RSA_C) )
1544#error "POLARSSL_X509_PARSE_C defined, but not all prerequisites"
1545#endif
1546
1547#if defined(POLARSSL_X509_WRITE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1548 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
1549 !defined(POLARSSL_RSA_C) )
1550#error "POLARSSL_X509_WRITE_C defined, but not all prerequisites"
1551#endif
1552
Paul Bakker5121ce52009-01-03 21:22:43 +00001553#endif /* config.h */