blob: c1a1269e669884bbb871ef6e350f9dfbb97d58f0 [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 Bakkerd2f068e2013-08-27 21:19:20 +0200563 * \def POLARSSL_SSL_PROTO_SSL3
564 *
565 * Enable support for SSL 3.0
566 *
567 * Requires: POLARSSL_MD5_C
568 * POLARSSL_SHA1_C
569 *
570 * Comment this macro to disable support for SSL 3.0
571 */
572#define POLARSSL_SSL_PROTO_SSL3
573
574/**
575 * \def POLARSSL_SSL_PROTO_TLS1
576 *
577 * Enable support for TLS 1.0
578 *
579 * Requires: POLARSSL_MD5_C
580 * POLARSSL_SHA1_C
581 *
582 * Comment this macro to disable support for TLS 1.0
583 */
584#define POLARSSL_SSL_PROTO_TLS1
585
586/**
587 * \def POLARSSL_SSL_PROTO_TLS1_1
588 *
589 * Enable support for TLS 1.1
590 *
591 * Requires: POLARSSL_MD5_C
592 * POLARSSL_SHA1_C
593 *
594 * Comment this macro to disable support for TLS 1.1
595 */
596#define POLARSSL_SSL_PROTO_TLS1_1
597
598/**
599 * \def POLARSSL_SSL_PROTO_TLS1_2
600 *
601 * Enable support for TLS 1.2
602 *
603 * Requires: POLARSSL_SHA256_C or POLARSSL_SHA512_C
604 * (Depends on ciphersuites)
605 *
606 * Comment this macro to disable support for TLS 1.2
607 */
608#define POLARSSL_SSL_PROTO_TLS1_2
609
610/**
Paul Bakkera503a632013-08-14 13:48:06 +0200611 * \def POLARSSL_SSL_SESSION_TICKETS
612 *
613 * Enable support for RFC 5077 session tickets in SSL
614 *
615 * Requires: POLARSSL_AES_C
616 * POLARSSL_SHA256_C
617 *
618 * Comment this macro to disable support for SSL session tickets
619 */
620#define POLARSSL_SSL_SESSION_TICKETS
621
622/**
Paul Bakker0be444a2013-08-27 21:55:01 +0200623 * \def POLARSSL_SSL_SERVER_NAME_INDICATION
624 *
625 * Enable support for RFC 6066 server name indication (SNI) in SSL
626 *
627 * Comment this macro to disable support for server name indication in SSL
628 */
629#define POLARSSL_SSL_SERVER_NAME_INDICATION
630
631/**
Paul Bakker1f2bc622013-08-15 13:45:55 +0200632 * \def POLARSSL_SSL_TRUNCATED_HMAC
633 *
634 * Enable support for RFC 6066 truncated HMAC in SSL
635 *
636 * Comment this macro to disable support for truncated HMAC in SSL
637 */
638#define POLARSSL_SSL_TRUNCATED_HMAC
639
640/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000641 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
642 *
643 * If set, the X509 parser will not break-off when parsing an X509 certificate
644 * and encountering an unknown critical extension.
645 *
646 * Uncomment to prevent an error.
647 *
648#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
649 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000650
651/**
652 * \def POLARSSL_ZLIB_SUPPORT
653 *
654 * If set, the SSL/TLS module uses ZLIB to support compression and
655 * decompression of packet data.
656 *
657 * Used in: library/ssl_tls.c
658 * library/ssl_cli.c
659 * library/ssl_srv.c
660 *
661 * This feature requires zlib library and headers to be present.
662 *
663 * Uncomment to enable use of ZLIB
664#define POLARSSL_ZLIB_SUPPORT
665 */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000666/* \} name */
667
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000668/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000669 * \name SECTION: PolarSSL modules
670 *
671 * This section enables or disables entire modules in PolarSSL
672 * \{
673 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000674
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000675/**
676 * \def POLARSSL_AES_C
677 *
678 * Enable the AES block cipher.
679 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000680 * Module: library/aes.c
681 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000682 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000683 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000684 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000685 * This module enables the following ciphersuites (if other requisites are
686 * enabled as well):
687 * TLS_RSA_WITH_AES_128_CBC_SHA
688 * TLS_RSA_WITH_AES_256_CBC_SHA
689 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
690 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
691 * TLS_RSA_WITH_AES_128_CBC_SHA256
692 * TLS_RSA_WITH_AES_256_CBC_SHA256
693 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
694 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
695 * TLS_RSA_WITH_AES_128_GCM_SHA256
696 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100697 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
698 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200699 * TLS_PSK_WITH_AES_128_CBC_SHA
700 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100701 *
702 * PEM uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000703 */
Paul Bakker40e46942009-01-03 21:51:57 +0000704#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000705
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000706/**
707 * \def POLARSSL_ARC4_C
708 *
709 * Enable the ARCFOUR stream cipher.
710 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000711 * Module: library/arc4.c
712 * Caller: library/ssl_tls.c
713 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100714 * This module enables the following ciphersuites (if other requisites are
715 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000716 * TLS_RSA_WITH_RC4_128_MD5
717 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100718 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200719 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000720 */
Paul Bakker40e46942009-01-03 21:51:57 +0000721#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000722
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000723/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000724 * \def POLARSSL_ASN1_PARSE_C
725 *
726 * Enable the generic ASN1 parser.
727 *
728 * Module: library/asn1.c
729 * Caller: library/x509parse.c
730 */
731#define POLARSSL_ASN1_PARSE_C
732
733/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000734 * \def POLARSSL_ASN1_WRITE_C
735 *
736 * Enable the generic ASN1 writer.
737 *
738 * Module: library/asn1write.c
739 */
740#define POLARSSL_ASN1_WRITE_C
741
742/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000743 * \def POLARSSL_BASE64_C
744 *
745 * Enable the Base64 module.
746 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000747 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000748 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000749 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000750 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000751 */
Paul Bakker40e46942009-01-03 21:51:57 +0000752#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000753
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000754/**
755 * \def POLARSSL_BIGNUM_C
756 *
Paul Bakker9a736322012-11-14 12:39:52 +0000757 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000758 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000759 * Module: library/bignum.c
760 * Caller: library/dhm.c
761 * library/rsa.c
762 * library/ssl_tls.c
763 * library/x509parse.c
764 *
765 * This module is required for RSA and DHM support.
766 */
Paul Bakker40e46942009-01-03 21:51:57 +0000767#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000768
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000769/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000770 * \def POLARSSL_BLOWFISH_C
771 *
772 * Enable the Blowfish block cipher.
773 *
774 * Module: library/blowfish.c
775 */
776#define POLARSSL_BLOWFISH_C
777
778/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000779 * \def POLARSSL_CAMELLIA_C
780 *
781 * Enable the Camellia block cipher.
782 *
Paul Bakker38119b12009-01-10 23:31:23 +0000783 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000784 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000785 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000786 * This module enables the following ciphersuites (if other requisites are
787 * enabled as well):
788 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
789 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
790 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
791 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
792 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
793 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
794 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
795 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000796 */
797#define POLARSSL_CAMELLIA_C
798
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000799/**
800 * \def POLARSSL_CERTS_C
801 *
802 * Enable the test certificates.
803 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000804 * Module: library/certs.c
805 * Caller:
806 *
807 * This module is used for testing (ssl_client/server).
808 */
Paul Bakker40e46942009-01-03 21:51:57 +0000809#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000810
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000811/**
812 * \def POLARSSL_CIPHER_C
813 *
814 * Enable the generic cipher layer.
815 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000816 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +0200817 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +0000818 *
819 * Uncomment to enable generic cipher wrappers.
820 */
821#define POLARSSL_CIPHER_C
822
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000823/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000824 * \def POLARSSL_CTR_DRBG_C
825 *
826 * Enable the CTR_DRBG AES-256-based random generator
827 *
828 * Module: library/ctr_drbg.c
829 * Caller:
830 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000831 * Requires: POLARSSL_AES_C
832 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000833 * This module provides the CTR_DRBG AES-256 random number generator.
834 */
835#define POLARSSL_CTR_DRBG_C
836
837/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000838 * \def POLARSSL_DEBUG_C
839 *
840 * Enable the debug functions.
841 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000842 * Module: library/debug.c
843 * Caller: library/ssl_cli.c
844 * library/ssl_srv.c
845 * library/ssl_tls.c
846 *
847 * This module provides debugging functions.
848 */
Paul Bakker40e46942009-01-03 21:51:57 +0000849#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000850
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000851/**
852 * \def POLARSSL_DES_C
853 *
854 * Enable the DES block cipher.
855 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000856 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100857 * Caller: library/pem.c
858 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000859 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000860 * This module enables the following ciphersuites (if other requisites are
861 * enabled as well):
862 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
863 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100864 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200865 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100866 *
867 * PEM uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000868 */
Paul Bakker40e46942009-01-03 21:51:57 +0000869#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000870
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000871/**
872 * \def POLARSSL_DHM_C
873 *
874 * Enable the Diffie-Hellman-Merkle key exchange.
875 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000876 * Module: library/dhm.c
877 * Caller: library/ssl_cli.c
878 * library/ssl_srv.c
879 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000880 * This module enables the following ciphersuites (if other requisites are
881 * enabled as well):
882 * TLS_DHE_RSA_WITH_DES_CBC_SHA
883 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
884 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
885 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
886 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
887 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
888 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
889 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
890 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
891 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
892 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
893 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000894 */
Paul Bakker40e46942009-01-03 21:51:57 +0000895#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000896
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000897/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100898 * \def POLARSSL_ECDH_C
899 *
900 * Enable the elliptic curve Diffie-Hellman library.
901 *
902 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100903 * Caller: library/ssl_cli.c
904 * library/ssl_srv.c
905 *
906 * This module enables the following ciphersuites (if other requisites are
907 * enabled as well):
908 * TLS_ECDHE_RSA_WITH_NULL_SHA
909 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
910 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
911 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
912 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100913 *
914 * Requires: POLARSSL_ECP_C
915 */
916#define POLARSSL_ECDH_C
917
918/**
919 * \def POLARSSL_ECDSA_C
920 *
921 * Enable the elliptic curve DSA library.
922 *
923 * Module: library/ecdsa.c
924 * Caller:
925 *
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +0200926 * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100927 */
928#define POLARSSL_ECDSA_C
929
930/**
931 * \def POLARSSL_ECP_C
932 *
933 * Enable the elliptic curve over GF(p) library.
934 *
935 * Module: library/ecp.c
936 * Caller: library/ecdh.c
937 * library/ecdsa.c
938 *
939 * Requires: POLARSSL_BIGNUM_C
940 */
941#define POLARSSL_ECP_C
942
943/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000944 * \def POLARSSL_ENTROPY_C
945 *
946 * Enable the platform-specific entropy code.
947 *
948 * Module: library/entropy.c
949 * Caller:
950 *
Paul Bakker9e36f042013-06-30 14:34:05 +0200951 * Requires: POLARSSL_SHA512_C
Paul Bakker6083fd22011-12-03 21:45:14 +0000952 *
953 * This module provides a generic entropy pool
954 */
955#define POLARSSL_ENTROPY_C
956
957/**
Paul Bakker9d781402011-05-09 16:17:09 +0000958 * \def POLARSSL_ERROR_C
959 *
960 * Enable error code to error string conversion.
961 *
962 * Module: library/error.c
963 * Caller:
964 *
965 * This module enables err_strerror().
966 */
967#define POLARSSL_ERROR_C
968
969/**
Paul Bakker89e80c92012-03-20 13:50:09 +0000970 * \def POLARSSL_GCM_C
971 *
972 * Enable the Galois/Counter Mode (GCM) for AES
973 *
974 * Module: library/gcm.c
975 *
976 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +0000977 *
978 * This module enables the following ciphersuites (if other requisites are
979 * enabled as well):
980 * TLS_RSA_WITH_AES_128_GCM_SHA256
981 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +0000982 */
983#define POLARSSL_GCM_C
984
985/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000986 * \def POLARSSL_HAVEGE_C
987 *
988 * Enable the HAVEGE random generator.
989 *
Paul Bakker2a844242013-06-24 13:01:53 +0200990 * Warning: the HAVEGE random generator is not suitable for virtualized
991 * environments
992 *
993 * Warning: the HAVEGE random generator is dependent on timing and specific
994 * processor traits. It is therefore not advised to use HAVEGE as
995 * your applications primary random generator or primary entropy pool
996 * input. As a secondary input to your entropy pool, it IS able add
997 * the (limited) extra entropy it provides.
998 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000999 * Module: library/havege.c
1000 * Caller:
1001 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001002 * Requires: POLARSSL_TIMING_C
1003 *
Paul Bakker2a844242013-06-24 13:01:53 +02001004 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001005#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +02001006 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001007
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001008/**
1009 * \def POLARSSL_MD_C
1010 *
1011 * Enable the generic message digest layer.
1012 *
Paul Bakker17373852011-01-06 14:20:01 +00001013 * Module: library/md.c
1014 * Caller:
1015 *
1016 * Uncomment to enable generic message digest wrappers.
1017 */
1018#define POLARSSL_MD_C
1019
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001020/**
1021 * \def POLARSSL_MD2_C
1022 *
1023 * Enable the MD2 hash algorithm
1024 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001025 * Module: library/md2.c
1026 * Caller: library/x509parse.c
1027 *
1028 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
1029 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001030#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001031 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001032
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001033/**
1034 * \def POLARSSL_MD4_C
1035 *
1036 * Enable the MD4 hash algorithm
1037 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001038 * Module: library/md4.c
1039 * Caller: library/x509parse.c
1040 *
1041 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1042 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001043#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001044 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001045
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001046/**
1047 * \def POLARSSL_MD5_C
1048 *
1049 * Enable the MD5 hash algorithm
1050 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001051 * Module: library/md5.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001052 * Caller: library/pem.c
1053 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001054 * library/x509parse.c
1055 *
1056 * This module is required for SSL/TLS and X.509.
Paul Bakker6deb37e2013-02-19 13:17:08 +01001057 * PEM uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +00001058 */
Paul Bakker40e46942009-01-03 21:51:57 +00001059#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001060
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001061/**
Paul Bakker6e339b52013-07-03 13:37:05 +02001062 * \def POLARSSL_MEMORY_C
1063 *
1064 * Enable the memory allocation layer.
1065 * By default PolarSSL uses the system-provided malloc() and free().
1066 * (As long as POLARSSL_MEMORY_STDMALLOC and POLARSSL_MEMORY_STDFREE
1067 * are defined and unmodified)
1068 *
1069 * This allows different allocators (self-implemented or provided)
1070 *
1071 * Enable this layer to allow use of alternative memory allocators.
1072#define POLARSSL_MEMORY_C
1073 */
1074
1075/**
1076 * The buffer allocator implementation that makes use of a (stack) based
1077 * buffer to 'allocate' dynamic memory. (replaces malloc() and free() calls)
1078 *
1079 * Module: library/memory_buffer_alloc.c
1080 *
1081 * Requires: POLARSSL_MEMORY_C
1082 *
1083 * Enable this module to enable the buffer memory allocator.
1084#define POLARSSL_MEMORY_BUFFER_ALLOC_C
1085 */
1086
1087/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001088 * \def POLARSSL_NET_C
1089 *
1090 * Enable the TCP/IP networking routines.
1091 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001092 * Module: library/net.c
1093 * Caller:
1094 *
1095 * This module provides TCP/IP networking routines.
1096 */
Paul Bakker40e46942009-01-03 21:51:57 +00001097#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001098
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001099/**
Paul Bakkerc70b9822013-04-07 22:00:46 +02001100 * \def POLARSSL_OID_C
1101 *
1102 * Enable the OID database
1103 *
1104 * Module: library/oid.c
1105 * Caller: library/rsa.c
1106 * library/x509parse.c
1107 * library/x509write.c
1108 *
1109 * This modules translates between OIDs and internal values.
1110 */
1111#define POLARSSL_OID_C
1112
1113/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001114 * \def POLARSSL_PADLOCK_C
1115 *
1116 * Enable VIA Padlock support on x86.
1117 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001118 * Module: library/padlock.c
1119 * Caller: library/aes.c
1120 *
1121 * This modules adds support for the VIA PadLock on x86.
1122 */
Paul Bakker40e46942009-01-03 21:51:57 +00001123#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001124
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001125/**
Paul Bakkerf518b162012-08-23 13:03:18 +00001126 * \def POLARSSL_PBKDF2_C
1127 *
1128 * Enable PKCS#5 PBKDF2 key derivation function
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001129 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +00001130 *
1131 * Module: library/pbkdf2.c
1132 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001133 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001134 *
1135 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +00001136 */
Paul Bakker370e90c2013-04-08 15:19:43 +02001137#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001138
1139/**
Paul Bakker96743fc2011-02-12 14:30:57 +00001140 * \def POLARSSL_PEM_C
1141 *
1142 * Enable PEM decoding
1143 *
1144 * Module: library/pem.c
1145 * Caller: library/x509parse.c
1146 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001147 * Requires: POLARSSL_BASE64_C
1148 *
Paul Bakker96743fc2011-02-12 14:30:57 +00001149 * This modules adds support for decoding PEM files.
1150 */
1151#define POLARSSL_PEM_C
1152
1153/**
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001154 * \def POLARSSL_PK_C
1155 *
1156 * Enable the generic public (asymetric) key layer.
1157 *
1158 * Module: library/pk.c
1159 * Caller: library/x509parse.c
1160 * library/ssl_tls.c
1161 * library/ssl_cli.c
1162 * library/ssl_srv.c
1163 *
1164 * Uncomment to enable generic public key wrappers.
1165 */
1166#define POLARSSL_PK_C
1167
1168/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001169 * \def POLARSSL_PKCS5_C
1170 *
1171 * Enable PKCS#5 functions
1172 *
1173 * Module: library/pkcs5.c
1174 *
1175 * Requires: POLARSSL_MD_C
1176 *
1177 * This module adds support for the PKCS#5 functions.
1178 */
1179#define POLARSSL_PKCS5_C
1180
1181/**
Paul Bakker5690efc2011-05-26 13:16:06 +00001182 * \def POLARSSL_PKCS11_C
1183 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001184 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001185 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001186 * Module: library/pkcs11.c
1187 * Caller: library/pk.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001188 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001189 * Requires: POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001190 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001191 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001192 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1193#define POLARSSL_PKCS11_C
1194 */
1195
1196/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001197 * \def POLARSSL_PKCS12_C
1198 *
1199 * Enable PKCS#12 PBE functions
1200 * Adds algorithms for parsing PKCS#8 encrypted private keys
1201 *
1202 * Module: library/pkcs12.c
1203 * Caller: library/x509parse.c
1204 *
Paul Bakkerb0713c72013-06-24 19:34:08 +02001205 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
1206 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001207 *
1208 * This module enables PKCS#12 functions.
1209 */
1210#define POLARSSL_PKCS12_C
1211
1212/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001213 * \def POLARSSL_RSA_C
1214 *
1215 * Enable the RSA public-key cryptosystem.
1216 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001217 * Module: library/rsa.c
1218 * Caller: library/ssl_cli.c
1219 * library/ssl_srv.c
1220 * library/ssl_tls.c
1221 * library/x509.c
1222 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001223 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001224 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001225 * This module is required for SSL/TLS and MD5-signed certificates.
1226 */
Paul Bakker40e46942009-01-03 21:51:57 +00001227#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001228
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001229/**
1230 * \def POLARSSL_SHA1_C
1231 *
1232 * Enable the SHA1 cryptographic hash algorithm.
1233 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001234 * Module: library/sha1.c
1235 * Caller: library/ssl_cli.c
1236 * library/ssl_srv.c
1237 * library/ssl_tls.c
1238 * library/x509parse.c
1239 *
1240 * This module is required for SSL/TLS and SHA1-signed certificates.
1241 */
Paul Bakker40e46942009-01-03 21:51:57 +00001242#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001243
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001244/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001245 * \def POLARSSL_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001246 *
1247 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001248 * (Used to be POLARSSL_SHA2_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001249 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001250 * Module: library/sha256.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001251 * Caller: library/md_wrap.c
1252 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001253 *
1254 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001255 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001256 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001257#define POLARSSL_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001258
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001259/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001260 * \def POLARSSL_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001261 *
1262 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001263 * (Used to be POLARSSL_SHA4_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001264 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001265 * Module: library/sha512.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001266 * Caller: library/md_wrap.c
1267 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001268 *
1269 * This module adds support for SHA-384 and SHA-512.
1270 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001271#define POLARSSL_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001272
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001273/**
Paul Bakker0a597072012-09-25 21:55:46 +00001274 * \def POLARSSL_SSL_CACHE_C
1275 *
1276 * Enable simple SSL cache implementation.
1277 *
1278 * Module: library/ssl_cache.c
1279 * Caller:
1280 *
1281 * Requires: POLARSSL_SSL_CACHE_C
1282 */
1283#define POLARSSL_SSL_CACHE_C
1284
1285/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001286 * \def POLARSSL_SSL_CLI_C
1287 *
1288 * Enable the SSL/TLS client code.
1289 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001290 * Module: library/ssl_cli.c
1291 * Caller:
1292 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001293 * Requires: POLARSSL_SSL_TLS_C
1294 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001295 * This module is required for SSL/TLS client support.
1296 */
Paul Bakker40e46942009-01-03 21:51:57 +00001297#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001298
Paul Bakker9a736322012-11-14 12:39:52 +00001299/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001300 * \def POLARSSL_SSL_SRV_C
1301 *
1302 * Enable the SSL/TLS server code.
1303 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001304 * Module: library/ssl_srv.c
1305 * Caller:
1306 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001307 * Requires: POLARSSL_SSL_TLS_C
1308 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001309 * This module is required for SSL/TLS server support.
1310 */
Paul Bakker40e46942009-01-03 21:51:57 +00001311#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001312
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001313/**
1314 * \def POLARSSL_SSL_TLS_C
1315 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001316 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001317 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001318 * Module: library/ssl_tls.c
1319 * Caller: library/ssl_cli.c
1320 * library/ssl_srv.c
1321 *
Paul Bakker577e0062013-08-28 11:57:20 +02001322 * Requires: POLARSSL_CIPHER_C, POLARSSL_PK_C, POLARSSL_MD_C
1323 * and at least one of the POLARSSL_SSL_PROTO_* defines
Paul Bakker5690efc2011-05-26 13:16:06 +00001324 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001325 * This module is required for SSL/TLS.
1326 */
Paul Bakker40e46942009-01-03 21:51:57 +00001327#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001328
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001329/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001330 * \def POLARSSL_TIMING_C
1331 *
1332 * Enable the portable timing interface.
1333 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001334 * Module: library/timing.c
1335 * Caller: library/havege.c
1336 *
1337 * This module is used by the HAVEGE random number generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001338#define POLARSSL_TIMING_C
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001339 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001340
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001341/**
1342 * \def POLARSSL_VERSION_C
1343 *
1344 * Enable run-time version information.
1345 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001346 * Module: library/version.c
1347 *
1348 * This module provides run-time version information.
1349 */
1350#define POLARSSL_VERSION_C
1351
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001352/**
1353 * \def POLARSSL_X509_PARSE_C
1354 *
1355 * Enable X.509 certificate parsing.
1356 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001357 * Module: library/x509parse.c
1358 * Caller: library/ssl_cli.c
1359 * library/ssl_srv.c
1360 * library/ssl_tls.c
1361 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001362 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001363 * POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001364 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001365 * This module is required for X.509 certificate parsing.
1366 */
Paul Bakker40e46942009-01-03 21:51:57 +00001367#define POLARSSL_X509_PARSE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001368
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001369/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001370 * \def POLARSSL_X509_WRITE_C
1371 *
1372 * Enable X.509 buffer writing.
1373 *
1374 * Module: library/x509write.c
1375 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001376 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_RSA_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001377 *
1378 * This module is required for X.509 certificate request writing.
1379 */
1380#define POLARSSL_X509_WRITE_C
1381
1382/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001383 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001384 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001385 * Enable the XTEA block cipher.
1386 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001387 * Module: library/xtea.c
1388 * Caller:
1389 */
1390#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001391
Paul Bakker0a62cd12011-01-21 11:00:08 +00001392/* \} name */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001393
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001394/**
1395 * \name SECTION: Module configuration options
1396 *
1397 * This section allows for the setting of module specific sizes and
1398 * configuration options. The default values are already present in the
1399 * relevant header files and should suffice for the regular use cases.
1400 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1401 * only if you have a good reason and know the consequences.
1402 *
1403 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1404 * header file take precedence.
1405 *
1406 * Please check the respective header file for documentation on these
1407 * parameters (to prevent duplicate documentation).
1408 *
1409 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1410 * \{
1411 */
1412//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1413
1414#if defined(POLARSSL_CONFIG_OPTIONS)
1415
1416// MPI / BIGNUM options
1417//
1418#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1419#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1420
1421// CTR_DRBG options
1422//
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001423#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 +02001424#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1425#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1426#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1427#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1428
1429// Entropy options
1430//
1431#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1432#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1433
Paul Bakker6e339b52013-07-03 13:37:05 +02001434// Memory options
1435#define MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1436#define POLARSSL_MEMORY_STDMALLOC malloc /**< Default allocator to use, can be undefined */
1437#define POLARSSL_MEMORY_STDFREE free /**< Default free to use, can be undefined */
1438
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001439// SSL Cache options
1440//
1441#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1442#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1443
1444// SSL options
1445//
1446#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
Paul Bakker606b4ba2013-08-14 16:52:14 +02001447#define SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001448
1449#endif /* POLARSSL_CONFIG_OPTIONS */
1450
1451/* \} name */
1452
Paul Bakker7ad00f92013-04-18 23:05:25 +02001453/*
1454 * Sanity checks on defines and dependencies
1455 */
1456#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1457#error "POLARSSL_DHM_C defined, but not all prerequisites"
1458#endif
1459
1460#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1461#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1462#endif
1463
1464#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1465#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1466#endif
1467
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001468#if defined(POLARSSL_ECDSA_C) && \
1469 ( !defined(POLARSSL_ECP_C) || \
1470 !defined(POLARSSL_ASN1_PARSE_C) || \
1471 !defined(POLARSSL_ASN1_WRITE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001472#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1473#endif
1474
1475#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
1476#error "POLARSSL_ECP_C defined, but not all prerequisites"
1477#endif
1478
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001479#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
1480 !defined(POLARSSL_SHA256_C))
Paul Bakker7ad00f92013-04-18 23:05:25 +02001481#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1482#endif
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001483#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
1484 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
1485#error "CTR_DRBG_ENTROPY_LEN value too high"
1486#endif
1487#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA512_C) && \
1488 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
1489#error "CTR_DRBG_ENTROPY_LEN value too high"
1490#endif
Paul Bakker7ad00f92013-04-18 23:05:25 +02001491
1492#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1493#error "POLARSSL_GCM_C defined, but not all prerequisites"
1494#endif
1495
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001496#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
1497#error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
1498#endif
1499
Paul Bakkere07f41d2013-04-19 09:08:57 +02001500#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1501#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1502#endif
1503
1504#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1505 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
1506 !defined(POLARSSL_X509_PARSE_C) )
1507#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1508#endif
1509
1510#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1511 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
1512 !defined(POLARSSL_X509_PARSE_C) )
1513#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1514#endif
1515
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +02001516#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
1517 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \
1518 !defined(POLARSSL_X509_PARSE_C) )
1519#error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
1520#endif
1521
Paul Bakkere07f41d2013-04-19 09:08:57 +02001522#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
1523 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1524#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1525#endif
1526
1527#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
1528 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1529#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1530#endif
1531
Paul Bakker6e339b52013-07-03 13:37:05 +02001532#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && !defined(POLARSSL_MEMORY_C)
1533#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
1534#endif
1535
Paul Bakker7ad00f92013-04-18 23:05:25 +02001536#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1537#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1538#endif
1539
1540#if defined(POLARSSL_PEM_C) && !defined(POLARSSL_PEM_C)
1541#error "POLARSSL_PEM_C defined, but not all prerequisites"
1542#endif
1543
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001544#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001545#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1546#endif
1547
1548#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1549 !defined(POLARSSL_OID_C) )
1550#error "POLARSSL_RSA_C defined, but not all prerequisites"
1551#endif
1552
1553#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1554#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1555#endif
1556
Paul Bakker577e0062013-08-28 11:57:20 +02001557#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \
1558 !defined(POLARSSL_PK_C) || !defined(POLARSSL_MD_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001559#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1560#endif
1561
1562#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1563#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1564#endif
1565
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001566#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
1567 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
1568 !defined(POLARSSL_SSL_PROTO_TLS1_2))
1569#error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
1570#endif
1571
1572#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1573 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
1574#error "Illegal protocol selection"
1575#endif
1576
1577#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
1578 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
1579#error "Illegal protocol selection"
1580#endif
1581
1582#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1583 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
1584 !defined(POLARSSL_SSL_PROTO_TLS1_1)))
1585#error "Illegal protocol selection"
1586#endif
1587
Paul Bakker59da0a42013-08-19 13:27:17 +02001588#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
1589 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) )
1590#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
1591#endif
1592
Paul Bakker7ad00f92013-04-18 23:05:25 +02001593#if defined(POLARSSL_X509_PARSE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1594 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001595 !defined(POLARSSL_PK_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001596#error "POLARSSL_X509_PARSE_C defined, but not all prerequisites"
1597#endif
1598
1599#if defined(POLARSSL_X509_WRITE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1600 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
1601 !defined(POLARSSL_RSA_C) )
1602#error "POLARSSL_X509_WRITE_C defined, but not all prerequisites"
1603#endif
1604
Paul Bakker5121ce52009-01-03 21:22:43 +00001605#endif /* config.h */