blob: 08a136b5101dab0db837fee85d9b5edff675240f [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/**
2 * \file config.h
3 *
Paul Bakker37ca75d2011-01-06 12:28:03 +00004 * \brief Configuration options (set of defines)
5 *
Paul Bakker9bcf16c2013-06-24 19:31:17 +02006 * Copyright (C) 2006-2013, Brainspark B.V.
Paul Bakkerb96f1542010-07-18 20:36:00 +00007 *
8 * This file is part of PolarSSL (http://www.polarssl.org)
Paul Bakker84f12b72010-07-18 10:13:04 +00009 * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
Paul Bakkerb96f1542010-07-18 20:36:00 +000010 *
Paul Bakker77b385e2009-07-28 17:23:11 +000011 * All rights reserved.
Paul Bakkere0ccd0a2009-01-04 16:27:10 +000012 *
Paul Bakkere0ccd0a2009-01-04 16:27:10 +000013 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 *
Paul Bakker5121ce52009-01-03 21:22:43 +000027 * This set of compile-time options may be used to enable
28 * or disable features selectively, and reduce the global
29 * memory footprint.
30 */
Paul Bakker40e46942009-01-03 21:51:57 +000031#ifndef POLARSSL_CONFIG_H
32#define POLARSSL_CONFIG_H
Paul Bakker5121ce52009-01-03 21:22:43 +000033
Paul Bakkercce9d772011-11-18 14:26:47 +000034#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
Paul Bakker5121ce52009-01-03 21:22:43 +000035#define _CRT_SECURE_NO_DEPRECATE 1
36#endif
37
Paul Bakkerf3b86c12011-01-27 15:24:17 +000038/**
Paul Bakker0a62cd12011-01-21 11:00:08 +000039 * \name SECTION: System support
40 *
41 * This section sets system specific settings.
42 * \{
43 */
44
Paul Bakkerf3b86c12011-01-27 15:24:17 +000045/**
46 * \def POLARSSL_HAVE_INT8
Paul Bakker5121ce52009-01-03 21:22:43 +000047 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +000048 * The system uses 8-bit wide native integers.
49 *
50 * Uncomment if native integers are 8-bit wide.
Paul Bakker40e46942009-01-03 21:51:57 +000051#define POLARSSL_HAVE_INT8
Paul Bakker5121ce52009-01-03 21:22:43 +000052 */
53
Paul Bakkerf3b86c12011-01-27 15:24:17 +000054/**
55 * \def POLARSSL_HAVE_INT16
Paul Bakker5121ce52009-01-03 21:22:43 +000056 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +000057 * The system uses 16-bit wide native integers.
58 *
59 * Uncomment if native integers are 16-bit wide.
Paul Bakker40e46942009-01-03 21:51:57 +000060#define POLARSSL_HAVE_INT16
Paul Bakker5121ce52009-01-03 21:22:43 +000061 */
62
Paul Bakkerf3b86c12011-01-27 15:24:17 +000063/**
Paul Bakker62261d62012-10-02 12:19:31 +000064 * \def POLARSSL_HAVE_LONGLONG
Paul Bakker5121ce52009-01-03 21:22:43 +000065 *
Paul Bakker62261d62012-10-02 12:19:31 +000066 * The compiler supports the 'long long' type.
67 * (Only used on 32-bit platforms)
Paul Bakker5121ce52009-01-03 21:22:43 +000068 */
Paul Bakker62261d62012-10-02 12:19:31 +000069#define POLARSSL_HAVE_LONGLONG
Paul Bakker5121ce52009-01-03 21:22:43 +000070
Paul Bakkerf3b86c12011-01-27 15:24:17 +000071/**
72 * \def POLARSSL_HAVE_ASM
73 *
74 * The compiler has support for asm()
75 *
Paul Bakker5121ce52009-01-03 21:22:43 +000076 * Uncomment to enable the use of assembly code.
Paul Bakker68041ec2009-04-19 21:17:55 +000077 *
78 * Requires support for asm() in compiler.
79 *
80 * Used in:
81 * library/timing.c
82 * library/padlock.c
83 * include/polarssl/bn_mul.h
84 *
Paul Bakker5121ce52009-01-03 21:22:43 +000085 */
Paul Bakker40e46942009-01-03 21:51:57 +000086#define POLARSSL_HAVE_ASM
Paul Bakker5121ce52009-01-03 21:22:43 +000087
Paul Bakkerf3b86c12011-01-27 15:24:17 +000088/**
89 * \def POLARSSL_HAVE_SSE2
90 *
Paul Bakkere23c3152012-10-01 14:42:47 +000091 * CPU supports SSE2 instruction set.
Paul Bakkerf3b86c12011-01-27 15:24:17 +000092 *
Paul Bakker5121ce52009-01-03 21:22:43 +000093 * Uncomment if the CPU supports SSE2 (IA-32 specific).
94 *
Paul Bakker40e46942009-01-03 21:51:57 +000095#define POLARSSL_HAVE_SSE2
Paul Bakker5121ce52009-01-03 21:22:43 +000096 */
Paul Bakkerfa9b1002013-07-03 15:31:03 +020097
98/**
99 * \def POLARSSL_HAVE_TIME
100 *
101 * System has time.h and time() / localtime() / gettimeofday()
102 *
103 * Comment if your system does not support time functions
104 */
105#define POLARSSL_HAVE_TIME
Paul Bakker0a62cd12011-01-21 11:00:08 +0000106/* \} name */
107
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000108/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000109 * \name SECTION: PolarSSL feature support
110 *
111 * This section sets support for features that are or are not needed
112 * within the modules that are enabled.
113 * \{
114 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000115
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000116/**
Paul Bakker90995b52013-06-24 19:20:35 +0200117 * \def POLARSSL_XXX_ALT
118 *
119 * Uncomment a macro to let PolarSSL use your alternate core implementation of
120 * a symmetric or hash algorithm (e.g. platform specific assembly optimized
121 * implementations). Keep in mind that the function prototypes should remain
122 * the same.
123 *
124 * Example: In case you uncomment POLARSSL_AES_ALT, PolarSSL will no longer
125 * provide the "struct aes_context" definition and omit the base function
126 * declarations and implementations. "aes_alt.h" will be included from
127 * "aes.h" to include the new function definitions.
128 *
129 * Uncomment a macro to enable alternate implementation for core algorithm
130 * functions
131#define POLARSSL_AES_ALT
132#define POLARSSL_ARC4_ALT
133#define POLARSSL_BLOWFISH_ALT
134#define POLARSSL_CAMELLIA_ALT
135#define POLARSSL_DES_ALT
136#define POLARSSL_XTEA_ALT
137#define POLARSSL_MD2_ALT
138#define POLARSSL_MD4_ALT
139#define POLARSSL_MD5_ALT
140#define POLARSSL_SHA1_ALT
Paul Bakker9e36f042013-06-30 14:34:05 +0200141#define POLARSSL_SHA256_ALT
142#define POLARSSL_SHA512_ALT
Paul Bakker90995b52013-06-24 19:20:35 +0200143 */
144
145/**
Paul Bakker15566e42011-04-24 21:19:15 +0000146 * \def POLARSSL_AES_ROM_TABLES
147 *
148 * Store the AES tables in ROM.
149 *
150 * Uncomment this macro to store the AES tables in ROM.
151 *
152#define POLARSSL_AES_ROM_TABLES
153 */
154
155/**
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000156 * \def POLARSSL_CIPHER_MODE_CFB
157 *
158 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
159 */
160#define POLARSSL_CIPHER_MODE_CFB
161
162/**
163 * \def POLARSSL_CIPHER_MODE_CTR
164 *
165 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
166 */
167#define POLARSSL_CIPHER_MODE_CTR
168
169/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000170 * \def POLARSSL_CIPHER_NULL_CIPHER
171 *
172 * Enable NULL cipher.
173 * Warning: Only do so when you know what you are doing. This allows for
174 * encryption or channels without any security!
175 *
176 * Requires POLARSSL_ENABLE_WEAK_CIPHERSUITES as well to enable
177 * the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000178 * TLS_RSA_WITH_NULL_MD5
179 * TLS_RSA_WITH_NULL_SHA
180 * TLS_RSA_WITH_NULL_SHA256
Paul Bakker41c83d32013-03-20 14:39:14 +0100181 * TLS_ECDHE_RSA_WITH_NULL_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200182 * TLS_PSK_WITH_NULL
183 * TLS_PSK_WITH_NULL256
184 * TLS_PSK_WITH_NULL384
185 * TLS_DHE_PSK_WITH_NULL
186 * TLS_DHE_PSK_WITH_NULL256
187 * TLS_DHE_PSK_WITH_NULL384
188 * TLS_RSA_PSK_WITH_NULL
189 * TLS_RSA_PSK_WITH_NULL256
190 * TLS_RSA_PSK_WITH_NULL384
Paul Bakkerfab5c822012-02-06 16:45:10 +0000191 *
192 * Uncomment this macro to enable the NULL cipher and ciphersuites
193#define POLARSSL_CIPHER_NULL_CIPHER
194 */
195
196/**
Paul Bakker48e93c82013-08-14 12:21:18 +0200197 * \def POLARSSL_CIPHER_PADDING_XXX
198 *
199 * Uncomment or comment macros to add support for specific padding modes
200 * in the cipher layer with cipher modes that support padding (e.g. CBC)
201 *
202 * If you disable all padding modes, only full blocks can be used with CBC.
203 *
204 * Enable padding modes in the cipher layer.
205 */
206#define POLARSSL_CIPHER_PADDING_PKCS7
207#define POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS
208#define POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN
209#define POLARSSL_CIPHER_PADDING_ZEROS
210
211/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000212 * \def POLARSSL_ENABLE_WEAK_CIPHERSUITES
213 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000214 * Enable weak ciphersuites in SSL / TLS
Paul Bakkerfab5c822012-02-06 16:45:10 +0000215 * Warning: Only do so when you know what you are doing. This allows for
Paul Bakker9a736322012-11-14 12:39:52 +0000216 * channels with virtually no security at all!
Paul Bakkerfab5c822012-02-06 16:45:10 +0000217 *
218 * This enables the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000219 * TLS_RSA_WITH_DES_CBC_SHA
220 * TLS_DHE_RSA_WITH_DES_CBC_SHA
Paul Bakkerfab5c822012-02-06 16:45:10 +0000221 *
222 * Uncomment this macro to enable weak ciphersuites
223#define POLARSSL_ENABLE_WEAK_CIPHERSUITES
224 */
225
226/**
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200227 * \def POLARSSL_ECP_XXXX_ENABLED
228 *
229 * Enables specific curves within the Elliptic Curve module.
230 * By default all supported curves are enables.
231 *
232 * Comment macros to disable the curve and functions for it
233 */
234#define POLARSSL_ECP_DP_SECP192R1_ENABLED
235#define POLARSSL_ECP_DP_SECP224R1_ENABLED
236#define POLARSSL_ECP_DP_SECP256R1_ENABLED
237#define POLARSSL_ECP_DP_SECP384R1_ENABLED
238#define POLARSSL_ECP_DP_SECP521R1_ENABLED
239
240/**
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200241 * \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED
242 *
243 * Enable the PSK based ciphersuite modes in SSL / TLS
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200244 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200245 * This enables the following ciphersuites (if other requisites are
246 * enabled as well):
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200247 * TLS_PSK_WITH_RC4_128_SHA
248 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
249 * TLS_PSK_WITH_AES_128_CBC_SHA
250 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200251 * TLS_PSK_WITH_AES_128_CBC_SHA256
252 * TLS_PSK_WITH_AES_256_CBC_SHA384
253 * TLS_PSK_WITH_AES_128_GCM_SHA256
254 * TLS_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200255 */
256#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED
257
258/**
Paul Bakkere07f41d2013-04-19 09:08:57 +0200259 * \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
260 *
261 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS
262 *
263 * Requires: POLARSSL_DHM_C
264 *
265 * This enables the following ciphersuites (if other requisites are
266 * enabled as well):
267 * TLS_DHE_PSK_WITH_RC4_128_SHA
268 * TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
269 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA
270 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200271 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
272 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
273 * TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
274 * TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200275 */
Paul Bakker48f7a5d2013-04-19 14:30:58 +0200276#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200277
278/**
279 * \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
280 *
281 * Enable the RSA-PSK based ciphersuite modes in SSL / TLS
Paul Bakker45bda902013-04-19 22:28:21 +0200282 * (NOT YET IMPLEMENTED)
Paul Bakker48377d92013-08-30 12:06:24 +0200283 * Requires: POLARSSL_RSA_C, POLARSSL_X509_PARSE_C, POLARSSL_PKCS1_V15
Paul Bakkere07f41d2013-04-19 09:08:57 +0200284 *
285 * This enables the following ciphersuites (if other requisites are
286 * enabled as well):
287 * TLS_RSA_PSK_WITH_RC4_128_SHA
288 * TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
289 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA
290 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200291 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
292 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
293 * TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
294 * TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200295#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
296 */
297
298/**
299 * \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED
300 *
301 * Enable the RSA-only based ciphersuite modes in SSL / TLS
302 *
Paul Bakker48377d92013-08-30 12:06:24 +0200303 * Requires: POLARSSL_RSA_C, POLARSSL_X509_PARSE_C, POLARSSL_PKCS1_V15
Paul Bakkere07f41d2013-04-19 09:08:57 +0200304 *
305 * This enables the following ciphersuites (if other requisites are
306 * enabled as well):
307 * TLS_RSA_WITH_AES_128_CBC_SHA
308 * TLS_RSA_WITH_AES_256_CBC_SHA
309 * TLS_RSA_WITH_AES_128_CBC_SHA256
310 * TLS_RSA_WITH_AES_256_CBC_SHA256
311 * TLS_RSA_WITH_AES_128_GCM_SHA256
312 * TLS_RSA_WITH_AES_256_GCM_SHA384
313 * TLS_RSA_WITH_RC4_128_MD5
314 * TLS_RSA_WITH_RC4_128_SHA
315 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
316 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
317 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
318 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
319 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
320 */
321#define POLARSSL_KEY_EXCHANGE_RSA_ENABLED
322
323/**
324 * \def POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
325 *
326 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS
327 *
Paul Bakker48377d92013-08-30 12:06:24 +0200328 * Requires: POLARSSL_DHM_C, POLARSSL_RSA_C, POLARSSL_X509_PARSE_C,
329 * POLARSSL_PKCS1_V15
Paul Bakkere07f41d2013-04-19 09:08:57 +0200330 *
331 * This enables the following ciphersuites (if other requisites are
332 * enabled as well):
333 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
334 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
335 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
336 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
337 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
338 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
339 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
340 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
341 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
342 */
343#define POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
344
345/**
346 * \def POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
347 *
348 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS
349 *
Paul Bakker48377d92013-08-30 12:06:24 +0200350 * Requires: POLARSSL_ECDH_C, POLARSSL_RSA_C, POLARSSL_X509_PARSE_C,
351 * POLARSSL_PKCS1_V15
Paul Bakkere07f41d2013-04-19 09:08:57 +0200352 *
353 * This enables the following ciphersuites (if other requisites are
354 * enabled as well):
355 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
356 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
357 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
358 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
359 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
360 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
361 * TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
362 * TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
363 * TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
364 * TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
365 */
366#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
367
368/**
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200369 * \def POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
370 *
371 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS
372 *
373 * Requires: POLARSSL_ECDH_C, POLARSSL_ECDSA_C, POLARSSL_X509_PARSE_C
374 *
375 * This enables the following ciphersuites (if other requisites are
376 * enabled as well):
377 * TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
378 * TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
379 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
380 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
381 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
382 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
383 * TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
384 * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
385 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
386 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
387 */
388#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
389
390/**
Paul Bakkere2ab84f2013-06-29 18:24:32 +0200391 * \def POLARSSL_ERROR_STRERROR_BC
392 *
393 * Make available the backward compatible error_strerror() next to the
394 * current polarssl_strerror().
395 *
396 * Disable if you run into name conflicts and want to really remove the
397 * error_strerror()
398 */
399#define POLARSSL_ERROR_STRERROR_BC
400
401/**
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100402 * \def POLARSSL_ERROR_STRERROR_DUMMY
403 *
Paul Bakkereba3ccf2013-09-09 15:55:12 +0200404 * Enable a dummy error function to make use of polarssl_strerror() in
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100405 * third party libraries easier.
406 *
407 * Disable if you run into name conflicts and want to really remove the
Paul Bakkereba3ccf2013-09-09 15:55:12 +0200408 * polarssl_strerror()
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100409 */
410#define POLARSSL_ERROR_STRERROR_DUMMY
411
412/**
Paul Bakker15566e42011-04-24 21:19:15 +0000413 * \def POLARSSL_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000414 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000415 * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C
416 *
Paul Bakker15566e42011-04-24 21:19:15 +0000417 * Enable the RSA prime-number generation code.
Paul Bakker5121ce52009-01-03 21:22:43 +0000418 */
Paul Bakker15566e42011-04-24 21:19:15 +0000419#define POLARSSL_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000420
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000421/**
Paul Bakker335db3f2011-04-25 15:28:35 +0000422 * \def POLARSSL_FS_IO
423 *
424 * Enable functions that use the filesystem.
425 */
426#define POLARSSL_FS_IO
427
428/**
Paul Bakker43655f42011-12-15 20:11:16 +0000429 * \def POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
430 *
431 * Do not add default entropy sources. These are the platform specific,
432 * hardclock and HAVEGE based poll functions.
433 *
434 * This is useful to have more control over the added entropy sources in an
435 * application.
436 *
437 * Uncomment this macro to prevent loading of default entropy functions.
438#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
439 */
440
441/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000442 * \def POLARSSL_NO_PLATFORM_ENTROPY
443 *
444 * Do not use built-in platform entropy functions.
445 * This is useful if your platform does not support
446 * standards like the /dev/urandom or Windows CryptoAPI.
447 *
448 * Uncomment this macro to disable the built-in platform entropy functions.
449#define POLARSSL_NO_PLATFORM_ENTROPY
450 */
451
452/**
Paul Bakker6e339b52013-07-03 13:37:05 +0200453 * \def POLARSSL_MEMORY_DEBUG
454 *
455 * Enable debugging of buffer allocator memory issues. Automatically prints
456 * (to stderr) all (fatal) messages on memory allocation issues. Enables
457 * function for 'debug output' of allocated memory.
458 *
459 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
460 * fprintf()
461 *
462 * Uncomment this macro to let the buffer allocator print out error messages.
463#define POLARSSL_MEMORY_DEBUG
464*/
465
466/**
467 * \def POLARSSL_MEMORY_BACKTRACE
468 *
469 * Include backtrace information with each allocated block.
470 *
471 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
472 * GLIBC-compatible backtrace() an backtrace_symbols() support
473 *
474 * Uncomment this macro to include backtrace information
475#define POLARSSL_MEMORY_BACKTRACE
476 */
477
478/**
Paul Bakker48377d92013-08-30 12:06:24 +0200479 * \def POLARSSL_PKCS1_V15
480 *
481 * Requires: POLARSSL_RSA_C
482 *
483 * Enable support for PKCS#1 v1.5 encoding.
484 * This enables support for PKCS#1 v1.5 operations.
485 */
486#define POLARSSL_PKCS1_V15
487
488/**
Paul Bakker9dcc3222011-03-08 14:16:06 +0000489 * \def POLARSSL_PKCS1_V21
490 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000491 * Requires: POLARSSL_MD_C, POLARSSL_RSA_C
492 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000493 * Enable support for PKCS#1 v2.1 encoding.
494 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
495 */
496#define POLARSSL_PKCS1_V21
497
498/**
Paul Bakker0216cc12011-03-26 13:40:23 +0000499 * \def POLARSSL_RSA_NO_CRT
500 *
501 * Do not use the Chinese Remainder Theorem for the RSA private operation.
502 *
503 * Uncomment this macro to disable the use of CRT in RSA.
504 *
505#define POLARSSL_RSA_NO_CRT
506 */
Paul Bakker15566e42011-04-24 21:19:15 +0000507
508/**
509 * \def POLARSSL_SELF_TEST
510 *
511 * Enable the checkup functions (*_self_test).
512 */
513#define POLARSSL_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000514
515/**
Paul Bakker40865c82013-01-31 17:13:13 +0100516 * \def POLARSSL_SSL_ALL_ALERT_MESSAGES
517 *
518 * Enable sending of alert messages in case of encountered errors as per RFC.
519 * If you choose not to send the alert messages, PolarSSL can still communicate
520 * with other servers, only debugging of failures is harder.
521 *
522 * The advantage of not sending alert messages, is that no information is given
523 * about reasons for failures thus preventing adversaries of gaining intel.
524 *
525 * Enable sending of all alert messages
526 */
527#define POLARSSL_SSL_ALERT_MESSAGES
528
529/**
Paul Bakkerd66f0702013-01-31 16:57:45 +0100530 * \def POLARSSL_SSL_DEBUG_ALL
531 *
532 * Enable the debug messages in SSL module for all issues.
533 * Debug messages have been disabled in some places to prevent timing
534 * attacks due to (unbalanced) debugging function calls.
535 *
536 * If you need all error reporting you should enable this during debugging,
537 * but remove this for production servers that should log as well.
538 *
539 * Uncomment this macro to report all debug messages on errors introducing
540 * a timing side-channel.
541 *
542#define POLARSSL_SSL_DEBUG_ALL
543 */
544
545/**
Paul Bakker05ef8352012-05-08 09:17:57 +0000546 * \def POLARSSL_SSL_HW_RECORD_ACCEL
547 *
548 * Enable hooking functions in SSL module for hardware acceleration of
549 * individual records.
550 *
551 * Uncomment this macro to enable hooking functions.
552#define POLARSSL_SSL_HW_RECORD_ACCEL
553 */
554
555/**
Paul Bakker78a8c712013-03-06 17:01:52 +0100556 * \def POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
557 *
558 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
559 * SSL Server module (POLARSSL_SSL_SRV_C)
560 *
561 * Comment this macro to disable support for SSLv2 Client Hello messages.
562 */
563#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
564
565/**
Paul Bakker05decb22013-08-15 13:33:48 +0200566 * \def POLARSSL_SSL_MAX_FRAGMENT_LENGTH
567 *
568 * Enable support for RFC 6066 max_fragment_length extension in SSL
569 *
570 * Comment this macro to disable support for the max_fragment_length extension
571 */
572#define POLARSSL_SSL_MAX_FRAGMENT_LENGTH
573
574/**
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200575 * \def POLARSSL_SSL_PROTO_SSL3
576 *
577 * Enable support for SSL 3.0
578 *
579 * Requires: POLARSSL_MD5_C
580 * POLARSSL_SHA1_C
581 *
582 * Comment this macro to disable support for SSL 3.0
583 */
584#define POLARSSL_SSL_PROTO_SSL3
585
586/**
587 * \def POLARSSL_SSL_PROTO_TLS1
588 *
589 * Enable support for TLS 1.0
590 *
591 * Requires: POLARSSL_MD5_C
592 * POLARSSL_SHA1_C
593 *
594 * Comment this macro to disable support for TLS 1.0
595 */
596#define POLARSSL_SSL_PROTO_TLS1
597
598/**
599 * \def POLARSSL_SSL_PROTO_TLS1_1
600 *
601 * Enable support for TLS 1.1
602 *
603 * Requires: POLARSSL_MD5_C
604 * POLARSSL_SHA1_C
605 *
606 * Comment this macro to disable support for TLS 1.1
607 */
608#define POLARSSL_SSL_PROTO_TLS1_1
609
610/**
611 * \def POLARSSL_SSL_PROTO_TLS1_2
612 *
613 * Enable support for TLS 1.2
614 *
615 * Requires: POLARSSL_SHA256_C or POLARSSL_SHA512_C
616 * (Depends on ciphersuites)
617 *
618 * Comment this macro to disable support for TLS 1.2
619 */
620#define POLARSSL_SSL_PROTO_TLS1_2
621
622/**
Paul Bakkera503a632013-08-14 13:48:06 +0200623 * \def POLARSSL_SSL_SESSION_TICKETS
624 *
625 * Enable support for RFC 5077 session tickets in SSL
626 *
627 * Requires: POLARSSL_AES_C
628 * POLARSSL_SHA256_C
629 *
630 * Comment this macro to disable support for SSL session tickets
631 */
632#define POLARSSL_SSL_SESSION_TICKETS
633
634/**
Paul Bakker0be444a2013-08-27 21:55:01 +0200635 * \def POLARSSL_SSL_SERVER_NAME_INDICATION
636 *
637 * Enable support for RFC 6066 server name indication (SNI) in SSL
638 *
639 * Comment this macro to disable support for server name indication in SSL
640 */
641#define POLARSSL_SSL_SERVER_NAME_INDICATION
642
643/**
Paul Bakker1f2bc622013-08-15 13:45:55 +0200644 * \def POLARSSL_SSL_TRUNCATED_HMAC
645 *
646 * Enable support for RFC 6066 truncated HMAC in SSL
647 *
648 * Comment this macro to disable support for truncated HMAC in SSL
649 */
650#define POLARSSL_SSL_TRUNCATED_HMAC
651
652/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000653 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
654 *
655 * If set, the X509 parser will not break-off when parsing an X509 certificate
656 * and encountering an unknown critical extension.
657 *
658 * Uncomment to prevent an error.
659 *
660#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
661 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000662
663/**
664 * \def POLARSSL_ZLIB_SUPPORT
665 *
666 * If set, the SSL/TLS module uses ZLIB to support compression and
667 * decompression of packet data.
668 *
669 * Used in: library/ssl_tls.c
670 * library/ssl_cli.c
671 * library/ssl_srv.c
672 *
673 * This feature requires zlib library and headers to be present.
674 *
675 * Uncomment to enable use of ZLIB
676#define POLARSSL_ZLIB_SUPPORT
677 */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000678/* \} name */
679
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000680/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000681 * \name SECTION: PolarSSL modules
682 *
683 * This section enables or disables entire modules in PolarSSL
684 * \{
685 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000686
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000687/**
688 * \def POLARSSL_AES_C
689 *
690 * Enable the AES block cipher.
691 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000692 * Module: library/aes.c
693 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000694 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000695 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000696 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000697 * This module enables the following ciphersuites (if other requisites are
698 * enabled as well):
699 * TLS_RSA_WITH_AES_128_CBC_SHA
700 * TLS_RSA_WITH_AES_256_CBC_SHA
701 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
702 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
703 * TLS_RSA_WITH_AES_128_CBC_SHA256
704 * TLS_RSA_WITH_AES_256_CBC_SHA256
705 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
706 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
707 * TLS_RSA_WITH_AES_128_GCM_SHA256
708 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100709 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
710 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200711 * TLS_PSK_WITH_AES_128_CBC_SHA
712 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100713 *
714 * PEM uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000715 */
Paul Bakker40e46942009-01-03 21:51:57 +0000716#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000717
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000718/**
719 * \def POLARSSL_ARC4_C
720 *
721 * Enable the ARCFOUR stream cipher.
722 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000723 * Module: library/arc4.c
724 * Caller: library/ssl_tls.c
725 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100726 * This module enables the following ciphersuites (if other requisites are
727 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000728 * TLS_RSA_WITH_RC4_128_MD5
729 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100730 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200731 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000732 */
Paul Bakker40e46942009-01-03 21:51:57 +0000733#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000734
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000735/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000736 * \def POLARSSL_ASN1_PARSE_C
737 *
738 * Enable the generic ASN1 parser.
739 *
740 * Module: library/asn1.c
741 * Caller: library/x509parse.c
742 */
743#define POLARSSL_ASN1_PARSE_C
744
745/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000746 * \def POLARSSL_ASN1_WRITE_C
747 *
748 * Enable the generic ASN1 writer.
749 *
750 * Module: library/asn1write.c
751 */
752#define POLARSSL_ASN1_WRITE_C
753
754/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000755 * \def POLARSSL_BASE64_C
756 *
757 * Enable the Base64 module.
758 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000759 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000760 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000761 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000762 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000763 */
Paul Bakker40e46942009-01-03 21:51:57 +0000764#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000765
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000766/**
767 * \def POLARSSL_BIGNUM_C
768 *
Paul Bakker9a736322012-11-14 12:39:52 +0000769 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000770 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000771 * Module: library/bignum.c
772 * Caller: library/dhm.c
773 * library/rsa.c
774 * library/ssl_tls.c
775 * library/x509parse.c
776 *
777 * This module is required for RSA and DHM support.
778 */
Paul Bakker40e46942009-01-03 21:51:57 +0000779#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000780
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000781/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000782 * \def POLARSSL_BLOWFISH_C
783 *
784 * Enable the Blowfish block cipher.
785 *
786 * Module: library/blowfish.c
787 */
788#define POLARSSL_BLOWFISH_C
789
790/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000791 * \def POLARSSL_CAMELLIA_C
792 *
793 * Enable the Camellia block cipher.
794 *
Paul Bakker38119b12009-01-10 23:31:23 +0000795 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000796 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000797 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000798 * This module enables the following ciphersuites (if other requisites are
799 * enabled as well):
800 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
801 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
802 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
803 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
804 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
805 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
806 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
807 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000808 */
809#define POLARSSL_CAMELLIA_C
810
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000811/**
812 * \def POLARSSL_CERTS_C
813 *
814 * Enable the test certificates.
815 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000816 * Module: library/certs.c
817 * Caller:
818 *
819 * This module is used for testing (ssl_client/server).
820 */
Paul Bakker40e46942009-01-03 21:51:57 +0000821#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000822
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000823/**
824 * \def POLARSSL_CIPHER_C
825 *
826 * Enable the generic cipher layer.
827 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000828 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +0200829 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +0000830 *
831 * Uncomment to enable generic cipher wrappers.
832 */
833#define POLARSSL_CIPHER_C
834
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000835/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000836 * \def POLARSSL_CTR_DRBG_C
837 *
838 * Enable the CTR_DRBG AES-256-based random generator
839 *
840 * Module: library/ctr_drbg.c
841 * Caller:
842 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000843 * Requires: POLARSSL_AES_C
844 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000845 * This module provides the CTR_DRBG AES-256 random number generator.
846 */
847#define POLARSSL_CTR_DRBG_C
848
849/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000850 * \def POLARSSL_DEBUG_C
851 *
852 * Enable the debug functions.
853 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000854 * Module: library/debug.c
855 * Caller: library/ssl_cli.c
856 * library/ssl_srv.c
857 * library/ssl_tls.c
858 *
859 * This module provides debugging functions.
860 */
Paul Bakker40e46942009-01-03 21:51:57 +0000861#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000862
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000863/**
864 * \def POLARSSL_DES_C
865 *
866 * Enable the DES block cipher.
867 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000868 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100869 * Caller: library/pem.c
870 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000871 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000872 * This module enables the following ciphersuites (if other requisites are
873 * enabled as well):
874 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
875 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100876 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200877 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100878 *
879 * PEM uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000880 */
Paul Bakker40e46942009-01-03 21:51:57 +0000881#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000882
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000883/**
884 * \def POLARSSL_DHM_C
885 *
886 * Enable the Diffie-Hellman-Merkle key exchange.
887 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000888 * Module: library/dhm.c
889 * Caller: library/ssl_cli.c
890 * library/ssl_srv.c
891 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000892 * This module enables the following ciphersuites (if other requisites are
893 * enabled as well):
894 * TLS_DHE_RSA_WITH_DES_CBC_SHA
895 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
896 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
897 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
898 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
899 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
900 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
901 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
902 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
903 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
904 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
905 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000906 */
Paul Bakker40e46942009-01-03 21:51:57 +0000907#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000908
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000909/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100910 * \def POLARSSL_ECDH_C
911 *
912 * Enable the elliptic curve Diffie-Hellman library.
913 *
914 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100915 * Caller: library/ssl_cli.c
916 * library/ssl_srv.c
917 *
918 * This module enables the following ciphersuites (if other requisites are
919 * enabled as well):
920 * TLS_ECDHE_RSA_WITH_NULL_SHA
921 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
922 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
923 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
924 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100925 *
926 * Requires: POLARSSL_ECP_C
927 */
928#define POLARSSL_ECDH_C
929
930/**
931 * \def POLARSSL_ECDSA_C
932 *
933 * Enable the elliptic curve DSA library.
934 *
935 * Module: library/ecdsa.c
936 * Caller:
937 *
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +0200938 * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100939 */
940#define POLARSSL_ECDSA_C
941
942/**
943 * \def POLARSSL_ECP_C
944 *
945 * Enable the elliptic curve over GF(p) library.
946 *
947 * Module: library/ecp.c
948 * Caller: library/ecdh.c
949 * library/ecdsa.c
950 *
951 * Requires: POLARSSL_BIGNUM_C
952 */
953#define POLARSSL_ECP_C
954
955/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000956 * \def POLARSSL_ENTROPY_C
957 *
958 * Enable the platform-specific entropy code.
959 *
960 * Module: library/entropy.c
961 * Caller:
962 *
Paul Bakker9e36f042013-06-30 14:34:05 +0200963 * Requires: POLARSSL_SHA512_C
Paul Bakker6083fd22011-12-03 21:45:14 +0000964 *
965 * This module provides a generic entropy pool
966 */
967#define POLARSSL_ENTROPY_C
968
969/**
Paul Bakker9d781402011-05-09 16:17:09 +0000970 * \def POLARSSL_ERROR_C
971 *
972 * Enable error code to error string conversion.
973 *
974 * Module: library/error.c
975 * Caller:
976 *
977 * This module enables err_strerror().
978 */
979#define POLARSSL_ERROR_C
980
981/**
Paul Bakker89e80c92012-03-20 13:50:09 +0000982 * \def POLARSSL_GCM_C
983 *
984 * Enable the Galois/Counter Mode (GCM) for AES
985 *
986 * Module: library/gcm.c
987 *
988 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +0000989 *
990 * This module enables the following ciphersuites (if other requisites are
991 * enabled as well):
992 * TLS_RSA_WITH_AES_128_GCM_SHA256
993 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +0000994 */
995#define POLARSSL_GCM_C
996
997/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000998 * \def POLARSSL_HAVEGE_C
999 *
1000 * Enable the HAVEGE random generator.
1001 *
Paul Bakker2a844242013-06-24 13:01:53 +02001002 * Warning: the HAVEGE random generator is not suitable for virtualized
1003 * environments
1004 *
1005 * Warning: the HAVEGE random generator is dependent on timing and specific
1006 * processor traits. It is therefore not advised to use HAVEGE as
1007 * your applications primary random generator or primary entropy pool
1008 * input. As a secondary input to your entropy pool, it IS able add
1009 * the (limited) extra entropy it provides.
1010 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001011 * Module: library/havege.c
1012 * Caller:
1013 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001014 * Requires: POLARSSL_TIMING_C
1015 *
Paul Bakker2a844242013-06-24 13:01:53 +02001016 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001017#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +02001018 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001019
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001020/**
1021 * \def POLARSSL_MD_C
1022 *
1023 * Enable the generic message digest layer.
1024 *
Paul Bakker17373852011-01-06 14:20:01 +00001025 * Module: library/md.c
1026 * Caller:
1027 *
1028 * Uncomment to enable generic message digest wrappers.
1029 */
1030#define POLARSSL_MD_C
1031
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001032/**
1033 * \def POLARSSL_MD2_C
1034 *
1035 * Enable the MD2 hash algorithm
1036 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001037 * Module: library/md2.c
1038 * Caller: library/x509parse.c
1039 *
1040 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
1041 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001042#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001043 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001044
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001045/**
1046 * \def POLARSSL_MD4_C
1047 *
1048 * Enable the MD4 hash algorithm
1049 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001050 * Module: library/md4.c
1051 * Caller: library/x509parse.c
1052 *
1053 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1054 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001055#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001056 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001057
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001058/**
1059 * \def POLARSSL_MD5_C
1060 *
1061 * Enable the MD5 hash algorithm
1062 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001063 * Module: library/md5.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001064 * Caller: library/pem.c
1065 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001066 * library/x509parse.c
1067 *
1068 * This module is required for SSL/TLS and X.509.
Paul Bakker6deb37e2013-02-19 13:17:08 +01001069 * PEM uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +00001070 */
Paul Bakker40e46942009-01-03 21:51:57 +00001071#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001072
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001073/**
Paul Bakker6e339b52013-07-03 13:37:05 +02001074 * \def POLARSSL_MEMORY_C
1075 *
1076 * Enable the memory allocation layer.
1077 * By default PolarSSL uses the system-provided malloc() and free().
1078 * (As long as POLARSSL_MEMORY_STDMALLOC and POLARSSL_MEMORY_STDFREE
1079 * are defined and unmodified)
1080 *
1081 * This allows different allocators (self-implemented or provided)
1082 *
1083 * Enable this layer to allow use of alternative memory allocators.
1084#define POLARSSL_MEMORY_C
1085 */
1086
1087/**
1088 * The buffer allocator implementation that makes use of a (stack) based
1089 * buffer to 'allocate' dynamic memory. (replaces malloc() and free() calls)
1090 *
1091 * Module: library/memory_buffer_alloc.c
1092 *
1093 * Requires: POLARSSL_MEMORY_C
1094 *
1095 * Enable this module to enable the buffer memory allocator.
1096#define POLARSSL_MEMORY_BUFFER_ALLOC_C
1097 */
1098
1099/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001100 * \def POLARSSL_NET_C
1101 *
1102 * Enable the TCP/IP networking routines.
1103 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001104 * Module: library/net.c
1105 * Caller:
1106 *
1107 * This module provides TCP/IP networking routines.
1108 */
Paul Bakker40e46942009-01-03 21:51:57 +00001109#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001110
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001111/**
Paul Bakkerc70b9822013-04-07 22:00:46 +02001112 * \def POLARSSL_OID_C
1113 *
1114 * Enable the OID database
1115 *
1116 * Module: library/oid.c
1117 * Caller: library/rsa.c
1118 * library/x509parse.c
1119 * library/x509write.c
1120 *
1121 * This modules translates between OIDs and internal values.
1122 */
1123#define POLARSSL_OID_C
1124
1125/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001126 * \def POLARSSL_PADLOCK_C
1127 *
1128 * Enable VIA Padlock support on x86.
1129 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001130 * Module: library/padlock.c
1131 * Caller: library/aes.c
1132 *
1133 * This modules adds support for the VIA PadLock on x86.
1134 */
Paul Bakker40e46942009-01-03 21:51:57 +00001135#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001136
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001137/**
Paul Bakkerf518b162012-08-23 13:03:18 +00001138 * \def POLARSSL_PBKDF2_C
1139 *
1140 * Enable PKCS#5 PBKDF2 key derivation function
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001141 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +00001142 *
1143 * Module: library/pbkdf2.c
1144 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001145 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001146 *
1147 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +00001148 */
Paul Bakker370e90c2013-04-08 15:19:43 +02001149#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001150
1151/**
Paul Bakker96743fc2011-02-12 14:30:57 +00001152 * \def POLARSSL_PEM_C
1153 *
1154 * Enable PEM decoding
1155 *
1156 * Module: library/pem.c
1157 * Caller: library/x509parse.c
1158 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001159 * Requires: POLARSSL_BASE64_C
1160 *
Paul Bakker96743fc2011-02-12 14:30:57 +00001161 * This modules adds support for decoding PEM files.
1162 */
1163#define POLARSSL_PEM_C
1164
1165/**
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001166 * \def POLARSSL_PK_C
1167 *
1168 * Enable the generic public (asymetric) key layer.
1169 *
1170 * Module: library/pk.c
1171 * Caller: library/x509parse.c
1172 * library/ssl_tls.c
1173 * library/ssl_cli.c
1174 * library/ssl_srv.c
1175 *
1176 * Uncomment to enable generic public key wrappers.
1177 */
1178#define POLARSSL_PK_C
1179
1180/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001181 * \def POLARSSL_PKCS5_C
1182 *
1183 * Enable PKCS#5 functions
1184 *
1185 * Module: library/pkcs5.c
1186 *
1187 * Requires: POLARSSL_MD_C
1188 *
1189 * This module adds support for the PKCS#5 functions.
1190 */
1191#define POLARSSL_PKCS5_C
1192
1193/**
Paul Bakker5690efc2011-05-26 13:16:06 +00001194 * \def POLARSSL_PKCS11_C
1195 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001196 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001197 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001198 * Module: library/pkcs11.c
1199 * Caller: library/pk.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001200 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001201 * Requires: POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001202 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001203 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001204 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1205#define POLARSSL_PKCS11_C
1206 */
1207
1208/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001209 * \def POLARSSL_PKCS12_C
1210 *
1211 * Enable PKCS#12 PBE functions
1212 * Adds algorithms for parsing PKCS#8 encrypted private keys
1213 *
1214 * Module: library/pkcs12.c
1215 * Caller: library/x509parse.c
1216 *
Paul Bakkerb0713c72013-06-24 19:34:08 +02001217 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
1218 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001219 *
1220 * This module enables PKCS#12 functions.
1221 */
1222#define POLARSSL_PKCS12_C
1223
1224/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001225 * \def POLARSSL_RSA_C
1226 *
1227 * Enable the RSA public-key cryptosystem.
1228 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001229 * Module: library/rsa.c
1230 * Caller: library/ssl_cli.c
1231 * library/ssl_srv.c
1232 * library/ssl_tls.c
1233 * library/x509.c
1234 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001235 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001236 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001237 * This module is required for SSL/TLS and MD5-signed certificates.
1238 */
Paul Bakker40e46942009-01-03 21:51:57 +00001239#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001240
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001241/**
1242 * \def POLARSSL_SHA1_C
1243 *
1244 * Enable the SHA1 cryptographic hash algorithm.
1245 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001246 * Module: library/sha1.c
1247 * Caller: library/ssl_cli.c
1248 * library/ssl_srv.c
1249 * library/ssl_tls.c
1250 * library/x509parse.c
1251 *
1252 * This module is required for SSL/TLS and SHA1-signed certificates.
1253 */
Paul Bakker40e46942009-01-03 21:51:57 +00001254#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001255
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001256/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001257 * \def POLARSSL_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001258 *
1259 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001260 * (Used to be POLARSSL_SHA2_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001261 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001262 * Module: library/sha256.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001263 * Caller: library/md_wrap.c
1264 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001265 *
1266 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001267 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001268 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001269#define POLARSSL_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001270
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001271/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001272 * \def POLARSSL_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001273 *
1274 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001275 * (Used to be POLARSSL_SHA4_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001276 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001277 * Module: library/sha512.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001278 * Caller: library/md_wrap.c
1279 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001280 *
1281 * This module adds support for SHA-384 and SHA-512.
1282 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001283#define POLARSSL_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001284
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001285/**
Paul Bakker0a597072012-09-25 21:55:46 +00001286 * \def POLARSSL_SSL_CACHE_C
1287 *
1288 * Enable simple SSL cache implementation.
1289 *
1290 * Module: library/ssl_cache.c
1291 * Caller:
1292 *
1293 * Requires: POLARSSL_SSL_CACHE_C
1294 */
1295#define POLARSSL_SSL_CACHE_C
1296
1297/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001298 * \def POLARSSL_SSL_CLI_C
1299 *
1300 * Enable the SSL/TLS client code.
1301 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001302 * Module: library/ssl_cli.c
1303 * Caller:
1304 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001305 * Requires: POLARSSL_SSL_TLS_C
1306 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001307 * This module is required for SSL/TLS client support.
1308 */
Paul Bakker40e46942009-01-03 21:51:57 +00001309#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001310
Paul Bakker9a736322012-11-14 12:39:52 +00001311/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001312 * \def POLARSSL_SSL_SRV_C
1313 *
1314 * Enable the SSL/TLS server code.
1315 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001316 * Module: library/ssl_srv.c
1317 * Caller:
1318 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001319 * Requires: POLARSSL_SSL_TLS_C
1320 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001321 * This module is required for SSL/TLS server support.
1322 */
Paul Bakker40e46942009-01-03 21:51:57 +00001323#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001324
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001325/**
1326 * \def POLARSSL_SSL_TLS_C
1327 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001328 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001329 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001330 * Module: library/ssl_tls.c
1331 * Caller: library/ssl_cli.c
1332 * library/ssl_srv.c
1333 *
Paul Bakker577e0062013-08-28 11:57:20 +02001334 * Requires: POLARSSL_CIPHER_C, POLARSSL_PK_C, POLARSSL_MD_C
1335 * and at least one of the POLARSSL_SSL_PROTO_* defines
Paul Bakker5690efc2011-05-26 13:16:06 +00001336 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001337 * This module is required for SSL/TLS.
1338 */
Paul Bakker40e46942009-01-03 21:51:57 +00001339#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001340
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001341/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001342 * \def POLARSSL_TIMING_C
1343 *
1344 * Enable the portable timing interface.
1345 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001346 * Module: library/timing.c
1347 * Caller: library/havege.c
1348 *
1349 * This module is used by the HAVEGE random number generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001350#define POLARSSL_TIMING_C
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001351 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001352
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001353/**
1354 * \def POLARSSL_VERSION_C
1355 *
1356 * Enable run-time version information.
1357 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001358 * Module: library/version.c
1359 *
1360 * This module provides run-time version information.
1361 */
1362#define POLARSSL_VERSION_C
1363
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001364/**
1365 * \def POLARSSL_X509_PARSE_C
1366 *
1367 * Enable X.509 certificate parsing.
1368 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001369 * Module: library/x509parse.c
1370 * Caller: library/ssl_cli.c
1371 * library/ssl_srv.c
1372 * library/ssl_tls.c
1373 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001374 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001375 * POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001376 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001377 * This module is required for X.509 certificate parsing.
1378 */
Paul Bakker40e46942009-01-03 21:51:57 +00001379#define POLARSSL_X509_PARSE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001380
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001381/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001382 * \def POLARSSL_X509_WRITE_C
1383 *
1384 * Enable X.509 buffer writing.
1385 *
1386 * Module: library/x509write.c
1387 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001388 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_RSA_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001389 *
1390 * This module is required for X.509 certificate request writing.
1391 */
1392#define POLARSSL_X509_WRITE_C
1393
1394/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001395 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001396 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001397 * Enable the XTEA block cipher.
1398 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001399 * Module: library/xtea.c
1400 * Caller:
1401 */
1402#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001403
Paul Bakker0a62cd12011-01-21 11:00:08 +00001404/* \} name */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001405
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001406/**
1407 * \name SECTION: Module configuration options
1408 *
1409 * This section allows for the setting of module specific sizes and
1410 * configuration options. The default values are already present in the
1411 * relevant header files and should suffice for the regular use cases.
1412 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1413 * only if you have a good reason and know the consequences.
1414 *
1415 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1416 * header file take precedence.
1417 *
1418 * Please check the respective header file for documentation on these
1419 * parameters (to prevent duplicate documentation).
1420 *
1421 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1422 * \{
1423 */
1424//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1425
1426#if defined(POLARSSL_CONFIG_OPTIONS)
1427
1428// MPI / BIGNUM options
1429//
1430#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1431#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1432
1433// CTR_DRBG options
1434//
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001435#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 +02001436#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1437#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1438#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1439#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1440
1441// Entropy options
1442//
1443#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1444#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1445
Paul Bakker6e339b52013-07-03 13:37:05 +02001446// Memory options
1447#define MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1448#define POLARSSL_MEMORY_STDMALLOC malloc /**< Default allocator to use, can be undefined */
1449#define POLARSSL_MEMORY_STDFREE free /**< Default free to use, can be undefined */
1450
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001451// SSL Cache options
1452//
1453#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1454#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1455
1456// SSL options
1457//
1458#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
Paul Bakker606b4ba2013-08-14 16:52:14 +02001459#define SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001460
1461#endif /* POLARSSL_CONFIG_OPTIONS */
1462
1463/* \} name */
1464
Paul Bakker7ad00f92013-04-18 23:05:25 +02001465/*
1466 * Sanity checks on defines and dependencies
1467 */
1468#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1469#error "POLARSSL_DHM_C defined, but not all prerequisites"
1470#endif
1471
1472#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1473#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1474#endif
1475
1476#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1477#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1478#endif
1479
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001480#if defined(POLARSSL_ECDSA_C) && \
1481 ( !defined(POLARSSL_ECP_C) || \
1482 !defined(POLARSSL_ASN1_PARSE_C) || \
1483 !defined(POLARSSL_ASN1_WRITE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001484#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1485#endif
1486
1487#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
1488#error "POLARSSL_ECP_C defined, but not all prerequisites"
1489#endif
1490
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001491#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
1492 !defined(POLARSSL_SHA256_C))
Paul Bakker7ad00f92013-04-18 23:05:25 +02001493#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1494#endif
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001495#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
1496 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
1497#error "CTR_DRBG_ENTROPY_LEN value too high"
1498#endif
1499#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA512_C) && \
1500 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
1501#error "CTR_DRBG_ENTROPY_LEN value too high"
1502#endif
Paul Bakker7ad00f92013-04-18 23:05:25 +02001503
1504#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1505#error "POLARSSL_GCM_C defined, but not all prerequisites"
1506#endif
1507
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001508#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
1509#error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
1510#endif
1511
Paul Bakkere07f41d2013-04-19 09:08:57 +02001512#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1513#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1514#endif
1515
1516#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1517 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
Paul Bakker48377d92013-08-30 12:06:24 +02001518 !defined(POLARSSL_X509_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001519#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1520#endif
1521
1522#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1523 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
Paul Bakker48377d92013-08-30 12:06:24 +02001524 !defined(POLARSSL_X509_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001525#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1526#endif
1527
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +02001528#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
1529 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \
1530 !defined(POLARSSL_X509_PARSE_C) )
1531#error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
1532#endif
1533
Paul Bakkere07f41d2013-04-19 09:08:57 +02001534#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
Paul Bakker48377d92013-08-30 12:06:24 +02001535 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) || \
1536 !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001537#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1538#endif
1539
1540#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
Paul Bakker48377d92013-08-30 12:06:24 +02001541 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_PARSE_C) || \
1542 !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001543#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1544#endif
1545
Paul Bakker6e339b52013-07-03 13:37:05 +02001546#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && !defined(POLARSSL_MEMORY_C)
1547#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
1548#endif
1549
Paul Bakker7ad00f92013-04-18 23:05:25 +02001550#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1551#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1552#endif
1553
1554#if defined(POLARSSL_PEM_C) && !defined(POLARSSL_PEM_C)
1555#error "POLARSSL_PEM_C defined, but not all prerequisites"
1556#endif
1557
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001558#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001559#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1560#endif
1561
1562#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1563 !defined(POLARSSL_OID_C) )
1564#error "POLARSSL_RSA_C defined, but not all prerequisites"
1565#endif
1566
1567#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1568#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1569#endif
1570
Paul Bakker577e0062013-08-28 11:57:20 +02001571#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \
1572 !defined(POLARSSL_PK_C) || !defined(POLARSSL_MD_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001573#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1574#endif
1575
1576#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1577#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1578#endif
1579
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001580#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
1581 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
1582 !defined(POLARSSL_SSL_PROTO_TLS1_2))
1583#error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
1584#endif
1585
1586#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1587 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
1588#error "Illegal protocol selection"
1589#endif
1590
1591#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
1592 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
1593#error "Illegal protocol selection"
1594#endif
1595
1596#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1597 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
1598 !defined(POLARSSL_SSL_PROTO_TLS1_1)))
1599#error "Illegal protocol selection"
1600#endif
1601
Paul Bakker59da0a42013-08-19 13:27:17 +02001602#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
1603 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) )
1604#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
1605#endif
1606
Paul Bakker7ad00f92013-04-18 23:05:25 +02001607#if defined(POLARSSL_X509_PARSE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1608 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001609 !defined(POLARSSL_PK_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001610#error "POLARSSL_X509_PARSE_C defined, but not all prerequisites"
1611#endif
1612
1613#if defined(POLARSSL_X509_WRITE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1614 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
1615 !defined(POLARSSL_RSA_C) )
1616#error "POLARSSL_X509_WRITE_C defined, but not all prerequisites"
1617#endif
1618
Paul Bakker5121ce52009-01-03 21:22:43 +00001619#endif /* config.h */