blob: 4a9d0efd54c92967cf87e0996b920db58d5a8355 [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/**
97 * \def POLARSSL_HAVE_TIME
98 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +020099 * System has time.h and time() / localtime() / gettimeofday().
Paul Bakkerfa9b1002013-07-03 15:31:03 +0200100 *
101 * Comment if your system does not support time functions
102 */
103#define POLARSSL_HAVE_TIME
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200104/* \} name SECTION: System support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000105
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000106/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000107 * \name SECTION: PolarSSL feature support
108 *
109 * This section sets support for features that are or are not needed
110 * within the modules that are enabled.
111 * \{
112 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000113
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000114/**
Paul Bakker90995b52013-06-24 19:20:35 +0200115 * \def POLARSSL_XXX_ALT
116 *
117 * Uncomment a macro to let PolarSSL use your alternate core implementation of
118 * a symmetric or hash algorithm (e.g. platform specific assembly optimized
119 * implementations). Keep in mind that the function prototypes should remain
120 * the same.
121 *
122 * Example: In case you uncomment POLARSSL_AES_ALT, PolarSSL will no longer
123 * provide the "struct aes_context" definition and omit the base function
124 * declarations and implementations. "aes_alt.h" will be included from
125 * "aes.h" to include the new function definitions.
126 *
127 * Uncomment a macro to enable alternate implementation for core algorithm
128 * functions
129#define POLARSSL_AES_ALT
130#define POLARSSL_ARC4_ALT
131#define POLARSSL_BLOWFISH_ALT
132#define POLARSSL_CAMELLIA_ALT
133#define POLARSSL_DES_ALT
134#define POLARSSL_XTEA_ALT
135#define POLARSSL_MD2_ALT
136#define POLARSSL_MD4_ALT
137#define POLARSSL_MD5_ALT
138#define POLARSSL_SHA1_ALT
Paul Bakker9e36f042013-06-30 14:34:05 +0200139#define POLARSSL_SHA256_ALT
140#define POLARSSL_SHA512_ALT
Paul Bakker90995b52013-06-24 19:20:35 +0200141 */
142
143/**
Paul Bakker15566e42011-04-24 21:19:15 +0000144 * \def POLARSSL_AES_ROM_TABLES
145 *
146 * Store the AES tables in ROM.
147 *
148 * Uncomment this macro to store the AES tables in ROM.
149 *
150#define POLARSSL_AES_ROM_TABLES
151 */
152
153/**
Manuel Pégourié-Gonnardf7dc3782013-09-13 14:10:44 +0200154 * \def POLARSSL_CIPHER_MODE_CBC
155 *
156 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
157 */
158#define POLARSSL_CIPHER_MODE_CBC
159
160/**
Paul Bakkerb6ecaf52011-04-19 14:29:23 +0000161 * \def POLARSSL_CIPHER_MODE_CFB
162 *
163 * Enable Cipher Feedback mode (CFB) for symmetric ciphers.
164 */
165#define POLARSSL_CIPHER_MODE_CFB
166
167/**
168 * \def POLARSSL_CIPHER_MODE_CTR
169 *
170 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
171 */
172#define POLARSSL_CIPHER_MODE_CTR
173
174/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000175 * \def POLARSSL_CIPHER_NULL_CIPHER
176 *
177 * Enable NULL cipher.
178 * Warning: Only do so when you know what you are doing. This allows for
179 * encryption or channels without any security!
180 *
181 * Requires POLARSSL_ENABLE_WEAK_CIPHERSUITES as well to enable
182 * the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000183 * TLS_RSA_WITH_NULL_MD5
184 * TLS_RSA_WITH_NULL_SHA
185 * TLS_RSA_WITH_NULL_SHA256
Paul Bakker41c83d32013-03-20 14:39:14 +0100186 * TLS_ECDHE_RSA_WITH_NULL_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200187 * TLS_PSK_WITH_NULL
188 * TLS_PSK_WITH_NULL256
189 * TLS_PSK_WITH_NULL384
190 * TLS_DHE_PSK_WITH_NULL
191 * TLS_DHE_PSK_WITH_NULL256
192 * TLS_DHE_PSK_WITH_NULL384
193 * TLS_RSA_PSK_WITH_NULL
194 * TLS_RSA_PSK_WITH_NULL256
195 * TLS_RSA_PSK_WITH_NULL384
Paul Bakkerfab5c822012-02-06 16:45:10 +0000196 *
197 * Uncomment this macro to enable the NULL cipher and ciphersuites
198#define POLARSSL_CIPHER_NULL_CIPHER
199 */
200
201/**
Paul Bakker48e93c82013-08-14 12:21:18 +0200202 * \def POLARSSL_CIPHER_PADDING_XXX
203 *
204 * Uncomment or comment macros to add support for specific padding modes
205 * in the cipher layer with cipher modes that support padding (e.g. CBC)
206 *
207 * If you disable all padding modes, only full blocks can be used with CBC.
208 *
209 * Enable padding modes in the cipher layer.
210 */
211#define POLARSSL_CIPHER_PADDING_PKCS7
212#define POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS
213#define POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN
214#define POLARSSL_CIPHER_PADDING_ZEROS
215
216/**
Paul Bakkerfab5c822012-02-06 16:45:10 +0000217 * \def POLARSSL_ENABLE_WEAK_CIPHERSUITES
218 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200219 * Enable weak ciphersuites in SSL / TLS.
Paul Bakkerfab5c822012-02-06 16:45:10 +0000220 * Warning: Only do so when you know what you are doing. This allows for
Paul Bakker9a736322012-11-14 12:39:52 +0000221 * channels with virtually no security at all!
Paul Bakkerfab5c822012-02-06 16:45:10 +0000222 *
223 * This enables the following ciphersuites:
Paul Bakker645ce3a2012-10-31 12:32:41 +0000224 * TLS_RSA_WITH_DES_CBC_SHA
225 * TLS_DHE_RSA_WITH_DES_CBC_SHA
Paul Bakkerfab5c822012-02-06 16:45:10 +0000226 *
227 * Uncomment this macro to enable weak ciphersuites
228#define POLARSSL_ENABLE_WEAK_CIPHERSUITES
229 */
230
231/**
Paul Bakker5dc6b5f2013-06-29 23:26:34 +0200232 * \def POLARSSL_ECP_XXXX_ENABLED
233 *
234 * Enables specific curves within the Elliptic Curve module.
235 * By default all supported curves are enables.
236 *
237 * Comment macros to disable the curve and functions for it
238 */
239#define POLARSSL_ECP_DP_SECP192R1_ENABLED
240#define POLARSSL_ECP_DP_SECP224R1_ENABLED
241#define POLARSSL_ECP_DP_SECP256R1_ENABLED
242#define POLARSSL_ECP_DP_SECP384R1_ENABLED
243#define POLARSSL_ECP_DP_SECP521R1_ENABLED
244
245/**
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200246 * \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED
247 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200248 * Enable the PSK based ciphersuite modes in SSL / TLS.
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200249 *
Paul Bakkere07f41d2013-04-19 09:08:57 +0200250 * This enables the following ciphersuites (if other requisites are
251 * enabled as well):
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200252 * TLS_PSK_WITH_RC4_128_SHA
253 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
254 * TLS_PSK_WITH_AES_128_CBC_SHA
255 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200256 * TLS_PSK_WITH_AES_128_CBC_SHA256
257 * TLS_PSK_WITH_AES_256_CBC_SHA384
258 * TLS_PSK_WITH_AES_128_GCM_SHA256
259 * TLS_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200260 */
261#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED
262
263/**
Paul Bakkere07f41d2013-04-19 09:08:57 +0200264 * \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
265 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200266 * Enable the DHE-PSK based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200267 *
268 * Requires: POLARSSL_DHM_C
269 *
270 * This enables the following ciphersuites (if other requisites are
271 * enabled as well):
272 * TLS_DHE_PSK_WITH_RC4_128_SHA
273 * TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
274 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA
275 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200276 * TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
277 * TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
278 * TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
279 * TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200280 */
Paul Bakker48f7a5d2013-04-19 14:30:58 +0200281#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
Paul Bakkere07f41d2013-04-19 09:08:57 +0200282
283/**
284 * \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
285 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200286 * Enable the RSA-PSK based ciphersuite modes in SSL / TLS.
Paul Bakker45bda902013-04-19 22:28:21 +0200287 * (NOT YET IMPLEMENTED)
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +0200288 * Requires: POLARSSL_RSA_C, POLARSSL_PKCS1_V15,
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +0200289 * POLARSSL_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200290 *
291 * This enables the following ciphersuites (if other requisites are
292 * enabled as well):
293 * TLS_RSA_PSK_WITH_RC4_128_SHA
294 * TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
295 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA
296 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA
Paul Bakker45bda902013-04-19 22:28:21 +0200297 * TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
298 * TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
299 * TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
300 * TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
Paul Bakkere07f41d2013-04-19 09:08:57 +0200301#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
302 */
303
304/**
305 * \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED
306 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200307 * Enable the RSA-only based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200308 *
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +0200309 * Requires: POLARSSL_RSA_C, POLARSSL_PKCS1_V15,
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +0200310 * POLARSSL_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200311 *
312 * This enables the following ciphersuites (if other requisites are
313 * enabled as well):
314 * TLS_RSA_WITH_AES_128_CBC_SHA
315 * TLS_RSA_WITH_AES_256_CBC_SHA
316 * TLS_RSA_WITH_AES_128_CBC_SHA256
317 * TLS_RSA_WITH_AES_256_CBC_SHA256
318 * TLS_RSA_WITH_AES_128_GCM_SHA256
319 * TLS_RSA_WITH_AES_256_GCM_SHA384
320 * TLS_RSA_WITH_RC4_128_MD5
321 * TLS_RSA_WITH_RC4_128_SHA
322 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
323 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
324 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
325 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
326 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
327 */
328#define POLARSSL_KEY_EXCHANGE_RSA_ENABLED
329
330/**
331 * \def POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
332 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200333 * Enable the DHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200334 *
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +0200335 * Requires: POLARSSL_DHM_C, POLARSSL_RSA_C, POLARSSL_PKCS1_V15,
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +0200336 * POLARSSL_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200337 *
338 * This enables the following ciphersuites (if other requisites are
339 * enabled as well):
340 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
341 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
342 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
343 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
344 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
345 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
346 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
347 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
348 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
349 */
350#define POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED
351
352/**
353 * \def POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
354 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200355 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
Paul Bakkere07f41d2013-04-19 09:08:57 +0200356 *
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +0200357 * Requires: POLARSSL_ECDH_C, POLARSSL_RSA_C, POLARSSL_PKCS1_V15,
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +0200358 * POLARSSL_X509_CRT_PARSE_C
Paul Bakkere07f41d2013-04-19 09:08:57 +0200359 *
360 * This enables the following ciphersuites (if other requisites are
361 * enabled as well):
362 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
363 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
364 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
365 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
366 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
367 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
368 * TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
369 * TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
370 * TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
371 * TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
372 */
373#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
374
375/**
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200376 * \def POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
377 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200378 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200379 *
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +0200380 * Requires: POLARSSL_ECDH_C, POLARSSL_ECDSA_C, POLARSSL_X509_CRT_PARSE_C,
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200381 *
382 * This enables the following ciphersuites (if other requisites are
383 * enabled as well):
384 * TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
385 * TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
386 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
387 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
388 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
389 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
390 * TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
391 * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
392 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
393 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
394 */
395#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
396
397/**
Paul Bakkere2ab84f2013-06-29 18:24:32 +0200398 * \def POLARSSL_ERROR_STRERROR_BC
399 *
400 * Make available the backward compatible error_strerror() next to the
401 * current polarssl_strerror().
402 *
403 * Disable if you run into name conflicts and want to really remove the
404 * error_strerror()
405 */
406#define POLARSSL_ERROR_STRERROR_BC
407
408/**
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100409 * \def POLARSSL_ERROR_STRERROR_DUMMY
410 *
Paul Bakkereba3ccf2013-09-09 15:55:12 +0200411 * Enable a dummy error function to make use of polarssl_strerror() in
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100412 * third party libraries easier.
413 *
414 * Disable if you run into name conflicts and want to really remove the
Paul Bakkereba3ccf2013-09-09 15:55:12 +0200415 * polarssl_strerror()
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100416 */
417#define POLARSSL_ERROR_STRERROR_DUMMY
418
419/**
Paul Bakker15566e42011-04-24 21:19:15 +0000420 * \def POLARSSL_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000421 *
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200422 * Enable the prime-number generation code.
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200423 *
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200424 * Requires: POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000425 */
Paul Bakker15566e42011-04-24 21:19:15 +0000426#define POLARSSL_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000427
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000428/**
Paul Bakker335db3f2011-04-25 15:28:35 +0000429 * \def POLARSSL_FS_IO
430 *
431 * Enable functions that use the filesystem.
432 */
433#define POLARSSL_FS_IO
434
435/**
Paul Bakker43655f42011-12-15 20:11:16 +0000436 * \def POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
437 *
438 * Do not add default entropy sources. These are the platform specific,
439 * hardclock and HAVEGE based poll functions.
440 *
441 * This is useful to have more control over the added entropy sources in an
442 * application.
443 *
444 * Uncomment this macro to prevent loading of default entropy functions.
445#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
446 */
447
448/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000449 * \def POLARSSL_NO_PLATFORM_ENTROPY
450 *
451 * Do not use built-in platform entropy functions.
452 * This is useful if your platform does not support
453 * standards like the /dev/urandom or Windows CryptoAPI.
454 *
455 * Uncomment this macro to disable the built-in platform entropy functions.
456#define POLARSSL_NO_PLATFORM_ENTROPY
457 */
458
459/**
Paul Bakker6e339b52013-07-03 13:37:05 +0200460 * \def POLARSSL_MEMORY_DEBUG
461 *
462 * Enable debugging of buffer allocator memory issues. Automatically prints
463 * (to stderr) all (fatal) messages on memory allocation issues. Enables
464 * function for 'debug output' of allocated memory.
465 *
466 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
467 * fprintf()
468 *
469 * Uncomment this macro to let the buffer allocator print out error messages.
470#define POLARSSL_MEMORY_DEBUG
471*/
472
473/**
474 * \def POLARSSL_MEMORY_BACKTRACE
475 *
476 * Include backtrace information with each allocated block.
477 *
478 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
479 * GLIBC-compatible backtrace() an backtrace_symbols() support
480 *
481 * Uncomment this macro to include backtrace information
482#define POLARSSL_MEMORY_BACKTRACE
483 */
484
485/**
Paul Bakker48377d92013-08-30 12:06:24 +0200486 * \def POLARSSL_PKCS1_V15
487 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200488 * Enable support for PKCS#1 v1.5 encoding.
489 *
Paul Bakker48377d92013-08-30 12:06:24 +0200490 * Requires: POLARSSL_RSA_C
491 *
Paul Bakker48377d92013-08-30 12:06:24 +0200492 * This enables support for PKCS#1 v1.5 operations.
493 */
494#define POLARSSL_PKCS1_V15
495
496/**
Paul Bakker9dcc3222011-03-08 14:16:06 +0000497 * \def POLARSSL_PKCS1_V21
498 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200499 * Enable support for PKCS#1 v2.1 encoding.
500 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000501 * Requires: POLARSSL_MD_C, POLARSSL_RSA_C
502 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000503 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
504 */
505#define POLARSSL_PKCS1_V21
506
507/**
Paul Bakker0216cc12011-03-26 13:40:23 +0000508 * \def POLARSSL_RSA_NO_CRT
509 *
510 * Do not use the Chinese Remainder Theorem for the RSA private operation.
511 *
512 * Uncomment this macro to disable the use of CRT in RSA.
513 *
514#define POLARSSL_RSA_NO_CRT
515 */
Paul Bakker15566e42011-04-24 21:19:15 +0000516
517/**
518 * \def POLARSSL_SELF_TEST
519 *
520 * Enable the checkup functions (*_self_test).
521 */
522#define POLARSSL_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000523
524/**
Paul Bakker40865c82013-01-31 17:13:13 +0100525 * \def POLARSSL_SSL_ALL_ALERT_MESSAGES
526 *
527 * Enable sending of alert messages in case of encountered errors as per RFC.
528 * If you choose not to send the alert messages, PolarSSL can still communicate
529 * with other servers, only debugging of failures is harder.
530 *
531 * The advantage of not sending alert messages, is that no information is given
532 * about reasons for failures thus preventing adversaries of gaining intel.
533 *
534 * Enable sending of all alert messages
535 */
536#define POLARSSL_SSL_ALERT_MESSAGES
537
538/**
Paul Bakkerd66f0702013-01-31 16:57:45 +0100539 * \def POLARSSL_SSL_DEBUG_ALL
540 *
541 * Enable the debug messages in SSL module for all issues.
542 * Debug messages have been disabled in some places to prevent timing
543 * attacks due to (unbalanced) debugging function calls.
544 *
545 * If you need all error reporting you should enable this during debugging,
546 * but remove this for production servers that should log as well.
547 *
548 * Uncomment this macro to report all debug messages on errors introducing
549 * a timing side-channel.
550 *
551#define POLARSSL_SSL_DEBUG_ALL
552 */
553
554/**
Paul Bakker05ef8352012-05-08 09:17:57 +0000555 * \def POLARSSL_SSL_HW_RECORD_ACCEL
556 *
557 * Enable hooking functions in SSL module for hardware acceleration of
558 * individual records.
559 *
560 * Uncomment this macro to enable hooking functions.
561#define POLARSSL_SSL_HW_RECORD_ACCEL
562 */
563
564/**
Paul Bakker78a8c712013-03-06 17:01:52 +0100565 * \def POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
566 *
567 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200568 * SSL Server module (POLARSSL_SSL_SRV_C).
Paul Bakker78a8c712013-03-06 17:01:52 +0100569 *
570 * Comment this macro to disable support for SSLv2 Client Hello messages.
571 */
572#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
573
574/**
Paul Bakker05decb22013-08-15 13:33:48 +0200575 * \def POLARSSL_SSL_MAX_FRAGMENT_LENGTH
576 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200577 * Enable support for RFC 6066 max_fragment_length extension in SSL.
Paul Bakker05decb22013-08-15 13:33:48 +0200578 *
579 * Comment this macro to disable support for the max_fragment_length extension
580 */
581#define POLARSSL_SSL_MAX_FRAGMENT_LENGTH
582
583/**
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200584 * \def POLARSSL_SSL_PROTO_SSL3
585 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200586 * Enable support for SSL 3.0.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200587 *
588 * Requires: POLARSSL_MD5_C
589 * POLARSSL_SHA1_C
590 *
591 * Comment this macro to disable support for SSL 3.0
592 */
593#define POLARSSL_SSL_PROTO_SSL3
594
595/**
596 * \def POLARSSL_SSL_PROTO_TLS1
597 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200598 * Enable support for TLS 1.0.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200599 *
600 * Requires: POLARSSL_MD5_C
601 * POLARSSL_SHA1_C
602 *
603 * Comment this macro to disable support for TLS 1.0
604 */
605#define POLARSSL_SSL_PROTO_TLS1
606
607/**
608 * \def POLARSSL_SSL_PROTO_TLS1_1
609 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200610 * Enable support for TLS 1.1.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200611 *
612 * Requires: POLARSSL_MD5_C
613 * POLARSSL_SHA1_C
614 *
615 * Comment this macro to disable support for TLS 1.1
616 */
617#define POLARSSL_SSL_PROTO_TLS1_1
618
619/**
620 * \def POLARSSL_SSL_PROTO_TLS1_2
621 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200622 * Enable support for TLS 1.2.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200623 *
624 * Requires: POLARSSL_SHA256_C or POLARSSL_SHA512_C
625 * (Depends on ciphersuites)
626 *
627 * Comment this macro to disable support for TLS 1.2
628 */
629#define POLARSSL_SSL_PROTO_TLS1_2
630
631/**
Paul Bakkera503a632013-08-14 13:48:06 +0200632 * \def POLARSSL_SSL_SESSION_TICKETS
633 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200634 * Enable support for RFC 5077 session tickets in SSL.
Paul Bakkera503a632013-08-14 13:48:06 +0200635 *
636 * Requires: POLARSSL_AES_C
637 * POLARSSL_SHA256_C
Manuel Pégourié-Gonnard92cb1d32013-09-13 16:24:20 +0200638 * POLARSSL_CIPHER_MODE_CBC
Paul Bakkera503a632013-08-14 13:48:06 +0200639 *
640 * Comment this macro to disable support for SSL session tickets
641 */
642#define POLARSSL_SSL_SESSION_TICKETS
643
644/**
Paul Bakker0be444a2013-08-27 21:55:01 +0200645 * \def POLARSSL_SSL_SERVER_NAME_INDICATION
646 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200647 * Enable support for RFC 6066 server name indication (SNI) in SSL.
Paul Bakker0be444a2013-08-27 21:55:01 +0200648 *
649 * Comment this macro to disable support for server name indication in SSL
650 */
651#define POLARSSL_SSL_SERVER_NAME_INDICATION
652
653/**
Paul Bakker1f2bc622013-08-15 13:45:55 +0200654 * \def POLARSSL_SSL_TRUNCATED_HMAC
655 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200656 * Enable support for RFC 6066 truncated HMAC in SSL.
Paul Bakker1f2bc622013-08-15 13:45:55 +0200657 *
658 * Comment this macro to disable support for truncated HMAC in SSL
659 */
660#define POLARSSL_SSL_TRUNCATED_HMAC
661
662/**
Paul Bakker2466d932013-09-28 14:40:38 +0200663 * \def POLARSSL_THREADING_ALT
664 *
665 * Provide your own alternate threading implementation.
666 *
667 * Requires: POLARSSL_THREADING_C
668 *
669 * Uncomment this to allow your own alternate threading implementation.
670#define POLARSSL_THREADING_ALT
671 */
672
673/**
674 * \def POLARSSL_THREADING_DUMMY
675 *
676 * Provide a dummy threading implementation.
677 *
678 * Requires: POLARSSL_THREADING_C
679 *
680 * Uncomment this to enable code to compile like with threading enabled
681#define POLARSSL_THREADING_DUMMY
682 */
683
684/**
685 * \def POLARSSL_THREADING_PTHREAD
686 *
687 * Enable the pthread wrapper layer for the threading layer.
688 *
689 * Requires: POLARSSL_THREADING_C
690 *
691 * Uncomment this to enable pthread mutexes.
692#define POLARSSL_THREADING_PTHREAD
693 */
694
695/**
Paul Bakkerc27c4e22013-09-23 15:01:36 +0200696 * \def POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3
697 *
698 * If set, the X509 parser will not break-off when parsing an X509 certificate
699 * and encountering an extension in a v1 or v2 certificate.
700 *
701 * Uncomment to prevent an error.
702 *
703#define POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3
704 */
705
706/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000707 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
708 *
709 * If set, the X509 parser will not break-off when parsing an X509 certificate
710 * and encountering an unknown critical extension.
711 *
712 * Uncomment to prevent an error.
713 *
714#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
715 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000716
717/**
718 * \def POLARSSL_ZLIB_SUPPORT
719 *
720 * If set, the SSL/TLS module uses ZLIB to support compression and
721 * decompression of packet data.
722 *
723 * Used in: library/ssl_tls.c
724 * library/ssl_cli.c
725 * library/ssl_srv.c
726 *
727 * This feature requires zlib library and headers to be present.
728 *
729 * Uncomment to enable use of ZLIB
730#define POLARSSL_ZLIB_SUPPORT
731 */
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200732/* \} name SECTION: PolarSSL feature support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000733
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000734/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000735 * \name SECTION: PolarSSL modules
736 *
737 * This section enables or disables entire modules in PolarSSL
738 * \{
739 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000740
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000741/**
742 * \def POLARSSL_AES_C
743 *
744 * Enable the AES block cipher.
745 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000746 * Module: library/aes.c
747 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000748 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000749 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000750 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000751 * This module enables the following ciphersuites (if other requisites are
752 * enabled as well):
753 * TLS_RSA_WITH_AES_128_CBC_SHA
754 * TLS_RSA_WITH_AES_256_CBC_SHA
755 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
756 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
757 * TLS_RSA_WITH_AES_128_CBC_SHA256
758 * TLS_RSA_WITH_AES_256_CBC_SHA256
759 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
760 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
761 * TLS_RSA_WITH_AES_128_GCM_SHA256
762 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100763 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
764 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200765 * TLS_PSK_WITH_AES_128_CBC_SHA
766 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100767 *
Paul Bakkercff68422013-09-15 20:43:33 +0200768 * PEM_PARSE uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000769 */
Paul Bakker40e46942009-01-03 21:51:57 +0000770#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000771
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000772/**
773 * \def POLARSSL_ARC4_C
774 *
775 * Enable the ARCFOUR stream cipher.
776 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000777 * Module: library/arc4.c
778 * Caller: library/ssl_tls.c
779 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100780 * This module enables the following ciphersuites (if other requisites are
781 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000782 * TLS_RSA_WITH_RC4_128_MD5
783 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100784 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200785 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000786 */
Paul Bakker40e46942009-01-03 21:51:57 +0000787#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000788
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000789/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000790 * \def POLARSSL_ASN1_PARSE_C
791 *
792 * Enable the generic ASN1 parser.
793 *
794 * Module: library/asn1.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200795 * Caller: library/x509.c
796 * library/dhm.c
797 * library/pkcs12.c
798 * library/pkcs5.c
799 * library/pkparse.c
Paul Bakkerefc30292011-11-10 14:43:23 +0000800 */
801#define POLARSSL_ASN1_PARSE_C
802
803/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000804 * \def POLARSSL_ASN1_WRITE_C
805 *
806 * Enable the generic ASN1 writer.
807 *
808 * Module: library/asn1write.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200809 * Caller: library/ecdsa.c
810 * library/pkwrite.c
811 * library/x509_create.c
812 * library/x509write_crt.c
813 * library/x509write_csr.c
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000814 */
815#define POLARSSL_ASN1_WRITE_C
816
817/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000818 * \def POLARSSL_BASE64_C
819 *
820 * Enable the Base64 module.
821 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000822 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000823 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000824 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000825 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000826 */
Paul Bakker40e46942009-01-03 21:51:57 +0000827#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000828
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000829/**
830 * \def POLARSSL_BIGNUM_C
831 *
Paul Bakker9a736322012-11-14 12:39:52 +0000832 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000833 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000834 * Module: library/bignum.c
835 * Caller: library/dhm.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +0200836 * library/ecp.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000837 * library/rsa.c
838 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000839 *
840 * This module is required for RSA and DHM support.
841 */
Paul Bakker40e46942009-01-03 21:51:57 +0000842#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000843
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000844/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000845 * \def POLARSSL_BLOWFISH_C
846 *
847 * Enable the Blowfish block cipher.
848 *
849 * Module: library/blowfish.c
850 */
851#define POLARSSL_BLOWFISH_C
852
853/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000854 * \def POLARSSL_CAMELLIA_C
855 *
856 * Enable the Camellia block cipher.
857 *
Paul Bakker38119b12009-01-10 23:31:23 +0000858 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000859 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000860 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000861 * This module enables the following ciphersuites (if other requisites are
862 * enabled as well):
863 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
864 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
865 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
866 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
867 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
868 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
869 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
870 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000871 */
872#define POLARSSL_CAMELLIA_C
873
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000874/**
875 * \def POLARSSL_CERTS_C
876 *
877 * Enable the test certificates.
878 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000879 * Module: library/certs.c
880 * Caller:
881 *
882 * This module is used for testing (ssl_client/server).
883 */
Paul Bakker40e46942009-01-03 21:51:57 +0000884#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000885
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000886/**
887 * \def POLARSSL_CIPHER_C
888 *
889 * Enable the generic cipher layer.
890 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000891 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +0200892 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +0000893 *
894 * Uncomment to enable generic cipher wrappers.
895 */
896#define POLARSSL_CIPHER_C
897
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000898/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000899 * \def POLARSSL_CTR_DRBG_C
900 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200901 * Enable the CTR_DRBG AES-256-based random generator.
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000902 *
903 * Module: library/ctr_drbg.c
904 * Caller:
905 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000906 * Requires: POLARSSL_AES_C
907 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000908 * This module provides the CTR_DRBG AES-256 random number generator.
909 */
910#define POLARSSL_CTR_DRBG_C
911
912/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000913 * \def POLARSSL_DEBUG_C
914 *
915 * Enable the debug functions.
916 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000917 * Module: library/debug.c
918 * Caller: library/ssl_cli.c
919 * library/ssl_srv.c
920 * library/ssl_tls.c
921 *
922 * This module provides debugging functions.
923 */
Paul Bakker40e46942009-01-03 21:51:57 +0000924#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000925
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000926/**
927 * \def POLARSSL_DES_C
928 *
929 * Enable the DES block cipher.
930 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000931 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100932 * Caller: library/pem.c
933 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000934 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000935 * This module enables the following ciphersuites (if other requisites are
936 * enabled as well):
937 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
938 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100939 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200940 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100941 *
Paul Bakkercff68422013-09-15 20:43:33 +0200942 * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000943 */
Paul Bakker40e46942009-01-03 21:51:57 +0000944#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000945
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000946/**
947 * \def POLARSSL_DHM_C
948 *
949 * Enable the Diffie-Hellman-Merkle key exchange.
950 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000951 * Module: library/dhm.c
952 * Caller: library/ssl_cli.c
953 * library/ssl_srv.c
954 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000955 * This module enables the following ciphersuites (if other requisites are
956 * enabled as well):
957 * TLS_DHE_RSA_WITH_DES_CBC_SHA
958 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
959 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
960 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
961 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
962 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
963 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
964 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
965 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
966 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
967 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
968 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000969 */
Paul Bakker40e46942009-01-03 21:51:57 +0000970#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000971
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000972/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100973 * \def POLARSSL_ECDH_C
974 *
975 * Enable the elliptic curve Diffie-Hellman library.
976 *
977 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100978 * Caller: library/ssl_cli.c
979 * library/ssl_srv.c
980 *
981 * This module enables the following ciphersuites (if other requisites are
982 * enabled as well):
983 * TLS_ECDHE_RSA_WITH_NULL_SHA
984 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
985 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
986 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
987 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100988 *
989 * Requires: POLARSSL_ECP_C
990 */
991#define POLARSSL_ECDH_C
992
993/**
994 * \def POLARSSL_ECDSA_C
995 *
996 * Enable the elliptic curve DSA library.
997 *
998 * Module: library/ecdsa.c
999 * Caller:
1000 *
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001001 * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +01001002 */
1003#define POLARSSL_ECDSA_C
1004
1005/**
1006 * \def POLARSSL_ECP_C
1007 *
1008 * Enable the elliptic curve over GF(p) library.
1009 *
1010 * Module: library/ecp.c
1011 * Caller: library/ecdh.c
1012 * library/ecdsa.c
1013 *
1014 * Requires: POLARSSL_BIGNUM_C
1015 */
1016#define POLARSSL_ECP_C
1017
1018/**
Paul Bakker6083fd22011-12-03 21:45:14 +00001019 * \def POLARSSL_ENTROPY_C
1020 *
1021 * Enable the platform-specific entropy code.
1022 *
1023 * Module: library/entropy.c
1024 * Caller:
1025 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001026 * Requires: POLARSSL_SHA512_C
Paul Bakker6083fd22011-12-03 21:45:14 +00001027 *
1028 * This module provides a generic entropy pool
1029 */
1030#define POLARSSL_ENTROPY_C
1031
1032/**
Paul Bakker9d781402011-05-09 16:17:09 +00001033 * \def POLARSSL_ERROR_C
1034 *
1035 * Enable error code to error string conversion.
1036 *
1037 * Module: library/error.c
1038 * Caller:
1039 *
1040 * This module enables err_strerror().
1041 */
1042#define POLARSSL_ERROR_C
1043
1044/**
Paul Bakker89e80c92012-03-20 13:50:09 +00001045 * \def POLARSSL_GCM_C
1046 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001047 * Enable the Galois/Counter Mode (GCM) for AES.
Paul Bakker89e80c92012-03-20 13:50:09 +00001048 *
1049 * Module: library/gcm.c
1050 *
1051 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +00001052 *
1053 * This module enables the following ciphersuites (if other requisites are
1054 * enabled as well):
1055 * TLS_RSA_WITH_AES_128_GCM_SHA256
1056 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +00001057 */
1058#define POLARSSL_GCM_C
1059
1060/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001061 * \def POLARSSL_HAVEGE_C
1062 *
1063 * Enable the HAVEGE random generator.
1064 *
Paul Bakker2a844242013-06-24 13:01:53 +02001065 * Warning: the HAVEGE random generator is not suitable for virtualized
1066 * environments
1067 *
1068 * Warning: the HAVEGE random generator is dependent on timing and specific
1069 * processor traits. It is therefore not advised to use HAVEGE as
1070 * your applications primary random generator or primary entropy pool
1071 * input. As a secondary input to your entropy pool, it IS able add
1072 * the (limited) extra entropy it provides.
1073 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001074 * Module: library/havege.c
1075 * Caller:
1076 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001077 * Requires: POLARSSL_TIMING_C
1078 *
Paul Bakker2a844242013-06-24 13:01:53 +02001079 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001080#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +02001081 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001082
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001083/**
1084 * \def POLARSSL_MD_C
1085 *
1086 * Enable the generic message digest layer.
1087 *
Paul Bakker17373852011-01-06 14:20:01 +00001088 * Module: library/md.c
1089 * Caller:
1090 *
1091 * Uncomment to enable generic message digest wrappers.
1092 */
1093#define POLARSSL_MD_C
1094
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001095/**
1096 * \def POLARSSL_MD2_C
1097 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001098 * Enable the MD2 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001099 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001100 * Module: library/md2.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001101 * Caller:
Paul Bakker5121ce52009-01-03 21:22:43 +00001102 *
1103 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
1104 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001105#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001106 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001107
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001108/**
1109 * \def POLARSSL_MD4_C
1110 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001111 * Enable the MD4 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001112 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001113 * Module: library/md4.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001114 * Caller:
Paul Bakker5121ce52009-01-03 21:22:43 +00001115 *
1116 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1117 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001118#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001119 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001120
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001121/**
1122 * \def POLARSSL_MD5_C
1123 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001124 * Enable the MD5 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001125 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001126 * Module: library/md5.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001127 * Caller: library/md.c
1128 * library/pem.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001129 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001130 *
1131 * This module is required for SSL/TLS and X.509.
Paul Bakkercff68422013-09-15 20:43:33 +02001132 * PEM_PARSE uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +00001133 */
Paul Bakker40e46942009-01-03 21:51:57 +00001134#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001135
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001136/**
Paul Bakker6e339b52013-07-03 13:37:05 +02001137 * \def POLARSSL_MEMORY_C
1138 *
1139 * Enable the memory allocation layer.
1140 * By default PolarSSL uses the system-provided malloc() and free().
1141 * (As long as POLARSSL_MEMORY_STDMALLOC and POLARSSL_MEMORY_STDFREE
1142 * are defined and unmodified)
1143 *
1144 * This allows different allocators (self-implemented or provided)
1145 *
1146 * Enable this layer to allow use of alternative memory allocators.
1147#define POLARSSL_MEMORY_C
1148 */
1149
1150/**
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001151 * \def POLARSSL_MEMORY_BUFFER_ALLOC_C
1152 *
1153 * Enable the buffer allocator implementation that makes use of a (stack)
1154 * based buffer to 'allocate' dynamic memory. (replaces malloc() and free()
1155 * calls)
Paul Bakker6e339b52013-07-03 13:37:05 +02001156 *
1157 * Module: library/memory_buffer_alloc.c
1158 *
1159 * Requires: POLARSSL_MEMORY_C
1160 *
1161 * Enable this module to enable the buffer memory allocator.
1162#define POLARSSL_MEMORY_BUFFER_ALLOC_C
1163 */
1164
1165/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001166 * \def POLARSSL_NET_C
1167 *
1168 * Enable the TCP/IP networking routines.
1169 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001170 * Module: library/net.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001171 *
1172 * This module provides TCP/IP networking routines.
1173 */
Paul Bakker40e46942009-01-03 21:51:57 +00001174#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001175
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001176/**
Paul Bakkerc70b9822013-04-07 22:00:46 +02001177 * \def POLARSSL_OID_C
1178 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001179 * Enable the OID database.
Paul Bakkerc70b9822013-04-07 22:00:46 +02001180 *
1181 * Module: library/oid.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001182 * Caller: library/asn1write.c
1183 * library/pkcs5.c
1184 * library/pkparse.c
1185 * library/pkwrite.c
1186 * library/rsa.c
1187 * library/x509.c
1188 * library/x509_create.c
1189 * library/x509_crl.c
1190 * library/x509_crt.c
1191 * library/x509_csr.c
1192 * library/x509write_crt.c
1193 * library/x509write_csr.c
Paul Bakkerc70b9822013-04-07 22:00:46 +02001194 *
1195 * This modules translates between OIDs and internal values.
1196 */
1197#define POLARSSL_OID_C
1198
1199/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001200 * \def POLARSSL_PADLOCK_C
1201 *
1202 * Enable VIA Padlock support on x86.
1203 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001204 * Module: library/padlock.c
1205 * Caller: library/aes.c
1206 *
1207 * This modules adds support for the VIA PadLock on x86.
1208 */
Paul Bakker40e46942009-01-03 21:51:57 +00001209#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001210
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001211/**
Paul Bakkerf518b162012-08-23 13:03:18 +00001212 * \def POLARSSL_PBKDF2_C
1213 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001214 * Enable PKCS#5 PBKDF2 key derivation function.
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001215 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +00001216 *
1217 * Module: library/pbkdf2.c
1218 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001219 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001220 *
1221 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +00001222 */
Paul Bakker370e90c2013-04-08 15:19:43 +02001223#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001224
1225/**
Paul Bakkercff68422013-09-15 20:43:33 +02001226 * \def POLARSSL_PEM_PARSE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00001227 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001228 * Enable PEM decoding / parsing.
Paul Bakker96743fc2011-02-12 14:30:57 +00001229 *
1230 * Module: library/pem.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001231 * Caller: library/dhm.c
Paul Bakkercff68422013-09-15 20:43:33 +02001232 * library/pkparse.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001233 * library/x509_crl.c
1234 * library/x509_crt.c
1235 * library/x509_csr.c
Paul Bakker96743fc2011-02-12 14:30:57 +00001236 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001237 * Requires: POLARSSL_BASE64_C
1238 *
Paul Bakkercff68422013-09-15 20:43:33 +02001239 * This modules adds support for decoding / parsing PEM files.
Paul Bakker96743fc2011-02-12 14:30:57 +00001240 */
Paul Bakkercff68422013-09-15 20:43:33 +02001241#define POLARSSL_PEM_PARSE_C
1242
1243/**
1244 * \def POLARSSL_PEM_WRITE_C
1245 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001246 * Enable PEM encoding / writing.
Paul Bakkercff68422013-09-15 20:43:33 +02001247 *
1248 * Module: library/pem.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001249 * Caller: library/pkwrite.c
1250 * library/x509write_crt.c
1251 * library/x509write_csr.c
Paul Bakkercff68422013-09-15 20:43:33 +02001252 *
1253 * Requires: POLARSSL_BASE64_C
1254 *
1255 * This modules adds support for encoding / writing PEM files.
1256 */
1257#define POLARSSL_PEM_WRITE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00001258
1259/**
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001260 * \def POLARSSL_PK_C
1261 *
1262 * Enable the generic public (asymetric) key layer.
1263 *
1264 * Module: library/pk.c
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001265 * Caller: library/ssl_tls.c
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001266 * library/ssl_cli.c
1267 * library/ssl_srv.c
1268 *
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001269 * Requires: POLARSSL_RSA_C or POLARSSL_ECP_C
1270 *
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001271 * Uncomment to enable generic public key wrappers.
1272 */
1273#define POLARSSL_PK_C
1274
1275/**
Paul Bakker4606c732013-09-15 17:04:23 +02001276 * \def POLARSSL_PK_PARSE_C
1277 *
1278 * Enable the generic public (asymetric) key parser.
1279 *
1280 * Module: library/pkparse.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001281 * Caller: library/x509_crt.c
1282 * library/x509_csr.c
Paul Bakker4606c732013-09-15 17:04:23 +02001283 *
1284 * Requires: POLARSSL_PK_C
1285 *
1286 * Uncomment to enable generic public key parse functions.
1287 */
1288#define POLARSSL_PK_PARSE_C
1289
1290/**
1291 * \def POLARSSL_PK_WRITE_C
1292 *
Paul Bakkerf20ba4b2013-09-16 22:46:20 +02001293 * Enable the generic public (asymetric) key writer.
Paul Bakker4606c732013-09-15 17:04:23 +02001294 *
1295 * Module: library/pkwrite.c
1296 * Caller: library/x509write.c
1297 *
1298 * Requires: POLARSSL_PK_C
1299 *
1300 * Uncomment to enable generic public key write functions.
1301 */
1302#define POLARSSL_PK_WRITE_C
1303
1304/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001305 * \def POLARSSL_PKCS5_C
1306 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001307 * Enable PKCS#5 functions.
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001308 *
1309 * Module: library/pkcs5.c
1310 *
1311 * Requires: POLARSSL_MD_C
1312 *
1313 * This module adds support for the PKCS#5 functions.
1314 */
1315#define POLARSSL_PKCS5_C
1316
1317/**
Paul Bakker5690efc2011-05-26 13:16:06 +00001318 * \def POLARSSL_PKCS11_C
1319 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001320 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001321 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001322 * Module: library/pkcs11.c
1323 * Caller: library/pk.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001324 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001325 * Requires: POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001326 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001327 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001328 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1329#define POLARSSL_PKCS11_C
1330 */
1331
1332/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001333 * \def POLARSSL_PKCS12_C
1334 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001335 * Enable PKCS#12 PBE functions.
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001336 * Adds algorithms for parsing PKCS#8 encrypted private keys
1337 *
1338 * Module: library/pkcs12.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001339 * Caller: library/pkparse.c
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001340 *
Paul Bakkerb0713c72013-06-24 19:34:08 +02001341 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
1342 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001343 *
1344 * This module enables PKCS#12 functions.
1345 */
1346#define POLARSSL_PKCS12_C
1347
1348/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001349 * \def POLARSSL_RSA_C
1350 *
1351 * Enable the RSA public-key cryptosystem.
1352 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001353 * Module: library/rsa.c
1354 * Caller: library/ssl_cli.c
1355 * library/ssl_srv.c
1356 * library/ssl_tls.c
1357 * library/x509.c
1358 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001359 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001360 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001361 * This module is required for SSL/TLS and MD5-signed certificates.
1362 */
Paul Bakker40e46942009-01-03 21:51:57 +00001363#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001364
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001365/**
1366 * \def POLARSSL_SHA1_C
1367 *
1368 * Enable the SHA1 cryptographic hash algorithm.
1369 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001370 * Module: library/sha1.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001371 * Caller: library/md.c
1372 * library/ssl_cli.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001373 * library/ssl_srv.c
1374 * library/ssl_tls.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001375 * library/x509write_crt.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001376 *
1377 * This module is required for SSL/TLS and SHA1-signed certificates.
1378 */
Paul Bakker40e46942009-01-03 21:51:57 +00001379#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001380
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001381/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001382 * \def POLARSSL_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001383 *
1384 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001385 * (Used to be POLARSSL_SHA2_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001386 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001387 * Module: library/sha256.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001388 * Caller: library/entropy.c
1389 * library/md.c
1390 * library/ssl_cli.c
1391 * library/ssl_srv.c
1392 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001393 *
1394 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001395 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001396 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001397#define POLARSSL_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001398
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001399/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001400 * \def POLARSSL_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001401 *
1402 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001403 * (Used to be POLARSSL_SHA4_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001404 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001405 * Module: library/sha512.c
Manuel Pégourié-Gonnardfe286462013-09-20 14:10:14 +02001406 * Caller: library/entropy.c
1407 * library/md.c
1408 * library/ssl_cli.c
1409 * library/ssl_srv.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001410 *
1411 * This module adds support for SHA-384 and SHA-512.
1412 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001413#define POLARSSL_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001414
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001415/**
Paul Bakker0a597072012-09-25 21:55:46 +00001416 * \def POLARSSL_SSL_CACHE_C
1417 *
1418 * Enable simple SSL cache implementation.
1419 *
1420 * Module: library/ssl_cache.c
1421 * Caller:
1422 *
1423 * Requires: POLARSSL_SSL_CACHE_C
1424 */
1425#define POLARSSL_SSL_CACHE_C
1426
1427/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001428 * \def POLARSSL_SSL_CLI_C
1429 *
1430 * Enable the SSL/TLS client code.
1431 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001432 * Module: library/ssl_cli.c
1433 * Caller:
1434 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001435 * Requires: POLARSSL_SSL_TLS_C
1436 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001437 * This module is required for SSL/TLS client support.
1438 */
Paul Bakker40e46942009-01-03 21:51:57 +00001439#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001440
Paul Bakker9a736322012-11-14 12:39:52 +00001441/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001442 * \def POLARSSL_SSL_SRV_C
1443 *
1444 * Enable the SSL/TLS server code.
1445 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001446 * Module: library/ssl_srv.c
1447 * Caller:
1448 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001449 * Requires: POLARSSL_SSL_TLS_C
1450 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001451 * This module is required for SSL/TLS server support.
1452 */
Paul Bakker40e46942009-01-03 21:51:57 +00001453#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001454
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001455/**
1456 * \def POLARSSL_SSL_TLS_C
1457 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001458 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001459 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001460 * Module: library/ssl_tls.c
1461 * Caller: library/ssl_cli.c
1462 * library/ssl_srv.c
1463 *
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001464 * Requires: POLARSSL_CIPHER_C, POLARSSL_MD_C
Paul Bakker577e0062013-08-28 11:57:20 +02001465 * and at least one of the POLARSSL_SSL_PROTO_* defines
Paul Bakker5690efc2011-05-26 13:16:06 +00001466 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001467 * This module is required for SSL/TLS.
1468 */
Paul Bakker40e46942009-01-03 21:51:57 +00001469#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001470
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001471/**
Paul Bakker2466d932013-09-28 14:40:38 +02001472 * \def POLARSSL_THREADING_C
1473 *
1474 * Enable the threading abstraction layer.
1475 * By default PolarSSL assumes it is used in a non-threaded environment or that
1476 * contexts are not shared between threads. If you do intend to use contexts
1477 * between threads, you will need to enable this layer to prevent race
1478 * conditions.
1479 *
1480 * Module: library/threading.c
1481 *
1482 * This allows different threading implementations (self-implemented or
1483 * provided).
1484 *
1485 * You will have to enable either POLARSSL_THREADING_ALT,
1486 * POLARSSL_THREADING_PTHREAD or POLARSSL_THREADING_DUMMY.
1487 *
1488 * Enable this layer to allow use of mutexes within PolarSSL
1489#define POLARSSL_THREADING_C
1490 */
1491
1492/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001493 * \def POLARSSL_TIMING_C
1494 *
1495 * Enable the portable timing interface.
1496 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001497 * Module: library/timing.c
1498 * Caller: library/havege.c
1499 *
1500 * This module is used by the HAVEGE random number generator.
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001501 */
Paul Bakkerdcbfdcc2013-09-10 16:16:50 +02001502#define POLARSSL_TIMING_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001503
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001504/**
1505 * \def POLARSSL_VERSION_C
1506 *
1507 * Enable run-time version information.
1508 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001509 * Module: library/version.c
1510 *
1511 * This module provides run-time version information.
1512 */
1513#define POLARSSL_VERSION_C
1514
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001515/**
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001516 * \def POLARSSL_X509_USE_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001517 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001518 * Enable X.509 core for using certificates.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001519 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001520 * Module: library/x509.c
1521 * Caller: library/x509_crl.c
1522 * library/x509_crt.c
1523 * library/x509_csr.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001524 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001525 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
Paul Bakker4606c732013-09-15 17:04:23 +02001526 * POLARSSL_PK_PARSE_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001527 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001528 * This module is required for the X.509 parsing modules.
Paul Bakker5121ce52009-01-03 21:22:43 +00001529 */
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001530#define POLARSSL_X509_USE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001531
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001532/**
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001533 * \def POLARSSL_X509_CRT_PARSE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001534 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001535 * Enable X.509 certificate parsing.
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001536 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001537 * Module: library/x509_crt.c
1538 * Caller: library/ssl_cli.c
1539 * library/ssl_srv.c
1540 * library/ssl_tls.c
1541 *
1542 * Requires: POLARSSL_X509_USE_C
1543 *
1544 * This module is required for X.509 certificate parsing.
1545 */
1546#define POLARSSL_X509_CRT_PARSE_C
1547
1548/**
1549 * \def POLARSSL_X509_CRL_PARSE_C
1550 *
1551 * Enable X.509 CRL parsing.
1552 *
1553 * Module: library/x509_crl.c
1554 * Caller: library/x509_crt.c
1555 *
1556 * Requires: POLARSSL_X509_USE_C
1557 *
1558 * This module is required for X.509 CRL parsing.
1559 */
1560#define POLARSSL_X509_CRL_PARSE_C
1561
1562/**
1563 * \def POLARSSL_X509_CSR_PARSE_C
1564 *
1565 * Enable X.509 Certificate Signing Request (CSR) parsing.
1566 *
1567 * Module: library/x509_csr.c
1568 * Caller: library/x509_crt_write.c
1569 *
1570 * Requires: POLARSSL_X509_USE_C
1571 *
1572 * This module is used for reading X.509 certificate request.
1573 */
1574#define POLARSSL_X509_CSR_PARSE_C
1575
1576/**
1577 * \def POLARSSL_X509_CREATE_C
1578 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001579 * Enable X.509 core for creating certificates.
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001580 *
1581 * Module: library/x509_create.c
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001582 *
Paul Bakker4606c732013-09-15 17:04:23 +02001583 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_PK_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001584 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001585 * This module is the basis for creating X.509 certificates and CSRs.
1586 */
1587#define POLARSSL_X509_CREATE_C
1588
1589/**
1590 * \def POLARSSL_X509_CRT_WRITE_C
1591 *
1592 * Enable creating X.509 certificates.
1593 *
1594 * Module: library/x509_crt_write.c
1595 *
1596 * Requires: POLARSSL_CREATE_C
1597 *
1598 * This module is required for X.509 certificate creation.
1599 */
1600#define POLARSSL_X509_CRT_WRITE_C
1601
1602/**
1603 * \def POLARSSL_X509_CSR_WRITE_C
1604 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001605 * Enable creating X.509 Certificate Signing Requests (CSR).
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001606 *
1607 * Module: library/x509_csr_write.c
1608 *
1609 * Requires: POLARSSL_CREATE_C
1610 *
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001611 * This module is required for X.509 certificate request writing.
1612 */
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001613#define POLARSSL_X509_CSR_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001614
1615/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001616 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001617 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001618 * Enable the XTEA block cipher.
1619 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001620 * Module: library/xtea.c
1621 * Caller:
1622 */
1623#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001624
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001625/* \} name SECTION: PolarSSL modules */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001626
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001627/**
1628 * \name SECTION: Module configuration options
1629 *
1630 * This section allows for the setting of module specific sizes and
1631 * configuration options. The default values are already present in the
1632 * relevant header files and should suffice for the regular use cases.
1633 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1634 * only if you have a good reason and know the consequences.
1635 *
1636 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1637 * header file take precedence.
1638 *
1639 * Please check the respective header file for documentation on these
1640 * parameters (to prevent duplicate documentation).
1641 *
1642 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1643 * \{
1644 */
1645//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1646
1647#if defined(POLARSSL_CONFIG_OPTIONS)
1648
1649// MPI / BIGNUM options
1650//
1651#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1652#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1653
1654// CTR_DRBG options
1655//
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001656#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 +02001657#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1658#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1659#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1660#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1661
1662// Entropy options
1663//
1664#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1665#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1666
Paul Bakker6e339b52013-07-03 13:37:05 +02001667// Memory options
1668#define MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1669#define POLARSSL_MEMORY_STDMALLOC malloc /**< Default allocator to use, can be undefined */
1670#define POLARSSL_MEMORY_STDFREE free /**< Default free to use, can be undefined */
1671
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001672// SSL Cache options
1673//
1674#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1675#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1676
1677// SSL options
1678//
1679#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
Paul Bakker606b4ba2013-08-14 16:52:14 +02001680#define SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001681
1682#endif /* POLARSSL_CONFIG_OPTIONS */
1683
1684/* \} name */
1685
Paul Bakker7ad00f92013-04-18 23:05:25 +02001686/*
1687 * Sanity checks on defines and dependencies
1688 */
1689#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1690#error "POLARSSL_DHM_C defined, but not all prerequisites"
1691#endif
1692
1693#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1694#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1695#endif
1696
1697#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1698#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1699#endif
1700
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001701#if defined(POLARSSL_ECDSA_C) && \
1702 ( !defined(POLARSSL_ECP_C) || \
1703 !defined(POLARSSL_ASN1_PARSE_C) || \
1704 !defined(POLARSSL_ASN1_WRITE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001705#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1706#endif
1707
1708#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
1709#error "POLARSSL_ECP_C defined, but not all prerequisites"
1710#endif
1711
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001712#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
1713 !defined(POLARSSL_SHA256_C))
Paul Bakker7ad00f92013-04-18 23:05:25 +02001714#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1715#endif
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001716#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
1717 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
1718#error "CTR_DRBG_ENTROPY_LEN value too high"
1719#endif
1720#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA512_C) && \
1721 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
1722#error "CTR_DRBG_ENTROPY_LEN value too high"
1723#endif
Paul Bakker7ad00f92013-04-18 23:05:25 +02001724
1725#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1726#error "POLARSSL_GCM_C defined, but not all prerequisites"
1727#endif
1728
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001729#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
1730#error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
1731#endif
1732
Paul Bakkere07f41d2013-04-19 09:08:57 +02001733#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1734#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1735#endif
1736
1737#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1738 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +02001739 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001740#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1741#endif
1742
1743#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1744 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +02001745 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001746#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1747#endif
1748
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +02001749#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
1750 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +02001751 !defined(POLARSSL_X509_CRT_PARSE_C) )
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +02001752#error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
1753#endif
1754
Paul Bakkere07f41d2013-04-19 09:08:57 +02001755#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001756 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +02001757 !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001758#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1759#endif
1760
1761#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001762 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
Manuel Pégourié-Gonnardcbf3ef32013-09-23 12:20:02 +02001763 !defined(POLARSSL_PKCS1_V15) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001764#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1765#endif
1766
Paul Bakker6e339b52013-07-03 13:37:05 +02001767#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && !defined(POLARSSL_MEMORY_C)
1768#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
1769#endif
1770
Paul Bakker7ad00f92013-04-18 23:05:25 +02001771#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1772#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1773#endif
1774
Paul Bakkercff68422013-09-15 20:43:33 +02001775#if defined(POLARSSL_PEM_PARSE_C) && !defined(POLARSSL_BASE64_C)
1776#error "POLARSSL_PEM_PARSE_C defined, but not all prerequisites"
1777#endif
1778
1779#if defined(POLARSSL_PEM_WRITE_C) && !defined(POLARSSL_BASE64_C)
1780#error "POLARSSL_PEM_WRITE_C defined, but not all prerequisites"
Paul Bakker7ad00f92013-04-18 23:05:25 +02001781#endif
1782
Paul Bakker4606c732013-09-15 17:04:23 +02001783#if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C)
1784#error "POLARSSL_PK_PARSE_C defined, but not all prerequisites"
1785#endif
1786
1787#if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C)
1788#error "POLARSSL_PK_WRITE_C defined, but not all prerequisites"
1789#endif
1790
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001791#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001792#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1793#endif
1794
1795#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1796 !defined(POLARSSL_OID_C) )
1797#error "POLARSSL_RSA_C defined, but not all prerequisites"
1798#endif
1799
1800#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1801#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1802#endif
1803
Paul Bakker577e0062013-08-28 11:57:20 +02001804#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001805 !defined(POLARSSL_MD_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001806#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1807#endif
1808
1809#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1810#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1811#endif
1812
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001813#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
1814 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
1815 !defined(POLARSSL_SSL_PROTO_TLS1_2))
1816#error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
1817#endif
1818
1819#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1820 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
1821#error "Illegal protocol selection"
1822#endif
1823
1824#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
1825 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
1826#error "Illegal protocol selection"
1827#endif
1828
1829#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1830 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
1831 !defined(POLARSSL_SSL_PROTO_TLS1_1)))
1832#error "Illegal protocol selection"
1833#endif
1834
Paul Bakker59da0a42013-08-19 13:27:17 +02001835#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
Manuel Pégourié-Gonnard92cb1d32013-09-13 16:24:20 +02001836 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) || \
1837 !defined(POLARSSL_CIPHER_MODE_CBC) )
Paul Bakker59da0a42013-08-19 13:27:17 +02001838#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
1839#endif
1840
Paul Bakker2466d932013-09-28 14:40:38 +02001841#if defined(POLARSSL_THREADING_DUMMY)
1842#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
1843#error "POLARSSL_THREADING_DUMMY defined, but not all prerequisites"
1844#endif
1845#define POLARSSL_THREADING_IMPL
1846#endif
1847
1848#if defined(POLARSSL_THREADING_PTHREAD)
1849#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
1850#error "POLARSSL_THREADING_PTHREAD defined, but not all prerequisites"
1851#endif
1852#define POLARSSL_THREADING_IMPL
1853#endif
1854
1855#if defined(POLARSSL_THREADING_ALT)
1856#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
1857#error "POLARSSL_THREADING_ALT defined, but not all prerequisites"
1858#endif
1859#define POLARSSL_THREADING_IMPL
1860#endif
1861
1862#if defined(POLARSSL_THREADING_C) && !defined(POLARSSL_THREADING_IMPL)
1863#error "POLARSSL_THREADING_C defined, single threading implementation required"
1864#endif
1865#undef POLARSSL_THREADING_IMPL
1866
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001867#if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
Paul Bakker7ad00f92013-04-18 23:05:25 +02001868 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
Paul Bakker4606c732013-09-15 17:04:23 +02001869 !defined(POLARSSL_PK_PARSE_C) )
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001870#error "POLARSSL_X509_USE_C defined, but not all prerequisites"
Paul Bakker7ad00f92013-04-18 23:05:25 +02001871#endif
1872
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001873#if defined(POLARSSL_X509_CREATE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1874 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
1875 !defined(POLARSSL_PK_WRITE_C) )
1876#error "POLARSSL_X509_CREATE_C defined, but not all prerequisites"
1877#endif
1878
1879#if defined(POLARSSL_X509_CRT_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
1880#error "POLARSSL_X509_CRT_PARSE_C defined, but not all prerequisites"
1881#endif
1882
1883#if defined(POLARSSL_X509_CRL_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
1884#error "POLARSSL_X509_CRL_PARSE_C defined, but not all prerequisites"
1885#endif
1886
1887#if defined(POLARSSL_X509_CSR_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
1888#error "POLARSSL_X509_CSR_PARSE_C defined, but not all prerequisites"
1889#endif
1890
1891#if defined(POLARSSL_X509_CRT_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
1892#error "POLARSSL_X509_CRT_WRITE_C defined, but not all prerequisites"
1893#endif
1894
1895#if defined(POLARSSL_X509_CSR_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
1896#error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites"
Paul Bakker7ad00f92013-04-18 23:05:25 +02001897#endif
1898
Paul Bakker5121ce52009-01-03 21:22:43 +00001899#endif /* config.h */