blob: 0e725d3034f19b75ec70e01cd24e606f370a3517 [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 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +020074 * The compiler has support for asm().
Paul Bakker68041ec2009-04-19 21:17:55 +000075 *
76 * Requires support for asm() in compiler.
77 *
78 * Used in:
79 * library/timing.c
80 * library/padlock.c
81 * include/polarssl/bn_mul.h
82 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +020083 * Comment to disable the use of assembly code.
Paul Bakker5121ce52009-01-03 21:22:43 +000084 */
Paul Bakker40e46942009-01-03 21:51:57 +000085#define POLARSSL_HAVE_ASM
Paul Bakker5121ce52009-01-03 21:22:43 +000086
Paul Bakkerf3b86c12011-01-27 15:24:17 +000087/**
88 * \def POLARSSL_HAVE_SSE2
89 *
Paul Bakkere23c3152012-10-01 14:42:47 +000090 * CPU supports SSE2 instruction set.
Paul Bakkerf3b86c12011-01-27 15:24:17 +000091 *
Paul Bakker5121ce52009-01-03 21:22:43 +000092 * Uncomment if the CPU supports SSE2 (IA-32 specific).
Paul Bakker40e46942009-01-03 21:51:57 +000093#define POLARSSL_HAVE_SSE2
Paul Bakker5121ce52009-01-03 21:22:43 +000094 */
Paul Bakkerfa9b1002013-07-03 15:31:03 +020095
96/**
Paul Bakkerbe089b02013-10-14 15:51:50 +020097 * \def POLARSSL_HAVE_READDIR_R
98 *
99 * (Non Windows) System has readdir_r().
100 *
101 * Required for x509_crt_parse_path() in non-Windows systems.
102 *
103 * Comment if your system does not have support.
104 */
105#define POLARSSL_HAVE_READDIR_R
106
107/**
Paul Bakkerfa9b1002013-07-03 15:31:03 +0200108 * \def POLARSSL_HAVE_TIME
109 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200110 * System has time.h and time() / localtime() / gettimeofday().
Paul Bakkerfa9b1002013-07-03 15:31:03 +0200111 *
112 * Comment if your system does not support time functions
113 */
114#define POLARSSL_HAVE_TIME
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200115/* \} name SECTION: System support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000116
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000117/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000118 * \name SECTION: PolarSSL feature support
119 *
120 * This section sets support for features that are or are not needed
121 * within the modules that are enabled.
122 * \{
123 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000124
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000125/**
Paul Bakker90995b52013-06-24 19:20:35 +0200126 * \def POLARSSL_XXX_ALT
127 *
128 * Uncomment a macro to let PolarSSL use your alternate core implementation of
129 * a symmetric or hash algorithm (e.g. platform specific assembly optimized
130 * implementations). Keep in mind that the function prototypes should remain
131 * the same.
132 *
133 * Example: In case you uncomment POLARSSL_AES_ALT, PolarSSL will no longer
134 * provide the "struct aes_context" definition and omit the base function
135 * declarations and implementations. "aes_alt.h" will be included from
136 * "aes.h" to include the new function definitions.
137 *
138 * Uncomment a macro to enable alternate implementation for core algorithm
139 * functions
140#define POLARSSL_AES_ALT
141#define POLARSSL_ARC4_ALT
142#define POLARSSL_BLOWFISH_ALT
143#define POLARSSL_CAMELLIA_ALT
144#define POLARSSL_DES_ALT
145#define POLARSSL_XTEA_ALT
146#define POLARSSL_MD2_ALT
147#define POLARSSL_MD4_ALT
148#define POLARSSL_MD5_ALT
149#define POLARSSL_SHA1_ALT
Paul Bakker9e36f042013-06-30 14:34:05 +0200150#define POLARSSL_SHA256_ALT
151#define POLARSSL_SHA512_ALT
Paul Bakker90995b52013-06-24 19:20:35 +0200152 */
153
154/**
Paul Bakker15566e42011-04-24 21:19:15 +0000155 * \def POLARSSL_AES_ROM_TABLES
156 *
157 * Store the AES tables in ROM.
158 *
159 * Uncomment this macro to store the AES tables in ROM.
160 *
161#define POLARSSL_AES_ROM_TABLES
162 */
163
164/**
Manuel Pégourié-Gonnardf7dc3782013-09-13 14:10:44 +0200165 * \def POLARSSL_CIPHER_MODE_CBC
166 *
167 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
168 */
169#define POLARSSL_CIPHER_MODE_CBC
170
171/**
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000172 * \def POLARSSL_CIPHER_MODE_CFB
173 *
174 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
175 */
176#define POLARSSL_CIPHER_MODE_CFB
177
178/**
179 * \def POLARSSL_CIPHER_MODE_CTR
180 *
181 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
182 */
183#define POLARSSL_CIPHER_MODE_CTR
184
185/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000186 * \def POLARSSL_CIPHER_NULL_CIPHER
187 *
188 * Enable NULL cipher.
189 * Warning: Only do so when you know what you are doing. This allows for
190 * encryption or channels without any security!
191 *
192 * Requires POLARSSL_ENABLE_WEAK_CIPHERSUITES as well to enable
193 * the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000194 * TLS_RSA_WITH_NULL_MD5
195 * TLS_RSA_WITH_NULL_SHA
196 * TLS_RSA_WITH_NULL_SHA256
Paul Bakker41c83d32013-03-20 14:39:14 +0100197 * TLS_ECDHE_RSA_WITH_NULL_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200198 * TLS_PSK_WITH_NULL
199 * TLS_PSK_WITH_NULL256
200 * TLS_PSK_WITH_NULL384
201 * TLS_DHE_PSK_WITH_NULL
202 * TLS_DHE_PSK_WITH_NULL256
203 * TLS_DHE_PSK_WITH_NULL384
204 * TLS_RSA_PSK_WITH_NULL
205 * TLS_RSA_PSK_WITH_NULL256
206 * TLS_RSA_PSK_WITH_NULL384
Paul Bakkerfab5c822012-02-06 16:45:10 +0000207 *
208 * Uncomment this macro to enable the NULL cipher and ciphersuites
209#define POLARSSL_CIPHER_NULL_CIPHER
210 */
211
212/**
Paul Bakker48e93c82013-08-14 12:21:18 +0200213 * \def POLARSSL_CIPHER_PADDING_XXX
214 *
215 * Uncomment or comment macros to add support for specific padding modes
216 * in the cipher layer with cipher modes that support padding (e.g. CBC)
217 *
218 * If you disable all padding modes, only full blocks can be used with CBC.
219 *
220 * Enable padding modes in the cipher layer.
221 */
222#define POLARSSL_CIPHER_PADDING_PKCS7
223#define POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS
224#define POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN
225#define POLARSSL_CIPHER_PADDING_ZEROS
226
227/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000228 * \def POLARSSL_ENABLE_WEAK_CIPHERSUITES
229 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200230 * Enable weak ciphersuites in SSL / TLS.
Paul Bakkerfab5c822012-02-06 16:45:10 +0000231 * Warning: Only do so when you know what you are doing. This allows for
Paul Bakker9a736322012-11-14 12:39:52 +0000232 * channels with virtually no security at all!
Paul Bakkerfab5c822012-02-06 16:45:10 +0000233 *
234 * This enables the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000235 * TLS_RSA_WITH_DES_CBC_SHA
236 * TLS_DHE_RSA_WITH_DES_CBC_SHA
Paul Bakkerfab5c822012-02-06 16:45:10 +0000237 *
238 * Uncomment this macro to enable weak ciphersuites
239#define POLARSSL_ENABLE_WEAK_CIPHERSUITES
240 */
241
242/**
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200243 * \def POLARSSL_ECP_XXXX_ENABLED
244 *
245 * Enables specific curves within the Elliptic Curve module.
246 * By default all supported curves are enables.
247 *
248 * Comment macros to disable the curve and functions for it
249 */
250#define POLARSSL_ECP_DP_SECP192R1_ENABLED
251#define POLARSSL_ECP_DP_SECP224R1_ENABLED
252#define POLARSSL_ECP_DP_SECP256R1_ENABLED
253#define POLARSSL_ECP_DP_SECP384R1_ENABLED
254#define POLARSSL_ECP_DP_SECP521R1_ENABLED
Manuel Pégourié-Gonnard8195c1a2013-10-07 19:40:41 +0200255#define POLARSSL_ECP_DP_BP256R1_ENABLED
256#define POLARSSL_ECP_DP_BP384R1_ENABLED
257#define POLARSSL_ECP_DP_BP512R1_ENABLED
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200258
259/**
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200260 * \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED
261 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200262 * Enable the PSK based ciphersuite modes in SSL / TLS.
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200263 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200264 * This enables the following ciphersuites (if other requisites are
265 * enabled as well):
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200266 * TLS_PSK_WITH_RC4_128_SHA
267 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
268 * TLS_PSK_WITH_AES_128_CBC_SHA
269 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200270 * TLS_PSK_WITH_AES_128_CBC_SHA256
271 * TLS_PSK_WITH_AES_256_CBC_SHA384
272 * TLS_PSK_WITH_AES_128_GCM_SHA256
273 * TLS_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200274 */
275#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED
276
277/**
Paul Bakkere07f41d2013-04-19 09:08:57 +0200278 * \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
279 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200280 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200281 *
282 * Requires: POLARSSL_DHM_C
283 *
284 * This enables the following ciphersuites (if other requisites are
285 * enabled as well):
286 * TLS_DHE_PSK_WITH_RC4_128_SHA
287 * TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
288 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA
289 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200290 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
291 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
292 * TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
293 * TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200294 */
Paul Bakker48f7a5d2013-04-19 14:30:58 +0200295#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200296
297/**
298 * \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
299 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200300 * Enable the RSA-PSK based ciphersuite modes in SSL / TLS.
Paul Bakker45bda902013-04-19 22:28:21 +0200301 * (NOT YET IMPLEMENTED)
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +0200302 * Requires: POLARSSL_RSA_C, POLARSSL_PKCS1_V15,
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +0200303 * POLARSSL_X509_CRT_PARSE_C
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_PSK_WITH_RC4_128_SHA
308 * TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
309 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA
310 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200311 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
312 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
313 * TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
314 * TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200315#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
316 */
317
318/**
319 * \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED
320 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200321 * Enable the RSA-only based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200322 *
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +0200323 * Requires: POLARSSL_RSA_C, POLARSSL_PKCS1_V15,
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +0200324 * POLARSSL_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200325 *
326 * This enables the following ciphersuites (if other requisites are
327 * enabled as well):
328 * TLS_RSA_WITH_AES_128_CBC_SHA
329 * TLS_RSA_WITH_AES_256_CBC_SHA
330 * TLS_RSA_WITH_AES_128_CBC_SHA256
331 * TLS_RSA_WITH_AES_256_CBC_SHA256
332 * TLS_RSA_WITH_AES_128_GCM_SHA256
333 * TLS_RSA_WITH_AES_256_GCM_SHA384
334 * TLS_RSA_WITH_RC4_128_MD5
335 * TLS_RSA_WITH_RC4_128_SHA
336 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
337 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
338 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
339 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
340 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
341 */
342#define POLARSSL_KEY_EXCHANGE_RSA_ENABLED
343
344/**
345 * \def POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
346 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200347 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200348 *
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +0200349 * Requires: POLARSSL_DHM_C, POLARSSL_RSA_C, POLARSSL_PKCS1_V15,
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +0200350 * POLARSSL_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200351 *
352 * This enables the following ciphersuites (if other requisites are
353 * enabled as well):
354 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
355 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
356 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
357 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
358 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
359 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
360 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
361 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
362 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
363 */
364#define POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
365
366/**
367 * \def POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
368 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200369 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200370 *
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +0200371 * Requires: POLARSSL_ECDH_C, POLARSSL_RSA_C, POLARSSL_PKCS1_V15,
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +0200372 * POLARSSL_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200373 *
374 * This enables the following ciphersuites (if other requisites are
375 * enabled as well):
376 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
377 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
378 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
379 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
380 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
381 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
382 * TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
383 * TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
384 * TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
385 * TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
386 */
387#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
388
389/**
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200390 * \def POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
391 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200392 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200393 *
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +0200394 * Requires: POLARSSL_ECDH_C, POLARSSL_ECDSA_C, POLARSSL_X509_CRT_PARSE_C,
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200395 *
396 * This enables the following ciphersuites (if other requisites are
397 * enabled as well):
398 * TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
399 * TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
400 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
401 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
402 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
403 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
404 * TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
405 * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
406 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
407 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
408 */
409#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
410
411/**
Paul Bakkere2ab84f2013-06-29 18:24:32 +0200412 * \def POLARSSL_ERROR_STRERROR_BC
413 *
414 * Make available the backward compatible error_strerror() next to the
415 * current polarssl_strerror().
416 *
417 * Disable if you run into name conflicts and want to really remove the
418 * error_strerror()
419 */
420#define POLARSSL_ERROR_STRERROR_BC
421
422/**
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100423 * \def POLARSSL_ERROR_STRERROR_DUMMY
424 *
Paul Bakkereba3ccf2013-09-09 15:55:12 +0200425 * Enable a dummy error function to make use of polarssl_strerror() in
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100426 * third party libraries easier.
427 *
428 * Disable if you run into name conflicts and want to really remove the
Paul Bakkereba3ccf2013-09-09 15:55:12 +0200429 * polarssl_strerror()
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100430 */
431#define POLARSSL_ERROR_STRERROR_DUMMY
432
433/**
Paul Bakker15566e42011-04-24 21:19:15 +0000434 * \def POLARSSL_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000435 *
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200436 * Enable the prime-number generation code.
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200437 *
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200438 * Requires: POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000439 */
Paul Bakker15566e42011-04-24 21:19:15 +0000440#define POLARSSL_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000441
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000442/**
Paul Bakker335db3f2011-04-25 15:28:35 +0000443 * \def POLARSSL_FS_IO
444 *
445 * Enable functions that use the filesystem.
446 */
447#define POLARSSL_FS_IO
448
449/**
Paul Bakker43655f42011-12-15 20:11:16 +0000450 * \def POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
451 *
452 * Do not add default entropy sources. These are the platform specific,
453 * hardclock and HAVEGE based poll functions.
454 *
455 * This is useful to have more control over the added entropy sources in an
456 * application.
457 *
458 * Uncomment this macro to prevent loading of default entropy functions.
459#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
460 */
461
462/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000463 * \def POLARSSL_NO_PLATFORM_ENTROPY
464 *
465 * Do not use built-in platform entropy functions.
466 * This is useful if your platform does not support
467 * standards like the /dev/urandom or Windows CryptoAPI.
468 *
469 * Uncomment this macro to disable the built-in platform entropy functions.
470#define POLARSSL_NO_PLATFORM_ENTROPY
471 */
472
473/**
Paul Bakker6e339b52013-07-03 13:37:05 +0200474 * \def POLARSSL_MEMORY_DEBUG
475 *
476 * Enable debugging of buffer allocator memory issues. Automatically prints
477 * (to stderr) all (fatal) messages on memory allocation issues. Enables
478 * function for 'debug output' of allocated memory.
479 *
480 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
481 * fprintf()
482 *
483 * Uncomment this macro to let the buffer allocator print out error messages.
484#define POLARSSL_MEMORY_DEBUG
485*/
486
487/**
488 * \def POLARSSL_MEMORY_BACKTRACE
489 *
490 * Include backtrace information with each allocated block.
491 *
492 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
493 * GLIBC-compatible backtrace() an backtrace_symbols() support
494 *
495 * Uncomment this macro to include backtrace information
496#define POLARSSL_MEMORY_BACKTRACE
497 */
498
499/**
Paul Bakker48377d92013-08-30 12:06:24 +0200500 * \def POLARSSL_PKCS1_V15
501 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200502 * Enable support for PKCS#1 v1.5 encoding.
503 *
Paul Bakker48377d92013-08-30 12:06:24 +0200504 * Requires: POLARSSL_RSA_C
505 *
Paul Bakker48377d92013-08-30 12:06:24 +0200506 * This enables support for PKCS#1 v1.5 operations.
507 */
508#define POLARSSL_PKCS1_V15
509
510/**
Paul Bakker9dcc3222011-03-08 14:16:06 +0000511 * \def POLARSSL_PKCS1_V21
512 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200513 * Enable support for PKCS#1 v2.1 encoding.
514 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000515 * Requires: POLARSSL_MD_C, POLARSSL_RSA_C
516 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000517 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
518 */
519#define POLARSSL_PKCS1_V21
520
521/**
Paul Bakker0216cc12011-03-26 13:40:23 +0000522 * \def POLARSSL_RSA_NO_CRT
523 *
524 * Do not use the Chinese Remainder Theorem for the RSA private operation.
525 *
526 * Uncomment this macro to disable the use of CRT in RSA.
527 *
528#define POLARSSL_RSA_NO_CRT
529 */
Paul Bakker15566e42011-04-24 21:19:15 +0000530
531/**
532 * \def POLARSSL_SELF_TEST
533 *
534 * Enable the checkup functions (*_self_test).
535 */
536#define POLARSSL_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000537
538/**
Paul Bakker40865c82013-01-31 17:13:13 +0100539 * \def POLARSSL_SSL_ALL_ALERT_MESSAGES
540 *
541 * Enable sending of alert messages in case of encountered errors as per RFC.
542 * If you choose not to send the alert messages, PolarSSL can still communicate
543 * with other servers, only debugging of failures is harder.
544 *
545 * The advantage of not sending alert messages, is that no information is given
546 * about reasons for failures thus preventing adversaries of gaining intel.
547 *
548 * Enable sending of all alert messages
549 */
550#define POLARSSL_SSL_ALERT_MESSAGES
551
552/**
Paul Bakkerd66f0702013-01-31 16:57:45 +0100553 * \def POLARSSL_SSL_DEBUG_ALL
554 *
555 * Enable the debug messages in SSL module for all issues.
556 * Debug messages have been disabled in some places to prevent timing
557 * attacks due to (unbalanced) debugging function calls.
558 *
559 * If you need all error reporting you should enable this during debugging,
560 * but remove this for production servers that should log as well.
561 *
562 * Uncomment this macro to report all debug messages on errors introducing
563 * a timing side-channel.
564 *
565#define POLARSSL_SSL_DEBUG_ALL
566 */
567
568/**
Paul Bakker05ef8352012-05-08 09:17:57 +0000569 * \def POLARSSL_SSL_HW_RECORD_ACCEL
570 *
571 * Enable hooking functions in SSL module for hardware acceleration of
572 * individual records.
573 *
574 * Uncomment this macro to enable hooking functions.
575#define POLARSSL_SSL_HW_RECORD_ACCEL
576 */
577
578/**
Paul Bakker78a8c712013-03-06 17:01:52 +0100579 * \def POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
580 *
581 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200582 * SSL Server module (POLARSSL_SSL_SRV_C).
Paul Bakker78a8c712013-03-06 17:01:52 +0100583 *
584 * Comment this macro to disable support for SSLv2 Client Hello messages.
585 */
586#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
587
588/**
Paul Bakker05decb22013-08-15 13:33:48 +0200589 * \def POLARSSL_SSL_MAX_FRAGMENT_LENGTH
590 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200591 * Enable support for RFC 6066 max_fragment_length extension in SSL.
Paul Bakker05decb22013-08-15 13:33:48 +0200592 *
593 * Comment this macro to disable support for the max_fragment_length extension
594 */
595#define POLARSSL_SSL_MAX_FRAGMENT_LENGTH
596
597/**
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200598 * \def POLARSSL_SSL_PROTO_SSL3
599 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200600 * Enable support for SSL 3.0.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200601 *
602 * Requires: POLARSSL_MD5_C
603 * POLARSSL_SHA1_C
604 *
605 * Comment this macro to disable support for SSL 3.0
606 */
607#define POLARSSL_SSL_PROTO_SSL3
608
609/**
610 * \def POLARSSL_SSL_PROTO_TLS1
611 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200612 * Enable support for TLS 1.0.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200613 *
614 * Requires: POLARSSL_MD5_C
615 * POLARSSL_SHA1_C
616 *
617 * Comment this macro to disable support for TLS 1.0
618 */
619#define POLARSSL_SSL_PROTO_TLS1
620
621/**
622 * \def POLARSSL_SSL_PROTO_TLS1_1
623 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200624 * Enable support for TLS 1.1.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200625 *
626 * Requires: POLARSSL_MD5_C
627 * POLARSSL_SHA1_C
628 *
629 * Comment this macro to disable support for TLS 1.1
630 */
631#define POLARSSL_SSL_PROTO_TLS1_1
632
633/**
634 * \def POLARSSL_SSL_PROTO_TLS1_2
635 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200636 * Enable support for TLS 1.2.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200637 *
638 * Requires: POLARSSL_SHA256_C or POLARSSL_SHA512_C
639 * (Depends on ciphersuites)
640 *
641 * Comment this macro to disable support for TLS 1.2
642 */
643#define POLARSSL_SSL_PROTO_TLS1_2
644
645/**
Paul Bakkera503a632013-08-14 13:48:06 +0200646 * \def POLARSSL_SSL_SESSION_TICKETS
647 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200648 * Enable support for RFC 5077 session tickets in SSL.
Paul Bakkera503a632013-08-14 13:48:06 +0200649 *
650 * Requires: POLARSSL_AES_C
651 * POLARSSL_SHA256_C
Manuel Pégourié-Gonnard92cb1d32013-09-13 16:24:20 +0200652 * POLARSSL_CIPHER_MODE_CBC
Paul Bakkera503a632013-08-14 13:48:06 +0200653 *
654 * Comment this macro to disable support for SSL session tickets
655 */
656#define POLARSSL_SSL_SESSION_TICKETS
657
658/**
Paul Bakker0be444a2013-08-27 21:55:01 +0200659 * \def POLARSSL_SSL_SERVER_NAME_INDICATION
660 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200661 * Enable support for RFC 6066 server name indication (SNI) in SSL.
Paul Bakker0be444a2013-08-27 21:55:01 +0200662 *
663 * Comment this macro to disable support for server name indication in SSL
664 */
665#define POLARSSL_SSL_SERVER_NAME_INDICATION
666
667/**
Paul Bakker1f2bc622013-08-15 13:45:55 +0200668 * \def POLARSSL_SSL_TRUNCATED_HMAC
669 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200670 * Enable support for RFC 6066 truncated HMAC in SSL.
Paul Bakker1f2bc622013-08-15 13:45:55 +0200671 *
672 * Comment this macro to disable support for truncated HMAC in SSL
673 */
674#define POLARSSL_SSL_TRUNCATED_HMAC
675
676/**
Paul Bakker2466d932013-09-28 14:40:38 +0200677 * \def POLARSSL_THREADING_ALT
678 *
679 * Provide your own alternate threading implementation.
680 *
681 * Requires: POLARSSL_THREADING_C
682 *
683 * Uncomment this to allow your own alternate threading implementation.
684#define POLARSSL_THREADING_ALT
685 */
686
687/**
688 * \def POLARSSL_THREADING_DUMMY
689 *
690 * Provide a dummy threading implementation.
Paul Bakker6838bd12013-09-30 13:56:38 +0200691 * Warning: If you use this, all claims of thread-safety in the documentation
692 * are void!
Paul Bakker2466d932013-09-28 14:40:38 +0200693 *
694 * Requires: POLARSSL_THREADING_C
695 *
696 * Uncomment this to enable code to compile like with threading enabled
697#define POLARSSL_THREADING_DUMMY
698 */
699
700/**
701 * \def POLARSSL_THREADING_PTHREAD
702 *
703 * Enable the pthread wrapper layer for the threading layer.
704 *
705 * Requires: POLARSSL_THREADING_C
706 *
707 * Uncomment this to enable pthread mutexes.
708#define POLARSSL_THREADING_PTHREAD
709 */
710
711/**
Paul Bakkerc27c4e22013-09-23 15:01:36 +0200712 * \def POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3
713 *
714 * If set, the X509 parser will not break-off when parsing an X509 certificate
715 * and encountering an extension in a v1 or v2 certificate.
716 *
717 * Uncomment to prevent an error.
718 *
719#define POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3
720 */
721
722/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000723 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
724 *
725 * If set, the X509 parser will not break-off when parsing an X509 certificate
726 * and encountering an unknown critical extension.
727 *
728 * Uncomment to prevent an error.
729 *
730#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
731 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000732
733/**
734 * \def POLARSSL_ZLIB_SUPPORT
735 *
736 * If set, the SSL/TLS module uses ZLIB to support compression and
737 * decompression of packet data.
738 *
739 * Used in: library/ssl_tls.c
740 * library/ssl_cli.c
741 * library/ssl_srv.c
742 *
743 * This feature requires zlib library and headers to be present.
744 *
745 * Uncomment to enable use of ZLIB
746#define POLARSSL_ZLIB_SUPPORT
747 */
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200748/* \} name SECTION: PolarSSL feature support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000749
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000750/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000751 * \name SECTION: PolarSSL modules
752 *
753 * This section enables or disables entire modules in PolarSSL
754 * \{
755 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000756
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000757/**
758 * \def POLARSSL_AES_C
759 *
760 * Enable the AES block cipher.
761 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000762 * Module: library/aes.c
763 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000764 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000765 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000766 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000767 * This module enables the following ciphersuites (if other requisites are
768 * enabled as well):
769 * TLS_RSA_WITH_AES_128_CBC_SHA
770 * TLS_RSA_WITH_AES_256_CBC_SHA
771 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
772 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
773 * TLS_RSA_WITH_AES_128_CBC_SHA256
774 * TLS_RSA_WITH_AES_256_CBC_SHA256
775 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
776 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
777 * TLS_RSA_WITH_AES_128_GCM_SHA256
778 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100779 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
780 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200781 * TLS_PSK_WITH_AES_128_CBC_SHA
782 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100783 *
Paul Bakkercff68422013-09-15 20:43:33 +0200784 * PEM_PARSE uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000785 */
Paul Bakker40e46942009-01-03 21:51:57 +0000786#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000787
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000788/**
789 * \def POLARSSL_ARC4_C
790 *
791 * Enable the ARCFOUR stream cipher.
792 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000793 * Module: library/arc4.c
794 * Caller: library/ssl_tls.c
795 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100796 * This module enables the following ciphersuites (if other requisites are
797 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000798 * TLS_RSA_WITH_RC4_128_MD5
799 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100800 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200801 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000802 */
Paul Bakker40e46942009-01-03 21:51:57 +0000803#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000804
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000805/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000806 * \def POLARSSL_ASN1_PARSE_C
807 *
808 * Enable the generic ASN1 parser.
809 *
810 * Module: library/asn1.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200811 * Caller: library/x509.c
812 * library/dhm.c
813 * library/pkcs12.c
814 * library/pkcs5.c
815 * library/pkparse.c
Paul Bakkerefc30292011-11-10 14:43:23 +0000816 */
817#define POLARSSL_ASN1_PARSE_C
818
819/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000820 * \def POLARSSL_ASN1_WRITE_C
821 *
822 * Enable the generic ASN1 writer.
823 *
824 * Module: library/asn1write.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200825 * Caller: library/ecdsa.c
826 * library/pkwrite.c
827 * library/x509_create.c
828 * library/x509write_crt.c
829 * library/x509write_csr.c
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000830 */
831#define POLARSSL_ASN1_WRITE_C
832
833/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000834 * \def POLARSSL_BASE64_C
835 *
836 * Enable the Base64 module.
837 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000838 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000839 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000840 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000841 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000842 */
Paul Bakker40e46942009-01-03 21:51:57 +0000843#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000844
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000845/**
846 * \def POLARSSL_BIGNUM_C
847 *
Paul Bakker9a736322012-11-14 12:39:52 +0000848 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000849 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000850 * Module: library/bignum.c
851 * Caller: library/dhm.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200852 * library/ecp.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000853 * library/rsa.c
854 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000855 *
856 * This module is required for RSA and DHM support.
857 */
Paul Bakker40e46942009-01-03 21:51:57 +0000858#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000859
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000860/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000861 * \def POLARSSL_BLOWFISH_C
862 *
863 * Enable the Blowfish block cipher.
864 *
865 * Module: library/blowfish.c
866 */
867#define POLARSSL_BLOWFISH_C
868
869/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000870 * \def POLARSSL_CAMELLIA_C
871 *
872 * Enable the Camellia block cipher.
873 *
Paul Bakker38119b12009-01-10 23:31:23 +0000874 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000875 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000876 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000877 * This module enables the following ciphersuites (if other requisites are
878 * enabled as well):
879 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
880 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
881 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
882 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
883 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
884 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
885 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
886 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000887 */
888#define POLARSSL_CAMELLIA_C
889
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000890/**
891 * \def POLARSSL_CERTS_C
892 *
893 * Enable the test certificates.
894 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000895 * Module: library/certs.c
896 * Caller:
897 *
898 * This module is used for testing (ssl_client/server).
899 */
Paul Bakker40e46942009-01-03 21:51:57 +0000900#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000901
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000902/**
903 * \def POLARSSL_CIPHER_C
904 *
905 * Enable the generic cipher layer.
906 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000907 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +0200908 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +0000909 *
910 * Uncomment to enable generic cipher wrappers.
911 */
912#define POLARSSL_CIPHER_C
913
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000914/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000915 * \def POLARSSL_CTR_DRBG_C
916 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200917 * Enable the CTR_DRBG AES-256-based random generator.
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000918 *
919 * Module: library/ctr_drbg.c
920 * Caller:
921 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000922 * Requires: POLARSSL_AES_C
923 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000924 * This module provides the CTR_DRBG AES-256 random number generator.
925 */
926#define POLARSSL_CTR_DRBG_C
927
928/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000929 * \def POLARSSL_DEBUG_C
930 *
931 * Enable the debug functions.
932 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000933 * Module: library/debug.c
934 * Caller: library/ssl_cli.c
935 * library/ssl_srv.c
936 * library/ssl_tls.c
937 *
938 * This module provides debugging functions.
939 */
Paul Bakker40e46942009-01-03 21:51:57 +0000940#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000941
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000942/**
943 * \def POLARSSL_DES_C
944 *
945 * Enable the DES block cipher.
946 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000947 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100948 * Caller: library/pem.c
949 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000950 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000951 * This module enables the following ciphersuites (if other requisites are
952 * enabled as well):
953 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
954 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100955 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200956 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100957 *
Paul Bakkercff68422013-09-15 20:43:33 +0200958 * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000959 */
Paul Bakker40e46942009-01-03 21:51:57 +0000960#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000961
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000962/**
963 * \def POLARSSL_DHM_C
964 *
965 * Enable the Diffie-Hellman-Merkle key exchange.
966 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000967 * Module: library/dhm.c
968 * Caller: library/ssl_cli.c
969 * library/ssl_srv.c
970 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000971 * This module enables the following ciphersuites (if other requisites are
972 * enabled as well):
973 * TLS_DHE_RSA_WITH_DES_CBC_SHA
974 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
975 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
976 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
977 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
978 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
979 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
980 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
981 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
982 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
983 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
984 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000985 */
Paul Bakker40e46942009-01-03 21:51:57 +0000986#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000987
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000988/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100989 * \def POLARSSL_ECDH_C
990 *
991 * Enable the elliptic curve Diffie-Hellman library.
992 *
993 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100994 * Caller: library/ssl_cli.c
995 * library/ssl_srv.c
996 *
997 * This module enables the following ciphersuites (if other requisites are
998 * enabled as well):
999 * TLS_ECDHE_RSA_WITH_NULL_SHA
1000 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
1001 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
1002 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
1003 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001004 *
1005 * Requires: POLARSSL_ECP_C
1006 */
1007#define POLARSSL_ECDH_C
1008
1009/**
1010 * \def POLARSSL_ECDSA_C
1011 *
1012 * Enable the elliptic curve DSA library.
1013 *
1014 * Module: library/ecdsa.c
1015 * Caller:
1016 *
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001017 * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001018 */
1019#define POLARSSL_ECDSA_C
1020
1021/**
1022 * \def POLARSSL_ECP_C
1023 *
1024 * Enable the elliptic curve over GF(p) library.
1025 *
1026 * Module: library/ecp.c
1027 * Caller: library/ecdh.c
1028 * library/ecdsa.c
1029 *
Manuel Pégourié-Gonnardb8012fc2013-10-10 15:40:49 +02001030 * Requires: POLARSSL_BIGNUM_C and at least one POLARSSL_ECP_DP_XXX_ENABLED
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001031 */
1032#define POLARSSL_ECP_C
1033
1034/**
Paul Bakker6083fd22011-12-03 21:45:14 +00001035 * \def POLARSSL_ENTROPY_C
1036 *
1037 * Enable the platform-specific entropy code.
1038 *
1039 * Module: library/entropy.c
1040 * Caller:
1041 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001042 * Requires: POLARSSL_SHA512_C
Paul Bakker6083fd22011-12-03 21:45:14 +00001043 *
1044 * This module provides a generic entropy pool
1045 */
1046#define POLARSSL_ENTROPY_C
1047
1048/**
Paul Bakker9d781402011-05-09 16:17:09 +00001049 * \def POLARSSL_ERROR_C
1050 *
1051 * Enable error code to error string conversion.
1052 *
1053 * Module: library/error.c
1054 * Caller:
1055 *
1056 * This module enables err_strerror().
1057 */
1058#define POLARSSL_ERROR_C
1059
1060/**
Paul Bakker89e80c92012-03-20 13:50:09 +00001061 * \def POLARSSL_GCM_C
1062 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001063 * Enable the Galois/Counter Mode (GCM) for AES.
Paul Bakker89e80c92012-03-20 13:50:09 +00001064 *
1065 * Module: library/gcm.c
1066 *
1067 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +00001068 *
1069 * This module enables the following ciphersuites (if other requisites are
1070 * enabled as well):
1071 * TLS_RSA_WITH_AES_128_GCM_SHA256
1072 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +00001073 */
1074#define POLARSSL_GCM_C
1075
1076/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001077 * \def POLARSSL_HAVEGE_C
1078 *
1079 * Enable the HAVEGE random generator.
1080 *
Paul Bakker2a844242013-06-24 13:01:53 +02001081 * Warning: the HAVEGE random generator is not suitable for virtualized
1082 * environments
1083 *
1084 * Warning: the HAVEGE random generator is dependent on timing and specific
1085 * processor traits. It is therefore not advised to use HAVEGE as
1086 * your applications primary random generator or primary entropy pool
1087 * input. As a secondary input to your entropy pool, it IS able add
1088 * the (limited) extra entropy it provides.
1089 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001090 * Module: library/havege.c
1091 * Caller:
1092 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001093 * Requires: POLARSSL_TIMING_C
1094 *
Paul Bakker2a844242013-06-24 13:01:53 +02001095 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001096#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +02001097 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001098
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001099/**
1100 * \def POLARSSL_MD_C
1101 *
1102 * Enable the generic message digest layer.
1103 *
Paul Bakker17373852011-01-06 14:20:01 +00001104 * Module: library/md.c
1105 * Caller:
1106 *
1107 * Uncomment to enable generic message digest wrappers.
1108 */
1109#define POLARSSL_MD_C
1110
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001111/**
1112 * \def POLARSSL_MD2_C
1113 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001114 * Enable the MD2 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001115 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001116 * Module: library/md2.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001117 * Caller:
Paul Bakker5121ce52009-01-03 21:22:43 +00001118 *
1119 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
1120 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001121#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001122 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001123
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001124/**
1125 * \def POLARSSL_MD4_C
1126 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001127 * Enable the MD4 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001128 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001129 * Module: library/md4.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001130 * Caller:
Paul Bakker5121ce52009-01-03 21:22:43 +00001131 *
1132 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1133 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001134#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001135 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001136
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001137/**
1138 * \def POLARSSL_MD5_C
1139 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001140 * Enable the MD5 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001141 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001142 * Module: library/md5.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001143 * Caller: library/md.c
1144 * library/pem.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001145 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001146 *
1147 * This module is required for SSL/TLS and X.509.
Paul Bakkercff68422013-09-15 20:43:33 +02001148 * PEM_PARSE uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +00001149 */
Paul Bakker40e46942009-01-03 21:51:57 +00001150#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001151
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001152/**
Paul Bakker6e339b52013-07-03 13:37:05 +02001153 * \def POLARSSL_MEMORY_C
1154 *
1155 * Enable the memory allocation layer.
1156 * By default PolarSSL uses the system-provided malloc() and free().
1157 * (As long as POLARSSL_MEMORY_STDMALLOC and POLARSSL_MEMORY_STDFREE
1158 * are defined and unmodified)
1159 *
1160 * This allows different allocators (self-implemented or provided)
1161 *
1162 * Enable this layer to allow use of alternative memory allocators.
1163#define POLARSSL_MEMORY_C
1164 */
1165
1166/**
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001167 * \def POLARSSL_MEMORY_BUFFER_ALLOC_C
1168 *
1169 * Enable the buffer allocator implementation that makes use of a (stack)
1170 * based buffer to 'allocate' dynamic memory. (replaces malloc() and free()
1171 * calls)
Paul Bakker6e339b52013-07-03 13:37:05 +02001172 *
1173 * Module: library/memory_buffer_alloc.c
1174 *
1175 * Requires: POLARSSL_MEMORY_C
1176 *
1177 * Enable this module to enable the buffer memory allocator.
1178#define POLARSSL_MEMORY_BUFFER_ALLOC_C
1179 */
1180
1181/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001182 * \def POLARSSL_NET_C
1183 *
1184 * Enable the TCP/IP networking routines.
1185 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001186 * Module: library/net.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001187 *
1188 * This module provides TCP/IP networking routines.
1189 */
Paul Bakker40e46942009-01-03 21:51:57 +00001190#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001191
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001192/**
Paul Bakkerc70b9822013-04-07 22:00:46 +02001193 * \def POLARSSL_OID_C
1194 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001195 * Enable the OID database.
Paul Bakkerc70b9822013-04-07 22:00:46 +02001196 *
1197 * Module: library/oid.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001198 * Caller: library/asn1write.c
1199 * library/pkcs5.c
1200 * library/pkparse.c
1201 * library/pkwrite.c
1202 * library/rsa.c
1203 * library/x509.c
1204 * library/x509_create.c
1205 * library/x509_crl.c
1206 * library/x509_crt.c
1207 * library/x509_csr.c
1208 * library/x509write_crt.c
1209 * library/x509write_csr.c
Paul Bakkerc70b9822013-04-07 22:00:46 +02001210 *
1211 * This modules translates between OIDs and internal values.
1212 */
1213#define POLARSSL_OID_C
1214
1215/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001216 * \def POLARSSL_PADLOCK_C
1217 *
1218 * Enable VIA Padlock support on x86.
1219 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001220 * Module: library/padlock.c
1221 * Caller: library/aes.c
1222 *
1223 * This modules adds support for the VIA PadLock on x86.
1224 */
Paul Bakker40e46942009-01-03 21:51:57 +00001225#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001226
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001227/**
Paul Bakkerf518b162012-08-23 13:03:18 +00001228 * \def POLARSSL_PBKDF2_C
1229 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001230 * Enable PKCS#5 PBKDF2 key derivation function.
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001231 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +00001232 *
1233 * Module: library/pbkdf2.c
1234 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001235 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001236 *
1237 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +00001238 */
Paul Bakker370e90c2013-04-08 15:19:43 +02001239#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001240
1241/**
Paul Bakkercff68422013-09-15 20:43:33 +02001242 * \def POLARSSL_PEM_PARSE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00001243 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001244 * Enable PEM decoding / parsing.
Paul Bakker96743fc2011-02-12 14:30:57 +00001245 *
1246 * Module: library/pem.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001247 * Caller: library/dhm.c
Paul Bakkercff68422013-09-15 20:43:33 +02001248 * library/pkparse.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001249 * library/x509_crl.c
1250 * library/x509_crt.c
1251 * library/x509_csr.c
Paul Bakker96743fc2011-02-12 14:30:57 +00001252 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001253 * Requires: POLARSSL_BASE64_C
1254 *
Paul Bakkercff68422013-09-15 20:43:33 +02001255 * This modules adds support for decoding / parsing PEM files.
Paul Bakker96743fc2011-02-12 14:30:57 +00001256 */
Paul Bakkercff68422013-09-15 20:43:33 +02001257#define POLARSSL_PEM_PARSE_C
1258
1259/**
1260 * \def POLARSSL_PEM_WRITE_C
1261 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001262 * Enable PEM encoding / writing.
Paul Bakkercff68422013-09-15 20:43:33 +02001263 *
1264 * Module: library/pem.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001265 * Caller: library/pkwrite.c
1266 * library/x509write_crt.c
1267 * library/x509write_csr.c
Paul Bakkercff68422013-09-15 20:43:33 +02001268 *
1269 * Requires: POLARSSL_BASE64_C
1270 *
1271 * This modules adds support for encoding / writing PEM files.
1272 */
1273#define POLARSSL_PEM_WRITE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00001274
1275/**
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001276 * \def POLARSSL_PK_C
1277 *
1278 * Enable the generic public (asymetric) key layer.
1279 *
1280 * Module: library/pk.c
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001281 * Caller: library/ssl_tls.c
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001282 * library/ssl_cli.c
1283 * library/ssl_srv.c
1284 *
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001285 * Requires: POLARSSL_RSA_C or POLARSSL_ECP_C
1286 *
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001287 * Uncomment to enable generic public key wrappers.
1288 */
1289#define POLARSSL_PK_C
1290
1291/**
Paul Bakker4606c732013-09-15 17:04:23 +02001292 * \def POLARSSL_PK_PARSE_C
1293 *
1294 * Enable the generic public (asymetric) key parser.
1295 *
1296 * Module: library/pkparse.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001297 * Caller: library/x509_crt.c
1298 * library/x509_csr.c
Paul Bakker4606c732013-09-15 17:04:23 +02001299 *
1300 * Requires: POLARSSL_PK_C
1301 *
1302 * Uncomment to enable generic public key parse functions.
1303 */
1304#define POLARSSL_PK_PARSE_C
1305
1306/**
1307 * \def POLARSSL_PK_WRITE_C
1308 *
Paul Bakkerf20ba4b2013-09-16 22:46:20 +02001309 * Enable the generic public (asymetric) key writer.
Paul Bakker4606c732013-09-15 17:04:23 +02001310 *
1311 * Module: library/pkwrite.c
1312 * Caller: library/x509write.c
1313 *
1314 * Requires: POLARSSL_PK_C
1315 *
1316 * Uncomment to enable generic public key write functions.
1317 */
1318#define POLARSSL_PK_WRITE_C
1319
1320/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001321 * \def POLARSSL_PKCS5_C
1322 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001323 * Enable PKCS#5 functions.
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001324 *
1325 * Module: library/pkcs5.c
1326 *
1327 * Requires: POLARSSL_MD_C
1328 *
1329 * This module adds support for the PKCS#5 functions.
1330 */
1331#define POLARSSL_PKCS5_C
1332
1333/**
Paul Bakker5690efc2011-05-26 13:16:06 +00001334 * \def POLARSSL_PKCS11_C
1335 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001336 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001337 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001338 * Module: library/pkcs11.c
1339 * Caller: library/pk.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001340 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001341 * Requires: POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001342 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001343 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001344 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1345#define POLARSSL_PKCS11_C
1346 */
1347
1348/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001349 * \def POLARSSL_PKCS12_C
1350 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001351 * Enable PKCS#12 PBE functions.
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001352 * Adds algorithms for parsing PKCS#8 encrypted private keys
1353 *
1354 * Module: library/pkcs12.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001355 * Caller: library/pkparse.c
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001356 *
Paul Bakkerb0713c72013-06-24 19:34:08 +02001357 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
1358 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001359 *
1360 * This module enables PKCS#12 functions.
1361 */
1362#define POLARSSL_PKCS12_C
1363
1364/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001365 * \def POLARSSL_RSA_C
1366 *
1367 * Enable the RSA public-key cryptosystem.
1368 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001369 * Module: library/rsa.c
1370 * Caller: library/ssl_cli.c
1371 * library/ssl_srv.c
1372 * library/ssl_tls.c
1373 * library/x509.c
1374 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001375 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001376 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001377 * This module is required for SSL/TLS and MD5-signed certificates.
1378 */
Paul Bakker40e46942009-01-03 21:51:57 +00001379#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001380
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001381/**
1382 * \def POLARSSL_SHA1_C
1383 *
1384 * Enable the SHA1 cryptographic hash algorithm.
1385 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001386 * Module: library/sha1.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001387 * Caller: library/md.c
1388 * library/ssl_cli.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001389 * library/ssl_srv.c
1390 * library/ssl_tls.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001391 * library/x509write_crt.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001392 *
1393 * This module is required for SSL/TLS and SHA1-signed certificates.
1394 */
Paul Bakker40e46942009-01-03 21:51:57 +00001395#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001396
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001397/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001398 * \def POLARSSL_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001399 *
1400 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001401 * (Used to be POLARSSL_SHA2_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001402 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001403 * Module: library/sha256.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001404 * Caller: library/entropy.c
1405 * library/md.c
1406 * library/ssl_cli.c
1407 * library/ssl_srv.c
1408 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001409 *
1410 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001411 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001412 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001413#define POLARSSL_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001414
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001415/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001416 * \def POLARSSL_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001417 *
1418 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001419 * (Used to be POLARSSL_SHA4_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001420 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001421 * Module: library/sha512.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001422 * Caller: library/entropy.c
1423 * library/md.c
1424 * library/ssl_cli.c
1425 * library/ssl_srv.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001426 *
1427 * This module adds support for SHA-384 and SHA-512.
1428 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001429#define POLARSSL_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001430
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001431/**
Paul Bakker0a597072012-09-25 21:55:46 +00001432 * \def POLARSSL_SSL_CACHE_C
1433 *
1434 * Enable simple SSL cache implementation.
1435 *
1436 * Module: library/ssl_cache.c
1437 * Caller:
1438 *
1439 * Requires: POLARSSL_SSL_CACHE_C
1440 */
1441#define POLARSSL_SSL_CACHE_C
1442
1443/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001444 * \def POLARSSL_SSL_CLI_C
1445 *
1446 * Enable the SSL/TLS client code.
1447 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001448 * Module: library/ssl_cli.c
1449 * Caller:
1450 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001451 * Requires: POLARSSL_SSL_TLS_C
1452 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001453 * This module is required for SSL/TLS client support.
1454 */
Paul Bakker40e46942009-01-03 21:51:57 +00001455#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001456
Paul Bakker9a736322012-11-14 12:39:52 +00001457/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001458 * \def POLARSSL_SSL_SRV_C
1459 *
1460 * Enable the SSL/TLS server code.
1461 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001462 * Module: library/ssl_srv.c
1463 * Caller:
1464 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001465 * Requires: POLARSSL_SSL_TLS_C
1466 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001467 * This module is required for SSL/TLS server support.
1468 */
Paul Bakker40e46942009-01-03 21:51:57 +00001469#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001470
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001471/**
1472 * \def POLARSSL_SSL_TLS_C
1473 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001474 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001475 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001476 * Module: library/ssl_tls.c
1477 * Caller: library/ssl_cli.c
1478 * library/ssl_srv.c
1479 *
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001480 * Requires: POLARSSL_CIPHER_C, POLARSSL_MD_C
Paul Bakker577e0062013-08-28 11:57:20 +02001481 * and at least one of the POLARSSL_SSL_PROTO_* defines
Paul Bakker5690efc2011-05-26 13:16:06 +00001482 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001483 * This module is required for SSL/TLS.
1484 */
Paul Bakker40e46942009-01-03 21:51:57 +00001485#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001486
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001487/**
Paul Bakker2466d932013-09-28 14:40:38 +02001488 * \def POLARSSL_THREADING_C
1489 *
1490 * Enable the threading abstraction layer.
1491 * By default PolarSSL assumes it is used in a non-threaded environment or that
1492 * contexts are not shared between threads. If you do intend to use contexts
1493 * between threads, you will need to enable this layer to prevent race
1494 * conditions.
1495 *
1496 * Module: library/threading.c
1497 *
1498 * This allows different threading implementations (self-implemented or
1499 * provided).
1500 *
1501 * You will have to enable either POLARSSL_THREADING_ALT,
1502 * POLARSSL_THREADING_PTHREAD or POLARSSL_THREADING_DUMMY.
1503 *
1504 * Enable this layer to allow use of mutexes within PolarSSL
1505#define POLARSSL_THREADING_C
1506 */
1507
1508/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001509 * \def POLARSSL_TIMING_C
1510 *
1511 * Enable the portable timing interface.
1512 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001513 * Module: library/timing.c
1514 * Caller: library/havege.c
1515 *
1516 * This module is used by the HAVEGE random number generator.
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001517 */
Paul Bakkerdcbfdcc2013-09-10 16:16:50 +02001518#define POLARSSL_TIMING_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001519
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001520/**
1521 * \def POLARSSL_VERSION_C
1522 *
1523 * Enable run-time version information.
1524 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001525 * Module: library/version.c
1526 *
1527 * This module provides run-time version information.
1528 */
1529#define POLARSSL_VERSION_C
1530
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001531/**
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001532 * \def POLARSSL_X509_USE_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001533 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001534 * Enable X.509 core for using certificates.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001535 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001536 * Module: library/x509.c
1537 * Caller: library/x509_crl.c
1538 * library/x509_crt.c
1539 * library/x509_csr.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001540 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001541 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
Paul Bakker4606c732013-09-15 17:04:23 +02001542 * POLARSSL_PK_PARSE_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001543 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001544 * This module is required for the X.509 parsing modules.
Paul Bakker5121ce52009-01-03 21:22:43 +00001545 */
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001546#define POLARSSL_X509_USE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001547
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001548/**
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001549 * \def POLARSSL_X509_CRT_PARSE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001550 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001551 * Enable X.509 certificate parsing.
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001552 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001553 * Module: library/x509_crt.c
1554 * Caller: library/ssl_cli.c
1555 * library/ssl_srv.c
1556 * library/ssl_tls.c
1557 *
1558 * Requires: POLARSSL_X509_USE_C
1559 *
1560 * This module is required for X.509 certificate parsing.
1561 */
1562#define POLARSSL_X509_CRT_PARSE_C
1563
1564/**
1565 * \def POLARSSL_X509_CRL_PARSE_C
1566 *
1567 * Enable X.509 CRL parsing.
1568 *
1569 * Module: library/x509_crl.c
1570 * Caller: library/x509_crt.c
1571 *
1572 * Requires: POLARSSL_X509_USE_C
1573 *
1574 * This module is required for X.509 CRL parsing.
1575 */
1576#define POLARSSL_X509_CRL_PARSE_C
1577
1578/**
1579 * \def POLARSSL_X509_CSR_PARSE_C
1580 *
1581 * Enable X.509 Certificate Signing Request (CSR) parsing.
1582 *
1583 * Module: library/x509_csr.c
1584 * Caller: library/x509_crt_write.c
1585 *
1586 * Requires: POLARSSL_X509_USE_C
1587 *
1588 * This module is used for reading X.509 certificate request.
1589 */
1590#define POLARSSL_X509_CSR_PARSE_C
1591
1592/**
1593 * \def POLARSSL_X509_CREATE_C
1594 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001595 * Enable X.509 core for creating certificates.
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001596 *
1597 * Module: library/x509_create.c
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001598 *
Paul Bakker4606c732013-09-15 17:04:23 +02001599 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_PK_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001600 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001601 * This module is the basis for creating X.509 certificates and CSRs.
1602 */
1603#define POLARSSL_X509_CREATE_C
1604
1605/**
1606 * \def POLARSSL_X509_CRT_WRITE_C
1607 *
1608 * Enable creating X.509 certificates.
1609 *
1610 * Module: library/x509_crt_write.c
1611 *
1612 * Requires: POLARSSL_CREATE_C
1613 *
1614 * This module is required for X.509 certificate creation.
1615 */
1616#define POLARSSL_X509_CRT_WRITE_C
1617
1618/**
1619 * \def POLARSSL_X509_CSR_WRITE_C
1620 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001621 * Enable creating X.509 Certificate Signing Requests (CSR).
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001622 *
1623 * Module: library/x509_csr_write.c
1624 *
1625 * Requires: POLARSSL_CREATE_C
1626 *
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001627 * This module is required for X.509 certificate request writing.
1628 */
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001629#define POLARSSL_X509_CSR_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001630
1631/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001632 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001633 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001634 * Enable the XTEA block cipher.
1635 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001636 * Module: library/xtea.c
1637 * Caller:
1638 */
1639#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001640
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001641/* \} name SECTION: PolarSSL modules */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001642
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001643/**
1644 * \name SECTION: Module configuration options
1645 *
1646 * This section allows for the setting of module specific sizes and
1647 * configuration options. The default values are already present in the
1648 * relevant header files and should suffice for the regular use cases.
1649 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1650 * only if you have a good reason and know the consequences.
1651 *
1652 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1653 * header file take precedence.
1654 *
1655 * Please check the respective header file for documentation on these
1656 * parameters (to prevent duplicate documentation).
1657 *
1658 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1659 * \{
1660 */
1661//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1662
1663#if defined(POLARSSL_CONFIG_OPTIONS)
1664
1665// MPI / BIGNUM options
1666//
1667#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1668#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1669
1670// CTR_DRBG options
1671//
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001672#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 +02001673#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1674#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1675#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1676#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1677
1678// Entropy options
1679//
1680#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1681#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1682
Paul Bakker6e339b52013-07-03 13:37:05 +02001683// Memory options
1684#define MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1685#define POLARSSL_MEMORY_STDMALLOC malloc /**< Default allocator to use, can be undefined */
1686#define POLARSSL_MEMORY_STDFREE free /**< Default free to use, can be undefined */
1687
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001688// SSL Cache options
1689//
1690#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1691#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1692
1693// SSL options
1694//
1695#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
Paul Bakker606b4ba2013-08-14 16:52:14 +02001696#define SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001697
1698#endif /* POLARSSL_CONFIG_OPTIONS */
1699
1700/* \} name */
1701
Paul Bakker7ad00f92013-04-18 23:05:25 +02001702/*
1703 * Sanity checks on defines and dependencies
1704 */
1705#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1706#error "POLARSSL_DHM_C defined, but not all prerequisites"
1707#endif
1708
1709#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1710#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1711#endif
1712
1713#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1714#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1715#endif
1716
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001717#if defined(POLARSSL_ECDSA_C) && \
1718 ( !defined(POLARSSL_ECP_C) || \
1719 !defined(POLARSSL_ASN1_PARSE_C) || \
1720 !defined(POLARSSL_ASN1_WRITE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001721#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1722#endif
1723
Manuel Pégourié-Gonnardb8012fc2013-10-10 15:40:49 +02001724#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C) || ( \
1725 !defined(POLARSSL_ECP_DP_SECP192R1_ENABLED) && \
1726 !defined(POLARSSL_ECP_DP_SECP224R1_ENABLED) && \
1727 !defined(POLARSSL_ECP_DP_SECP256R1_ENABLED) && \
1728 !defined(POLARSSL_ECP_DP_SECP384R1_ENABLED) && \
1729 !defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) && \
1730 !defined(POLARSSL_ECP_DP_BP256R1_ENABLED) && \
1731 !defined(POLARSSL_ECP_DP_BP384R1_ENABLED) && \
1732 !defined(POLARSSL_ECP_DP_BP512R1_ENABLED) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001733#error "POLARSSL_ECP_C defined, but not all prerequisites"
1734#endif
1735
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001736#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
1737 !defined(POLARSSL_SHA256_C))
Paul Bakker7ad00f92013-04-18 23:05:25 +02001738#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1739#endif
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001740#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
1741 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
1742#error "CTR_DRBG_ENTROPY_LEN value too high"
1743#endif
1744#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA512_C) && \
1745 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
1746#error "CTR_DRBG_ENTROPY_LEN value too high"
1747#endif
Paul Bakker7ad00f92013-04-18 23:05:25 +02001748
1749#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1750#error "POLARSSL_GCM_C defined, but not all prerequisites"
1751#endif
1752
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001753#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
1754#error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
1755#endif
1756
Paul Bakkere07f41d2013-04-19 09:08:57 +02001757#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1758#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1759#endif
1760
1761#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1762 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +02001763 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001764#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1765#endif
1766
1767#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1768 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +02001769 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001770#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1771#endif
1772
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +02001773#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
1774 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +02001775 !defined(POLARSSL_X509_CRT_PARSE_C) )
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +02001776#error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
1777#endif
1778
Paul Bakkere07f41d2013-04-19 09:08:57 +02001779#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001780 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +02001781 !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001782#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1783#endif
1784
1785#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001786 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +02001787 !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001788#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1789#endif
1790
Paul Bakker6e339b52013-07-03 13:37:05 +02001791#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && !defined(POLARSSL_MEMORY_C)
1792#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
1793#endif
1794
Paul Bakker7ad00f92013-04-18 23:05:25 +02001795#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1796#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1797#endif
1798
Paul Bakkercff68422013-09-15 20:43:33 +02001799#if defined(POLARSSL_PEM_PARSE_C) && !defined(POLARSSL_BASE64_C)
1800#error "POLARSSL_PEM_PARSE_C defined, but not all prerequisites"
1801#endif
1802
1803#if defined(POLARSSL_PEM_WRITE_C) && !defined(POLARSSL_BASE64_C)
1804#error "POLARSSL_PEM_WRITE_C defined, but not all prerequisites"
Paul Bakker7ad00f92013-04-18 23:05:25 +02001805#endif
1806
Paul Bakker4606c732013-09-15 17:04:23 +02001807#if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C)
1808#error "POLARSSL_PK_PARSE_C defined, but not all prerequisites"
1809#endif
1810
1811#if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C)
1812#error "POLARSSL_PK_WRITE_C defined, but not all prerequisites"
1813#endif
1814
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001815#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001816#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1817#endif
1818
1819#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1820 !defined(POLARSSL_OID_C) )
1821#error "POLARSSL_RSA_C defined, but not all prerequisites"
1822#endif
1823
1824#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1825#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1826#endif
1827
Paul Bakker577e0062013-08-28 11:57:20 +02001828#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001829 !defined(POLARSSL_MD_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001830#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1831#endif
1832
1833#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1834#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1835#endif
1836
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001837#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
1838 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
1839 !defined(POLARSSL_SSL_PROTO_TLS1_2))
1840#error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
1841#endif
1842
1843#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1844 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
1845#error "Illegal protocol selection"
1846#endif
1847
1848#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
1849 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
1850#error "Illegal protocol selection"
1851#endif
1852
1853#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1854 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
1855 !defined(POLARSSL_SSL_PROTO_TLS1_1)))
1856#error "Illegal protocol selection"
1857#endif
1858
Paul Bakker59da0a42013-08-19 13:27:17 +02001859#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
Manuel Pégourié-Gonnard92cb1d32013-09-13 16:24:20 +02001860 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) || \
1861 !defined(POLARSSL_CIPHER_MODE_CBC) )
Paul Bakker59da0a42013-08-19 13:27:17 +02001862#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
1863#endif
1864
Paul Bakker2466d932013-09-28 14:40:38 +02001865#if defined(POLARSSL_THREADING_DUMMY)
1866#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
1867#error "POLARSSL_THREADING_DUMMY defined, but not all prerequisites"
1868#endif
1869#define POLARSSL_THREADING_IMPL
1870#endif
1871
1872#if defined(POLARSSL_THREADING_PTHREAD)
1873#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
1874#error "POLARSSL_THREADING_PTHREAD defined, but not all prerequisites"
1875#endif
1876#define POLARSSL_THREADING_IMPL
1877#endif
1878
1879#if defined(POLARSSL_THREADING_ALT)
1880#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
1881#error "POLARSSL_THREADING_ALT defined, but not all prerequisites"
1882#endif
1883#define POLARSSL_THREADING_IMPL
1884#endif
1885
1886#if defined(POLARSSL_THREADING_C) && !defined(POLARSSL_THREADING_IMPL)
1887#error "POLARSSL_THREADING_C defined, single threading implementation required"
1888#endif
1889#undef POLARSSL_THREADING_IMPL
1890
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001891#if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
Paul Bakker7ad00f92013-04-18 23:05:25 +02001892 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
Paul Bakker4606c732013-09-15 17:04:23 +02001893 !defined(POLARSSL_PK_PARSE_C) )
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001894#error "POLARSSL_X509_USE_C defined, but not all prerequisites"
Paul Bakker7ad00f92013-04-18 23:05:25 +02001895#endif
1896
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001897#if defined(POLARSSL_X509_CREATE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1898 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
1899 !defined(POLARSSL_PK_WRITE_C) )
1900#error "POLARSSL_X509_CREATE_C defined, but not all prerequisites"
1901#endif
1902
1903#if defined(POLARSSL_X509_CRT_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
1904#error "POLARSSL_X509_CRT_PARSE_C defined, but not all prerequisites"
1905#endif
1906
1907#if defined(POLARSSL_X509_CRL_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
1908#error "POLARSSL_X509_CRL_PARSE_C defined, but not all prerequisites"
1909#endif
1910
1911#if defined(POLARSSL_X509_CSR_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
1912#error "POLARSSL_X509_CSR_PARSE_C defined, but not all prerequisites"
1913#endif
1914
1915#if defined(POLARSSL_X509_CRT_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
1916#error "POLARSSL_X509_CRT_WRITE_C defined, but not all prerequisites"
1917#endif
1918
1919#if defined(POLARSSL_X509_CSR_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
1920#error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites"
Paul Bakker7ad00f92013-04-18 23:05:25 +02001921#endif
1922
Paul Bakker5121ce52009-01-03 21:22:43 +00001923#endif /* config.h */