blob: 3c709fecf1d1d6a5ca363c515d6dd754b7b21757 [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/**
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200367 * \def POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
368 *
369 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS
370 *
371 * Requires: POLARSSL_ECDH_C, POLARSSL_ECDSA_C, POLARSSL_X509_PARSE_C
372 *
373 * This enables the following ciphersuites (if other requisites are
374 * enabled as well):
375 * TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
376 * TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
377 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
378 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
379 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
380 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
381 * TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
382 * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
383 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
384 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
385 */
386#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
387
388/**
Paul Bakkere2ab84f2013-06-29 18:24:32 +0200389 * \def POLARSSL_ERROR_STRERROR_BC
390 *
391 * Make available the backward compatible error_strerror() next to the
392 * current polarssl_strerror().
393 *
394 * Disable if you run into name conflicts and want to really remove the
395 * error_strerror()
396 */
397#define POLARSSL_ERROR_STRERROR_BC
398
399/**
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100400 * \def POLARSSL_ERROR_STRERROR_DUMMY
401 *
402 * Enable a dummy error function to make use of error_strerror() in
403 * third party libraries easier.
404 *
405 * Disable if you run into name conflicts and want to really remove the
406 * error_strerror()
407 */
408#define POLARSSL_ERROR_STRERROR_DUMMY
409
410/**
Paul Bakker15566e42011-04-24 21:19:15 +0000411 * \def POLARSSL_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000412 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000413 * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C
414 *
Paul Bakker15566e42011-04-24 21:19:15 +0000415 * Enable the RSA prime-number generation code.
Paul Bakker5121ce52009-01-03 21:22:43 +0000416 */
Paul Bakker15566e42011-04-24 21:19:15 +0000417#define POLARSSL_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000418
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000419/**
Paul Bakker335db3f2011-04-25 15:28:35 +0000420 * \def POLARSSL_FS_IO
421 *
422 * Enable functions that use the filesystem.
423 */
424#define POLARSSL_FS_IO
425
426/**
Paul Bakker43655f42011-12-15 20:11:16 +0000427 * \def POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
428 *
429 * Do not add default entropy sources. These are the platform specific,
430 * hardclock and HAVEGE based poll functions.
431 *
432 * This is useful to have more control over the added entropy sources in an
433 * application.
434 *
435 * Uncomment this macro to prevent loading of default entropy functions.
436#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
437 */
438
439/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000440 * \def POLARSSL_NO_PLATFORM_ENTROPY
441 *
442 * Do not use built-in platform entropy functions.
443 * This is useful if your platform does not support
444 * standards like the /dev/urandom or Windows CryptoAPI.
445 *
446 * Uncomment this macro to disable the built-in platform entropy functions.
447#define POLARSSL_NO_PLATFORM_ENTROPY
448 */
449
450/**
Paul Bakker6e339b52013-07-03 13:37:05 +0200451 * \def POLARSSL_MEMORY_DEBUG
452 *
453 * Enable debugging of buffer allocator memory issues. Automatically prints
454 * (to stderr) all (fatal) messages on memory allocation issues. Enables
455 * function for 'debug output' of allocated memory.
456 *
457 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
458 * fprintf()
459 *
460 * Uncomment this macro to let the buffer allocator print out error messages.
461#define POLARSSL_MEMORY_DEBUG
462*/
463
464/**
465 * \def POLARSSL_MEMORY_BACKTRACE
466 *
467 * Include backtrace information with each allocated block.
468 *
469 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
470 * GLIBC-compatible backtrace() an backtrace_symbols() support
471 *
472 * Uncomment this macro to include backtrace information
473#define POLARSSL_MEMORY_BACKTRACE
474 */
475
476/**
Paul Bakker9dcc3222011-03-08 14:16:06 +0000477 * \def POLARSSL_PKCS1_V21
478 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000479 * Requires: POLARSSL_MD_C, POLARSSL_RSA_C
480 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000481 * Enable support for PKCS#1 v2.1 encoding.
482 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
483 */
484#define POLARSSL_PKCS1_V21
485
486/**
Paul Bakker0216cc12011-03-26 13:40:23 +0000487 * \def POLARSSL_RSA_NO_CRT
488 *
489 * Do not use the Chinese Remainder Theorem for the RSA private operation.
490 *
491 * Uncomment this macro to disable the use of CRT in RSA.
492 *
493#define POLARSSL_RSA_NO_CRT
494 */
Paul Bakker15566e42011-04-24 21:19:15 +0000495
496/**
497 * \def POLARSSL_SELF_TEST
498 *
499 * Enable the checkup functions (*_self_test).
500 */
501#define POLARSSL_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000502
503/**
Paul Bakker40865c82013-01-31 17:13:13 +0100504 * \def POLARSSL_SSL_ALL_ALERT_MESSAGES
505 *
506 * Enable sending of alert messages in case of encountered errors as per RFC.
507 * If you choose not to send the alert messages, PolarSSL can still communicate
508 * with other servers, only debugging of failures is harder.
509 *
510 * The advantage of not sending alert messages, is that no information is given
511 * about reasons for failures thus preventing adversaries of gaining intel.
512 *
513 * Enable sending of all alert messages
514 */
515#define POLARSSL_SSL_ALERT_MESSAGES
516
517/**
Paul Bakkerd66f0702013-01-31 16:57:45 +0100518 * \def POLARSSL_SSL_DEBUG_ALL
519 *
520 * Enable the debug messages in SSL module for all issues.
521 * Debug messages have been disabled in some places to prevent timing
522 * attacks due to (unbalanced) debugging function calls.
523 *
524 * If you need all error reporting you should enable this during debugging,
525 * but remove this for production servers that should log as well.
526 *
527 * Uncomment this macro to report all debug messages on errors introducing
528 * a timing side-channel.
529 *
530#define POLARSSL_SSL_DEBUG_ALL
531 */
532
533/**
Paul Bakker05ef8352012-05-08 09:17:57 +0000534 * \def POLARSSL_SSL_HW_RECORD_ACCEL
535 *
536 * Enable hooking functions in SSL module for hardware acceleration of
537 * individual records.
538 *
539 * Uncomment this macro to enable hooking functions.
540#define POLARSSL_SSL_HW_RECORD_ACCEL
541 */
542
543/**
Paul Bakker78a8c712013-03-06 17:01:52 +0100544 * \def POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
545 *
546 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
547 * SSL Server module (POLARSSL_SSL_SRV_C)
548 *
549 * Comment this macro to disable support for SSLv2 Client Hello messages.
550 */
551#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
552
553/**
Paul Bakker05decb22013-08-15 13:33:48 +0200554 * \def POLARSSL_SSL_MAX_FRAGMENT_LENGTH
555 *
556 * Enable support for RFC 6066 max_fragment_length extension in SSL
557 *
558 * Comment this macro to disable support for the max_fragment_length extension
559 */
560#define POLARSSL_SSL_MAX_FRAGMENT_LENGTH
561
562/**
Paul Bakkera503a632013-08-14 13:48:06 +0200563 * \def POLARSSL_SSL_SESSION_TICKETS
564 *
565 * Enable support for RFC 5077 session tickets in SSL
566 *
567 * Requires: POLARSSL_AES_C
568 * POLARSSL_SHA256_C
569 *
570 * Comment this macro to disable support for SSL session tickets
571 */
572#define POLARSSL_SSL_SESSION_TICKETS
573
574/**
Paul Bakker1f2bc622013-08-15 13:45:55 +0200575 * \def POLARSSL_SSL_TRUNCATED_HMAC
576 *
577 * Enable support for RFC 6066 truncated HMAC in SSL
578 *
579 * Comment this macro to disable support for truncated HMAC in SSL
580 */
581#define POLARSSL_SSL_TRUNCATED_HMAC
582
583/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000584 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
585 *
586 * If set, the X509 parser will not break-off when parsing an X509 certificate
587 * and encountering an unknown critical extension.
588 *
589 * Uncomment to prevent an error.
590 *
591#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
592 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000593
594/**
595 * \def POLARSSL_ZLIB_SUPPORT
596 *
597 * If set, the SSL/TLS module uses ZLIB to support compression and
598 * decompression of packet data.
599 *
600 * Used in: library/ssl_tls.c
601 * library/ssl_cli.c
602 * library/ssl_srv.c
603 *
604 * This feature requires zlib library and headers to be present.
605 *
606 * Uncomment to enable use of ZLIB
607#define POLARSSL_ZLIB_SUPPORT
608 */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000609/* \} name */
610
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000611/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000612 * \name SECTION: PolarSSL modules
613 *
614 * This section enables or disables entire modules in PolarSSL
615 * \{
616 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000617
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000618/**
619 * \def POLARSSL_AES_C
620 *
621 * Enable the AES block cipher.
622 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000623 * Module: library/aes.c
624 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000625 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000626 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000627 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000628 * This module enables the following ciphersuites (if other requisites are
629 * enabled as well):
630 * TLS_RSA_WITH_AES_128_CBC_SHA
631 * TLS_RSA_WITH_AES_256_CBC_SHA
632 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
633 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
634 * TLS_RSA_WITH_AES_128_CBC_SHA256
635 * TLS_RSA_WITH_AES_256_CBC_SHA256
636 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
637 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
638 * TLS_RSA_WITH_AES_128_GCM_SHA256
639 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100640 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
641 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200642 * TLS_PSK_WITH_AES_128_CBC_SHA
643 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100644 *
645 * PEM uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000646 */
Paul Bakker40e46942009-01-03 21:51:57 +0000647#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000648
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000649/**
650 * \def POLARSSL_ARC4_C
651 *
652 * Enable the ARCFOUR stream cipher.
653 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000654 * Module: library/arc4.c
655 * Caller: library/ssl_tls.c
656 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100657 * This module enables the following ciphersuites (if other requisites are
658 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000659 * TLS_RSA_WITH_RC4_128_MD5
660 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100661 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200662 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000663 */
Paul Bakker40e46942009-01-03 21:51:57 +0000664#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000665
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000666/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000667 * \def POLARSSL_ASN1_PARSE_C
668 *
669 * Enable the generic ASN1 parser.
670 *
671 * Module: library/asn1.c
672 * Caller: library/x509parse.c
673 */
674#define POLARSSL_ASN1_PARSE_C
675
676/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000677 * \def POLARSSL_ASN1_WRITE_C
678 *
679 * Enable the generic ASN1 writer.
680 *
681 * Module: library/asn1write.c
682 */
683#define POLARSSL_ASN1_WRITE_C
684
685/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000686 * \def POLARSSL_BASE64_C
687 *
688 * Enable the Base64 module.
689 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000690 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000691 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000692 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000693 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000694 */
Paul Bakker40e46942009-01-03 21:51:57 +0000695#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000696
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000697/**
698 * \def POLARSSL_BIGNUM_C
699 *
Paul Bakker9a736322012-11-14 12:39:52 +0000700 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000701 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000702 * Module: library/bignum.c
703 * Caller: library/dhm.c
704 * library/rsa.c
705 * library/ssl_tls.c
706 * library/x509parse.c
707 *
708 * This module is required for RSA and DHM support.
709 */
Paul Bakker40e46942009-01-03 21:51:57 +0000710#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000711
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000712/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000713 * \def POLARSSL_BLOWFISH_C
714 *
715 * Enable the Blowfish block cipher.
716 *
717 * Module: library/blowfish.c
718 */
719#define POLARSSL_BLOWFISH_C
720
721/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000722 * \def POLARSSL_CAMELLIA_C
723 *
724 * Enable the Camellia block cipher.
725 *
Paul Bakker38119b12009-01-10 23:31:23 +0000726 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000727 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000728 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000729 * This module enables the following ciphersuites (if other requisites are
730 * enabled as well):
731 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
732 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
733 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
734 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
735 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
736 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
737 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
738 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000739 */
740#define POLARSSL_CAMELLIA_C
741
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000742/**
743 * \def POLARSSL_CERTS_C
744 *
745 * Enable the test certificates.
746 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000747 * Module: library/certs.c
748 * Caller:
749 *
750 * This module is used for testing (ssl_client/server).
751 */
Paul Bakker40e46942009-01-03 21:51:57 +0000752#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000753
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000754/**
755 * \def POLARSSL_CIPHER_C
756 *
757 * Enable the generic cipher layer.
758 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000759 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +0200760 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +0000761 *
762 * Uncomment to enable generic cipher wrappers.
763 */
764#define POLARSSL_CIPHER_C
765
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000766/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000767 * \def POLARSSL_CTR_DRBG_C
768 *
769 * Enable the CTR_DRBG AES-256-based random generator
770 *
771 * Module: library/ctr_drbg.c
772 * Caller:
773 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000774 * Requires: POLARSSL_AES_C
775 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000776 * This module provides the CTR_DRBG AES-256 random number generator.
777 */
778#define POLARSSL_CTR_DRBG_C
779
780/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000781 * \def POLARSSL_DEBUG_C
782 *
783 * Enable the debug functions.
784 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000785 * Module: library/debug.c
786 * Caller: library/ssl_cli.c
787 * library/ssl_srv.c
788 * library/ssl_tls.c
789 *
790 * This module provides debugging functions.
791 */
Paul Bakker40e46942009-01-03 21:51:57 +0000792#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000793
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000794/**
795 * \def POLARSSL_DES_C
796 *
797 * Enable the DES block cipher.
798 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000799 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100800 * Caller: library/pem.c
801 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000802 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000803 * This module enables the following ciphersuites (if other requisites are
804 * enabled as well):
805 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
806 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100807 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200808 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100809 *
810 * PEM uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000811 */
Paul Bakker40e46942009-01-03 21:51:57 +0000812#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000813
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000814/**
815 * \def POLARSSL_DHM_C
816 *
817 * Enable the Diffie-Hellman-Merkle key exchange.
818 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000819 * Module: library/dhm.c
820 * Caller: library/ssl_cli.c
821 * library/ssl_srv.c
822 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000823 * This module enables the following ciphersuites (if other requisites are
824 * enabled as well):
825 * TLS_DHE_RSA_WITH_DES_CBC_SHA
826 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
827 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
828 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
829 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
830 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
831 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
832 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
833 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
834 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
835 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
836 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000837 */
Paul Bakker40e46942009-01-03 21:51:57 +0000838#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000839
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000840/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100841 * \def POLARSSL_ECDH_C
842 *
843 * Enable the elliptic curve Diffie-Hellman library.
844 *
845 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100846 * Caller: library/ssl_cli.c
847 * library/ssl_srv.c
848 *
849 * This module enables the following ciphersuites (if other requisites are
850 * enabled as well):
851 * TLS_ECDHE_RSA_WITH_NULL_SHA
852 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
853 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
854 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
855 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100856 *
857 * Requires: POLARSSL_ECP_C
858 */
859#define POLARSSL_ECDH_C
860
861/**
862 * \def POLARSSL_ECDSA_C
863 *
864 * Enable the elliptic curve DSA library.
865 *
866 * Module: library/ecdsa.c
867 * Caller:
868 *
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +0200869 * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100870 */
871#define POLARSSL_ECDSA_C
872
873/**
874 * \def POLARSSL_ECP_C
875 *
876 * Enable the elliptic curve over GF(p) library.
877 *
878 * Module: library/ecp.c
879 * Caller: library/ecdh.c
880 * library/ecdsa.c
881 *
882 * Requires: POLARSSL_BIGNUM_C
883 */
884#define POLARSSL_ECP_C
885
886/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000887 * \def POLARSSL_ENTROPY_C
888 *
889 * Enable the platform-specific entropy code.
890 *
891 * Module: library/entropy.c
892 * Caller:
893 *
Paul Bakker9e36f042013-06-30 14:34:05 +0200894 * Requires: POLARSSL_SHA512_C
Paul Bakker6083fd22011-12-03 21:45:14 +0000895 *
896 * This module provides a generic entropy pool
897 */
898#define POLARSSL_ENTROPY_C
899
900/**
Paul Bakker9d781402011-05-09 16:17:09 +0000901 * \def POLARSSL_ERROR_C
902 *
903 * Enable error code to error string conversion.
904 *
905 * Module: library/error.c
906 * Caller:
907 *
908 * This module enables err_strerror().
909 */
910#define POLARSSL_ERROR_C
911
912/**
Paul Bakker89e80c92012-03-20 13:50:09 +0000913 * \def POLARSSL_GCM_C
914 *
915 * Enable the Galois/Counter Mode (GCM) for AES
916 *
917 * Module: library/gcm.c
918 *
919 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +0000920 *
921 * This module enables the following ciphersuites (if other requisites are
922 * enabled as well):
923 * TLS_RSA_WITH_AES_128_GCM_SHA256
924 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +0000925 */
926#define POLARSSL_GCM_C
927
928/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000929 * \def POLARSSL_HAVEGE_C
930 *
931 * Enable the HAVEGE random generator.
932 *
Paul Bakker2a844242013-06-24 13:01:53 +0200933 * Warning: the HAVEGE random generator is not suitable for virtualized
934 * environments
935 *
936 * Warning: the HAVEGE random generator is dependent on timing and specific
937 * processor traits. It is therefore not advised to use HAVEGE as
938 * your applications primary random generator or primary entropy pool
939 * input. As a secondary input to your entropy pool, it IS able add
940 * the (limited) extra entropy it provides.
941 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000942 * Module: library/havege.c
943 * Caller:
944 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000945 * Requires: POLARSSL_TIMING_C
946 *
Paul Bakker2a844242013-06-24 13:01:53 +0200947 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +0000948#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +0200949 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000950
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000951/**
952 * \def POLARSSL_MD_C
953 *
954 * Enable the generic message digest layer.
955 *
Paul Bakker17373852011-01-06 14:20:01 +0000956 * Module: library/md.c
957 * Caller:
958 *
959 * Uncomment to enable generic message digest wrappers.
960 */
961#define POLARSSL_MD_C
962
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000963/**
964 * \def POLARSSL_MD2_C
965 *
966 * Enable the MD2 hash algorithm
967 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000968 * Module: library/md2.c
969 * Caller: library/x509parse.c
970 *
971 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
972 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000973#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +0000974 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000975
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000976/**
977 * \def POLARSSL_MD4_C
978 *
979 * Enable the MD4 hash algorithm
980 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000981 * Module: library/md4.c
982 * Caller: library/x509parse.c
983 *
984 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
985 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000986#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +0000987 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000988
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000989/**
990 * \def POLARSSL_MD5_C
991 *
992 * Enable the MD5 hash algorithm
993 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000994 * Module: library/md5.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100995 * Caller: library/pem.c
996 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000997 * library/x509parse.c
998 *
999 * This module is required for SSL/TLS and X.509.
Paul Bakker6deb37e2013-02-19 13:17:08 +01001000 * PEM uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +00001001 */
Paul Bakker40e46942009-01-03 21:51:57 +00001002#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001003
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001004/**
Paul Bakker6e339b52013-07-03 13:37:05 +02001005 * \def POLARSSL_MEMORY_C
1006 *
1007 * Enable the memory allocation layer.
1008 * By default PolarSSL uses the system-provided malloc() and free().
1009 * (As long as POLARSSL_MEMORY_STDMALLOC and POLARSSL_MEMORY_STDFREE
1010 * are defined and unmodified)
1011 *
1012 * This allows different allocators (self-implemented or provided)
1013 *
1014 * Enable this layer to allow use of alternative memory allocators.
1015#define POLARSSL_MEMORY_C
1016 */
1017
1018/**
1019 * The buffer allocator implementation that makes use of a (stack) based
1020 * buffer to 'allocate' dynamic memory. (replaces malloc() and free() calls)
1021 *
1022 * Module: library/memory_buffer_alloc.c
1023 *
1024 * Requires: POLARSSL_MEMORY_C
1025 *
1026 * Enable this module to enable the buffer memory allocator.
1027#define POLARSSL_MEMORY_BUFFER_ALLOC_C
1028 */
1029
1030/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001031 * \def POLARSSL_NET_C
1032 *
1033 * Enable the TCP/IP networking routines.
1034 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001035 * Module: library/net.c
1036 * Caller:
1037 *
1038 * This module provides TCP/IP networking routines.
1039 */
Paul Bakker40e46942009-01-03 21:51:57 +00001040#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001041
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001042/**
Paul Bakkerc70b9822013-04-07 22:00:46 +02001043 * \def POLARSSL_OID_C
1044 *
1045 * Enable the OID database
1046 *
1047 * Module: library/oid.c
1048 * Caller: library/rsa.c
1049 * library/x509parse.c
1050 * library/x509write.c
1051 *
1052 * This modules translates between OIDs and internal values.
1053 */
1054#define POLARSSL_OID_C
1055
1056/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001057 * \def POLARSSL_PADLOCK_C
1058 *
1059 * Enable VIA Padlock support on x86.
1060 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001061 * Module: library/padlock.c
1062 * Caller: library/aes.c
1063 *
1064 * This modules adds support for the VIA PadLock on x86.
1065 */
Paul Bakker40e46942009-01-03 21:51:57 +00001066#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001067
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001068/**
Paul Bakkerf518b162012-08-23 13:03:18 +00001069 * \def POLARSSL_PBKDF2_C
1070 *
1071 * Enable PKCS#5 PBKDF2 key derivation function
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001072 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +00001073 *
1074 * Module: library/pbkdf2.c
1075 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001076 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001077 *
1078 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +00001079 */
Paul Bakker370e90c2013-04-08 15:19:43 +02001080#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001081
1082/**
Paul Bakker96743fc2011-02-12 14:30:57 +00001083 * \def POLARSSL_PEM_C
1084 *
1085 * Enable PEM decoding
1086 *
1087 * Module: library/pem.c
1088 * Caller: library/x509parse.c
1089 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001090 * Requires: POLARSSL_BASE64_C
1091 *
Paul Bakker96743fc2011-02-12 14:30:57 +00001092 * This modules adds support for decoding PEM files.
1093 */
1094#define POLARSSL_PEM_C
1095
1096/**
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001097 * \def POLARSSL_PK_C
1098 *
1099 * Enable the generic public (asymetric) key layer.
1100 *
1101 * Module: library/pk.c
1102 * Caller: library/x509parse.c
1103 * library/ssl_tls.c
1104 * library/ssl_cli.c
1105 * library/ssl_srv.c
1106 *
1107 * Uncomment to enable generic public key wrappers.
1108 */
1109#define POLARSSL_PK_C
1110
1111/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001112 * \def POLARSSL_PKCS5_C
1113 *
1114 * Enable PKCS#5 functions
1115 *
1116 * Module: library/pkcs5.c
1117 *
1118 * Requires: POLARSSL_MD_C
1119 *
1120 * This module adds support for the PKCS#5 functions.
1121 */
1122#define POLARSSL_PKCS5_C
1123
1124/**
Paul Bakker5690efc2011-05-26 13:16:06 +00001125 * \def POLARSSL_PKCS11_C
1126 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001127 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001128 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001129 * Module: library/pkcs11.c
1130 * Caller: library/pk.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001131 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001132 * Requires: POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001133 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001134 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001135 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1136#define POLARSSL_PKCS11_C
1137 */
1138
1139/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001140 * \def POLARSSL_PKCS12_C
1141 *
1142 * Enable PKCS#12 PBE functions
1143 * Adds algorithms for parsing PKCS#8 encrypted private keys
1144 *
1145 * Module: library/pkcs12.c
1146 * Caller: library/x509parse.c
1147 *
Paul Bakkerb0713c72013-06-24 19:34:08 +02001148 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
1149 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001150 *
1151 * This module enables PKCS#12 functions.
1152 */
1153#define POLARSSL_PKCS12_C
1154
1155/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001156 * \def POLARSSL_RSA_C
1157 *
1158 * Enable the RSA public-key cryptosystem.
1159 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001160 * Module: library/rsa.c
1161 * Caller: library/ssl_cli.c
1162 * library/ssl_srv.c
1163 * library/ssl_tls.c
1164 * library/x509.c
1165 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001166 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001167 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001168 * This module is required for SSL/TLS and MD5-signed certificates.
1169 */
Paul Bakker40e46942009-01-03 21:51:57 +00001170#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001171
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001172/**
1173 * \def POLARSSL_SHA1_C
1174 *
1175 * Enable the SHA1 cryptographic hash algorithm.
1176 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001177 * Module: library/sha1.c
1178 * Caller: library/ssl_cli.c
1179 * library/ssl_srv.c
1180 * library/ssl_tls.c
1181 * library/x509parse.c
1182 *
1183 * This module is required for SSL/TLS and SHA1-signed certificates.
1184 */
Paul Bakker40e46942009-01-03 21:51:57 +00001185#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001186
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001187/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001188 * \def POLARSSL_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001189 *
1190 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001191 * (Used to be POLARSSL_SHA2_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001192 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001193 * Module: library/sha256.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001194 * Caller: library/md_wrap.c
1195 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001196 *
1197 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001198 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001199 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001200#define POLARSSL_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001201
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001202/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001203 * \def POLARSSL_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001204 *
1205 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001206 * (Used to be POLARSSL_SHA4_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001207 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001208 * Module: library/sha512.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001209 * Caller: library/md_wrap.c
1210 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001211 *
1212 * This module adds support for SHA-384 and SHA-512.
1213 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001214#define POLARSSL_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001215
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001216/**
Paul Bakker0a597072012-09-25 21:55:46 +00001217 * \def POLARSSL_SSL_CACHE_C
1218 *
1219 * Enable simple SSL cache implementation.
1220 *
1221 * Module: library/ssl_cache.c
1222 * Caller:
1223 *
1224 * Requires: POLARSSL_SSL_CACHE_C
1225 */
1226#define POLARSSL_SSL_CACHE_C
1227
1228/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001229 * \def POLARSSL_SSL_CLI_C
1230 *
1231 * Enable the SSL/TLS client code.
1232 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001233 * Module: library/ssl_cli.c
1234 * Caller:
1235 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001236 * Requires: POLARSSL_SSL_TLS_C
1237 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001238 * This module is required for SSL/TLS client support.
1239 */
Paul Bakker40e46942009-01-03 21:51:57 +00001240#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001241
Paul Bakker9a736322012-11-14 12:39:52 +00001242/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001243 * \def POLARSSL_SSL_SRV_C
1244 *
1245 * Enable the SSL/TLS server code.
1246 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001247 * Module: library/ssl_srv.c
1248 * Caller:
1249 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001250 * Requires: POLARSSL_SSL_TLS_C
1251 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001252 * This module is required for SSL/TLS server support.
1253 */
Paul Bakker40e46942009-01-03 21:51:57 +00001254#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001255
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001256/**
1257 * \def POLARSSL_SSL_TLS_C
1258 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001259 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001260 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001261 * Module: library/ssl_tls.c
1262 * Caller: library/ssl_cli.c
1263 * library/ssl_srv.c
1264 *
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001265 * Requires: POLARSSL_MD5_C, POLARSSL_SHA1_C, POLARSSL_CIPHER_C, POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001266 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001267 * This module is required for SSL/TLS.
1268 */
Paul Bakker40e46942009-01-03 21:51:57 +00001269#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001270
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001271/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001272 * \def POLARSSL_TIMING_C
1273 *
1274 * Enable the portable timing interface.
1275 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001276 * Module: library/timing.c
1277 * Caller: library/havege.c
1278 *
1279 * This module is used by the HAVEGE random number generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001280#define POLARSSL_TIMING_C
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001281 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001282
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001283/**
1284 * \def POLARSSL_VERSION_C
1285 *
1286 * Enable run-time version information.
1287 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001288 * Module: library/version.c
1289 *
1290 * This module provides run-time version information.
1291 */
1292#define POLARSSL_VERSION_C
1293
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001294/**
1295 * \def POLARSSL_X509_PARSE_C
1296 *
1297 * Enable X.509 certificate parsing.
1298 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001299 * Module: library/x509parse.c
1300 * Caller: library/ssl_cli.c
1301 * library/ssl_srv.c
1302 * library/ssl_tls.c
1303 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001304 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001305 * POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001306 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001307 * This module is required for X.509 certificate parsing.
1308 */
Paul Bakker40e46942009-01-03 21:51:57 +00001309#define POLARSSL_X509_PARSE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001310
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001311/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001312 * \def POLARSSL_X509_WRITE_C
1313 *
1314 * Enable X.509 buffer writing.
1315 *
1316 * Module: library/x509write.c
1317 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001318 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_RSA_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001319 *
1320 * This module is required for X.509 certificate request writing.
1321 */
1322#define POLARSSL_X509_WRITE_C
1323
1324/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001325 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001326 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001327 * Enable the XTEA block cipher.
1328 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001329 * Module: library/xtea.c
1330 * Caller:
1331 */
1332#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001333
Paul Bakker0a62cd12011-01-21 11:00:08 +00001334/* \} name */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001335
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001336/**
1337 * \name SECTION: Module configuration options
1338 *
1339 * This section allows for the setting of module specific sizes and
1340 * configuration options. The default values are already present in the
1341 * relevant header files and should suffice for the regular use cases.
1342 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1343 * only if you have a good reason and know the consequences.
1344 *
1345 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1346 * header file take precedence.
1347 *
1348 * Please check the respective header file for documentation on these
1349 * parameters (to prevent duplicate documentation).
1350 *
1351 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1352 * \{
1353 */
1354//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1355
1356#if defined(POLARSSL_CONFIG_OPTIONS)
1357
1358// MPI / BIGNUM options
1359//
1360#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1361#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1362
1363// CTR_DRBG options
1364//
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001365#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 +02001366#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1367#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1368#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1369#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1370
1371// Entropy options
1372//
1373#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1374#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1375
Paul Bakker6e339b52013-07-03 13:37:05 +02001376// Memory options
1377#define MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1378#define POLARSSL_MEMORY_STDMALLOC malloc /**< Default allocator to use, can be undefined */
1379#define POLARSSL_MEMORY_STDFREE free /**< Default free to use, can be undefined */
1380
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001381// SSL Cache options
1382//
1383#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1384#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1385
1386// SSL options
1387//
1388#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
Paul Bakker606b4ba2013-08-14 16:52:14 +02001389#define SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001390
1391#endif /* POLARSSL_CONFIG_OPTIONS */
1392
1393/* \} name */
1394
Paul Bakker7ad00f92013-04-18 23:05:25 +02001395/*
1396 * Sanity checks on defines and dependencies
1397 */
1398#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1399#error "POLARSSL_DHM_C defined, but not all prerequisites"
1400#endif
1401
1402#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1403#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1404#endif
1405
1406#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1407#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1408#endif
1409
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001410#if defined(POLARSSL_ECDSA_C) && \
1411 ( !defined(POLARSSL_ECP_C) || \
1412 !defined(POLARSSL_ASN1_PARSE_C) || \
1413 !defined(POLARSSL_ASN1_WRITE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001414#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1415#endif
1416
1417#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
1418#error "POLARSSL_ECP_C defined, but not all prerequisites"
1419#endif
1420
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001421#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
1422 !defined(POLARSSL_SHA256_C))
Paul Bakker7ad00f92013-04-18 23:05:25 +02001423#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1424#endif
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001425#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
1426 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
1427#error "CTR_DRBG_ENTROPY_LEN value too high"
1428#endif
1429#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA512_C) && \
1430 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
1431#error "CTR_DRBG_ENTROPY_LEN value too high"
1432#endif
Paul Bakker7ad00f92013-04-18 23:05:25 +02001433
1434#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1435#error "POLARSSL_GCM_C defined, but not all prerequisites"
1436#endif
1437
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001438#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
1439#error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
1440#endif
1441
Paul Bakkere07f41d2013-04-19 09:08:57 +02001442#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1443#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1444#endif
1445
1446#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1447 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
1448 !defined(POLARSSL_X509_PARSE_C) )
1449#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1450#endif
1451
1452#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1453 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
1454 !defined(POLARSSL_X509_PARSE_C) )
1455#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1456#endif
1457
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +02001458#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
1459 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \
1460 !defined(POLARSSL_X509_PARSE_C) )
1461#error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
1462#endif
1463
Paul Bakkere07f41d2013-04-19 09:08:57 +02001464#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
1465 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1466#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1467#endif
1468
1469#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
1470 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1471#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1472#endif
1473
Paul Bakker6e339b52013-07-03 13:37:05 +02001474#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && !defined(POLARSSL_MEMORY_C)
1475#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
1476#endif
1477
Paul Bakker7ad00f92013-04-18 23:05:25 +02001478#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1479#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1480#endif
1481
1482#if defined(POLARSSL_PEM_C) && !defined(POLARSSL_PEM_C)
1483#error "POLARSSL_PEM_C defined, but not all prerequisites"
1484#endif
1485
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001486#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001487#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1488#endif
1489
1490#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1491 !defined(POLARSSL_OID_C) )
1492#error "POLARSSL_RSA_C defined, but not all prerequisites"
1493#endif
1494
1495#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1496#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1497#endif
1498
1499#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_MD5_C) || \
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001500 !defined(POLARSSL_SHA1_C) || !defined(POLARSSL_CIPHER_C) ) || \
1501 !defined(POLARSSL_PK_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001502#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1503#endif
1504
1505#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1506#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1507#endif
1508
Paul Bakker59da0a42013-08-19 13:27:17 +02001509#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
1510 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) )
1511#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
1512#endif
1513
Paul Bakker7ad00f92013-04-18 23:05:25 +02001514#if defined(POLARSSL_X509_PARSE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1515 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001516 !defined(POLARSSL_PK_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001517#error "POLARSSL_X509_PARSE_C defined, but not all prerequisites"
1518#endif
1519
1520#if defined(POLARSSL_X509_WRITE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1521 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
1522 !defined(POLARSSL_RSA_C) )
1523#error "POLARSSL_X509_WRITE_C defined, but not all prerequisites"
1524#endif
1525
Paul Bakker5121ce52009-01-03 21:22:43 +00001526#endif /* config.h */