blob: fddd50b6899f6c38bd08a0459989b85b52448d01 [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 Bakker0a62cd12011-01-21 11:00:08 +000097/* \} name */
98
Paul Bakkerf3b86c12011-01-27 15:24:17 +000099/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000100 * \name SECTION: PolarSSL feature support
101 *
102 * This section sets support for features that are or are not needed
103 * within the modules that are enabled.
104 * \{
105 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000106
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000107/**
Paul Bakker90995b52013-06-24 19:20:35 +0200108 * \def POLARSSL_XXX_ALT
109 *
110 * Uncomment a macro to let PolarSSL use your alternate core implementation of
111 * a symmetric or hash algorithm (e.g. platform specific assembly optimized
112 * implementations). Keep in mind that the function prototypes should remain
113 * the same.
114 *
115 * Example: In case you uncomment POLARSSL_AES_ALT, PolarSSL will no longer
116 * provide the "struct aes_context" definition and omit the base function
117 * declarations and implementations. "aes_alt.h" will be included from
118 * "aes.h" to include the new function definitions.
119 *
120 * Uncomment a macro to enable alternate implementation for core algorithm
121 * functions
122#define POLARSSL_AES_ALT
123#define POLARSSL_ARC4_ALT
124#define POLARSSL_BLOWFISH_ALT
125#define POLARSSL_CAMELLIA_ALT
126#define POLARSSL_DES_ALT
127#define POLARSSL_XTEA_ALT
128#define POLARSSL_MD2_ALT
129#define POLARSSL_MD4_ALT
130#define POLARSSL_MD5_ALT
131#define POLARSSL_SHA1_ALT
132#define POLARSSL_SHA2_ALT
133#define POLARSSL_SHA4_ALT
134 */
135
136/**
Paul Bakker15566e42011-04-24 21:19:15 +0000137 * \def POLARSSL_AES_ROM_TABLES
138 *
139 * Store the AES tables in ROM.
140 *
141 * Uncomment this macro to store the AES tables in ROM.
142 *
143#define POLARSSL_AES_ROM_TABLES
144 */
145
146/**
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000147 * \def POLARSSL_CIPHER_MODE_CFB
148 *
149 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
150 */
151#define POLARSSL_CIPHER_MODE_CFB
152
153/**
154 * \def POLARSSL_CIPHER_MODE_CTR
155 *
156 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
157 */
158#define POLARSSL_CIPHER_MODE_CTR
159
160/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000161 * \def POLARSSL_CIPHER_NULL_CIPHER
162 *
163 * Enable NULL cipher.
164 * Warning: Only do so when you know what you are doing. This allows for
165 * encryption or channels without any security!
166 *
167 * Requires POLARSSL_ENABLE_WEAK_CIPHERSUITES as well to enable
168 * the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000169 * TLS_RSA_WITH_NULL_MD5
170 * TLS_RSA_WITH_NULL_SHA
171 * TLS_RSA_WITH_NULL_SHA256
Paul Bakker41c83d32013-03-20 14:39:14 +0100172 * TLS_ECDHE_RSA_WITH_NULL_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200173 * TLS_PSK_WITH_NULL
174 * TLS_PSK_WITH_NULL256
175 * TLS_PSK_WITH_NULL384
176 * TLS_DHE_PSK_WITH_NULL
177 * TLS_DHE_PSK_WITH_NULL256
178 * TLS_DHE_PSK_WITH_NULL384
179 * TLS_RSA_PSK_WITH_NULL
180 * TLS_RSA_PSK_WITH_NULL256
181 * TLS_RSA_PSK_WITH_NULL384
Paul Bakkerfab5c822012-02-06 16:45:10 +0000182 *
183 * Uncomment this macro to enable the NULL cipher and ciphersuites
184#define POLARSSL_CIPHER_NULL_CIPHER
185 */
186
187/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000188 * \def POLARSSL_ENABLE_WEAK_CIPHERSUITES
189 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000190 * Enable weak ciphersuites in SSL / TLS
Paul Bakkerfab5c822012-02-06 16:45:10 +0000191 * Warning: Only do so when you know what you are doing. This allows for
Paul Bakker9a736322012-11-14 12:39:52 +0000192 * channels with virtually no security at all!
Paul Bakkerfab5c822012-02-06 16:45:10 +0000193 *
194 * This enables the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000195 * TLS_RSA_WITH_DES_CBC_SHA
196 * TLS_DHE_RSA_WITH_DES_CBC_SHA
Paul Bakkerfab5c822012-02-06 16:45:10 +0000197 *
198 * Uncomment this macro to enable weak ciphersuites
199#define POLARSSL_ENABLE_WEAK_CIPHERSUITES
200 */
201
202/**
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200203 * \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED
204 *
205 * Enable the PSK based ciphersuite modes in SSL / TLS
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200206 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200207 * This enables the following ciphersuites (if other requisites are
208 * enabled as well):
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200209 * TLS_PSK_WITH_RC4_128_SHA
210 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
211 * TLS_PSK_WITH_AES_128_CBC_SHA
212 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200213 * TLS_PSK_WITH_AES_128_CBC_SHA256
214 * TLS_PSK_WITH_AES_256_CBC_SHA384
215 * TLS_PSK_WITH_AES_128_GCM_SHA256
216 * TLS_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200217 */
218#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED
219
220/**
Paul Bakkere07f41d2013-04-19 09:08:57 +0200221 * \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
222 *
223 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS
224 *
225 * Requires: POLARSSL_DHM_C
226 *
227 * This enables the following ciphersuites (if other requisites are
228 * enabled as well):
229 * TLS_DHE_PSK_WITH_RC4_128_SHA
230 * TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
231 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA
232 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200233 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
234 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
235 * TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
236 * TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200237 */
Paul Bakker48f7a5d2013-04-19 14:30:58 +0200238#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200239
240/**
241 * \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
242 *
243 * Enable the RSA-PSK based ciphersuite modes in SSL / TLS
Paul Bakker45bda902013-04-19 22:28:21 +0200244 * (NOT YET IMPLEMENTED)
Paul Bakkere07f41d2013-04-19 09:08:57 +0200245 * Requires: POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
246 *
247 * This enables the following ciphersuites (if other requisites are
248 * enabled as well):
249 * TLS_RSA_PSK_WITH_RC4_128_SHA
250 * TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
251 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA
252 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200253 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
254 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
255 * TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
256 * TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200257#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
258 */
259
260/**
261 * \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED
262 *
263 * Enable the RSA-only based ciphersuite modes in SSL / TLS
264 *
265 * Requires: POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
266 *
267 * This enables the following ciphersuites (if other requisites are
268 * enabled as well):
269 * TLS_RSA_WITH_AES_128_CBC_SHA
270 * TLS_RSA_WITH_AES_256_CBC_SHA
271 * TLS_RSA_WITH_AES_128_CBC_SHA256
272 * TLS_RSA_WITH_AES_256_CBC_SHA256
273 * TLS_RSA_WITH_AES_128_GCM_SHA256
274 * TLS_RSA_WITH_AES_256_GCM_SHA384
275 * TLS_RSA_WITH_RC4_128_MD5
276 * TLS_RSA_WITH_RC4_128_SHA
277 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
278 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
279 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
280 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
281 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
282 */
283#define POLARSSL_KEY_EXCHANGE_RSA_ENABLED
284
285/**
286 * \def POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
287 *
288 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS
289 *
290 * Requires: POLARSSL_DHM_C, POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
291 *
292 * This enables the following ciphersuites (if other requisites are
293 * enabled as well):
294 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
295 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
296 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
297 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
298 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
299 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
300 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
301 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
302 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
303 */
304#define POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
305
306/**
307 * \def POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
308 *
309 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS
310 *
311 * Requires: POLARSSL_ECDH_C, POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
312 *
313 * This enables the following ciphersuites (if other requisites are
314 * enabled as well):
315 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
316 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
317 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
318 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
319 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
320 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
321 * TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
322 * TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
323 * TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
324 * TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
325 */
326#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
327
328/**
Paul Bakkere2ab84f2013-06-29 18:24:32 +0200329 * \def POLARSSL_ERROR_STRERROR_BC
330 *
331 * Make available the backward compatible error_strerror() next to the
332 * current polarssl_strerror().
333 *
334 * Disable if you run into name conflicts and want to really remove the
335 * error_strerror()
336 */
337#define POLARSSL_ERROR_STRERROR_BC
338
339/**
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100340 * \def POLARSSL_ERROR_STRERROR_DUMMY
341 *
342 * Enable a dummy error function to make use of error_strerror() in
343 * third party libraries easier.
344 *
345 * Disable if you run into name conflicts and want to really remove the
346 * error_strerror()
347 */
348#define POLARSSL_ERROR_STRERROR_DUMMY
349
350/**
Paul Bakker15566e42011-04-24 21:19:15 +0000351 * \def POLARSSL_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000352 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000353 * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C
354 *
Paul Bakker15566e42011-04-24 21:19:15 +0000355 * Enable the RSA prime-number generation code.
Paul Bakker5121ce52009-01-03 21:22:43 +0000356 */
Paul Bakker15566e42011-04-24 21:19:15 +0000357#define POLARSSL_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000358
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000359/**
Paul Bakker335db3f2011-04-25 15:28:35 +0000360 * \def POLARSSL_FS_IO
361 *
362 * Enable functions that use the filesystem.
363 */
364#define POLARSSL_FS_IO
365
366/**
Paul Bakker43655f42011-12-15 20:11:16 +0000367 * \def POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
368 *
369 * Do not add default entropy sources. These are the platform specific,
370 * hardclock and HAVEGE based poll functions.
371 *
372 * This is useful to have more control over the added entropy sources in an
373 * application.
374 *
375 * Uncomment this macro to prevent loading of default entropy functions.
376#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
377 */
378
379/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000380 * \def POLARSSL_NO_PLATFORM_ENTROPY
381 *
382 * Do not use built-in platform entropy functions.
383 * This is useful if your platform does not support
384 * standards like the /dev/urandom or Windows CryptoAPI.
385 *
386 * Uncomment this macro to disable the built-in platform entropy functions.
387#define POLARSSL_NO_PLATFORM_ENTROPY
388 */
389
390/**
Paul Bakker9dcc3222011-03-08 14:16:06 +0000391 * \def POLARSSL_PKCS1_V21
392 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000393 * Requires: POLARSSL_MD_C, POLARSSL_RSA_C
394 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000395 * Enable support for PKCS#1 v2.1 encoding.
396 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
397 */
398#define POLARSSL_PKCS1_V21
399
400/**
Paul Bakker0216cc12011-03-26 13:40:23 +0000401 * \def POLARSSL_RSA_NO_CRT
402 *
403 * Do not use the Chinese Remainder Theorem for the RSA private operation.
404 *
405 * Uncomment this macro to disable the use of CRT in RSA.
406 *
407#define POLARSSL_RSA_NO_CRT
408 */
Paul Bakker15566e42011-04-24 21:19:15 +0000409
410/**
411 * \def POLARSSL_SELF_TEST
412 *
413 * Enable the checkup functions (*_self_test).
414 */
415#define POLARSSL_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000416
417/**
Paul Bakker40865c82013-01-31 17:13:13 +0100418 * \def POLARSSL_SSL_ALL_ALERT_MESSAGES
419 *
420 * Enable sending of alert messages in case of encountered errors as per RFC.
421 * If you choose not to send the alert messages, PolarSSL can still communicate
422 * with other servers, only debugging of failures is harder.
423 *
424 * The advantage of not sending alert messages, is that no information is given
425 * about reasons for failures thus preventing adversaries of gaining intel.
426 *
427 * Enable sending of all alert messages
428 */
429#define POLARSSL_SSL_ALERT_MESSAGES
430
431/**
Paul Bakkerd66f0702013-01-31 16:57:45 +0100432 * \def POLARSSL_SSL_DEBUG_ALL
433 *
434 * Enable the debug messages in SSL module for all issues.
435 * Debug messages have been disabled in some places to prevent timing
436 * attacks due to (unbalanced) debugging function calls.
437 *
438 * If you need all error reporting you should enable this during debugging,
439 * but remove this for production servers that should log as well.
440 *
441 * Uncomment this macro to report all debug messages on errors introducing
442 * a timing side-channel.
443 *
444#define POLARSSL_SSL_DEBUG_ALL
445 */
446
447/**
Paul Bakker05ef8352012-05-08 09:17:57 +0000448 * \def POLARSSL_SSL_HW_RECORD_ACCEL
449 *
450 * Enable hooking functions in SSL module for hardware acceleration of
451 * individual records.
452 *
453 * Uncomment this macro to enable hooking functions.
454#define POLARSSL_SSL_HW_RECORD_ACCEL
455 */
456
457/**
Paul Bakker78a8c712013-03-06 17:01:52 +0100458 * \def POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
459 *
460 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
461 * SSL Server module (POLARSSL_SSL_SRV_C)
462 *
463 * Comment this macro to disable support for SSLv2 Client Hello messages.
464 */
465#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
466
467/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000468 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
469 *
470 * If set, the X509 parser will not break-off when parsing an X509 certificate
471 * and encountering an unknown critical extension.
472 *
473 * Uncomment to prevent an error.
474 *
475#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
476 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000477
478/**
479 * \def POLARSSL_ZLIB_SUPPORT
480 *
481 * If set, the SSL/TLS module uses ZLIB to support compression and
482 * decompression of packet data.
483 *
484 * Used in: library/ssl_tls.c
485 * library/ssl_cli.c
486 * library/ssl_srv.c
487 *
488 * This feature requires zlib library and headers to be present.
489 *
490 * Uncomment to enable use of ZLIB
491#define POLARSSL_ZLIB_SUPPORT
492 */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000493/* \} name */
494
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000495/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000496 * \name SECTION: PolarSSL modules
497 *
498 * This section enables or disables entire modules in PolarSSL
499 * \{
500 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000501
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000502/**
503 * \def POLARSSL_AES_C
504 *
505 * Enable the AES block cipher.
506 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000507 * Module: library/aes.c
508 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000509 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000510 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000511 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000512 * This module enables the following ciphersuites (if other requisites are
513 * enabled as well):
514 * TLS_RSA_WITH_AES_128_CBC_SHA
515 * TLS_RSA_WITH_AES_256_CBC_SHA
516 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
517 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
518 * TLS_RSA_WITH_AES_128_CBC_SHA256
519 * TLS_RSA_WITH_AES_256_CBC_SHA256
520 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
521 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
522 * TLS_RSA_WITH_AES_128_GCM_SHA256
523 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100524 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
525 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200526 * TLS_PSK_WITH_AES_128_CBC_SHA
527 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100528 *
529 * PEM uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000530 */
Paul Bakker40e46942009-01-03 21:51:57 +0000531#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000532
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000533/**
534 * \def POLARSSL_ARC4_C
535 *
536 * Enable the ARCFOUR stream cipher.
537 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000538 * Module: library/arc4.c
539 * Caller: library/ssl_tls.c
540 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100541 * This module enables the following ciphersuites (if other requisites are
542 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000543 * TLS_RSA_WITH_RC4_128_MD5
544 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100545 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200546 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000547 */
Paul Bakker40e46942009-01-03 21:51:57 +0000548#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000549
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000550/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000551 * \def POLARSSL_ASN1_PARSE_C
552 *
553 * Enable the generic ASN1 parser.
554 *
555 * Module: library/asn1.c
556 * Caller: library/x509parse.c
557 */
558#define POLARSSL_ASN1_PARSE_C
559
560/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000561 * \def POLARSSL_ASN1_WRITE_C
562 *
563 * Enable the generic ASN1 writer.
564 *
565 * Module: library/asn1write.c
566 */
567#define POLARSSL_ASN1_WRITE_C
568
569/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000570 * \def POLARSSL_BASE64_C
571 *
572 * Enable the Base64 module.
573 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000574 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000575 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000576 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000577 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000578 */
Paul Bakker40e46942009-01-03 21:51:57 +0000579#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000580
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000581/**
582 * \def POLARSSL_BIGNUM_C
583 *
Paul Bakker9a736322012-11-14 12:39:52 +0000584 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000585 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000586 * Module: library/bignum.c
587 * Caller: library/dhm.c
588 * library/rsa.c
589 * library/ssl_tls.c
590 * library/x509parse.c
591 *
592 * This module is required for RSA and DHM support.
593 */
Paul Bakker40e46942009-01-03 21:51:57 +0000594#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000595
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000596/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000597 * \def POLARSSL_BLOWFISH_C
598 *
599 * Enable the Blowfish block cipher.
600 *
601 * Module: library/blowfish.c
602 */
603#define POLARSSL_BLOWFISH_C
604
605/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000606 * \def POLARSSL_CAMELLIA_C
607 *
608 * Enable the Camellia block cipher.
609 *
Paul Bakker38119b12009-01-10 23:31:23 +0000610 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000611 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000612 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000613 * This module enables the following ciphersuites (if other requisites are
614 * enabled as well):
615 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
616 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
617 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
618 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
619 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
620 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
621 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
622 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000623 */
624#define POLARSSL_CAMELLIA_C
625
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000626/**
627 * \def POLARSSL_CERTS_C
628 *
629 * Enable the test certificates.
630 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000631 * Module: library/certs.c
632 * Caller:
633 *
634 * This module is used for testing (ssl_client/server).
635 */
Paul Bakker40e46942009-01-03 21:51:57 +0000636#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000637
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000638/**
639 * \def POLARSSL_CIPHER_C
640 *
641 * Enable the generic cipher layer.
642 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000643 * Module: library/cipher.c
644 * Caller:
645 *
646 * Uncomment to enable generic cipher wrappers.
647 */
648#define POLARSSL_CIPHER_C
649
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000650/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000651 * \def POLARSSL_CTR_DRBG_C
652 *
653 * Enable the CTR_DRBG AES-256-based random generator
654 *
655 * Module: library/ctr_drbg.c
656 * Caller:
657 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000658 * Requires: POLARSSL_AES_C
659 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000660 * This module provides the CTR_DRBG AES-256 random number generator.
661 */
662#define POLARSSL_CTR_DRBG_C
663
664/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000665 * \def POLARSSL_DEBUG_C
666 *
667 * Enable the debug functions.
668 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000669 * Module: library/debug.c
670 * Caller: library/ssl_cli.c
671 * library/ssl_srv.c
672 * library/ssl_tls.c
673 *
674 * This module provides debugging functions.
675 */
Paul Bakker40e46942009-01-03 21:51:57 +0000676#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000677
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000678/**
679 * \def POLARSSL_DES_C
680 *
681 * Enable the DES block cipher.
682 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000683 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100684 * Caller: library/pem.c
685 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000686 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000687 * This module enables the following ciphersuites (if other requisites are
688 * enabled as well):
689 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
690 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100691 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200692 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100693 *
694 * PEM uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000695 */
Paul Bakker40e46942009-01-03 21:51:57 +0000696#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000697
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000698/**
699 * \def POLARSSL_DHM_C
700 *
701 * Enable the Diffie-Hellman-Merkle key exchange.
702 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000703 * Module: library/dhm.c
704 * Caller: library/ssl_cli.c
705 * library/ssl_srv.c
706 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000707 * This module enables the following ciphersuites (if other requisites are
708 * enabled as well):
709 * TLS_DHE_RSA_WITH_DES_CBC_SHA
710 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
711 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
712 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
713 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
714 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
715 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
716 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
717 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
718 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
719 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
720 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000721 */
Paul Bakker40e46942009-01-03 21:51:57 +0000722#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000723
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000724/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100725 * \def POLARSSL_ECDH_C
726 *
727 * Enable the elliptic curve Diffie-Hellman library.
728 *
729 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100730 * Caller: library/ssl_cli.c
731 * library/ssl_srv.c
732 *
733 * This module enables the following ciphersuites (if other requisites are
734 * enabled as well):
735 * TLS_ECDHE_RSA_WITH_NULL_SHA
736 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
737 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
738 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
739 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100740 *
741 * Requires: POLARSSL_ECP_C
742 */
743#define POLARSSL_ECDH_C
744
745/**
746 * \def POLARSSL_ECDSA_C
747 *
748 * Enable the elliptic curve DSA library.
749 *
750 * Module: library/ecdsa.c
751 * Caller:
752 *
753 * Requires: POLARSSL_ECP_C
754 */
755#define POLARSSL_ECDSA_C
756
757/**
758 * \def POLARSSL_ECP_C
759 *
760 * Enable the elliptic curve over GF(p) library.
761 *
762 * Module: library/ecp.c
763 * Caller: library/ecdh.c
764 * library/ecdsa.c
765 *
766 * Requires: POLARSSL_BIGNUM_C
767 */
768#define POLARSSL_ECP_C
769
770/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000771 * \def POLARSSL_ENTROPY_C
772 *
773 * Enable the platform-specific entropy code.
774 *
775 * Module: library/entropy.c
776 * Caller:
777 *
778 * Requires: POLARSSL_SHA4_C
779 *
780 * This module provides a generic entropy pool
781 */
782#define POLARSSL_ENTROPY_C
783
784/**
Paul Bakker9d781402011-05-09 16:17:09 +0000785 * \def POLARSSL_ERROR_C
786 *
787 * Enable error code to error string conversion.
788 *
789 * Module: library/error.c
790 * Caller:
791 *
792 * This module enables err_strerror().
793 */
794#define POLARSSL_ERROR_C
795
796/**
Paul Bakker89e80c92012-03-20 13:50:09 +0000797 * \def POLARSSL_GCM_C
798 *
799 * Enable the Galois/Counter Mode (GCM) for AES
800 *
801 * Module: library/gcm.c
802 *
803 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +0000804 *
805 * This module enables the following ciphersuites (if other requisites are
806 * enabled as well):
807 * TLS_RSA_WITH_AES_128_GCM_SHA256
808 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +0000809 */
810#define POLARSSL_GCM_C
811
812/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000813 * \def POLARSSL_HAVEGE_C
814 *
815 * Enable the HAVEGE random generator.
816 *
Paul Bakker2a844242013-06-24 13:01:53 +0200817 * Warning: the HAVEGE random generator is not suitable for virtualized
818 * environments
819 *
820 * Warning: the HAVEGE random generator is dependent on timing and specific
821 * processor traits. It is therefore not advised to use HAVEGE as
822 * your applications primary random generator or primary entropy pool
823 * input. As a secondary input to your entropy pool, it IS able add
824 * the (limited) extra entropy it provides.
825 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000826 * Module: library/havege.c
827 * Caller:
828 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000829 * Requires: POLARSSL_TIMING_C
830 *
Paul Bakker2a844242013-06-24 13:01:53 +0200831 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +0000832#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +0200833 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000834
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000835/**
836 * \def POLARSSL_MD_C
837 *
838 * Enable the generic message digest layer.
839 *
Paul Bakker17373852011-01-06 14:20:01 +0000840 * Module: library/md.c
841 * Caller:
842 *
843 * Uncomment to enable generic message digest wrappers.
844 */
845#define POLARSSL_MD_C
846
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000847/**
848 * \def POLARSSL_MD2_C
849 *
850 * Enable the MD2 hash algorithm
851 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000852 * Module: library/md2.c
853 * Caller: library/x509parse.c
854 *
855 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
856 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000857#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +0000858 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000859
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000860/**
861 * \def POLARSSL_MD4_C
862 *
863 * Enable the MD4 hash algorithm
864 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000865 * Module: library/md4.c
866 * Caller: library/x509parse.c
867 *
868 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
869 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000870#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +0000871 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000872
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000873/**
874 * \def POLARSSL_MD5_C
875 *
876 * Enable the MD5 hash algorithm
877 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000878 * Module: library/md5.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100879 * Caller: library/pem.c
880 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000881 * library/x509parse.c
882 *
883 * This module is required for SSL/TLS and X.509.
Paul Bakker6deb37e2013-02-19 13:17:08 +0100884 * PEM uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000885 */
Paul Bakker40e46942009-01-03 21:51:57 +0000886#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000887
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000888/**
889 * \def POLARSSL_NET_C
890 *
891 * Enable the TCP/IP networking routines.
892 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000893 * Module: library/net.c
894 * Caller:
895 *
896 * This module provides TCP/IP networking routines.
897 */
Paul Bakker40e46942009-01-03 21:51:57 +0000898#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000899
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000900/**
Paul Bakkerc70b9822013-04-07 22:00:46 +0200901 * \def POLARSSL_OID_C
902 *
903 * Enable the OID database
904 *
905 * Module: library/oid.c
906 * Caller: library/rsa.c
907 * library/x509parse.c
908 * library/x509write.c
909 *
910 * This modules translates between OIDs and internal values.
911 */
912#define POLARSSL_OID_C
913
914/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000915 * \def POLARSSL_PADLOCK_C
916 *
917 * Enable VIA Padlock support on x86.
918 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000919 * Module: library/padlock.c
920 * Caller: library/aes.c
921 *
922 * This modules adds support for the VIA PadLock on x86.
923 */
Paul Bakker40e46942009-01-03 21:51:57 +0000924#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000925
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000926/**
Paul Bakkerf518b162012-08-23 13:03:18 +0000927 * \def POLARSSL_PBKDF2_C
928 *
929 * Enable PKCS#5 PBKDF2 key derivation function
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200930 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +0000931 *
932 * Module: library/pbkdf2.c
933 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200934 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +0000935 *
936 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +0000937 */
Paul Bakker370e90c2013-04-08 15:19:43 +0200938#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +0000939
940/**
Paul Bakker96743fc2011-02-12 14:30:57 +0000941 * \def POLARSSL_PEM_C
942 *
943 * Enable PEM decoding
944 *
945 * Module: library/pem.c
946 * Caller: library/x509parse.c
947 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000948 * Requires: POLARSSL_BASE64_C
949 *
Paul Bakker96743fc2011-02-12 14:30:57 +0000950 * This modules adds support for decoding PEM files.
951 */
952#define POLARSSL_PEM_C
953
954/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200955 * \def POLARSSL_PKCS5_C
956 *
957 * Enable PKCS#5 functions
958 *
959 * Module: library/pkcs5.c
960 *
961 * Requires: POLARSSL_MD_C
962 *
963 * This module adds support for the PKCS#5 functions.
964 */
965#define POLARSSL_PKCS5_C
966
967/**
Paul Bakker5690efc2011-05-26 13:16:06 +0000968 * \def POLARSSL_PKCS11_C
969 *
Paul Bakkereb2c6582012-09-27 19:15:01 +0000970 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +0000971 *
972 * Module: library/ssl_srv.c
973 * Caller: library/ssl_cli.c
974 * library/ssl_srv.c
975 *
976 * Requires: POLARSSL_SSL_TLS_C
977 *
Paul Bakkereb2c6582012-09-27 19:15:01 +0000978 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +0000979 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
980#define POLARSSL_PKCS11_C
981 */
982
983/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +0200984 * \def POLARSSL_PKCS12_C
985 *
986 * Enable PKCS#12 PBE functions
987 * Adds algorithms for parsing PKCS#8 encrypted private keys
988 *
989 * Module: library/pkcs12.c
990 * Caller: library/x509parse.c
991 *
Paul Bakkerb0713c72013-06-24 19:34:08 +0200992 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
993 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +0200994 *
995 * This module enables PKCS#12 functions.
996 */
997#define POLARSSL_PKCS12_C
998
999/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001000 * \def POLARSSL_RSA_C
1001 *
1002 * Enable the RSA public-key cryptosystem.
1003 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001004 * Module: library/rsa.c
1005 * Caller: library/ssl_cli.c
1006 * library/ssl_srv.c
1007 * library/ssl_tls.c
1008 * library/x509.c
1009 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001010 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001011 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001012 * This module is required for SSL/TLS and MD5-signed certificates.
1013 */
Paul Bakker40e46942009-01-03 21:51:57 +00001014#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001015
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001016/**
1017 * \def POLARSSL_SHA1_C
1018 *
1019 * Enable the SHA1 cryptographic hash algorithm.
1020 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001021 * Module: library/sha1.c
1022 * Caller: library/ssl_cli.c
1023 * library/ssl_srv.c
1024 * library/ssl_tls.c
1025 * library/x509parse.c
1026 *
1027 * This module is required for SSL/TLS and SHA1-signed certificates.
1028 */
Paul Bakker40e46942009-01-03 21:51:57 +00001029#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001030
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001031/**
1032 * \def POLARSSL_SHA2_C
1033 *
1034 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
1035 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001036 * Module: library/sha2.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001037 * Caller: library/md_wrap.c
1038 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001039 *
1040 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001041 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001042 */
Paul Bakker40e46942009-01-03 21:51:57 +00001043#define POLARSSL_SHA2_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001044
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001045/**
1046 * \def POLARSSL_SHA4_C
1047 *
1048 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
1049 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001050 * Module: library/sha4.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001051 * Caller: library/md_wrap.c
1052 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001053 *
1054 * This module adds support for SHA-384 and SHA-512.
1055 */
Paul Bakker40e46942009-01-03 21:51:57 +00001056#define POLARSSL_SHA4_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001057
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001058/**
Paul Bakker0a597072012-09-25 21:55:46 +00001059 * \def POLARSSL_SSL_CACHE_C
1060 *
1061 * Enable simple SSL cache implementation.
1062 *
1063 * Module: library/ssl_cache.c
1064 * Caller:
1065 *
1066 * Requires: POLARSSL_SSL_CACHE_C
1067 */
1068#define POLARSSL_SSL_CACHE_C
1069
1070/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001071 * \def POLARSSL_SSL_CLI_C
1072 *
1073 * Enable the SSL/TLS client code.
1074 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001075 * Module: library/ssl_cli.c
1076 * Caller:
1077 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001078 * Requires: POLARSSL_SSL_TLS_C
1079 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001080 * This module is required for SSL/TLS client support.
1081 */
Paul Bakker40e46942009-01-03 21:51:57 +00001082#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001083
Paul Bakker9a736322012-11-14 12:39:52 +00001084/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001085 * \def POLARSSL_SSL_SRV_C
1086 *
1087 * Enable the SSL/TLS server code.
1088 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001089 * Module: library/ssl_srv.c
1090 * Caller:
1091 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001092 * Requires: POLARSSL_SSL_TLS_C
1093 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001094 * This module is required for SSL/TLS server support.
1095 */
Paul Bakker40e46942009-01-03 21:51:57 +00001096#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001097
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001098/**
1099 * \def POLARSSL_SSL_TLS_C
1100 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001101 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001102 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001103 * Module: library/ssl_tls.c
1104 * Caller: library/ssl_cli.c
1105 * library/ssl_srv.c
1106 *
Paul Bakker7ad00f92013-04-18 23:05:25 +02001107 * Requires: POLARSSL_MD5_C, POLARSSL_SHA1_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001108 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001109 * This module is required for SSL/TLS.
1110 */
Paul Bakker40e46942009-01-03 21:51:57 +00001111#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001112
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001113/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001114 * \def POLARSSL_TIMING_C
1115 *
1116 * Enable the portable timing interface.
1117 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001118 * Module: library/timing.c
1119 * Caller: library/havege.c
1120 *
1121 * This module is used by the HAVEGE random number generator.
1122 */
Paul Bakker40e46942009-01-03 21:51:57 +00001123#define POLARSSL_TIMING_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001124
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001125/**
1126 * \def POLARSSL_VERSION_C
1127 *
1128 * Enable run-time version information.
1129 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001130 * Module: library/version.c
1131 *
1132 * This module provides run-time version information.
1133 */
1134#define POLARSSL_VERSION_C
1135
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001136/**
1137 * \def POLARSSL_X509_PARSE_C
1138 *
1139 * Enable X.509 certificate parsing.
1140 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001141 * Module: library/x509parse.c
1142 * Caller: library/ssl_cli.c
1143 * library/ssl_srv.c
1144 * library/ssl_tls.c
1145 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001146 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
1147 * POLARSSL_RSA_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001148 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001149 * This module is required for X.509 certificate parsing.
1150 */
Paul Bakker40e46942009-01-03 21:51:57 +00001151#define POLARSSL_X509_PARSE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001152
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001153/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001154 * \def POLARSSL_X509_WRITE_C
1155 *
1156 * Enable X.509 buffer writing.
1157 *
1158 * Module: library/x509write.c
1159 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001160 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_RSA_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001161 *
1162 * This module is required for X.509 certificate request writing.
1163 */
1164#define POLARSSL_X509_WRITE_C
1165
1166/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001167 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001168 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001169 * Enable the XTEA block cipher.
1170 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001171 * Module: library/xtea.c
1172 * Caller:
1173 */
1174#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001175
Paul Bakker0a62cd12011-01-21 11:00:08 +00001176/* \} name */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001177
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001178/**
1179 * \name SECTION: Module configuration options
1180 *
1181 * This section allows for the setting of module specific sizes and
1182 * configuration options. The default values are already present in the
1183 * relevant header files and should suffice for the regular use cases.
1184 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1185 * only if you have a good reason and know the consequences.
1186 *
1187 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1188 * header file take precedence.
1189 *
1190 * Please check the respective header file for documentation on these
1191 * parameters (to prevent duplicate documentation).
1192 *
1193 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1194 * \{
1195 */
1196//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1197
1198#if defined(POLARSSL_CONFIG_OPTIONS)
1199
1200// MPI / BIGNUM options
1201//
1202#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1203#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1204
1205// CTR_DRBG options
1206//
1207#define CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default */
1208#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1209#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1210#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1211#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1212
1213// Entropy options
1214//
1215#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1216#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1217
1218// SSL Cache options
1219//
1220#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1221#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1222
1223// SSL options
1224//
1225#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
1226
1227#endif /* POLARSSL_CONFIG_OPTIONS */
1228
1229/* \} name */
1230
Paul Bakker7ad00f92013-04-18 23:05:25 +02001231/*
1232 * Sanity checks on defines and dependencies
1233 */
1234#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1235#error "POLARSSL_DHM_C defined, but not all prerequisites"
1236#endif
1237
1238#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1239#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1240#endif
1241
1242#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1243#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1244#endif
1245
1246#if defined(POLARSSL_ECDSA_C) && !defined(POLARSSL_ECP_C)
1247#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1248#endif
1249
1250#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
1251#error "POLARSSL_ECP_C defined, but not all prerequisites"
1252#endif
1253
1254#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA4_C)
1255#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1256#endif
1257
1258#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1259#error "POLARSSL_GCM_C defined, but not all prerequisites"
1260#endif
1261
Paul Bakkere07f41d2013-04-19 09:08:57 +02001262#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1263#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1264#endif
1265
1266#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1267 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
1268 !defined(POLARSSL_X509_PARSE_C) )
1269#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1270#endif
1271
1272#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1273 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
1274 !defined(POLARSSL_X509_PARSE_C) )
1275#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1276#endif
1277
1278#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
1279 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1280#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1281#endif
1282
1283#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
1284 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1285#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1286#endif
1287
Paul Bakker7ad00f92013-04-18 23:05:25 +02001288#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1289#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1290#endif
1291
1292#if defined(POLARSSL_PEM_C) && !defined(POLARSSL_PEM_C)
1293#error "POLARSSL_PEM_C defined, but not all prerequisites"
1294#endif
1295
1296#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_SSL_TLS_C)
1297#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1298#endif
1299
1300#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1301 !defined(POLARSSL_OID_C) )
1302#error "POLARSSL_RSA_C defined, but not all prerequisites"
1303#endif
1304
1305#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1306#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1307#endif
1308
1309#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_MD5_C) || \
1310 !defined(POLARSSL_SHA1_C) )
1311#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1312#endif
1313
1314#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1315#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1316#endif
1317
1318#if defined(POLARSSL_X509_PARSE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1319 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
1320 !defined(POLARSSL_RSA_C) )
1321#error "POLARSSL_X509_PARSE_C defined, but not all prerequisites"
1322#endif
1323
1324#if defined(POLARSSL_X509_WRITE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1325 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
1326 !defined(POLARSSL_RSA_C) )
1327#error "POLARSSL_X509_WRITE_C defined, but not all prerequisites"
1328#endif
1329
Paul Bakker5121ce52009-01-03 21:22:43 +00001330#endif /* config.h */