blob: 23bbae0275d6afb8d782c8bb5b4d1b2a0d14c68a [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/**
2 * \file config.h
3 *
Paul Bakker37ca75d2011-01-06 12:28:03 +00004 * \brief Configuration options (set of defines)
5 *
Paul Bakker9bcf16c2013-06-24 19:31:17 +02006 * Copyright (C) 2006-2013, Brainspark B.V.
Paul Bakkerb96f1542010-07-18 20:36:00 +00007 *
8 * This file is part of PolarSSL (http://www.polarssl.org)
Paul Bakker84f12b72010-07-18 10:13:04 +00009 * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
Paul Bakkerb96f1542010-07-18 20:36:00 +000010 *
Paul Bakker77b385e2009-07-28 17:23:11 +000011 * All rights reserved.
Paul Bakkere0ccd0a2009-01-04 16:27:10 +000012 *
Paul Bakkere0ccd0a2009-01-04 16:27:10 +000013 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 *
Paul Bakker5121ce52009-01-03 21:22:43 +000027 * This set of compile-time options may be used to enable
28 * or disable features selectively, and reduce the global
29 * memory footprint.
30 */
Paul Bakker40e46942009-01-03 21:51:57 +000031#ifndef POLARSSL_CONFIG_H
32#define POLARSSL_CONFIG_H
Paul Bakker5121ce52009-01-03 21:22:43 +000033
Paul Bakkercce9d772011-11-18 14:26:47 +000034#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
Paul Bakker5121ce52009-01-03 21:22:43 +000035#define _CRT_SECURE_NO_DEPRECATE 1
36#endif
37
Paul Bakkerf3b86c12011-01-27 15:24:17 +000038/**
Paul Bakker0a62cd12011-01-21 11:00:08 +000039 * \name SECTION: System support
40 *
41 * This section sets system specific settings.
42 * \{
43 */
44
Paul Bakkerf3b86c12011-01-27 15:24:17 +000045/**
46 * \def POLARSSL_HAVE_INT8
Paul Bakker5121ce52009-01-03 21:22:43 +000047 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +000048 * The system uses 8-bit wide native integers.
49 *
50 * Uncomment if native integers are 8-bit wide.
Paul Bakker40e46942009-01-03 21:51:57 +000051#define POLARSSL_HAVE_INT8
Paul Bakker5121ce52009-01-03 21:22:43 +000052 */
53
Paul Bakkerf3b86c12011-01-27 15:24:17 +000054/**
55 * \def POLARSSL_HAVE_INT16
Paul Bakker5121ce52009-01-03 21:22:43 +000056 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +000057 * The system uses 16-bit wide native integers.
58 *
59 * Uncomment if native integers are 16-bit wide.
Paul Bakker40e46942009-01-03 21:51:57 +000060#define POLARSSL_HAVE_INT16
Paul Bakker5121ce52009-01-03 21:22:43 +000061 */
62
Paul Bakkerf3b86c12011-01-27 15:24:17 +000063/**
Paul Bakker62261d62012-10-02 12:19:31 +000064 * \def POLARSSL_HAVE_LONGLONG
Paul Bakker5121ce52009-01-03 21:22:43 +000065 *
Paul Bakker62261d62012-10-02 12:19:31 +000066 * The compiler supports the 'long long' type.
67 * (Only used on 32-bit platforms)
Paul Bakker5121ce52009-01-03 21:22:43 +000068 */
Paul Bakker62261d62012-10-02 12:19:31 +000069#define POLARSSL_HAVE_LONGLONG
Paul Bakker5121ce52009-01-03 21:22:43 +000070
Paul Bakkerf3b86c12011-01-27 15:24:17 +000071/**
72 * \def POLARSSL_HAVE_ASM
73 *
74 * The compiler has support for asm()
75 *
Paul Bakker5121ce52009-01-03 21:22:43 +000076 * Uncomment to enable the use of assembly code.
Paul Bakker68041ec2009-04-19 21:17:55 +000077 *
78 * Requires support for asm() in compiler.
79 *
80 * Used in:
81 * library/timing.c
82 * library/padlock.c
83 * include/polarssl/bn_mul.h
84 *
Paul Bakker5121ce52009-01-03 21:22:43 +000085 */
Paul Bakker40e46942009-01-03 21:51:57 +000086#define POLARSSL_HAVE_ASM
Paul Bakker5121ce52009-01-03 21:22:43 +000087
Paul Bakkerf3b86c12011-01-27 15:24:17 +000088/**
89 * \def POLARSSL_HAVE_SSE2
90 *
Paul Bakkere23c3152012-10-01 14:42:47 +000091 * CPU supports SSE2 instruction set.
Paul Bakkerf3b86c12011-01-27 15:24:17 +000092 *
Paul Bakker5121ce52009-01-03 21:22:43 +000093 * Uncomment if the CPU supports SSE2 (IA-32 specific).
94 *
Paul Bakker40e46942009-01-03 21:51:57 +000095#define POLARSSL_HAVE_SSE2
Paul Bakker5121ce52009-01-03 21:22:43 +000096 */
Paul Bakkerfa9b1002013-07-03 15:31:03 +020097
98/**
99 * \def POLARSSL_HAVE_TIME
100 *
101 * System has time.h and time() / localtime() / gettimeofday()
102 *
103 * Comment if your system does not support time functions
104 */
105#define POLARSSL_HAVE_TIME
Paul Bakker0a62cd12011-01-21 11:00:08 +0000106/* \} name */
107
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000108/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000109 * \name SECTION: PolarSSL feature support
110 *
111 * This section sets support for features that are or are not needed
112 * within the modules that are enabled.
113 * \{
114 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000115
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000116/**
Paul Bakker90995b52013-06-24 19:20:35 +0200117 * \def POLARSSL_XXX_ALT
118 *
119 * Uncomment a macro to let PolarSSL use your alternate core implementation of
120 * a symmetric or hash algorithm (e.g. platform specific assembly optimized
121 * implementations). Keep in mind that the function prototypes should remain
122 * the same.
123 *
124 * Example: In case you uncomment POLARSSL_AES_ALT, PolarSSL will no longer
125 * provide the "struct aes_context" definition and omit the base function
126 * declarations and implementations. "aes_alt.h" will be included from
127 * "aes.h" to include the new function definitions.
128 *
129 * Uncomment a macro to enable alternate implementation for core algorithm
130 * functions
131#define POLARSSL_AES_ALT
132#define POLARSSL_ARC4_ALT
133#define POLARSSL_BLOWFISH_ALT
134#define POLARSSL_CAMELLIA_ALT
135#define POLARSSL_DES_ALT
136#define POLARSSL_XTEA_ALT
137#define POLARSSL_MD2_ALT
138#define POLARSSL_MD4_ALT
139#define POLARSSL_MD5_ALT
140#define POLARSSL_SHA1_ALT
Paul Bakker9e36f042013-06-30 14:34:05 +0200141#define POLARSSL_SHA256_ALT
142#define POLARSSL_SHA512_ALT
Paul Bakker90995b52013-06-24 19:20:35 +0200143 */
144
145/**
Paul Bakker15566e42011-04-24 21:19:15 +0000146 * \def POLARSSL_AES_ROM_TABLES
147 *
148 * Store the AES tables in ROM.
149 *
150 * Uncomment this macro to store the AES tables in ROM.
151 *
152#define POLARSSL_AES_ROM_TABLES
153 */
154
155/**
Manuel Pégourié-Gonnardf7dc3782013-09-13 14:10:44 +0200156 * \def POLARSSL_CIPHER_MODE_CBC
157 *
158 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
159 */
160#define POLARSSL_CIPHER_MODE_CBC
161
162/**
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000163 * \def POLARSSL_CIPHER_MODE_CFB
164 *
165 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
166 */
167#define POLARSSL_CIPHER_MODE_CFB
168
169/**
170 * \def POLARSSL_CIPHER_MODE_CTR
171 *
172 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
173 */
174#define POLARSSL_CIPHER_MODE_CTR
175
176/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000177 * \def POLARSSL_CIPHER_NULL_CIPHER
178 *
179 * Enable NULL cipher.
180 * Warning: Only do so when you know what you are doing. This allows for
181 * encryption or channels without any security!
182 *
183 * Requires POLARSSL_ENABLE_WEAK_CIPHERSUITES as well to enable
184 * the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000185 * TLS_RSA_WITH_NULL_MD5
186 * TLS_RSA_WITH_NULL_SHA
187 * TLS_RSA_WITH_NULL_SHA256
Paul Bakker41c83d32013-03-20 14:39:14 +0100188 * TLS_ECDHE_RSA_WITH_NULL_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200189 * TLS_PSK_WITH_NULL
190 * TLS_PSK_WITH_NULL256
191 * TLS_PSK_WITH_NULL384
192 * TLS_DHE_PSK_WITH_NULL
193 * TLS_DHE_PSK_WITH_NULL256
194 * TLS_DHE_PSK_WITH_NULL384
195 * TLS_RSA_PSK_WITH_NULL
196 * TLS_RSA_PSK_WITH_NULL256
197 * TLS_RSA_PSK_WITH_NULL384
Paul Bakkerfab5c822012-02-06 16:45:10 +0000198 *
199 * Uncomment this macro to enable the NULL cipher and ciphersuites
200#define POLARSSL_CIPHER_NULL_CIPHER
201 */
202
203/**
Paul Bakker48e93c82013-08-14 12:21:18 +0200204 * \def POLARSSL_CIPHER_PADDING_XXX
205 *
206 * Uncomment or comment macros to add support for specific padding modes
207 * in the cipher layer with cipher modes that support padding (e.g. CBC)
208 *
209 * If you disable all padding modes, only full blocks can be used with CBC.
210 *
211 * Enable padding modes in the cipher layer.
212 */
213#define POLARSSL_CIPHER_PADDING_PKCS7
214#define POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS
215#define POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN
216#define POLARSSL_CIPHER_PADDING_ZEROS
217
218/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000219 * \def POLARSSL_ENABLE_WEAK_CIPHERSUITES
220 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000221 * Enable weak ciphersuites in SSL / TLS
Paul Bakkerfab5c822012-02-06 16:45:10 +0000222 * Warning: Only do so when you know what you are doing. This allows for
Paul Bakker9a736322012-11-14 12:39:52 +0000223 * channels with virtually no security at all!
Paul Bakkerfab5c822012-02-06 16:45:10 +0000224 *
225 * This enables the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000226 * TLS_RSA_WITH_DES_CBC_SHA
227 * TLS_DHE_RSA_WITH_DES_CBC_SHA
Paul Bakkerfab5c822012-02-06 16:45:10 +0000228 *
229 * Uncomment this macro to enable weak ciphersuites
230#define POLARSSL_ENABLE_WEAK_CIPHERSUITES
231 */
232
233/**
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200234 * \def POLARSSL_ECP_XXXX_ENABLED
235 *
236 * Enables specific curves within the Elliptic Curve module.
237 * By default all supported curves are enables.
238 *
239 * Comment macros to disable the curve and functions for it
240 */
241#define POLARSSL_ECP_DP_SECP192R1_ENABLED
242#define POLARSSL_ECP_DP_SECP224R1_ENABLED
243#define POLARSSL_ECP_DP_SECP256R1_ENABLED
244#define POLARSSL_ECP_DP_SECP384R1_ENABLED
245#define POLARSSL_ECP_DP_SECP521R1_ENABLED
246
247/**
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200248 * \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED
249 *
250 * Enable the PSK based ciphersuite modes in SSL / TLS
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200251 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200252 * This enables the following ciphersuites (if other requisites are
253 * enabled as well):
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200254 * TLS_PSK_WITH_RC4_128_SHA
255 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
256 * TLS_PSK_WITH_AES_128_CBC_SHA
257 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200258 * TLS_PSK_WITH_AES_128_CBC_SHA256
259 * TLS_PSK_WITH_AES_256_CBC_SHA384
260 * TLS_PSK_WITH_AES_128_GCM_SHA256
261 * TLS_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200262 */
263#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED
264
265/**
Paul Bakkere07f41d2013-04-19 09:08:57 +0200266 * \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
267 *
268 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS
269 *
270 * Requires: POLARSSL_DHM_C
271 *
272 * This enables the following ciphersuites (if other requisites are
273 * enabled as well):
274 * TLS_DHE_PSK_WITH_RC4_128_SHA
275 * TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
276 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA
277 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200278 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
279 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
280 * TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
281 * TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200282 */
Paul Bakker48f7a5d2013-04-19 14:30:58 +0200283#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200284
285/**
286 * \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
287 *
288 * Enable the RSA-PSK based ciphersuite modes in SSL / TLS
Paul Bakker45bda902013-04-19 22:28:21 +0200289 * (NOT YET IMPLEMENTED)
Paul Bakker48377d92013-08-30 12:06:24 +0200290 * Requires: POLARSSL_RSA_C, POLARSSL_X509_PARSE_C, POLARSSL_PKCS1_V15
Paul Bakkere07f41d2013-04-19 09:08:57 +0200291 *
292 * This enables the following ciphersuites (if other requisites are
293 * enabled as well):
294 * TLS_RSA_PSK_WITH_RC4_128_SHA
295 * TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
296 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA
297 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200298 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
299 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
300 * TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
301 * TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200302#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
303 */
304
305/**
306 * \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED
307 *
308 * Enable the RSA-only based ciphersuite modes in SSL / TLS
309 *
Paul Bakker48377d92013-08-30 12:06:24 +0200310 * Requires: POLARSSL_RSA_C, POLARSSL_X509_PARSE_C, POLARSSL_PKCS1_V15
Paul Bakkere07f41d2013-04-19 09:08:57 +0200311 *
312 * This enables the following ciphersuites (if other requisites are
313 * enabled as well):
314 * TLS_RSA_WITH_AES_128_CBC_SHA
315 * TLS_RSA_WITH_AES_256_CBC_SHA
316 * TLS_RSA_WITH_AES_128_CBC_SHA256
317 * TLS_RSA_WITH_AES_256_CBC_SHA256
318 * TLS_RSA_WITH_AES_128_GCM_SHA256
319 * TLS_RSA_WITH_AES_256_GCM_SHA384
320 * TLS_RSA_WITH_RC4_128_MD5
321 * TLS_RSA_WITH_RC4_128_SHA
322 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
323 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
324 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
325 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
326 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
327 */
328#define POLARSSL_KEY_EXCHANGE_RSA_ENABLED
329
330/**
331 * \def POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
332 *
333 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS
334 *
Paul Bakker48377d92013-08-30 12:06:24 +0200335 * Requires: POLARSSL_DHM_C, POLARSSL_RSA_C, POLARSSL_X509_PARSE_C,
336 * POLARSSL_PKCS1_V15
Paul Bakkere07f41d2013-04-19 09:08:57 +0200337 *
338 * This enables the following ciphersuites (if other requisites are
339 * enabled as well):
340 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
341 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
342 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
343 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
344 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
345 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
346 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
347 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
348 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
349 */
350#define POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
351
352/**
353 * \def POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
354 *
355 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS
356 *
Paul Bakker48377d92013-08-30 12:06:24 +0200357 * Requires: POLARSSL_ECDH_C, POLARSSL_RSA_C, POLARSSL_X509_PARSE_C,
358 * POLARSSL_PKCS1_V15
Paul Bakkere07f41d2013-04-19 09:08:57 +0200359 *
360 * This enables the following ciphersuites (if other requisites are
361 * enabled as well):
362 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
363 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
364 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
365 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
366 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
367 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
368 * TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
369 * TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
370 * TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
371 * TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
372 */
373#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
374
375/**
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200376 * \def POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
377 *
378 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS
379 *
380 * Requires: POLARSSL_ECDH_C, POLARSSL_ECDSA_C, POLARSSL_X509_PARSE_C
381 *
382 * This enables the following ciphersuites (if other requisites are
383 * enabled as well):
384 * TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
385 * TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
386 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
387 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
388 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
389 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
390 * TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
391 * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
392 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
393 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
394 */
395#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
396
397/**
Paul Bakkere2ab84f2013-06-29 18:24:32 +0200398 * \def POLARSSL_ERROR_STRERROR_BC
399 *
400 * Make available the backward compatible error_strerror() next to the
401 * current polarssl_strerror().
402 *
403 * Disable if you run into name conflicts and want to really remove the
404 * error_strerror()
405 */
406#define POLARSSL_ERROR_STRERROR_BC
407
408/**
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100409 * \def POLARSSL_ERROR_STRERROR_DUMMY
410 *
Paul Bakkereba3ccf2013-09-09 15:55:12 +0200411 * Enable a dummy error function to make use of polarssl_strerror() in
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100412 * third party libraries easier.
413 *
414 * Disable if you run into name conflicts and want to really remove the
Paul Bakkereba3ccf2013-09-09 15:55:12 +0200415 * polarssl_strerror()
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100416 */
417#define POLARSSL_ERROR_STRERROR_DUMMY
418
419/**
Paul Bakker15566e42011-04-24 21:19:15 +0000420 * \def POLARSSL_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000421 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000422 * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C
423 *
Paul Bakker15566e42011-04-24 21:19:15 +0000424 * Enable the RSA prime-number generation code.
Paul Bakker5121ce52009-01-03 21:22:43 +0000425 */
Paul Bakker15566e42011-04-24 21:19:15 +0000426#define POLARSSL_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000427
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000428/**
Paul Bakker335db3f2011-04-25 15:28:35 +0000429 * \def POLARSSL_FS_IO
430 *
431 * Enable functions that use the filesystem.
432 */
433#define POLARSSL_FS_IO
434
435/**
Paul Bakker43655f42011-12-15 20:11:16 +0000436 * \def POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
437 *
438 * Do not add default entropy sources. These are the platform specific,
439 * hardclock and HAVEGE based poll functions.
440 *
441 * This is useful to have more control over the added entropy sources in an
442 * application.
443 *
444 * Uncomment this macro to prevent loading of default entropy functions.
445#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
446 */
447
448/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000449 * \def POLARSSL_NO_PLATFORM_ENTROPY
450 *
451 * Do not use built-in platform entropy functions.
452 * This is useful if your platform does not support
453 * standards like the /dev/urandom or Windows CryptoAPI.
454 *
455 * Uncomment this macro to disable the built-in platform entropy functions.
456#define POLARSSL_NO_PLATFORM_ENTROPY
457 */
458
459/**
Paul Bakker6e339b52013-07-03 13:37:05 +0200460 * \def POLARSSL_MEMORY_DEBUG
461 *
462 * Enable debugging of buffer allocator memory issues. Automatically prints
463 * (to stderr) all (fatal) messages on memory allocation issues. Enables
464 * function for 'debug output' of allocated memory.
465 *
466 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
467 * fprintf()
468 *
469 * Uncomment this macro to let the buffer allocator print out error messages.
470#define POLARSSL_MEMORY_DEBUG
471*/
472
473/**
474 * \def POLARSSL_MEMORY_BACKTRACE
475 *
476 * Include backtrace information with each allocated block.
477 *
478 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
479 * GLIBC-compatible backtrace() an backtrace_symbols() support
480 *
481 * Uncomment this macro to include backtrace information
482#define POLARSSL_MEMORY_BACKTRACE
483 */
484
485/**
Paul Bakker48377d92013-08-30 12:06:24 +0200486 * \def POLARSSL_PKCS1_V15
487 *
488 * Requires: POLARSSL_RSA_C
489 *
490 * Enable support for PKCS#1 v1.5 encoding.
491 * This enables support for PKCS#1 v1.5 operations.
492 */
493#define POLARSSL_PKCS1_V15
494
495/**
Paul Bakker9dcc3222011-03-08 14:16:06 +0000496 * \def POLARSSL_PKCS1_V21
497 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000498 * Requires: POLARSSL_MD_C, POLARSSL_RSA_C
499 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000500 * Enable support for PKCS#1 v2.1 encoding.
501 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
502 */
503#define POLARSSL_PKCS1_V21
504
505/**
Paul Bakker0216cc12011-03-26 13:40:23 +0000506 * \def POLARSSL_RSA_NO_CRT
507 *
508 * Do not use the Chinese Remainder Theorem for the RSA private operation.
509 *
510 * Uncomment this macro to disable the use of CRT in RSA.
511 *
512#define POLARSSL_RSA_NO_CRT
513 */
Paul Bakker15566e42011-04-24 21:19:15 +0000514
515/**
516 * \def POLARSSL_SELF_TEST
517 *
518 * Enable the checkup functions (*_self_test).
519 */
520#define POLARSSL_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000521
522/**
Paul Bakker40865c82013-01-31 17:13:13 +0100523 * \def POLARSSL_SSL_ALL_ALERT_MESSAGES
524 *
525 * Enable sending of alert messages in case of encountered errors as per RFC.
526 * If you choose not to send the alert messages, PolarSSL can still communicate
527 * with other servers, only debugging of failures is harder.
528 *
529 * The advantage of not sending alert messages, is that no information is given
530 * about reasons for failures thus preventing adversaries of gaining intel.
531 *
532 * Enable sending of all alert messages
533 */
534#define POLARSSL_SSL_ALERT_MESSAGES
535
536/**
Paul Bakkerd66f0702013-01-31 16:57:45 +0100537 * \def POLARSSL_SSL_DEBUG_ALL
538 *
539 * Enable the debug messages in SSL module for all issues.
540 * Debug messages have been disabled in some places to prevent timing
541 * attacks due to (unbalanced) debugging function calls.
542 *
543 * If you need all error reporting you should enable this during debugging,
544 * but remove this for production servers that should log as well.
545 *
546 * Uncomment this macro to report all debug messages on errors introducing
547 * a timing side-channel.
548 *
549#define POLARSSL_SSL_DEBUG_ALL
550 */
551
552/**
Paul Bakker05ef8352012-05-08 09:17:57 +0000553 * \def POLARSSL_SSL_HW_RECORD_ACCEL
554 *
555 * Enable hooking functions in SSL module for hardware acceleration of
556 * individual records.
557 *
558 * Uncomment this macro to enable hooking functions.
559#define POLARSSL_SSL_HW_RECORD_ACCEL
560 */
561
562/**
Paul Bakker78a8c712013-03-06 17:01:52 +0100563 * \def POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
564 *
565 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
566 * SSL Server module (POLARSSL_SSL_SRV_C)
567 *
568 * Comment this macro to disable support for SSLv2 Client Hello messages.
569 */
570#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
571
572/**
Paul Bakker05decb22013-08-15 13:33:48 +0200573 * \def POLARSSL_SSL_MAX_FRAGMENT_LENGTH
574 *
575 * Enable support for RFC 6066 max_fragment_length extension in SSL
576 *
577 * Comment this macro to disable support for the max_fragment_length extension
578 */
579#define POLARSSL_SSL_MAX_FRAGMENT_LENGTH
580
581/**
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200582 * \def POLARSSL_SSL_PROTO_SSL3
583 *
584 * Enable support for SSL 3.0
585 *
586 * Requires: POLARSSL_MD5_C
587 * POLARSSL_SHA1_C
588 *
589 * Comment this macro to disable support for SSL 3.0
590 */
591#define POLARSSL_SSL_PROTO_SSL3
592
593/**
594 * \def POLARSSL_SSL_PROTO_TLS1
595 *
596 * Enable support for TLS 1.0
597 *
598 * Requires: POLARSSL_MD5_C
599 * POLARSSL_SHA1_C
600 *
601 * Comment this macro to disable support for TLS 1.0
602 */
603#define POLARSSL_SSL_PROTO_TLS1
604
605/**
606 * \def POLARSSL_SSL_PROTO_TLS1_1
607 *
608 * Enable support for TLS 1.1
609 *
610 * Requires: POLARSSL_MD5_C
611 * POLARSSL_SHA1_C
612 *
613 * Comment this macro to disable support for TLS 1.1
614 */
615#define POLARSSL_SSL_PROTO_TLS1_1
616
617/**
618 * \def POLARSSL_SSL_PROTO_TLS1_2
619 *
620 * Enable support for TLS 1.2
621 *
622 * Requires: POLARSSL_SHA256_C or POLARSSL_SHA512_C
623 * (Depends on ciphersuites)
624 *
625 * Comment this macro to disable support for TLS 1.2
626 */
627#define POLARSSL_SSL_PROTO_TLS1_2
628
629/**
Paul Bakkera503a632013-08-14 13:48:06 +0200630 * \def POLARSSL_SSL_SESSION_TICKETS
631 *
632 * Enable support for RFC 5077 session tickets in SSL
633 *
634 * Requires: POLARSSL_AES_C
635 * POLARSSL_SHA256_C
Manuel Pégourié-Gonnard92cb1d32013-09-13 16:24:20 +0200636 * POLARSSL_CIPHER_MODE_CBC
Paul Bakkera503a632013-08-14 13:48:06 +0200637 *
638 * Comment this macro to disable support for SSL session tickets
639 */
640#define POLARSSL_SSL_SESSION_TICKETS
641
642/**
Paul Bakker0be444a2013-08-27 21:55:01 +0200643 * \def POLARSSL_SSL_SERVER_NAME_INDICATION
644 *
645 * Enable support for RFC 6066 server name indication (SNI) in SSL
646 *
647 * Comment this macro to disable support for server name indication in SSL
648 */
649#define POLARSSL_SSL_SERVER_NAME_INDICATION
650
651/**
Paul Bakker1f2bc622013-08-15 13:45:55 +0200652 * \def POLARSSL_SSL_TRUNCATED_HMAC
653 *
654 * Enable support for RFC 6066 truncated HMAC in SSL
655 *
656 * Comment this macro to disable support for truncated HMAC in SSL
657 */
658#define POLARSSL_SSL_TRUNCATED_HMAC
659
660/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000661 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
662 *
663 * If set, the X509 parser will not break-off when parsing an X509 certificate
664 * and encountering an unknown critical extension.
665 *
666 * Uncomment to prevent an error.
667 *
668#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
669 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000670
671/**
672 * \def POLARSSL_ZLIB_SUPPORT
673 *
674 * If set, the SSL/TLS module uses ZLIB to support compression and
675 * decompression of packet data.
676 *
677 * Used in: library/ssl_tls.c
678 * library/ssl_cli.c
679 * library/ssl_srv.c
680 *
681 * This feature requires zlib library and headers to be present.
682 *
683 * Uncomment to enable use of ZLIB
684#define POLARSSL_ZLIB_SUPPORT
685 */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000686/* \} name */
687
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000688/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000689 * \name SECTION: PolarSSL modules
690 *
691 * This section enables or disables entire modules in PolarSSL
692 * \{
693 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000694
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000695/**
696 * \def POLARSSL_AES_C
697 *
698 * Enable the AES block cipher.
699 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000700 * Module: library/aes.c
701 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000702 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000703 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000704 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000705 * This module enables the following ciphersuites (if other requisites are
706 * enabled as well):
707 * TLS_RSA_WITH_AES_128_CBC_SHA
708 * TLS_RSA_WITH_AES_256_CBC_SHA
709 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
710 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
711 * TLS_RSA_WITH_AES_128_CBC_SHA256
712 * TLS_RSA_WITH_AES_256_CBC_SHA256
713 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
714 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
715 * TLS_RSA_WITH_AES_128_GCM_SHA256
716 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100717 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
718 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200719 * TLS_PSK_WITH_AES_128_CBC_SHA
720 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100721 *
722 * PEM uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000723 */
Paul Bakker40e46942009-01-03 21:51:57 +0000724#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000725
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000726/**
727 * \def POLARSSL_ARC4_C
728 *
729 * Enable the ARCFOUR stream cipher.
730 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000731 * Module: library/arc4.c
732 * Caller: library/ssl_tls.c
733 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100734 * This module enables the following ciphersuites (if other requisites are
735 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000736 * TLS_RSA_WITH_RC4_128_MD5
737 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100738 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200739 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000740 */
Paul Bakker40e46942009-01-03 21:51:57 +0000741#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000742
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000743/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000744 * \def POLARSSL_ASN1_PARSE_C
745 *
746 * Enable the generic ASN1 parser.
747 *
748 * Module: library/asn1.c
749 * Caller: library/x509parse.c
750 */
751#define POLARSSL_ASN1_PARSE_C
752
753/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000754 * \def POLARSSL_ASN1_WRITE_C
755 *
756 * Enable the generic ASN1 writer.
757 *
758 * Module: library/asn1write.c
759 */
760#define POLARSSL_ASN1_WRITE_C
761
762/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000763 * \def POLARSSL_BASE64_C
764 *
765 * Enable the Base64 module.
766 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000767 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000768 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000769 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000770 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000771 */
Paul Bakker40e46942009-01-03 21:51:57 +0000772#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000773
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000774/**
775 * \def POLARSSL_BIGNUM_C
776 *
Paul Bakker9a736322012-11-14 12:39:52 +0000777 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000778 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000779 * Module: library/bignum.c
780 * Caller: library/dhm.c
781 * library/rsa.c
782 * library/ssl_tls.c
783 * library/x509parse.c
784 *
785 * This module is required for RSA and DHM support.
786 */
Paul Bakker40e46942009-01-03 21:51:57 +0000787#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000788
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000789/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000790 * \def POLARSSL_BLOWFISH_C
791 *
792 * Enable the Blowfish block cipher.
793 *
794 * Module: library/blowfish.c
795 */
796#define POLARSSL_BLOWFISH_C
797
798/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000799 * \def POLARSSL_CAMELLIA_C
800 *
801 * Enable the Camellia block cipher.
802 *
Paul Bakker38119b12009-01-10 23:31:23 +0000803 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000804 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000805 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000806 * This module enables the following ciphersuites (if other requisites are
807 * enabled as well):
808 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
809 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
810 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
811 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
812 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
813 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
814 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
815 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000816 */
817#define POLARSSL_CAMELLIA_C
818
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000819/**
820 * \def POLARSSL_CERTS_C
821 *
822 * Enable the test certificates.
823 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000824 * Module: library/certs.c
825 * Caller:
826 *
827 * This module is used for testing (ssl_client/server).
828 */
Paul Bakker40e46942009-01-03 21:51:57 +0000829#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000830
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000831/**
832 * \def POLARSSL_CIPHER_C
833 *
834 * Enable the generic cipher layer.
835 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000836 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +0200837 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +0000838 *
839 * Uncomment to enable generic cipher wrappers.
840 */
841#define POLARSSL_CIPHER_C
842
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000843/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000844 * \def POLARSSL_CTR_DRBG_C
845 *
846 * Enable the CTR_DRBG AES-256-based random generator
847 *
848 * Module: library/ctr_drbg.c
849 * Caller:
850 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000851 * Requires: POLARSSL_AES_C
852 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000853 * This module provides the CTR_DRBG AES-256 random number generator.
854 */
855#define POLARSSL_CTR_DRBG_C
856
857/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000858 * \def POLARSSL_DEBUG_C
859 *
860 * Enable the debug functions.
861 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000862 * Module: library/debug.c
863 * Caller: library/ssl_cli.c
864 * library/ssl_srv.c
865 * library/ssl_tls.c
866 *
867 * This module provides debugging functions.
868 */
Paul Bakker40e46942009-01-03 21:51:57 +0000869#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000870
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000871/**
872 * \def POLARSSL_DES_C
873 *
874 * Enable the DES block cipher.
875 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000876 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100877 * Caller: library/pem.c
878 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000879 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000880 * This module enables the following ciphersuites (if other requisites are
881 * enabled as well):
882 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
883 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100884 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200885 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100886 *
887 * PEM uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000888 */
Paul Bakker40e46942009-01-03 21:51:57 +0000889#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000890
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000891/**
892 * \def POLARSSL_DHM_C
893 *
894 * Enable the Diffie-Hellman-Merkle key exchange.
895 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000896 * Module: library/dhm.c
897 * Caller: library/ssl_cli.c
898 * library/ssl_srv.c
899 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000900 * This module enables the following ciphersuites (if other requisites are
901 * enabled as well):
902 * TLS_DHE_RSA_WITH_DES_CBC_SHA
903 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
904 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
905 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
906 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
907 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
908 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
909 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
910 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
911 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
912 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
913 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000914 */
Paul Bakker40e46942009-01-03 21:51:57 +0000915#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000916
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000917/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100918 * \def POLARSSL_ECDH_C
919 *
920 * Enable the elliptic curve Diffie-Hellman library.
921 *
922 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100923 * Caller: library/ssl_cli.c
924 * library/ssl_srv.c
925 *
926 * This module enables the following ciphersuites (if other requisites are
927 * enabled as well):
928 * TLS_ECDHE_RSA_WITH_NULL_SHA
929 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
930 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
931 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
932 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100933 *
934 * Requires: POLARSSL_ECP_C
935 */
936#define POLARSSL_ECDH_C
937
938/**
939 * \def POLARSSL_ECDSA_C
940 *
941 * Enable the elliptic curve DSA library.
942 *
943 * Module: library/ecdsa.c
944 * Caller:
945 *
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +0200946 * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100947 */
948#define POLARSSL_ECDSA_C
949
950/**
951 * \def POLARSSL_ECP_C
952 *
953 * Enable the elliptic curve over GF(p) library.
954 *
955 * Module: library/ecp.c
956 * Caller: library/ecdh.c
957 * library/ecdsa.c
958 *
959 * Requires: POLARSSL_BIGNUM_C
960 */
961#define POLARSSL_ECP_C
962
963/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000964 * \def POLARSSL_ENTROPY_C
965 *
966 * Enable the platform-specific entropy code.
967 *
968 * Module: library/entropy.c
969 * Caller:
970 *
Paul Bakker9e36f042013-06-30 14:34:05 +0200971 * Requires: POLARSSL_SHA512_C
Paul Bakker6083fd22011-12-03 21:45:14 +0000972 *
973 * This module provides a generic entropy pool
974 */
975#define POLARSSL_ENTROPY_C
976
977/**
Paul Bakker9d781402011-05-09 16:17:09 +0000978 * \def POLARSSL_ERROR_C
979 *
980 * Enable error code to error string conversion.
981 *
982 * Module: library/error.c
983 * Caller:
984 *
985 * This module enables err_strerror().
986 */
987#define POLARSSL_ERROR_C
988
989/**
Paul Bakker89e80c92012-03-20 13:50:09 +0000990 * \def POLARSSL_GCM_C
991 *
992 * Enable the Galois/Counter Mode (GCM) for AES
993 *
994 * Module: library/gcm.c
995 *
996 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +0000997 *
998 * This module enables the following ciphersuites (if other requisites are
999 * enabled as well):
1000 * TLS_RSA_WITH_AES_128_GCM_SHA256
1001 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +00001002 */
1003#define POLARSSL_GCM_C
1004
1005/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001006 * \def POLARSSL_HAVEGE_C
1007 *
1008 * Enable the HAVEGE random generator.
1009 *
Paul Bakker2a844242013-06-24 13:01:53 +02001010 * Warning: the HAVEGE random generator is not suitable for virtualized
1011 * environments
1012 *
1013 * Warning: the HAVEGE random generator is dependent on timing and specific
1014 * processor traits. It is therefore not advised to use HAVEGE as
1015 * your applications primary random generator or primary entropy pool
1016 * input. As a secondary input to your entropy pool, it IS able add
1017 * the (limited) extra entropy it provides.
1018 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001019 * Module: library/havege.c
1020 * Caller:
1021 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001022 * Requires: POLARSSL_TIMING_C
1023 *
Paul Bakker2a844242013-06-24 13:01:53 +02001024 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001025#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +02001026 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001027
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001028/**
1029 * \def POLARSSL_MD_C
1030 *
1031 * Enable the generic message digest layer.
1032 *
Paul Bakker17373852011-01-06 14:20:01 +00001033 * Module: library/md.c
1034 * Caller:
1035 *
1036 * Uncomment to enable generic message digest wrappers.
1037 */
1038#define POLARSSL_MD_C
1039
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001040/**
1041 * \def POLARSSL_MD2_C
1042 *
1043 * Enable the MD2 hash algorithm
1044 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001045 * Module: library/md2.c
1046 * Caller: library/x509parse.c
1047 *
1048 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
1049 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001050#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001051 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001052
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001053/**
1054 * \def POLARSSL_MD4_C
1055 *
1056 * Enable the MD4 hash algorithm
1057 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001058 * Module: library/md4.c
1059 * Caller: library/x509parse.c
1060 *
1061 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1062 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001063#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001064 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001065
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001066/**
1067 * \def POLARSSL_MD5_C
1068 *
1069 * Enable the MD5 hash algorithm
1070 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001071 * Module: library/md5.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001072 * Caller: library/pem.c
1073 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001074 * library/x509parse.c
1075 *
1076 * This module is required for SSL/TLS and X.509.
Paul Bakker6deb37e2013-02-19 13:17:08 +01001077 * PEM uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +00001078 */
Paul Bakker40e46942009-01-03 21:51:57 +00001079#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001080
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001081/**
Paul Bakker6e339b52013-07-03 13:37:05 +02001082 * \def POLARSSL_MEMORY_C
1083 *
1084 * Enable the memory allocation layer.
1085 * By default PolarSSL uses the system-provided malloc() and free().
1086 * (As long as POLARSSL_MEMORY_STDMALLOC and POLARSSL_MEMORY_STDFREE
1087 * are defined and unmodified)
1088 *
1089 * This allows different allocators (self-implemented or provided)
1090 *
1091 * Enable this layer to allow use of alternative memory allocators.
1092#define POLARSSL_MEMORY_C
1093 */
1094
1095/**
1096 * The buffer allocator implementation that makes use of a (stack) based
1097 * buffer to 'allocate' dynamic memory. (replaces malloc() and free() calls)
1098 *
1099 * Module: library/memory_buffer_alloc.c
1100 *
1101 * Requires: POLARSSL_MEMORY_C
1102 *
1103 * Enable this module to enable the buffer memory allocator.
1104#define POLARSSL_MEMORY_BUFFER_ALLOC_C
1105 */
1106
1107/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001108 * \def POLARSSL_NET_C
1109 *
1110 * Enable the TCP/IP networking routines.
1111 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001112 * Module: library/net.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001113 *
1114 * This module provides TCP/IP networking routines.
1115 */
Paul Bakker40e46942009-01-03 21:51:57 +00001116#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001117
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001118/**
Paul Bakkerc70b9822013-04-07 22:00:46 +02001119 * \def POLARSSL_OID_C
1120 *
1121 * Enable the OID database
1122 *
1123 * Module: library/oid.c
1124 * Caller: library/rsa.c
1125 * library/x509parse.c
1126 * library/x509write.c
1127 *
1128 * This modules translates between OIDs and internal values.
1129 */
1130#define POLARSSL_OID_C
1131
1132/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001133 * \def POLARSSL_PADLOCK_C
1134 *
1135 * Enable VIA Padlock support on x86.
1136 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001137 * Module: library/padlock.c
1138 * Caller: library/aes.c
1139 *
1140 * This modules adds support for the VIA PadLock on x86.
1141 */
Paul Bakker40e46942009-01-03 21:51:57 +00001142#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001143
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001144/**
Paul Bakkerf518b162012-08-23 13:03:18 +00001145 * \def POLARSSL_PBKDF2_C
1146 *
1147 * Enable PKCS#5 PBKDF2 key derivation function
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001148 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +00001149 *
1150 * Module: library/pbkdf2.c
1151 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001152 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001153 *
1154 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +00001155 */
Paul Bakker370e90c2013-04-08 15:19:43 +02001156#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001157
1158/**
Paul Bakker96743fc2011-02-12 14:30:57 +00001159 * \def POLARSSL_PEM_C
1160 *
1161 * Enable PEM decoding
1162 *
1163 * Module: library/pem.c
1164 * Caller: library/x509parse.c
1165 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001166 * Requires: POLARSSL_BASE64_C
1167 *
Paul Bakker96743fc2011-02-12 14:30:57 +00001168 * This modules adds support for decoding PEM files.
1169 */
1170#define POLARSSL_PEM_C
1171
1172/**
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001173 * \def POLARSSL_PK_C
1174 *
1175 * Enable the generic public (asymetric) key layer.
1176 *
1177 * Module: library/pk.c
1178 * Caller: library/x509parse.c
1179 * library/ssl_tls.c
1180 * library/ssl_cli.c
1181 * library/ssl_srv.c
1182 *
1183 * Uncomment to enable generic public key wrappers.
1184 */
1185#define POLARSSL_PK_C
1186
1187/**
Paul Bakker4606c732013-09-15 17:04:23 +02001188 * \def POLARSSL_PK_PARSE_C
1189 *
1190 * Enable the generic public (asymetric) key parser.
1191 *
1192 * Module: library/pkparse.c
1193 * Caller: library/x509parse.c
1194 *
1195 * Requires: POLARSSL_PK_C
1196 *
1197 * Uncomment to enable generic public key parse functions.
1198 */
1199#define POLARSSL_PK_PARSE_C
1200
1201/**
1202 * \def POLARSSL_PK_WRITE_C
1203 *
1204 * Enable the generic public (asymetric) key write.
1205 *
1206 * Module: library/pkwrite.c
1207 * Caller: library/x509write.c
1208 *
1209 * Requires: POLARSSL_PK_C
1210 *
1211 * Uncomment to enable generic public key write functions.
1212 */
1213#define POLARSSL_PK_WRITE_C
1214
1215/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001216 * \def POLARSSL_PKCS5_C
1217 *
1218 * Enable PKCS#5 functions
1219 *
1220 * Module: library/pkcs5.c
1221 *
1222 * Requires: POLARSSL_MD_C
1223 *
1224 * This module adds support for the PKCS#5 functions.
1225 */
1226#define POLARSSL_PKCS5_C
1227
1228/**
Paul Bakker5690efc2011-05-26 13:16:06 +00001229 * \def POLARSSL_PKCS11_C
1230 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001231 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001232 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001233 * Module: library/pkcs11.c
1234 * Caller: library/pk.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001235 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001236 * Requires: POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001237 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001238 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001239 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1240#define POLARSSL_PKCS11_C
1241 */
1242
1243/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001244 * \def POLARSSL_PKCS12_C
1245 *
1246 * Enable PKCS#12 PBE functions
1247 * Adds algorithms for parsing PKCS#8 encrypted private keys
1248 *
1249 * Module: library/pkcs12.c
1250 * Caller: library/x509parse.c
1251 *
Paul Bakkerb0713c72013-06-24 19:34:08 +02001252 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
1253 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001254 *
1255 * This module enables PKCS#12 functions.
1256 */
1257#define POLARSSL_PKCS12_C
1258
1259/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001260 * \def POLARSSL_RSA_C
1261 *
1262 * Enable the RSA public-key cryptosystem.
1263 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001264 * Module: library/rsa.c
1265 * Caller: library/ssl_cli.c
1266 * library/ssl_srv.c
1267 * library/ssl_tls.c
1268 * library/x509.c
1269 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001270 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001271 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001272 * This module is required for SSL/TLS and MD5-signed certificates.
1273 */
Paul Bakker40e46942009-01-03 21:51:57 +00001274#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001275
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001276/**
1277 * \def POLARSSL_SHA1_C
1278 *
1279 * Enable the SHA1 cryptographic hash algorithm.
1280 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001281 * Module: library/sha1.c
1282 * Caller: library/ssl_cli.c
1283 * library/ssl_srv.c
1284 * library/ssl_tls.c
1285 * library/x509parse.c
1286 *
1287 * This module is required for SSL/TLS and SHA1-signed certificates.
1288 */
Paul Bakker40e46942009-01-03 21:51:57 +00001289#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001290
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001291/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001292 * \def POLARSSL_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001293 *
1294 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001295 * (Used to be POLARSSL_SHA2_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001296 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001297 * Module: library/sha256.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001298 * Caller: library/md_wrap.c
1299 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001300 *
1301 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001302 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001303 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001304#define POLARSSL_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001305
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001306/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001307 * \def POLARSSL_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001308 *
1309 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001310 * (Used to be POLARSSL_SHA4_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001311 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001312 * Module: library/sha512.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001313 * Caller: library/md_wrap.c
1314 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001315 *
1316 * This module adds support for SHA-384 and SHA-512.
1317 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001318#define POLARSSL_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001319
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001320/**
Paul Bakker0a597072012-09-25 21:55:46 +00001321 * \def POLARSSL_SSL_CACHE_C
1322 *
1323 * Enable simple SSL cache implementation.
1324 *
1325 * Module: library/ssl_cache.c
1326 * Caller:
1327 *
1328 * Requires: POLARSSL_SSL_CACHE_C
1329 */
1330#define POLARSSL_SSL_CACHE_C
1331
1332/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001333 * \def POLARSSL_SSL_CLI_C
1334 *
1335 * Enable the SSL/TLS client code.
1336 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001337 * Module: library/ssl_cli.c
1338 * Caller:
1339 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001340 * Requires: POLARSSL_SSL_TLS_C
1341 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001342 * This module is required for SSL/TLS client support.
1343 */
Paul Bakker40e46942009-01-03 21:51:57 +00001344#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001345
Paul Bakker9a736322012-11-14 12:39:52 +00001346/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001347 * \def POLARSSL_SSL_SRV_C
1348 *
1349 * Enable the SSL/TLS server code.
1350 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001351 * Module: library/ssl_srv.c
1352 * Caller:
1353 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001354 * Requires: POLARSSL_SSL_TLS_C
1355 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001356 * This module is required for SSL/TLS server support.
1357 */
Paul Bakker40e46942009-01-03 21:51:57 +00001358#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001359
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001360/**
1361 * \def POLARSSL_SSL_TLS_C
1362 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001363 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001364 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001365 * Module: library/ssl_tls.c
1366 * Caller: library/ssl_cli.c
1367 * library/ssl_srv.c
1368 *
Paul Bakker577e0062013-08-28 11:57:20 +02001369 * Requires: POLARSSL_CIPHER_C, POLARSSL_PK_C, POLARSSL_MD_C
1370 * and at least one of the POLARSSL_SSL_PROTO_* defines
Paul Bakker5690efc2011-05-26 13:16:06 +00001371 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001372 * This module is required for SSL/TLS.
1373 */
Paul Bakker40e46942009-01-03 21:51:57 +00001374#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001375
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001376/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001377 * \def POLARSSL_TIMING_C
1378 *
1379 * Enable the portable timing interface.
1380 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001381 * Module: library/timing.c
1382 * Caller: library/havege.c
1383 *
1384 * This module is used by the HAVEGE random number generator.
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001385 */
Paul Bakkerdcbfdcc2013-09-10 16:16:50 +02001386#define POLARSSL_TIMING_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001387
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001388/**
1389 * \def POLARSSL_VERSION_C
1390 *
1391 * Enable run-time version information.
1392 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001393 * Module: library/version.c
1394 *
1395 * This module provides run-time version information.
1396 */
1397#define POLARSSL_VERSION_C
1398
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001399/**
1400 * \def POLARSSL_X509_PARSE_C
1401 *
1402 * Enable X.509 certificate parsing.
1403 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001404 * Module: library/x509parse.c
1405 * Caller: library/ssl_cli.c
1406 * library/ssl_srv.c
1407 * library/ssl_tls.c
1408 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001409 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
Paul Bakker4606c732013-09-15 17:04:23 +02001410 * POLARSSL_PK_PARSE_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001411 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001412 * This module is required for X.509 certificate parsing.
1413 */
Paul Bakker40e46942009-01-03 21:51:57 +00001414#define POLARSSL_X509_PARSE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001415
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001416/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001417 * \def POLARSSL_X509_WRITE_C
1418 *
1419 * Enable X.509 buffer writing.
1420 *
1421 * Module: library/x509write.c
1422 *
Paul Bakker4606c732013-09-15 17:04:23 +02001423 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_PK_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001424 *
1425 * This module is required for X.509 certificate request writing.
1426 */
1427#define POLARSSL_X509_WRITE_C
1428
1429/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001430 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001431 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001432 * Enable the XTEA block cipher.
1433 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001434 * Module: library/xtea.c
1435 * Caller:
1436 */
1437#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001438
Paul Bakker0a62cd12011-01-21 11:00:08 +00001439/* \} name */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001440
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001441/**
1442 * \name SECTION: Module configuration options
1443 *
1444 * This section allows for the setting of module specific sizes and
1445 * configuration options. The default values are already present in the
1446 * relevant header files and should suffice for the regular use cases.
1447 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1448 * only if you have a good reason and know the consequences.
1449 *
1450 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1451 * header file take precedence.
1452 *
1453 * Please check the respective header file for documentation on these
1454 * parameters (to prevent duplicate documentation).
1455 *
1456 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1457 * \{
1458 */
1459//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1460
1461#if defined(POLARSSL_CONFIG_OPTIONS)
1462
1463// MPI / BIGNUM options
1464//
1465#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1466#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1467
1468// CTR_DRBG options
1469//
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001470#define CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001471#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1472#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1473#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1474#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1475
1476// Entropy options
1477//
1478#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1479#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1480
Paul Bakker6e339b52013-07-03 13:37:05 +02001481// Memory options
1482#define MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1483#define POLARSSL_MEMORY_STDMALLOC malloc /**< Default allocator to use, can be undefined */
1484#define POLARSSL_MEMORY_STDFREE free /**< Default free to use, can be undefined */
1485
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001486// SSL Cache options
1487//
1488#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1489#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1490
1491// SSL options
1492//
1493#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
Paul Bakker606b4ba2013-08-14 16:52:14 +02001494#define SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001495
1496#endif /* POLARSSL_CONFIG_OPTIONS */
1497
1498/* \} name */
1499
Paul Bakker7ad00f92013-04-18 23:05:25 +02001500/*
1501 * Sanity checks on defines and dependencies
1502 */
1503#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1504#error "POLARSSL_DHM_C defined, but not all prerequisites"
1505#endif
1506
1507#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1508#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1509#endif
1510
1511#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1512#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1513#endif
1514
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001515#if defined(POLARSSL_ECDSA_C) && \
1516 ( !defined(POLARSSL_ECP_C) || \
1517 !defined(POLARSSL_ASN1_PARSE_C) || \
1518 !defined(POLARSSL_ASN1_WRITE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001519#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1520#endif
1521
1522#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
1523#error "POLARSSL_ECP_C defined, but not all prerequisites"
1524#endif
1525
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001526#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
1527 !defined(POLARSSL_SHA256_C))
Paul Bakker7ad00f92013-04-18 23:05:25 +02001528#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1529#endif
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001530#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
1531 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
1532#error "CTR_DRBG_ENTROPY_LEN value too high"
1533#endif
1534#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA512_C) && \
1535 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
1536#error "CTR_DRBG_ENTROPY_LEN value too high"
1537#endif
Paul Bakker7ad00f92013-04-18 23:05:25 +02001538
1539#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1540#error "POLARSSL_GCM_C defined, but not all prerequisites"
1541#endif
1542
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001543#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
1544#error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
1545#endif
1546
Paul Bakkere07f41d2013-04-19 09:08:57 +02001547#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1548#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1549#endif
1550
1551#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1552 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
Paul Bakker48377d92013-08-30 12:06:24 +02001553 !defined(POLARSSL_X509_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001554#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1555#endif
1556
1557#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1558 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
Paul Bakker48377d92013-08-30 12:06:24 +02001559 !defined(POLARSSL_X509_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001560#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1561#endif
1562
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +02001563#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
1564 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \
1565 !defined(POLARSSL_X509_PARSE_C) )
1566#error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
1567#endif
1568
Paul Bakkere07f41d2013-04-19 09:08:57 +02001569#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
Paul Bakker48377d92013-08-30 12:06:24 +02001570 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) || \
1571 !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001572#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1573#endif
1574
1575#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
Paul Bakker48377d92013-08-30 12:06:24 +02001576 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) || \
1577 !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001578#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1579#endif
1580
Paul Bakker6e339b52013-07-03 13:37:05 +02001581#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && !defined(POLARSSL_MEMORY_C)
1582#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
1583#endif
1584
Paul Bakker7ad00f92013-04-18 23:05:25 +02001585#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1586#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1587#endif
1588
1589#if defined(POLARSSL_PEM_C) && !defined(POLARSSL_PEM_C)
1590#error "POLARSSL_PEM_C defined, but not all prerequisites"
1591#endif
1592
Paul Bakker4606c732013-09-15 17:04:23 +02001593#if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C)
1594#error "POLARSSL_PK_PARSE_C defined, but not all prerequisites"
1595#endif
1596
1597#if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C)
1598#error "POLARSSL_PK_WRITE_C defined, but not all prerequisites"
1599#endif
1600
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001601#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001602#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1603#endif
1604
1605#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1606 !defined(POLARSSL_OID_C) )
1607#error "POLARSSL_RSA_C defined, but not all prerequisites"
1608#endif
1609
1610#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1611#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1612#endif
1613
Paul Bakker577e0062013-08-28 11:57:20 +02001614#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \
1615 !defined(POLARSSL_PK_C) || !defined(POLARSSL_MD_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001616#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1617#endif
1618
1619#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1620#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1621#endif
1622
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001623#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
1624 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
1625 !defined(POLARSSL_SSL_PROTO_TLS1_2))
1626#error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
1627#endif
1628
1629#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1630 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
1631#error "Illegal protocol selection"
1632#endif
1633
1634#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
1635 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
1636#error "Illegal protocol selection"
1637#endif
1638
1639#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1640 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
1641 !defined(POLARSSL_SSL_PROTO_TLS1_1)))
1642#error "Illegal protocol selection"
1643#endif
1644
Paul Bakker59da0a42013-08-19 13:27:17 +02001645#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
Manuel Pégourié-Gonnard92cb1d32013-09-13 16:24:20 +02001646 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) || \
1647 !defined(POLARSSL_CIPHER_MODE_CBC) )
Paul Bakker59da0a42013-08-19 13:27:17 +02001648#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
1649#endif
1650
Paul Bakker7ad00f92013-04-18 23:05:25 +02001651#if defined(POLARSSL_X509_PARSE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1652 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
Paul Bakker4606c732013-09-15 17:04:23 +02001653 !defined(POLARSSL_PK_PARSE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001654#error "POLARSSL_X509_PARSE_C defined, but not all prerequisites"
1655#endif
1656
1657#if defined(POLARSSL_X509_WRITE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1658 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
Paul Bakker4606c732013-09-15 17:04:23 +02001659 !defined(POLARSSL_RSA_C) || !defined(POLARSSL_PK_WRITE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001660#error "POLARSSL_X509_WRITE_C defined, but not all prerequisites"
1661#endif
1662
Paul Bakker5121ce52009-01-03 21:22:43 +00001663#endif /* config.h */