blob: 799c031dd0ae45eabc9eac211fba3ed1d3bb1955 [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 Bakker0be444a2013-08-27 21:55:01 +0200601 * \def POLARSSL_SSL_SERVER_NAME_INDICATION
602 *
603 * Enable support for RFC 6066 server name indication (SNI) in SSL
604 *
605 * Comment this macro to disable support for server name indication in SSL
606 */
607#define POLARSSL_SSL_SERVER_NAME_INDICATION
608
609/**
Paul Bakker1f2bc622013-08-15 13:45:55 +0200610 * \def POLARSSL_SSL_TRUNCATED_HMAC
611 *
612 * Enable support for RFC 6066 truncated HMAC in SSL
613 *
614 * Comment this macro to disable support for truncated HMAC in SSL
615 */
616#define POLARSSL_SSL_TRUNCATED_HMAC
617
618/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000619 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
620 *
621 * If set, the X509 parser will not break-off when parsing an X509 certificate
622 * and encountering an unknown critical extension.
623 *
624 * Uncomment to prevent an error.
625 *
626#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
627 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000628
629/**
630 * \def POLARSSL_ZLIB_SUPPORT
631 *
632 * If set, the SSL/TLS module uses ZLIB to support compression and
633 * decompression of packet data.
634 *
635 * Used in: library/ssl_tls.c
636 * library/ssl_cli.c
637 * library/ssl_srv.c
638 *
639 * This feature requires zlib library and headers to be present.
640 *
641 * Uncomment to enable use of ZLIB
642#define POLARSSL_ZLIB_SUPPORT
643 */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000644/* \} name */
645
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000646/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000647 * \name SECTION: PolarSSL modules
648 *
649 * This section enables or disables entire modules in PolarSSL
650 * \{
651 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000652
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000653/**
654 * \def POLARSSL_AES_C
655 *
656 * Enable the AES block cipher.
657 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000658 * Module: library/aes.c
659 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000660 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000661 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000662 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000663 * This module enables the following ciphersuites (if other requisites are
664 * enabled as well):
665 * TLS_RSA_WITH_AES_128_CBC_SHA
666 * TLS_RSA_WITH_AES_256_CBC_SHA
667 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
668 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
669 * TLS_RSA_WITH_AES_128_CBC_SHA256
670 * TLS_RSA_WITH_AES_256_CBC_SHA256
671 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
672 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
673 * TLS_RSA_WITH_AES_128_GCM_SHA256
674 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100675 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
676 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200677 * TLS_PSK_WITH_AES_128_CBC_SHA
678 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100679 *
680 * PEM uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000681 */
Paul Bakker40e46942009-01-03 21:51:57 +0000682#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000683
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000684/**
685 * \def POLARSSL_ARC4_C
686 *
687 * Enable the ARCFOUR stream cipher.
688 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000689 * Module: library/arc4.c
690 * Caller: library/ssl_tls.c
691 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100692 * This module enables the following ciphersuites (if other requisites are
693 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000694 * TLS_RSA_WITH_RC4_128_MD5
695 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100696 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200697 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000698 */
Paul Bakker40e46942009-01-03 21:51:57 +0000699#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000700
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000701/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000702 * \def POLARSSL_ASN1_PARSE_C
703 *
704 * Enable the generic ASN1 parser.
705 *
706 * Module: library/asn1.c
707 * Caller: library/x509parse.c
708 */
709#define POLARSSL_ASN1_PARSE_C
710
711/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000712 * \def POLARSSL_ASN1_WRITE_C
713 *
714 * Enable the generic ASN1 writer.
715 *
716 * Module: library/asn1write.c
717 */
718#define POLARSSL_ASN1_WRITE_C
719
720/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000721 * \def POLARSSL_BASE64_C
722 *
723 * Enable the Base64 module.
724 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000725 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000726 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000727 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000728 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000729 */
Paul Bakker40e46942009-01-03 21:51:57 +0000730#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000731
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000732/**
733 * \def POLARSSL_BIGNUM_C
734 *
Paul Bakker9a736322012-11-14 12:39:52 +0000735 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000736 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000737 * Module: library/bignum.c
738 * Caller: library/dhm.c
739 * library/rsa.c
740 * library/ssl_tls.c
741 * library/x509parse.c
742 *
743 * This module is required for RSA and DHM support.
744 */
Paul Bakker40e46942009-01-03 21:51:57 +0000745#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000746
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000747/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000748 * \def POLARSSL_BLOWFISH_C
749 *
750 * Enable the Blowfish block cipher.
751 *
752 * Module: library/blowfish.c
753 */
754#define POLARSSL_BLOWFISH_C
755
756/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000757 * \def POLARSSL_CAMELLIA_C
758 *
759 * Enable the Camellia block cipher.
760 *
Paul Bakker38119b12009-01-10 23:31:23 +0000761 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000762 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000763 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000764 * This module enables the following ciphersuites (if other requisites are
765 * enabled as well):
766 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
767 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
768 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
769 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
770 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
771 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
772 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
773 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000774 */
775#define POLARSSL_CAMELLIA_C
776
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000777/**
778 * \def POLARSSL_CERTS_C
779 *
780 * Enable the test certificates.
781 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000782 * Module: library/certs.c
783 * Caller:
784 *
785 * This module is used for testing (ssl_client/server).
786 */
Paul Bakker40e46942009-01-03 21:51:57 +0000787#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000788
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000789/**
790 * \def POLARSSL_CIPHER_C
791 *
792 * Enable the generic cipher layer.
793 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000794 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +0200795 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +0000796 *
797 * Uncomment to enable generic cipher wrappers.
798 */
799#define POLARSSL_CIPHER_C
800
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000801/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000802 * \def POLARSSL_CTR_DRBG_C
803 *
804 * Enable the CTR_DRBG AES-256-based random generator
805 *
806 * Module: library/ctr_drbg.c
807 * Caller:
808 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000809 * Requires: POLARSSL_AES_C
810 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000811 * This module provides the CTR_DRBG AES-256 random number generator.
812 */
813#define POLARSSL_CTR_DRBG_C
814
815/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000816 * \def POLARSSL_DEBUG_C
817 *
818 * Enable the debug functions.
819 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000820 * Module: library/debug.c
821 * Caller: library/ssl_cli.c
822 * library/ssl_srv.c
823 * library/ssl_tls.c
824 *
825 * This module provides debugging functions.
826 */
Paul Bakker40e46942009-01-03 21:51:57 +0000827#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000828
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000829/**
830 * \def POLARSSL_DES_C
831 *
832 * Enable the DES block cipher.
833 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000834 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100835 * Caller: library/pem.c
836 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000837 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000838 * This module enables the following ciphersuites (if other requisites are
839 * enabled as well):
840 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
841 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100842 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200843 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100844 *
845 * PEM uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000846 */
Paul Bakker40e46942009-01-03 21:51:57 +0000847#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000848
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000849/**
850 * \def POLARSSL_DHM_C
851 *
852 * Enable the Diffie-Hellman-Merkle key exchange.
853 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000854 * Module: library/dhm.c
855 * Caller: library/ssl_cli.c
856 * library/ssl_srv.c
857 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000858 * This module enables the following ciphersuites (if other requisites are
859 * enabled as well):
860 * TLS_DHE_RSA_WITH_DES_CBC_SHA
861 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
862 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
863 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
864 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
865 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
866 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
867 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
868 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
869 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
870 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
871 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000872 */
Paul Bakker40e46942009-01-03 21:51:57 +0000873#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000874
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000875/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100876 * \def POLARSSL_ECDH_C
877 *
878 * Enable the elliptic curve Diffie-Hellman library.
879 *
880 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100881 * Caller: library/ssl_cli.c
882 * library/ssl_srv.c
883 *
884 * This module enables the following ciphersuites (if other requisites are
885 * enabled as well):
886 * TLS_ECDHE_RSA_WITH_NULL_SHA
887 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
888 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
889 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
890 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100891 *
892 * Requires: POLARSSL_ECP_C
893 */
894#define POLARSSL_ECDH_C
895
896/**
897 * \def POLARSSL_ECDSA_C
898 *
899 * Enable the elliptic curve DSA library.
900 *
901 * Module: library/ecdsa.c
902 * Caller:
903 *
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +0200904 * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100905 */
906#define POLARSSL_ECDSA_C
907
908/**
909 * \def POLARSSL_ECP_C
910 *
911 * Enable the elliptic curve over GF(p) library.
912 *
913 * Module: library/ecp.c
914 * Caller: library/ecdh.c
915 * library/ecdsa.c
916 *
917 * Requires: POLARSSL_BIGNUM_C
918 */
919#define POLARSSL_ECP_C
920
921/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000922 * \def POLARSSL_ENTROPY_C
923 *
924 * Enable the platform-specific entropy code.
925 *
926 * Module: library/entropy.c
927 * Caller:
928 *
Paul Bakker9e36f042013-06-30 14:34:05 +0200929 * Requires: POLARSSL_SHA512_C
Paul Bakker6083fd22011-12-03 21:45:14 +0000930 *
931 * This module provides a generic entropy pool
932 */
933#define POLARSSL_ENTROPY_C
934
935/**
Paul Bakker9d781402011-05-09 16:17:09 +0000936 * \def POLARSSL_ERROR_C
937 *
938 * Enable error code to error string conversion.
939 *
940 * Module: library/error.c
941 * Caller:
942 *
943 * This module enables err_strerror().
944 */
945#define POLARSSL_ERROR_C
946
947/**
Paul Bakker89e80c92012-03-20 13:50:09 +0000948 * \def POLARSSL_GCM_C
949 *
950 * Enable the Galois/Counter Mode (GCM) for AES
951 *
952 * Module: library/gcm.c
953 *
954 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +0000955 *
956 * This module enables the following ciphersuites (if other requisites are
957 * enabled as well):
958 * TLS_RSA_WITH_AES_128_GCM_SHA256
959 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +0000960 */
961#define POLARSSL_GCM_C
962
963/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000964 * \def POLARSSL_HAVEGE_C
965 *
966 * Enable the HAVEGE random generator.
967 *
Paul Bakker2a844242013-06-24 13:01:53 +0200968 * Warning: the HAVEGE random generator is not suitable for virtualized
969 * environments
970 *
971 * Warning: the HAVEGE random generator is dependent on timing and specific
972 * processor traits. It is therefore not advised to use HAVEGE as
973 * your applications primary random generator or primary entropy pool
974 * input. As a secondary input to your entropy pool, it IS able add
975 * the (limited) extra entropy it provides.
976 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000977 * Module: library/havege.c
978 * Caller:
979 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000980 * Requires: POLARSSL_TIMING_C
981 *
Paul Bakker2a844242013-06-24 13:01:53 +0200982 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +0000983#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +0200984 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000985
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000986/**
987 * \def POLARSSL_MD_C
988 *
989 * Enable the generic message digest layer.
990 *
Paul Bakker17373852011-01-06 14:20:01 +0000991 * Module: library/md.c
992 * Caller:
993 *
994 * Uncomment to enable generic message digest wrappers.
995 */
996#define POLARSSL_MD_C
997
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000998/**
999 * \def POLARSSL_MD2_C
1000 *
1001 * Enable the MD2 hash algorithm
1002 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001003 * Module: library/md2.c
1004 * Caller: library/x509parse.c
1005 *
1006 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
1007 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001008#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001009 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001010
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001011/**
1012 * \def POLARSSL_MD4_C
1013 *
1014 * Enable the MD4 hash algorithm
1015 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001016 * Module: library/md4.c
1017 * Caller: library/x509parse.c
1018 *
1019 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1020 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001021#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001022 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001023
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001024/**
1025 * \def POLARSSL_MD5_C
1026 *
1027 * Enable the MD5 hash algorithm
1028 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001029 * Module: library/md5.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001030 * Caller: library/pem.c
1031 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001032 * library/x509parse.c
1033 *
1034 * This module is required for SSL/TLS and X.509.
Paul Bakker6deb37e2013-02-19 13:17:08 +01001035 * PEM uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +00001036 */
Paul Bakker40e46942009-01-03 21:51:57 +00001037#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001038
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001039/**
Paul Bakker6e339b52013-07-03 13:37:05 +02001040 * \def POLARSSL_MEMORY_C
1041 *
1042 * Enable the memory allocation layer.
1043 * By default PolarSSL uses the system-provided malloc() and free().
1044 * (As long as POLARSSL_MEMORY_STDMALLOC and POLARSSL_MEMORY_STDFREE
1045 * are defined and unmodified)
1046 *
1047 * This allows different allocators (self-implemented or provided)
1048 *
1049 * Enable this layer to allow use of alternative memory allocators.
1050#define POLARSSL_MEMORY_C
1051 */
1052
1053/**
1054 * The buffer allocator implementation that makes use of a (stack) based
1055 * buffer to 'allocate' dynamic memory. (replaces malloc() and free() calls)
1056 *
1057 * Module: library/memory_buffer_alloc.c
1058 *
1059 * Requires: POLARSSL_MEMORY_C
1060 *
1061 * Enable this module to enable the buffer memory allocator.
1062#define POLARSSL_MEMORY_BUFFER_ALLOC_C
1063 */
1064
1065/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001066 * \def POLARSSL_NET_C
1067 *
1068 * Enable the TCP/IP networking routines.
1069 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001070 * Module: library/net.c
1071 * Caller:
1072 *
1073 * This module provides TCP/IP networking routines.
1074 */
Paul Bakker40e46942009-01-03 21:51:57 +00001075#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001076
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001077/**
Paul Bakkerc70b9822013-04-07 22:00:46 +02001078 * \def POLARSSL_OID_C
1079 *
1080 * Enable the OID database
1081 *
1082 * Module: library/oid.c
1083 * Caller: library/rsa.c
1084 * library/x509parse.c
1085 * library/x509write.c
1086 *
1087 * This modules translates between OIDs and internal values.
1088 */
1089#define POLARSSL_OID_C
1090
1091/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001092 * \def POLARSSL_PADLOCK_C
1093 *
1094 * Enable VIA Padlock support on x86.
1095 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001096 * Module: library/padlock.c
1097 * Caller: library/aes.c
1098 *
1099 * This modules adds support for the VIA PadLock on x86.
1100 */
Paul Bakker40e46942009-01-03 21:51:57 +00001101#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001102
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001103/**
Paul Bakkerf518b162012-08-23 13:03:18 +00001104 * \def POLARSSL_PBKDF2_C
1105 *
1106 * Enable PKCS#5 PBKDF2 key derivation function
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001107 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +00001108 *
1109 * Module: library/pbkdf2.c
1110 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001111 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001112 *
1113 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +00001114 */
Paul Bakker370e90c2013-04-08 15:19:43 +02001115#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001116
1117/**
Paul Bakker96743fc2011-02-12 14:30:57 +00001118 * \def POLARSSL_PEM_C
1119 *
1120 * Enable PEM decoding
1121 *
1122 * Module: library/pem.c
1123 * Caller: library/x509parse.c
1124 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001125 * Requires: POLARSSL_BASE64_C
1126 *
Paul Bakker96743fc2011-02-12 14:30:57 +00001127 * This modules adds support for decoding PEM files.
1128 */
1129#define POLARSSL_PEM_C
1130
1131/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001132 * \def POLARSSL_PKCS5_C
1133 *
1134 * Enable PKCS#5 functions
1135 *
1136 * Module: library/pkcs5.c
1137 *
1138 * Requires: POLARSSL_MD_C
1139 *
1140 * This module adds support for the PKCS#5 functions.
1141 */
1142#define POLARSSL_PKCS5_C
1143
1144/**
Paul Bakker5690efc2011-05-26 13:16:06 +00001145 * \def POLARSSL_PKCS11_C
1146 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001147 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001148 *
1149 * Module: library/ssl_srv.c
1150 * Caller: library/ssl_cli.c
1151 * library/ssl_srv.c
1152 *
1153 * Requires: POLARSSL_SSL_TLS_C
1154 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001155 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001156 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1157#define POLARSSL_PKCS11_C
1158 */
1159
1160/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001161 * \def POLARSSL_PKCS12_C
1162 *
1163 * Enable PKCS#12 PBE functions
1164 * Adds algorithms for parsing PKCS#8 encrypted private keys
1165 *
1166 * Module: library/pkcs12.c
1167 * Caller: library/x509parse.c
1168 *
Paul Bakkerb0713c72013-06-24 19:34:08 +02001169 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
1170 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001171 *
1172 * This module enables PKCS#12 functions.
1173 */
1174#define POLARSSL_PKCS12_C
1175
1176/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001177 * \def POLARSSL_RSA_C
1178 *
1179 * Enable the RSA public-key cryptosystem.
1180 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001181 * Module: library/rsa.c
1182 * Caller: library/ssl_cli.c
1183 * library/ssl_srv.c
1184 * library/ssl_tls.c
1185 * library/x509.c
1186 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001187 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001188 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001189 * This module is required for SSL/TLS and MD5-signed certificates.
1190 */
Paul Bakker40e46942009-01-03 21:51:57 +00001191#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001192
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001193/**
1194 * \def POLARSSL_SHA1_C
1195 *
1196 * Enable the SHA1 cryptographic hash algorithm.
1197 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001198 * Module: library/sha1.c
1199 * Caller: library/ssl_cli.c
1200 * library/ssl_srv.c
1201 * library/ssl_tls.c
1202 * library/x509parse.c
1203 *
1204 * This module is required for SSL/TLS and SHA1-signed certificates.
1205 */
Paul Bakker40e46942009-01-03 21:51:57 +00001206#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001207
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001208/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001209 * \def POLARSSL_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001210 *
1211 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001212 * (Used to be POLARSSL_SHA2_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001213 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001214 * Module: library/sha256.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001215 * Caller: library/md_wrap.c
1216 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001217 *
1218 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001219 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001220 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001221#define POLARSSL_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001222
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001223/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001224 * \def POLARSSL_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001225 *
1226 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001227 * (Used to be POLARSSL_SHA4_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001228 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001229 * Module: library/sha512.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001230 * Caller: library/md_wrap.c
1231 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001232 *
1233 * This module adds support for SHA-384 and SHA-512.
1234 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001235#define POLARSSL_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001236
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001237/**
Paul Bakker0a597072012-09-25 21:55:46 +00001238 * \def POLARSSL_SSL_CACHE_C
1239 *
1240 * Enable simple SSL cache implementation.
1241 *
1242 * Module: library/ssl_cache.c
1243 * Caller:
1244 *
1245 * Requires: POLARSSL_SSL_CACHE_C
1246 */
1247#define POLARSSL_SSL_CACHE_C
1248
1249/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001250 * \def POLARSSL_SSL_CLI_C
1251 *
1252 * Enable the SSL/TLS client code.
1253 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001254 * Module: library/ssl_cli.c
1255 * Caller:
1256 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001257 * Requires: POLARSSL_SSL_TLS_C
1258 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001259 * This module is required for SSL/TLS client support.
1260 */
Paul Bakker40e46942009-01-03 21:51:57 +00001261#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001262
Paul Bakker9a736322012-11-14 12:39:52 +00001263/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001264 * \def POLARSSL_SSL_SRV_C
1265 *
1266 * Enable the SSL/TLS server code.
1267 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001268 * Module: library/ssl_srv.c
1269 * Caller:
1270 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001271 * Requires: POLARSSL_SSL_TLS_C
1272 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001273 * This module is required for SSL/TLS server support.
1274 */
Paul Bakker40e46942009-01-03 21:51:57 +00001275#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001276
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001277/**
1278 * \def POLARSSL_SSL_TLS_C
1279 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001280 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001281 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001282 * Module: library/ssl_tls.c
1283 * Caller: library/ssl_cli.c
1284 * library/ssl_srv.c
1285 *
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001286 * Requires: POLARSSL_CIPHER_C and at least one of the
1287 * POLARSSL_SSL_PROTO_* defines
Paul Bakker5690efc2011-05-26 13:16:06 +00001288 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001289 * This module is required for SSL/TLS.
1290 */
Paul Bakker40e46942009-01-03 21:51:57 +00001291#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001292
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001293/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001294 * \def POLARSSL_TIMING_C
1295 *
1296 * Enable the portable timing interface.
1297 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001298 * Module: library/timing.c
1299 * Caller: library/havege.c
1300 *
1301 * This module is used by the HAVEGE random number generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001302#define POLARSSL_TIMING_C
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001303 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001304
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001305/**
1306 * \def POLARSSL_VERSION_C
1307 *
1308 * Enable run-time version information.
1309 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001310 * Module: library/version.c
1311 *
1312 * This module provides run-time version information.
1313 */
1314#define POLARSSL_VERSION_C
1315
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001316/**
1317 * \def POLARSSL_X509_PARSE_C
1318 *
1319 * Enable X.509 certificate parsing.
1320 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001321 * Module: library/x509parse.c
1322 * Caller: library/ssl_cli.c
1323 * library/ssl_srv.c
1324 * library/ssl_tls.c
1325 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001326 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
1327 * POLARSSL_RSA_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001328 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001329 * This module is required for X.509 certificate parsing.
1330 */
Paul Bakker40e46942009-01-03 21:51:57 +00001331#define POLARSSL_X509_PARSE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001332
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001333/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001334 * \def POLARSSL_X509_WRITE_C
1335 *
1336 * Enable X.509 buffer writing.
1337 *
1338 * Module: library/x509write.c
1339 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001340 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_RSA_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001341 *
1342 * This module is required for X.509 certificate request writing.
1343 */
1344#define POLARSSL_X509_WRITE_C
1345
1346/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001347 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001348 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001349 * Enable the XTEA block cipher.
1350 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001351 * Module: library/xtea.c
1352 * Caller:
1353 */
1354#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001355
Paul Bakker0a62cd12011-01-21 11:00:08 +00001356/* \} name */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001357
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001358/**
1359 * \name SECTION: Module configuration options
1360 *
1361 * This section allows for the setting of module specific sizes and
1362 * configuration options. The default values are already present in the
1363 * relevant header files and should suffice for the regular use cases.
1364 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1365 * only if you have a good reason and know the consequences.
1366 *
1367 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1368 * header file take precedence.
1369 *
1370 * Please check the respective header file for documentation on these
1371 * parameters (to prevent duplicate documentation).
1372 *
1373 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1374 * \{
1375 */
1376//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1377
1378#if defined(POLARSSL_CONFIG_OPTIONS)
1379
1380// MPI / BIGNUM options
1381//
1382#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1383#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1384
1385// CTR_DRBG options
1386//
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001387#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 +02001388#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1389#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1390#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1391#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1392
1393// Entropy options
1394//
1395#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1396#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1397
Paul Bakker6e339b52013-07-03 13:37:05 +02001398// Memory options
1399#define MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1400#define POLARSSL_MEMORY_STDMALLOC malloc /**< Default allocator to use, can be undefined */
1401#define POLARSSL_MEMORY_STDFREE free /**< Default free to use, can be undefined */
1402
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001403// SSL Cache options
1404//
1405#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1406#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1407
1408// SSL options
1409//
1410#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
Paul Bakker606b4ba2013-08-14 16:52:14 +02001411#define SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001412
1413#endif /* POLARSSL_CONFIG_OPTIONS */
1414
1415/* \} name */
1416
Paul Bakker7ad00f92013-04-18 23:05:25 +02001417/*
1418 * Sanity checks on defines and dependencies
1419 */
1420#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1421#error "POLARSSL_DHM_C defined, but not all prerequisites"
1422#endif
1423
1424#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1425#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1426#endif
1427
1428#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1429#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1430#endif
1431
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001432#if defined(POLARSSL_ECDSA_C) && \
1433 ( !defined(POLARSSL_ECP_C) || \
1434 !defined(POLARSSL_ASN1_PARSE_C) || \
1435 !defined(POLARSSL_ASN1_WRITE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001436#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1437#endif
1438
1439#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
1440#error "POLARSSL_ECP_C defined, but not all prerequisites"
1441#endif
1442
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001443#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
1444 !defined(POLARSSL_SHA256_C))
Paul Bakker7ad00f92013-04-18 23:05:25 +02001445#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1446#endif
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001447#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
1448 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
1449#error "CTR_DRBG_ENTROPY_LEN value too high"
1450#endif
1451#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA512_C) && \
1452 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
1453#error "CTR_DRBG_ENTROPY_LEN value too high"
1454#endif
Paul Bakker7ad00f92013-04-18 23:05:25 +02001455
1456#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1457#error "POLARSSL_GCM_C defined, but not all prerequisites"
1458#endif
1459
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001460#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
1461#error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
1462#endif
1463
Paul Bakkere07f41d2013-04-19 09:08:57 +02001464#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1465#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1466#endif
1467
1468#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1469 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
1470 !defined(POLARSSL_X509_PARSE_C) )
1471#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1472#endif
1473
1474#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1475 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
1476 !defined(POLARSSL_X509_PARSE_C) )
1477#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1478#endif
1479
1480#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
1481 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1482#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1483#endif
1484
1485#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
1486 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1487#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1488#endif
1489
Paul Bakker6e339b52013-07-03 13:37:05 +02001490#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && !defined(POLARSSL_MEMORY_C)
1491#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
1492#endif
1493
Paul Bakker7ad00f92013-04-18 23:05:25 +02001494#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1495#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1496#endif
1497
1498#if defined(POLARSSL_PEM_C) && !defined(POLARSSL_PEM_C)
1499#error "POLARSSL_PEM_C defined, but not all prerequisites"
1500#endif
1501
1502#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_SSL_TLS_C)
1503#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1504#endif
1505
1506#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1507 !defined(POLARSSL_OID_C) )
1508#error "POLARSSL_RSA_C defined, but not all prerequisites"
1509#endif
1510
1511#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1512#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1513#endif
1514
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001515#if defined(POLARSSL_SSL_TLS_C) && !defined(POLARSSL_CIPHER_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001516#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1517#endif
1518
1519#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1520#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1521#endif
1522
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001523#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
1524 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
1525 !defined(POLARSSL_SSL_PROTO_TLS1_2))
1526#error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
1527#endif
1528
1529#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1530 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
1531#error "Illegal protocol selection"
1532#endif
1533
1534#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
1535 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
1536#error "Illegal protocol selection"
1537#endif
1538
1539#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1540 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
1541 !defined(POLARSSL_SSL_PROTO_TLS1_1)))
1542#error "Illegal protocol selection"
1543#endif
1544
Paul Bakker59da0a42013-08-19 13:27:17 +02001545#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
1546 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) )
1547#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
1548#endif
1549
Paul Bakker7ad00f92013-04-18 23:05:25 +02001550#if defined(POLARSSL_X509_PARSE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1551 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
1552 !defined(POLARSSL_RSA_C) )
1553#error "POLARSSL_X509_PARSE_C defined, but not all prerequisites"
1554#endif
1555
1556#if defined(POLARSSL_X509_WRITE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1557 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
1558 !defined(POLARSSL_RSA_C) )
1559#error "POLARSSL_X509_WRITE_C defined, but not all prerequisites"
1560#endif
1561
Paul Bakker5121ce52009-01-03 21:22:43 +00001562#endif /* config.h */