blob: ae973ed029307db5189e25e10a02b7139201cab1 [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
Paul Bakker9e36f042013-06-30 14:34:05 +0200132#define POLARSSL_SHA256_ALT
133#define POLARSSL_SHA512_ALT
Paul Bakker90995b52013-06-24 19:20:35 +0200134 */
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 Bakker5dc6b5f2013-06-29 23:26:34 +0200203 * \def POLARSSL_ECP_XXXX_ENABLED
204 *
205 * Enables specific curves within the Elliptic Curve module.
206 * By default all supported curves are enables.
207 *
208 * Comment macros to disable the curve and functions for it
209 */
210#define POLARSSL_ECP_DP_SECP192R1_ENABLED
211#define POLARSSL_ECP_DP_SECP224R1_ENABLED
212#define POLARSSL_ECP_DP_SECP256R1_ENABLED
213#define POLARSSL_ECP_DP_SECP384R1_ENABLED
214#define POLARSSL_ECP_DP_SECP521R1_ENABLED
215
216/**
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200217 * \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED
218 *
219 * Enable the PSK based ciphersuite modes in SSL / TLS
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200220 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200221 * This enables the following ciphersuites (if other requisites are
222 * enabled as well):
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200223 * TLS_PSK_WITH_RC4_128_SHA
224 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
225 * TLS_PSK_WITH_AES_128_CBC_SHA
226 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200227 * TLS_PSK_WITH_AES_128_CBC_SHA256
228 * TLS_PSK_WITH_AES_256_CBC_SHA384
229 * TLS_PSK_WITH_AES_128_GCM_SHA256
230 * TLS_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200231 */
232#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED
233
234/**
Paul Bakkere07f41d2013-04-19 09:08:57 +0200235 * \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
236 *
237 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS
238 *
239 * Requires: POLARSSL_DHM_C
240 *
241 * This enables the following ciphersuites (if other requisites are
242 * enabled as well):
243 * TLS_DHE_PSK_WITH_RC4_128_SHA
244 * TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
245 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA
246 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200247 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
248 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
249 * TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
250 * TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200251 */
Paul Bakker48f7a5d2013-04-19 14:30:58 +0200252#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200253
254/**
255 * \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
256 *
257 * Enable the RSA-PSK based ciphersuite modes in SSL / TLS
Paul Bakker45bda902013-04-19 22:28:21 +0200258 * (NOT YET IMPLEMENTED)
Paul Bakkere07f41d2013-04-19 09:08:57 +0200259 * Requires: POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
260 *
261 * This enables the following ciphersuites (if other requisites are
262 * enabled as well):
263 * TLS_RSA_PSK_WITH_RC4_128_SHA
264 * TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
265 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA
266 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200267 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
268 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
269 * TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
270 * TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200271#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
272 */
273
274/**
275 * \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED
276 *
277 * Enable the RSA-only based ciphersuite modes in SSL / TLS
278 *
279 * Requires: POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
280 *
281 * This enables the following ciphersuites (if other requisites are
282 * enabled as well):
283 * TLS_RSA_WITH_AES_128_CBC_SHA
284 * TLS_RSA_WITH_AES_256_CBC_SHA
285 * TLS_RSA_WITH_AES_128_CBC_SHA256
286 * TLS_RSA_WITH_AES_256_CBC_SHA256
287 * TLS_RSA_WITH_AES_128_GCM_SHA256
288 * TLS_RSA_WITH_AES_256_GCM_SHA384
289 * TLS_RSA_WITH_RC4_128_MD5
290 * TLS_RSA_WITH_RC4_128_SHA
291 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
292 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
293 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
294 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
295 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
296 */
297#define POLARSSL_KEY_EXCHANGE_RSA_ENABLED
298
299/**
300 * \def POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
301 *
302 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS
303 *
304 * Requires: POLARSSL_DHM_C, POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
305 *
306 * This enables the following ciphersuites (if other requisites are
307 * enabled as well):
308 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
309 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
310 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
311 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
312 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
313 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
314 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
315 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
316 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
317 */
318#define POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
319
320/**
321 * \def POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
322 *
323 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS
324 *
325 * Requires: POLARSSL_ECDH_C, POLARSSL_RSA_C, POLARSSL_X509_PARSE_C
326 *
327 * This enables the following ciphersuites (if other requisites are
328 * enabled as well):
329 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
330 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
331 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
332 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
333 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
334 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
335 * TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
336 * TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
337 * TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
338 * TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
339 */
340#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
341
342/**
Paul Bakkere2ab84f2013-06-29 18:24:32 +0200343 * \def POLARSSL_ERROR_STRERROR_BC
344 *
345 * Make available the backward compatible error_strerror() next to the
346 * current polarssl_strerror().
347 *
348 * Disable if you run into name conflicts and want to really remove the
349 * error_strerror()
350 */
351#define POLARSSL_ERROR_STRERROR_BC
352
353/**
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100354 * \def POLARSSL_ERROR_STRERROR_DUMMY
355 *
356 * Enable a dummy error function to make use of error_strerror() in
357 * third party libraries easier.
358 *
359 * Disable if you run into name conflicts and want to really remove the
360 * error_strerror()
361 */
362#define POLARSSL_ERROR_STRERROR_DUMMY
363
364/**
Paul Bakker15566e42011-04-24 21:19:15 +0000365 * \def POLARSSL_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000366 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000367 * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C
368 *
Paul Bakker15566e42011-04-24 21:19:15 +0000369 * Enable the RSA prime-number generation code.
Paul Bakker5121ce52009-01-03 21:22:43 +0000370 */
Paul Bakker15566e42011-04-24 21:19:15 +0000371#define POLARSSL_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000372
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000373/**
Paul Bakker335db3f2011-04-25 15:28:35 +0000374 * \def POLARSSL_FS_IO
375 *
376 * Enable functions that use the filesystem.
377 */
378#define POLARSSL_FS_IO
379
380/**
Paul Bakker43655f42011-12-15 20:11:16 +0000381 * \def POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
382 *
383 * Do not add default entropy sources. These are the platform specific,
384 * hardclock and HAVEGE based poll functions.
385 *
386 * This is useful to have more control over the added entropy sources in an
387 * application.
388 *
389 * Uncomment this macro to prevent loading of default entropy functions.
390#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
391 */
392
393/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000394 * \def POLARSSL_NO_PLATFORM_ENTROPY
395 *
396 * Do not use built-in platform entropy functions.
397 * This is useful if your platform does not support
398 * standards like the /dev/urandom or Windows CryptoAPI.
399 *
400 * Uncomment this macro to disable the built-in platform entropy functions.
401#define POLARSSL_NO_PLATFORM_ENTROPY
402 */
403
404/**
Paul Bakker9dcc3222011-03-08 14:16:06 +0000405 * \def POLARSSL_PKCS1_V21
406 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000407 * Requires: POLARSSL_MD_C, POLARSSL_RSA_C
408 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000409 * Enable support for PKCS#1 v2.1 encoding.
410 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
411 */
412#define POLARSSL_PKCS1_V21
413
414/**
Paul Bakker0216cc12011-03-26 13:40:23 +0000415 * \def POLARSSL_RSA_NO_CRT
416 *
417 * Do not use the Chinese Remainder Theorem for the RSA private operation.
418 *
419 * Uncomment this macro to disable the use of CRT in RSA.
420 *
421#define POLARSSL_RSA_NO_CRT
422 */
Paul Bakker15566e42011-04-24 21:19:15 +0000423
424/**
425 * \def POLARSSL_SELF_TEST
426 *
427 * Enable the checkup functions (*_self_test).
428 */
429#define POLARSSL_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000430
431/**
Paul Bakker40865c82013-01-31 17:13:13 +0100432 * \def POLARSSL_SSL_ALL_ALERT_MESSAGES
433 *
434 * Enable sending of alert messages in case of encountered errors as per RFC.
435 * If you choose not to send the alert messages, PolarSSL can still communicate
436 * with other servers, only debugging of failures is harder.
437 *
438 * The advantage of not sending alert messages, is that no information is given
439 * about reasons for failures thus preventing adversaries of gaining intel.
440 *
441 * Enable sending of all alert messages
442 */
443#define POLARSSL_SSL_ALERT_MESSAGES
444
445/**
Paul Bakkerd66f0702013-01-31 16:57:45 +0100446 * \def POLARSSL_SSL_DEBUG_ALL
447 *
448 * Enable the debug messages in SSL module for all issues.
449 * Debug messages have been disabled in some places to prevent timing
450 * attacks due to (unbalanced) debugging function calls.
451 *
452 * If you need all error reporting you should enable this during debugging,
453 * but remove this for production servers that should log as well.
454 *
455 * Uncomment this macro to report all debug messages on errors introducing
456 * a timing side-channel.
457 *
458#define POLARSSL_SSL_DEBUG_ALL
459 */
460
461/**
Paul Bakker05ef8352012-05-08 09:17:57 +0000462 * \def POLARSSL_SSL_HW_RECORD_ACCEL
463 *
464 * Enable hooking functions in SSL module for hardware acceleration of
465 * individual records.
466 *
467 * Uncomment this macro to enable hooking functions.
468#define POLARSSL_SSL_HW_RECORD_ACCEL
469 */
470
471/**
Paul Bakker78a8c712013-03-06 17:01:52 +0100472 * \def POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
473 *
474 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
475 * SSL Server module (POLARSSL_SSL_SRV_C)
476 *
477 * Comment this macro to disable support for SSLv2 Client Hello messages.
478 */
479#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
480
481/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000482 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
483 *
484 * If set, the X509 parser will not break-off when parsing an X509 certificate
485 * and encountering an unknown critical extension.
486 *
487 * Uncomment to prevent an error.
488 *
489#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
490 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000491
492/**
493 * \def POLARSSL_ZLIB_SUPPORT
494 *
495 * If set, the SSL/TLS module uses ZLIB to support compression and
496 * decompression of packet data.
497 *
498 * Used in: library/ssl_tls.c
499 * library/ssl_cli.c
500 * library/ssl_srv.c
501 *
502 * This feature requires zlib library and headers to be present.
503 *
504 * Uncomment to enable use of ZLIB
505#define POLARSSL_ZLIB_SUPPORT
506 */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000507/* \} name */
508
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000509/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000510 * \name SECTION: PolarSSL modules
511 *
512 * This section enables or disables entire modules in PolarSSL
513 * \{
514 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000515
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000516/**
517 * \def POLARSSL_AES_C
518 *
519 * Enable the AES block cipher.
520 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000521 * Module: library/aes.c
522 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000523 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000524 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000525 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000526 * This module enables the following ciphersuites (if other requisites are
527 * enabled as well):
528 * TLS_RSA_WITH_AES_128_CBC_SHA
529 * TLS_RSA_WITH_AES_256_CBC_SHA
530 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
531 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
532 * TLS_RSA_WITH_AES_128_CBC_SHA256
533 * TLS_RSA_WITH_AES_256_CBC_SHA256
534 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
535 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
536 * TLS_RSA_WITH_AES_128_GCM_SHA256
537 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100538 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
539 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200540 * TLS_PSK_WITH_AES_128_CBC_SHA
541 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100542 *
543 * PEM uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000544 */
Paul Bakker40e46942009-01-03 21:51:57 +0000545#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000546
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000547/**
548 * \def POLARSSL_ARC4_C
549 *
550 * Enable the ARCFOUR stream cipher.
551 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000552 * Module: library/arc4.c
553 * Caller: library/ssl_tls.c
554 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100555 * This module enables the following ciphersuites (if other requisites are
556 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000557 * TLS_RSA_WITH_RC4_128_MD5
558 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100559 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200560 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000561 */
Paul Bakker40e46942009-01-03 21:51:57 +0000562#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000563
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000564/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000565 * \def POLARSSL_ASN1_PARSE_C
566 *
567 * Enable the generic ASN1 parser.
568 *
569 * Module: library/asn1.c
570 * Caller: library/x509parse.c
571 */
572#define POLARSSL_ASN1_PARSE_C
573
574/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000575 * \def POLARSSL_ASN1_WRITE_C
576 *
577 * Enable the generic ASN1 writer.
578 *
579 * Module: library/asn1write.c
580 */
581#define POLARSSL_ASN1_WRITE_C
582
583/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000584 * \def POLARSSL_BASE64_C
585 *
586 * Enable the Base64 module.
587 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000588 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000589 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000590 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000591 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000592 */
Paul Bakker40e46942009-01-03 21:51:57 +0000593#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000594
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000595/**
596 * \def POLARSSL_BIGNUM_C
597 *
Paul Bakker9a736322012-11-14 12:39:52 +0000598 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000599 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000600 * Module: library/bignum.c
601 * Caller: library/dhm.c
602 * library/rsa.c
603 * library/ssl_tls.c
604 * library/x509parse.c
605 *
606 * This module is required for RSA and DHM support.
607 */
Paul Bakker40e46942009-01-03 21:51:57 +0000608#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000609
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000610/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000611 * \def POLARSSL_BLOWFISH_C
612 *
613 * Enable the Blowfish block cipher.
614 *
615 * Module: library/blowfish.c
616 */
617#define POLARSSL_BLOWFISH_C
618
619/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000620 * \def POLARSSL_CAMELLIA_C
621 *
622 * Enable the Camellia block cipher.
623 *
Paul Bakker38119b12009-01-10 23:31:23 +0000624 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000625 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000626 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000627 * This module enables the following ciphersuites (if other requisites are
628 * enabled as well):
629 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
630 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
631 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
632 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
633 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
634 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
635 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
636 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000637 */
638#define POLARSSL_CAMELLIA_C
639
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000640/**
641 * \def POLARSSL_CERTS_C
642 *
643 * Enable the test certificates.
644 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000645 * Module: library/certs.c
646 * Caller:
647 *
648 * This module is used for testing (ssl_client/server).
649 */
Paul Bakker40e46942009-01-03 21:51:57 +0000650#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000651
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000652/**
653 * \def POLARSSL_CIPHER_C
654 *
655 * Enable the generic cipher layer.
656 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000657 * Module: library/cipher.c
658 * Caller:
659 *
660 * Uncomment to enable generic cipher wrappers.
661 */
662#define POLARSSL_CIPHER_C
663
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000664/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000665 * \def POLARSSL_CTR_DRBG_C
666 *
667 * Enable the CTR_DRBG AES-256-based random generator
668 *
669 * Module: library/ctr_drbg.c
670 * Caller:
671 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000672 * Requires: POLARSSL_AES_C
673 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000674 * This module provides the CTR_DRBG AES-256 random number generator.
675 */
676#define POLARSSL_CTR_DRBG_C
677
678/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000679 * \def POLARSSL_DEBUG_C
680 *
681 * Enable the debug functions.
682 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000683 * Module: library/debug.c
684 * Caller: library/ssl_cli.c
685 * library/ssl_srv.c
686 * library/ssl_tls.c
687 *
688 * This module provides debugging functions.
689 */
Paul Bakker40e46942009-01-03 21:51:57 +0000690#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000691
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000692/**
693 * \def POLARSSL_DES_C
694 *
695 * Enable the DES block cipher.
696 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000697 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100698 * Caller: library/pem.c
699 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000700 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000701 * This module enables the following ciphersuites (if other requisites are
702 * enabled as well):
703 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
704 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100705 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200706 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100707 *
708 * PEM uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000709 */
Paul Bakker40e46942009-01-03 21:51:57 +0000710#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000711
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000712/**
713 * \def POLARSSL_DHM_C
714 *
715 * Enable the Diffie-Hellman-Merkle key exchange.
716 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000717 * Module: library/dhm.c
718 * Caller: library/ssl_cli.c
719 * library/ssl_srv.c
720 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000721 * This module enables the following ciphersuites (if other requisites are
722 * enabled as well):
723 * TLS_DHE_RSA_WITH_DES_CBC_SHA
724 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
725 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
726 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
727 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
728 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
729 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
730 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
731 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
732 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
733 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
734 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000735 */
Paul Bakker40e46942009-01-03 21:51:57 +0000736#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000737
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000738/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100739 * \def POLARSSL_ECDH_C
740 *
741 * Enable the elliptic curve Diffie-Hellman library.
742 *
743 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100744 * Caller: library/ssl_cli.c
745 * library/ssl_srv.c
746 *
747 * This module enables the following ciphersuites (if other requisites are
748 * enabled as well):
749 * TLS_ECDHE_RSA_WITH_NULL_SHA
750 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
751 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
752 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
753 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100754 *
755 * Requires: POLARSSL_ECP_C
756 */
757#define POLARSSL_ECDH_C
758
759/**
760 * \def POLARSSL_ECDSA_C
761 *
762 * Enable the elliptic curve DSA library.
763 *
764 * Module: library/ecdsa.c
765 * Caller:
766 *
767 * Requires: POLARSSL_ECP_C
768 */
769#define POLARSSL_ECDSA_C
770
771/**
772 * \def POLARSSL_ECP_C
773 *
774 * Enable the elliptic curve over GF(p) library.
775 *
776 * Module: library/ecp.c
777 * Caller: library/ecdh.c
778 * library/ecdsa.c
779 *
780 * Requires: POLARSSL_BIGNUM_C
781 */
782#define POLARSSL_ECP_C
783
784/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000785 * \def POLARSSL_ENTROPY_C
786 *
787 * Enable the platform-specific entropy code.
788 *
789 * Module: library/entropy.c
790 * Caller:
791 *
Paul Bakker9e36f042013-06-30 14:34:05 +0200792 * Requires: POLARSSL_SHA512_C
Paul Bakker6083fd22011-12-03 21:45:14 +0000793 *
794 * This module provides a generic entropy pool
795 */
796#define POLARSSL_ENTROPY_C
797
798/**
Paul Bakker9d781402011-05-09 16:17:09 +0000799 * \def POLARSSL_ERROR_C
800 *
801 * Enable error code to error string conversion.
802 *
803 * Module: library/error.c
804 * Caller:
805 *
806 * This module enables err_strerror().
807 */
808#define POLARSSL_ERROR_C
809
810/**
Paul Bakker89e80c92012-03-20 13:50:09 +0000811 * \def POLARSSL_GCM_C
812 *
813 * Enable the Galois/Counter Mode (GCM) for AES
814 *
815 * Module: library/gcm.c
816 *
817 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +0000818 *
819 * This module enables the following ciphersuites (if other requisites are
820 * enabled as well):
821 * TLS_RSA_WITH_AES_128_GCM_SHA256
822 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +0000823 */
824#define POLARSSL_GCM_C
825
826/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000827 * \def POLARSSL_HAVEGE_C
828 *
829 * Enable the HAVEGE random generator.
830 *
Paul Bakker2a844242013-06-24 13:01:53 +0200831 * Warning: the HAVEGE random generator is not suitable for virtualized
832 * environments
833 *
834 * Warning: the HAVEGE random generator is dependent on timing and specific
835 * processor traits. It is therefore not advised to use HAVEGE as
836 * your applications primary random generator or primary entropy pool
837 * input. As a secondary input to your entropy pool, it IS able add
838 * the (limited) extra entropy it provides.
839 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000840 * Module: library/havege.c
841 * Caller:
842 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000843 * Requires: POLARSSL_TIMING_C
844 *
Paul Bakker2a844242013-06-24 13:01:53 +0200845 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +0000846#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +0200847 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000848
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000849/**
850 * \def POLARSSL_MD_C
851 *
852 * Enable the generic message digest layer.
853 *
Paul Bakker17373852011-01-06 14:20:01 +0000854 * Module: library/md.c
855 * Caller:
856 *
857 * Uncomment to enable generic message digest wrappers.
858 */
859#define POLARSSL_MD_C
860
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000861/**
862 * \def POLARSSL_MD2_C
863 *
864 * Enable the MD2 hash algorithm
865 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000866 * Module: library/md2.c
867 * Caller: library/x509parse.c
868 *
869 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
870 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000871#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +0000872 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000873
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000874/**
875 * \def POLARSSL_MD4_C
876 *
877 * Enable the MD4 hash algorithm
878 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000879 * Module: library/md4.c
880 * Caller: library/x509parse.c
881 *
882 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
883 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000884#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +0000885 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000886
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000887/**
888 * \def POLARSSL_MD5_C
889 *
890 * Enable the MD5 hash algorithm
891 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000892 * Module: library/md5.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100893 * Caller: library/pem.c
894 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000895 * library/x509parse.c
896 *
897 * This module is required for SSL/TLS and X.509.
Paul Bakker6deb37e2013-02-19 13:17:08 +0100898 * PEM uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000899 */
Paul Bakker40e46942009-01-03 21:51:57 +0000900#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000901
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000902/**
903 * \def POLARSSL_NET_C
904 *
905 * Enable the TCP/IP networking routines.
906 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000907 * Module: library/net.c
908 * Caller:
909 *
910 * This module provides TCP/IP networking routines.
911 */
Paul Bakker40e46942009-01-03 21:51:57 +0000912#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000913
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000914/**
Paul Bakkerc70b9822013-04-07 22:00:46 +0200915 * \def POLARSSL_OID_C
916 *
917 * Enable the OID database
918 *
919 * Module: library/oid.c
920 * Caller: library/rsa.c
921 * library/x509parse.c
922 * library/x509write.c
923 *
924 * This modules translates between OIDs and internal values.
925 */
926#define POLARSSL_OID_C
927
928/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000929 * \def POLARSSL_PADLOCK_C
930 *
931 * Enable VIA Padlock support on x86.
932 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000933 * Module: library/padlock.c
934 * Caller: library/aes.c
935 *
936 * This modules adds support for the VIA PadLock on x86.
937 */
Paul Bakker40e46942009-01-03 21:51:57 +0000938#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000939
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000940/**
Paul Bakkerf518b162012-08-23 13:03:18 +0000941 * \def POLARSSL_PBKDF2_C
942 *
943 * Enable PKCS#5 PBKDF2 key derivation function
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200944 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +0000945 *
946 * Module: library/pbkdf2.c
947 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200948 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +0000949 *
950 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +0000951 */
Paul Bakker370e90c2013-04-08 15:19:43 +0200952#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +0000953
954/**
Paul Bakker96743fc2011-02-12 14:30:57 +0000955 * \def POLARSSL_PEM_C
956 *
957 * Enable PEM decoding
958 *
959 * Module: library/pem.c
960 * Caller: library/x509parse.c
961 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000962 * Requires: POLARSSL_BASE64_C
963 *
Paul Bakker96743fc2011-02-12 14:30:57 +0000964 * This modules adds support for decoding PEM files.
965 */
966#define POLARSSL_PEM_C
967
968/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200969 * \def POLARSSL_PKCS5_C
970 *
971 * Enable PKCS#5 functions
972 *
973 * Module: library/pkcs5.c
974 *
975 * Requires: POLARSSL_MD_C
976 *
977 * This module adds support for the PKCS#5 functions.
978 */
979#define POLARSSL_PKCS5_C
980
981/**
Paul Bakker5690efc2011-05-26 13:16:06 +0000982 * \def POLARSSL_PKCS11_C
983 *
Paul Bakkereb2c6582012-09-27 19:15:01 +0000984 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +0000985 *
986 * Module: library/ssl_srv.c
987 * Caller: library/ssl_cli.c
988 * library/ssl_srv.c
989 *
990 * Requires: POLARSSL_SSL_TLS_C
991 *
Paul Bakkereb2c6582012-09-27 19:15:01 +0000992 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +0000993 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
994#define POLARSSL_PKCS11_C
995 */
996
997/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +0200998 * \def POLARSSL_PKCS12_C
999 *
1000 * Enable PKCS#12 PBE functions
1001 * Adds algorithms for parsing PKCS#8 encrypted private keys
1002 *
1003 * Module: library/pkcs12.c
1004 * Caller: library/x509parse.c
1005 *
Paul Bakkerb0713c72013-06-24 19:34:08 +02001006 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
1007 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001008 *
1009 * This module enables PKCS#12 functions.
1010 */
1011#define POLARSSL_PKCS12_C
1012
1013/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001014 * \def POLARSSL_RSA_C
1015 *
1016 * Enable the RSA public-key cryptosystem.
1017 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001018 * Module: library/rsa.c
1019 * Caller: library/ssl_cli.c
1020 * library/ssl_srv.c
1021 * library/ssl_tls.c
1022 * library/x509.c
1023 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001024 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001025 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001026 * This module is required for SSL/TLS and MD5-signed certificates.
1027 */
Paul Bakker40e46942009-01-03 21:51:57 +00001028#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001029
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001030/**
1031 * \def POLARSSL_SHA1_C
1032 *
1033 * Enable the SHA1 cryptographic hash algorithm.
1034 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001035 * Module: library/sha1.c
1036 * Caller: library/ssl_cli.c
1037 * library/ssl_srv.c
1038 * library/ssl_tls.c
1039 * library/x509parse.c
1040 *
1041 * This module is required for SSL/TLS and SHA1-signed certificates.
1042 */
Paul Bakker40e46942009-01-03 21:51:57 +00001043#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001044
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001045/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001046 * \def POLARSSL_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001047 *
1048 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001049 * (Used to be POLARSSL_SHA2_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001050 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001051 * Module: library/sha256.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001052 * Caller: library/md_wrap.c
1053 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001054 *
1055 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001056 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001057 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001058#define POLARSSL_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001059
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001060/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001061 * \def POLARSSL_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001062 *
1063 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001064 * (Used to be POLARSSL_SHA4_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001065 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001066 * Module: library/sha512.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001067 * Caller: library/md_wrap.c
1068 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001069 *
1070 * This module adds support for SHA-384 and SHA-512.
1071 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001072#define POLARSSL_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001073
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001074/**
Paul Bakker0a597072012-09-25 21:55:46 +00001075 * \def POLARSSL_SSL_CACHE_C
1076 *
1077 * Enable simple SSL cache implementation.
1078 *
1079 * Module: library/ssl_cache.c
1080 * Caller:
1081 *
1082 * Requires: POLARSSL_SSL_CACHE_C
1083 */
1084#define POLARSSL_SSL_CACHE_C
1085
1086/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001087 * \def POLARSSL_SSL_CLI_C
1088 *
1089 * Enable the SSL/TLS client code.
1090 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001091 * Module: library/ssl_cli.c
1092 * Caller:
1093 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001094 * Requires: POLARSSL_SSL_TLS_C
1095 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001096 * This module is required for SSL/TLS client support.
1097 */
Paul Bakker40e46942009-01-03 21:51:57 +00001098#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001099
Paul Bakker9a736322012-11-14 12:39:52 +00001100/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001101 * \def POLARSSL_SSL_SRV_C
1102 *
1103 * Enable the SSL/TLS server code.
1104 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001105 * Module: library/ssl_srv.c
1106 * Caller:
1107 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001108 * Requires: POLARSSL_SSL_TLS_C
1109 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001110 * This module is required for SSL/TLS server support.
1111 */
Paul Bakker40e46942009-01-03 21:51:57 +00001112#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001113
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001114/**
1115 * \def POLARSSL_SSL_TLS_C
1116 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001117 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001118 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001119 * Module: library/ssl_tls.c
1120 * Caller: library/ssl_cli.c
1121 * library/ssl_srv.c
1122 *
Paul Bakker7ad00f92013-04-18 23:05:25 +02001123 * Requires: POLARSSL_MD5_C, POLARSSL_SHA1_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001124 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001125 * This module is required for SSL/TLS.
1126 */
Paul Bakker40e46942009-01-03 21:51:57 +00001127#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001128
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001129/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001130 * \def POLARSSL_TIMING_C
1131 *
1132 * Enable the portable timing interface.
1133 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001134 * Module: library/timing.c
1135 * Caller: library/havege.c
1136 *
1137 * This module is used by the HAVEGE random number generator.
1138 */
Paul Bakker40e46942009-01-03 21:51:57 +00001139#define POLARSSL_TIMING_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001140
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001141/**
1142 * \def POLARSSL_VERSION_C
1143 *
1144 * Enable run-time version information.
1145 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001146 * Module: library/version.c
1147 *
1148 * This module provides run-time version information.
1149 */
1150#define POLARSSL_VERSION_C
1151
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001152/**
1153 * \def POLARSSL_X509_PARSE_C
1154 *
1155 * Enable X.509 certificate parsing.
1156 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001157 * Module: library/x509parse.c
1158 * Caller: library/ssl_cli.c
1159 * library/ssl_srv.c
1160 * library/ssl_tls.c
1161 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001162 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
1163 * POLARSSL_RSA_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001164 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001165 * This module is required for X.509 certificate parsing.
1166 */
Paul Bakker40e46942009-01-03 21:51:57 +00001167#define POLARSSL_X509_PARSE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001168
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001169/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001170 * \def POLARSSL_X509_WRITE_C
1171 *
1172 * Enable X.509 buffer writing.
1173 *
1174 * Module: library/x509write.c
1175 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001176 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_RSA_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001177 *
1178 * This module is required for X.509 certificate request writing.
1179 */
1180#define POLARSSL_X509_WRITE_C
1181
1182/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001183 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001184 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001185 * Enable the XTEA block cipher.
1186 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001187 * Module: library/xtea.c
1188 * Caller:
1189 */
1190#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001191
Paul Bakker0a62cd12011-01-21 11:00:08 +00001192/* \} name */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001193
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001194/**
1195 * \name SECTION: Module configuration options
1196 *
1197 * This section allows for the setting of module specific sizes and
1198 * configuration options. The default values are already present in the
1199 * relevant header files and should suffice for the regular use cases.
1200 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1201 * only if you have a good reason and know the consequences.
1202 *
1203 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1204 * header file take precedence.
1205 *
1206 * Please check the respective header file for documentation on these
1207 * parameters (to prevent duplicate documentation).
1208 *
1209 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1210 * \{
1211 */
1212//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1213
1214#if defined(POLARSSL_CONFIG_OPTIONS)
1215
1216// MPI / BIGNUM options
1217//
1218#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1219#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1220
1221// CTR_DRBG options
1222//
1223#define CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default */
1224#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1225#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1226#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1227#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1228
1229// Entropy options
1230//
1231#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1232#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1233
1234// SSL Cache options
1235//
1236#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1237#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1238
1239// SSL options
1240//
1241#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
1242
1243#endif /* POLARSSL_CONFIG_OPTIONS */
1244
1245/* \} name */
1246
Paul Bakker7ad00f92013-04-18 23:05:25 +02001247/*
1248 * Sanity checks on defines and dependencies
1249 */
1250#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1251#error "POLARSSL_DHM_C defined, but not all prerequisites"
1252#endif
1253
1254#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1255#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1256#endif
1257
1258#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1259#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1260#endif
1261
1262#if defined(POLARSSL_ECDSA_C) && !defined(POLARSSL_ECP_C)
1263#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1264#endif
1265
1266#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
1267#error "POLARSSL_ECP_C defined, but not all prerequisites"
1268#endif
1269
Paul Bakker9e36f042013-06-30 14:34:05 +02001270#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA512_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001271#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1272#endif
1273
1274#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1275#error "POLARSSL_GCM_C defined, but not all prerequisites"
1276#endif
1277
Paul Bakkere07f41d2013-04-19 09:08:57 +02001278#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1279#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1280#endif
1281
1282#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1283 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
1284 !defined(POLARSSL_X509_PARSE_C) )
1285#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1286#endif
1287
1288#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1289 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
1290 !defined(POLARSSL_X509_PARSE_C) )
1291#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1292#endif
1293
1294#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
1295 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1296#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1297#endif
1298
1299#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
1300 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) )
1301#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1302#endif
1303
Paul Bakker7ad00f92013-04-18 23:05:25 +02001304#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1305#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1306#endif
1307
1308#if defined(POLARSSL_PEM_C) && !defined(POLARSSL_PEM_C)
1309#error "POLARSSL_PEM_C defined, but not all prerequisites"
1310#endif
1311
1312#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_SSL_TLS_C)
1313#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1314#endif
1315
1316#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1317 !defined(POLARSSL_OID_C) )
1318#error "POLARSSL_RSA_C defined, but not all prerequisites"
1319#endif
1320
1321#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1322#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1323#endif
1324
1325#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_MD5_C) || \
1326 !defined(POLARSSL_SHA1_C) )
1327#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1328#endif
1329
1330#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1331#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1332#endif
1333
1334#if defined(POLARSSL_X509_PARSE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1335 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
1336 !defined(POLARSSL_RSA_C) )
1337#error "POLARSSL_X509_PARSE_C defined, but not all prerequisites"
1338#endif
1339
1340#if defined(POLARSSL_X509_WRITE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1341 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
1342 !defined(POLARSSL_RSA_C) )
1343#error "POLARSSL_X509_WRITE_C defined, but not all prerequisites"
1344#endif
1345
Paul Bakker5121ce52009-01-03 21:22:43 +00001346#endif /* config.h */