blob: 8a1e60ea75156419b3e85b5d796c1aecce4dbb8a [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,
289 * POLARSSL_X509_CRT_PARSE_C, POLARSSL_X509_CRL_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,
310 * POLARSSL_X509_CRT_PARSE_C, POLARSSL_X509_CRL_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,
336 * POLARSSL_X509_CRT_PARSE_C, POLARSSL_X509_CRL_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,
358 * POLARSSL_X509_CRT_PARSE_C, POLARSSL_X509_CRL_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,
381 * POLARSSL_X509_CRL_PARSE_C
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +0200382 *
383 * This enables the following ciphersuites (if other requisites are
384 * enabled as well):
385 * TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
386 * TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
387 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
388 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
389 * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
390 * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
391 * TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
392 * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
393 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
394 * TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
395 */
396#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
397
398/**
Paul Bakkere2ab84f2013-06-29 18:24:32 +0200399 * \def POLARSSL_ERROR_STRERROR_BC
400 *
401 * Make available the backward compatible error_strerror() next to the
402 * current polarssl_strerror().
403 *
404 * Disable if you run into name conflicts and want to really remove the
405 * error_strerror()
406 */
407#define POLARSSL_ERROR_STRERROR_BC
408
409/**
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100410 * \def POLARSSL_ERROR_STRERROR_DUMMY
411 *
Paul Bakkereba3ccf2013-09-09 15:55:12 +0200412 * Enable a dummy error function to make use of polarssl_strerror() in
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100413 * third party libraries easier.
414 *
415 * Disable if you run into name conflicts and want to really remove the
Paul Bakkereba3ccf2013-09-09 15:55:12 +0200416 * polarssl_strerror()
Paul Bakker8fe40dc2013-02-02 12:43:08 +0100417 */
418#define POLARSSL_ERROR_STRERROR_DUMMY
419
420/**
Paul Bakker15566e42011-04-24 21:19:15 +0000421 * \def POLARSSL_GENPRIME
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000422 *
Paul Bakker15566e42011-04-24 21:19:15 +0000423 * Enable the RSA prime-number generation code.
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200424 *
425 * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000426 */
Paul Bakker15566e42011-04-24 21:19:15 +0000427#define POLARSSL_GENPRIME
Paul Bakker5121ce52009-01-03 21:22:43 +0000428
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000429/**
Paul Bakker335db3f2011-04-25 15:28:35 +0000430 * \def POLARSSL_FS_IO
431 *
432 * Enable functions that use the filesystem.
433 */
434#define POLARSSL_FS_IO
435
436/**
Paul Bakker43655f42011-12-15 20:11:16 +0000437 * \def POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
438 *
439 * Do not add default entropy sources. These are the platform specific,
440 * hardclock and HAVEGE based poll functions.
441 *
442 * This is useful to have more control over the added entropy sources in an
443 * application.
444 *
445 * Uncomment this macro to prevent loading of default entropy functions.
446#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
447 */
448
449/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000450 * \def POLARSSL_NO_PLATFORM_ENTROPY
451 *
452 * Do not use built-in platform entropy functions.
453 * This is useful if your platform does not support
454 * standards like the /dev/urandom or Windows CryptoAPI.
455 *
456 * Uncomment this macro to disable the built-in platform entropy functions.
457#define POLARSSL_NO_PLATFORM_ENTROPY
458 */
459
460/**
Paul Bakker6e339b52013-07-03 13:37:05 +0200461 * \def POLARSSL_MEMORY_DEBUG
462 *
463 * Enable debugging of buffer allocator memory issues. Automatically prints
464 * (to stderr) all (fatal) messages on memory allocation issues. Enables
465 * function for 'debug output' of allocated memory.
466 *
467 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
468 * fprintf()
469 *
470 * Uncomment this macro to let the buffer allocator print out error messages.
471#define POLARSSL_MEMORY_DEBUG
472*/
473
474/**
475 * \def POLARSSL_MEMORY_BACKTRACE
476 *
477 * Include backtrace information with each allocated block.
478 *
479 * Requires: POLARSSL_MEMORY_BUFFER_ALLOC_C
480 * GLIBC-compatible backtrace() an backtrace_symbols() support
481 *
482 * Uncomment this macro to include backtrace information
483#define POLARSSL_MEMORY_BACKTRACE
484 */
485
486/**
Paul Bakker48377d92013-08-30 12:06:24 +0200487 * \def POLARSSL_PKCS1_V15
488 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200489 * Enable support for PKCS#1 v1.5 encoding.
490 *
Paul Bakker48377d92013-08-30 12:06:24 +0200491 * Requires: POLARSSL_RSA_C
492 *
Paul Bakker48377d92013-08-30 12:06:24 +0200493 * This enables support for PKCS#1 v1.5 operations.
494 */
495#define POLARSSL_PKCS1_V15
496
497/**
Paul Bakker9dcc3222011-03-08 14:16:06 +0000498 * \def POLARSSL_PKCS1_V21
499 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200500 * Enable support for PKCS#1 v2.1 encoding.
501 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000502 * Requires: POLARSSL_MD_C, POLARSSL_RSA_C
503 *
Paul Bakker9dcc3222011-03-08 14:16:06 +0000504 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
505 */
506#define POLARSSL_PKCS1_V21
507
508/**
Paul Bakker0216cc12011-03-26 13:40:23 +0000509 * \def POLARSSL_RSA_NO_CRT
510 *
511 * Do not use the Chinese Remainder Theorem for the RSA private operation.
512 *
513 * Uncomment this macro to disable the use of CRT in RSA.
514 *
515#define POLARSSL_RSA_NO_CRT
516 */
Paul Bakker15566e42011-04-24 21:19:15 +0000517
518/**
519 * \def POLARSSL_SELF_TEST
520 *
521 * Enable the checkup functions (*_self_test).
522 */
523#define POLARSSL_SELF_TEST
Paul Bakker5c721f92011-07-27 16:51:09 +0000524
525/**
Paul Bakker40865c82013-01-31 17:13:13 +0100526 * \def POLARSSL_SSL_ALL_ALERT_MESSAGES
527 *
528 * Enable sending of alert messages in case of encountered errors as per RFC.
529 * If you choose not to send the alert messages, PolarSSL can still communicate
530 * with other servers, only debugging of failures is harder.
531 *
532 * The advantage of not sending alert messages, is that no information is given
533 * about reasons for failures thus preventing adversaries of gaining intel.
534 *
535 * Enable sending of all alert messages
536 */
537#define POLARSSL_SSL_ALERT_MESSAGES
538
539/**
Paul Bakkerd66f0702013-01-31 16:57:45 +0100540 * \def POLARSSL_SSL_DEBUG_ALL
541 *
542 * Enable the debug messages in SSL module for all issues.
543 * Debug messages have been disabled in some places to prevent timing
544 * attacks due to (unbalanced) debugging function calls.
545 *
546 * If you need all error reporting you should enable this during debugging,
547 * but remove this for production servers that should log as well.
548 *
549 * Uncomment this macro to report all debug messages on errors introducing
550 * a timing side-channel.
551 *
552#define POLARSSL_SSL_DEBUG_ALL
553 */
554
555/**
Paul Bakker05ef8352012-05-08 09:17:57 +0000556 * \def POLARSSL_SSL_HW_RECORD_ACCEL
557 *
558 * Enable hooking functions in SSL module for hardware acceleration of
559 * individual records.
560 *
561 * Uncomment this macro to enable hooking functions.
562#define POLARSSL_SSL_HW_RECORD_ACCEL
563 */
564
565/**
Paul Bakker78a8c712013-03-06 17:01:52 +0100566 * \def POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
567 *
568 * Enable support for receiving and parsing SSLv2 Client Hello messages for the
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200569 * SSL Server module (POLARSSL_SSL_SRV_C).
Paul Bakker78a8c712013-03-06 17:01:52 +0100570 *
571 * Comment this macro to disable support for SSLv2 Client Hello messages.
572 */
573#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
574
575/**
Paul Bakker05decb22013-08-15 13:33:48 +0200576 * \def POLARSSL_SSL_MAX_FRAGMENT_LENGTH
577 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200578 * Enable support for RFC 6066 max_fragment_length extension in SSL.
Paul Bakker05decb22013-08-15 13:33:48 +0200579 *
580 * Comment this macro to disable support for the max_fragment_length extension
581 */
582#define POLARSSL_SSL_MAX_FRAGMENT_LENGTH
583
584/**
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200585 * \def POLARSSL_SSL_PROTO_SSL3
586 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200587 * Enable support for SSL 3.0.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200588 *
589 * Requires: POLARSSL_MD5_C
590 * POLARSSL_SHA1_C
591 *
592 * Comment this macro to disable support for SSL 3.0
593 */
594#define POLARSSL_SSL_PROTO_SSL3
595
596/**
597 * \def POLARSSL_SSL_PROTO_TLS1
598 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200599 * Enable support for TLS 1.0.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200600 *
601 * Requires: POLARSSL_MD5_C
602 * POLARSSL_SHA1_C
603 *
604 * Comment this macro to disable support for TLS 1.0
605 */
606#define POLARSSL_SSL_PROTO_TLS1
607
608/**
609 * \def POLARSSL_SSL_PROTO_TLS1_1
610 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200611 * Enable support for TLS 1.1.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200612 *
613 * Requires: POLARSSL_MD5_C
614 * POLARSSL_SHA1_C
615 *
616 * Comment this macro to disable support for TLS 1.1
617 */
618#define POLARSSL_SSL_PROTO_TLS1_1
619
620/**
621 * \def POLARSSL_SSL_PROTO_TLS1_2
622 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200623 * Enable support for TLS 1.2.
Paul Bakkerd2f068e2013-08-27 21:19:20 +0200624 *
625 * Requires: POLARSSL_SHA256_C or POLARSSL_SHA512_C
626 * (Depends on ciphersuites)
627 *
628 * Comment this macro to disable support for TLS 1.2
629 */
630#define POLARSSL_SSL_PROTO_TLS1_2
631
632/**
Paul Bakkera503a632013-08-14 13:48:06 +0200633 * \def POLARSSL_SSL_SESSION_TICKETS
634 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200635 * Enable support for RFC 5077 session tickets in SSL.
Paul Bakkera503a632013-08-14 13:48:06 +0200636 *
637 * Requires: POLARSSL_AES_C
638 * POLARSSL_SHA256_C
Manuel Pégourié-Gonnard92cb1d32013-09-13 16:24:20 +0200639 * POLARSSL_CIPHER_MODE_CBC
Paul Bakkera503a632013-08-14 13:48:06 +0200640 *
641 * Comment this macro to disable support for SSL session tickets
642 */
643#define POLARSSL_SSL_SESSION_TICKETS
644
645/**
Paul Bakker0be444a2013-08-27 21:55:01 +0200646 * \def POLARSSL_SSL_SERVER_NAME_INDICATION
647 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200648 * Enable support for RFC 6066 server name indication (SNI) in SSL.
Paul Bakker0be444a2013-08-27 21:55:01 +0200649 *
650 * Comment this macro to disable support for server name indication in SSL
651 */
652#define POLARSSL_SSL_SERVER_NAME_INDICATION
653
654/**
Paul Bakker1f2bc622013-08-15 13:45:55 +0200655 * \def POLARSSL_SSL_TRUNCATED_HMAC
656 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200657 * Enable support for RFC 6066 truncated HMAC in SSL.
Paul Bakker1f2bc622013-08-15 13:45:55 +0200658 *
659 * Comment this macro to disable support for truncated HMAC in SSL
660 */
661#define POLARSSL_SSL_TRUNCATED_HMAC
662
663/**
Paul Bakker5c721f92011-07-27 16:51:09 +0000664 * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
665 *
666 * If set, the X509 parser will not break-off when parsing an X509 certificate
667 * and encountering an unknown critical extension.
668 *
669 * Uncomment to prevent an error.
670 *
671#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
672 */
Paul Bakker2770fbd2012-07-03 13:30:23 +0000673
674/**
675 * \def POLARSSL_ZLIB_SUPPORT
676 *
677 * If set, the SSL/TLS module uses ZLIB to support compression and
678 * decompression of packet data.
679 *
680 * Used in: library/ssl_tls.c
681 * library/ssl_cli.c
682 * library/ssl_srv.c
683 *
684 * This feature requires zlib library and headers to be present.
685 *
686 * Uncomment to enable use of ZLIB
687#define POLARSSL_ZLIB_SUPPORT
688 */
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200689/* \} name SECTION: PolarSSL feature support */
Paul Bakker0a62cd12011-01-21 11:00:08 +0000690
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000691/**
Paul Bakker0a62cd12011-01-21 11:00:08 +0000692 * \name SECTION: PolarSSL modules
693 *
694 * This section enables or disables entire modules in PolarSSL
695 * \{
696 */
Paul Bakker5121ce52009-01-03 21:22:43 +0000697
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000698/**
699 * \def POLARSSL_AES_C
700 *
701 * Enable the AES block cipher.
702 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000703 * Module: library/aes.c
704 * Caller: library/ssl_tls.c
Paul Bakker96743fc2011-02-12 14:30:57 +0000705 * library/pem.c
Paul Bakker6083fd22011-12-03 21:45:14 +0000706 * library/ctr_drbg.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000707 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000708 * This module enables the following ciphersuites (if other requisites are
709 * enabled as well):
710 * TLS_RSA_WITH_AES_128_CBC_SHA
711 * TLS_RSA_WITH_AES_256_CBC_SHA
712 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
713 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
714 * TLS_RSA_WITH_AES_128_CBC_SHA256
715 * TLS_RSA_WITH_AES_256_CBC_SHA256
716 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
717 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
718 * TLS_RSA_WITH_AES_128_GCM_SHA256
719 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker41c83d32013-03-20 14:39:14 +0100720 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
721 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200722 * TLS_PSK_WITH_AES_128_CBC_SHA
723 * TLS_PSK_WITH_AES_256_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100724 *
Paul Bakkercff68422013-09-15 20:43:33 +0200725 * PEM_PARSE uses AES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000726 */
Paul Bakker40e46942009-01-03 21:51:57 +0000727#define POLARSSL_AES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000728
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000729/**
730 * \def POLARSSL_ARC4_C
731 *
732 * Enable the ARCFOUR stream cipher.
733 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000734 * Module: library/arc4.c
735 * Caller: library/ssl_tls.c
736 *
Paul Bakker41c83d32013-03-20 14:39:14 +0100737 * This module enables the following ciphersuites (if other requisites are
738 * enabled as well):
Paul Bakker645ce3a2012-10-31 12:32:41 +0000739 * TLS_RSA_WITH_RC4_128_MD5
740 * TLS_RSA_WITH_RC4_128_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100741 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200742 * TLS_PSK_WITH_RC4_128_SHA
Paul Bakker5121ce52009-01-03 21:22:43 +0000743 */
Paul Bakker40e46942009-01-03 21:51:57 +0000744#define POLARSSL_ARC4_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000745
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000746/**
Paul Bakkerefc30292011-11-10 14:43:23 +0000747 * \def POLARSSL_ASN1_PARSE_C
748 *
749 * Enable the generic ASN1 parser.
750 *
751 * Module: library/asn1.c
752 * Caller: library/x509parse.c
753 */
754#define POLARSSL_ASN1_PARSE_C
755
756/**
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000757 * \def POLARSSL_ASN1_WRITE_C
758 *
759 * Enable the generic ASN1 writer.
760 *
761 * Module: library/asn1write.c
762 */
763#define POLARSSL_ASN1_WRITE_C
764
765/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000766 * \def POLARSSL_BASE64_C
767 *
768 * Enable the Base64 module.
769 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000770 * Module: library/base64.c
Paul Bakker5690efc2011-05-26 13:16:06 +0000771 * Caller: library/pem.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000772 *
Paul Bakker5690efc2011-05-26 13:16:06 +0000773 * This module is required for PEM support (required by X.509).
Paul Bakker5121ce52009-01-03 21:22:43 +0000774 */
Paul Bakker40e46942009-01-03 21:51:57 +0000775#define POLARSSL_BASE64_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000776
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000777/**
778 * \def POLARSSL_BIGNUM_C
779 *
Paul Bakker9a736322012-11-14 12:39:52 +0000780 * Enable the multi-precision integer library.
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000781 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000782 * Module: library/bignum.c
783 * Caller: library/dhm.c
784 * library/rsa.c
785 * library/ssl_tls.c
786 * library/x509parse.c
787 *
788 * This module is required for RSA and DHM support.
789 */
Paul Bakker40e46942009-01-03 21:51:57 +0000790#define POLARSSL_BIGNUM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000791
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000792/**
Paul Bakkera9379c02012-07-04 11:02:11 +0000793 * \def POLARSSL_BLOWFISH_C
794 *
795 * Enable the Blowfish block cipher.
796 *
797 * Module: library/blowfish.c
798 */
799#define POLARSSL_BLOWFISH_C
800
801/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000802 * \def POLARSSL_CAMELLIA_C
803 *
804 * Enable the Camellia block cipher.
805 *
Paul Bakker38119b12009-01-10 23:31:23 +0000806 * Module: library/camellia.c
Paul Bakker13e2dfe2009-07-28 07:18:38 +0000807 * Caller: library/ssl_tls.c
Paul Bakker38119b12009-01-10 23:31:23 +0000808 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000809 * This module enables the following ciphersuites (if other requisites are
810 * enabled as well):
811 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
812 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
813 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
814 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
815 * TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
816 * TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
817 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
818 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
Paul Bakker38119b12009-01-10 23:31:23 +0000819 */
820#define POLARSSL_CAMELLIA_C
821
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000822/**
823 * \def POLARSSL_CERTS_C
824 *
825 * Enable the test certificates.
826 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000827 * Module: library/certs.c
828 * Caller:
829 *
830 * This module is used for testing (ssl_client/server).
831 */
Paul Bakker40e46942009-01-03 21:51:57 +0000832#define POLARSSL_CERTS_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000833
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000834/**
835 * \def POLARSSL_CIPHER_C
836 *
837 * Enable the generic cipher layer.
838 *
Paul Bakker8123e9d2011-01-06 15:37:30 +0000839 * Module: library/cipher.c
Paul Bakker04784f52013-08-19 13:30:57 +0200840 * Caller: library/ssl_tls.c
Paul Bakker8123e9d2011-01-06 15:37:30 +0000841 *
842 * Uncomment to enable generic cipher wrappers.
843 */
844#define POLARSSL_CIPHER_C
845
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000846/**
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000847 * \def POLARSSL_CTR_DRBG_C
848 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200849 * Enable the CTR_DRBG AES-256-based random generator.
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000850 *
851 * Module: library/ctr_drbg.c
852 * Caller:
853 *
Paul Bakker6083fd22011-12-03 21:45:14 +0000854 * Requires: POLARSSL_AES_C
855 *
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000856 * This module provides the CTR_DRBG AES-256 random number generator.
857 */
858#define POLARSSL_CTR_DRBG_C
859
860/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000861 * \def POLARSSL_DEBUG_C
862 *
863 * Enable the debug functions.
864 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000865 * Module: library/debug.c
866 * Caller: library/ssl_cli.c
867 * library/ssl_srv.c
868 * library/ssl_tls.c
869 *
870 * This module provides debugging functions.
871 */
Paul Bakker40e46942009-01-03 21:51:57 +0000872#define POLARSSL_DEBUG_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000873
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000874/**
875 * \def POLARSSL_DES_C
876 *
877 * Enable the DES block cipher.
878 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000879 * Module: library/des.c
Paul Bakker6deb37e2013-02-19 13:17:08 +0100880 * Caller: library/pem.c
881 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +0000882 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000883 * This module enables the following ciphersuites (if other requisites are
884 * enabled as well):
885 * TLS_RSA_WITH_3DES_EDE_CBC_SHA
886 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakker41c83d32013-03-20 14:39:14 +0100887 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Paul Bakkerd4a56ec2013-04-16 18:05:29 +0200888 * TLS_PSK_WITH_3DES_EDE_CBC_SHA
Paul Bakker6deb37e2013-02-19 13:17:08 +0100889 *
Paul Bakkercff68422013-09-15 20:43:33 +0200890 * PEM_PARSE uses DES/3DES for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +0000891 */
Paul Bakker40e46942009-01-03 21:51:57 +0000892#define POLARSSL_DES_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000893
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000894/**
895 * \def POLARSSL_DHM_C
896 *
897 * Enable the Diffie-Hellman-Merkle key exchange.
898 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000899 * Module: library/dhm.c
900 * Caller: library/ssl_cli.c
901 * library/ssl_srv.c
902 *
Paul Bakker645ce3a2012-10-31 12:32:41 +0000903 * This module enables the following ciphersuites (if other requisites are
904 * enabled as well):
905 * TLS_DHE_RSA_WITH_DES_CBC_SHA
906 * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
907 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA
908 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA
909 * TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
910 * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
911 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
912 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
913 * TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
914 * TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
915 * TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
916 * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker5121ce52009-01-03 21:22:43 +0000917 */
Paul Bakker40e46942009-01-03 21:51:57 +0000918#define POLARSSL_DHM_C
Paul Bakker5121ce52009-01-03 21:22:43 +0000919
Paul Bakkerf3b86c12011-01-27 15:24:17 +0000920/**
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100921 * \def POLARSSL_ECDH_C
922 *
923 * Enable the elliptic curve Diffie-Hellman library.
924 *
925 * Module: library/ecdh.c
Paul Bakker41c83d32013-03-20 14:39:14 +0100926 * Caller: library/ssl_cli.c
927 * library/ssl_srv.c
928 *
929 * This module enables the following ciphersuites (if other requisites are
930 * enabled as well):
931 * TLS_ECDHE_RSA_WITH_NULL_SHA
932 * TLS_ECDHE_RSA_WITH_RC4_128_SHA
933 * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
934 * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
935 * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100936 *
937 * Requires: POLARSSL_ECP_C
938 */
939#define POLARSSL_ECDH_C
940
941/**
942 * \def POLARSSL_ECDSA_C
943 *
944 * Enable the elliptic curve DSA library.
945 *
946 * Module: library/ecdsa.c
947 * Caller:
948 *
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +0200949 * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100950 */
951#define POLARSSL_ECDSA_C
952
953/**
954 * \def POLARSSL_ECP_C
955 *
956 * Enable the elliptic curve over GF(p) library.
957 *
958 * Module: library/ecp.c
959 * Caller: library/ecdh.c
960 * library/ecdsa.c
961 *
962 * Requires: POLARSSL_BIGNUM_C
963 */
964#define POLARSSL_ECP_C
965
966/**
Paul Bakker6083fd22011-12-03 21:45:14 +0000967 * \def POLARSSL_ENTROPY_C
968 *
969 * Enable the platform-specific entropy code.
970 *
971 * Module: library/entropy.c
972 * Caller:
973 *
Paul Bakker9e36f042013-06-30 14:34:05 +0200974 * Requires: POLARSSL_SHA512_C
Paul Bakker6083fd22011-12-03 21:45:14 +0000975 *
976 * This module provides a generic entropy pool
977 */
978#define POLARSSL_ENTROPY_C
979
980/**
Paul Bakker9d781402011-05-09 16:17:09 +0000981 * \def POLARSSL_ERROR_C
982 *
983 * Enable error code to error string conversion.
984 *
985 * Module: library/error.c
986 * Caller:
987 *
988 * This module enables err_strerror().
989 */
990#define POLARSSL_ERROR_C
991
992/**
Paul Bakker89e80c92012-03-20 13:50:09 +0000993 * \def POLARSSL_GCM_C
994 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +0200995 * Enable the Galois/Counter Mode (GCM) for AES.
Paul Bakker89e80c92012-03-20 13:50:09 +0000996 *
997 * Module: library/gcm.c
998 *
999 * Requires: POLARSSL_AES_C
Paul Bakker645ce3a2012-10-31 12:32:41 +00001000 *
1001 * This module enables the following ciphersuites (if other requisites are
1002 * enabled as well):
1003 * TLS_RSA_WITH_AES_128_GCM_SHA256
1004 * TLS_RSA_WITH_AES_256_GCM_SHA384
Paul Bakker89e80c92012-03-20 13:50:09 +00001005 */
1006#define POLARSSL_GCM_C
1007
1008/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001009 * \def POLARSSL_HAVEGE_C
1010 *
1011 * Enable the HAVEGE random generator.
1012 *
Paul Bakker2a844242013-06-24 13:01:53 +02001013 * Warning: the HAVEGE random generator is not suitable for virtualized
1014 * environments
1015 *
1016 * Warning: the HAVEGE random generator is dependent on timing and specific
1017 * processor traits. It is therefore not advised to use HAVEGE as
1018 * your applications primary random generator or primary entropy pool
1019 * input. As a secondary input to your entropy pool, it IS able add
1020 * the (limited) extra entropy it provides.
1021 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001022 * Module: library/havege.c
1023 * Caller:
1024 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001025 * Requires: POLARSSL_TIMING_C
1026 *
Paul Bakker2a844242013-06-24 13:01:53 +02001027 * Uncomment to enable the HAVEGE random generator.
Paul Bakker40e46942009-01-03 21:51:57 +00001028#define POLARSSL_HAVEGE_C
Paul Bakker2a844242013-06-24 13:01:53 +02001029 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001030
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001031/**
1032 * \def POLARSSL_MD_C
1033 *
1034 * Enable the generic message digest layer.
1035 *
Paul Bakker17373852011-01-06 14:20:01 +00001036 * Module: library/md.c
1037 * Caller:
1038 *
1039 * Uncomment to enable generic message digest wrappers.
1040 */
1041#define POLARSSL_MD_C
1042
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001043/**
1044 * \def POLARSSL_MD2_C
1045 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001046 * Enable the MD2 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001047 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001048 * Module: library/md2.c
1049 * Caller: library/x509parse.c
1050 *
1051 * Uncomment to enable support for (rare) MD2-signed X.509 certs.
1052 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001053#define POLARSSL_MD2_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001054 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001055
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001056/**
1057 * \def POLARSSL_MD4_C
1058 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001059 * Enable the MD4 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001060 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001061 * Module: library/md4.c
1062 * Caller: library/x509parse.c
1063 *
1064 * Uncomment to enable support for (rare) MD4-signed X.509 certs.
1065 *
Paul Bakker13e2dfe2009-07-28 07:18:38 +00001066#define POLARSSL_MD4_C
Paul Bakker6506aff2009-07-28 20:52:02 +00001067 */
Paul Bakker5121ce52009-01-03 21:22:43 +00001068
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001069/**
1070 * \def POLARSSL_MD5_C
1071 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001072 * Enable the MD5 hash algorithm.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001073 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001074 * Module: library/md5.c
Paul Bakker6deb37e2013-02-19 13:17:08 +01001075 * Caller: library/pem.c
1076 * library/ssl_tls.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001077 * library/x509parse.c
1078 *
1079 * This module is required for SSL/TLS and X.509.
Paul Bakkercff68422013-09-15 20:43:33 +02001080 * PEM_PARSE uses MD5 for decrypting encrypted keys.
Paul Bakker5121ce52009-01-03 21:22:43 +00001081 */
Paul Bakker40e46942009-01-03 21:51:57 +00001082#define POLARSSL_MD5_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001083
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001084/**
Paul Bakker6e339b52013-07-03 13:37:05 +02001085 * \def POLARSSL_MEMORY_C
1086 *
1087 * Enable the memory allocation layer.
1088 * By default PolarSSL uses the system-provided malloc() and free().
1089 * (As long as POLARSSL_MEMORY_STDMALLOC and POLARSSL_MEMORY_STDFREE
1090 * are defined and unmodified)
1091 *
1092 * This allows different allocators (self-implemented or provided)
1093 *
1094 * Enable this layer to allow use of alternative memory allocators.
1095#define POLARSSL_MEMORY_C
1096 */
1097
1098/**
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001099 * \def POLARSSL_MEMORY_BUFFER_ALLOC_C
1100 *
1101 * Enable the buffer allocator implementation that makes use of a (stack)
1102 * based buffer to 'allocate' dynamic memory. (replaces malloc() and free()
1103 * calls)
Paul Bakker6e339b52013-07-03 13:37:05 +02001104 *
1105 * Module: library/memory_buffer_alloc.c
1106 *
1107 * Requires: POLARSSL_MEMORY_C
1108 *
1109 * Enable this module to enable the buffer memory allocator.
1110#define POLARSSL_MEMORY_BUFFER_ALLOC_C
1111 */
1112
1113/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001114 * \def POLARSSL_NET_C
1115 *
1116 * Enable the TCP/IP networking routines.
1117 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001118 * Module: library/net.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001119 *
1120 * This module provides TCP/IP networking routines.
1121 */
Paul Bakker40e46942009-01-03 21:51:57 +00001122#define POLARSSL_NET_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001123
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001124/**
Paul Bakkerc70b9822013-04-07 22:00:46 +02001125 * \def POLARSSL_OID_C
1126 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001127 * Enable the OID database.
Paul Bakkerc70b9822013-04-07 22:00:46 +02001128 *
1129 * Module: library/oid.c
1130 * Caller: library/rsa.c
1131 * library/x509parse.c
1132 * library/x509write.c
1133 *
1134 * This modules translates between OIDs and internal values.
1135 */
1136#define POLARSSL_OID_C
1137
1138/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001139 * \def POLARSSL_PADLOCK_C
1140 *
1141 * Enable VIA Padlock support on x86.
1142 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001143 * Module: library/padlock.c
1144 * Caller: library/aes.c
1145 *
1146 * This modules adds support for the VIA PadLock on x86.
1147 */
Paul Bakker40e46942009-01-03 21:51:57 +00001148#define POLARSSL_PADLOCK_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001149
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001150/**
Paul Bakkerf518b162012-08-23 13:03:18 +00001151 * \def POLARSSL_PBKDF2_C
1152 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001153 * Enable PKCS#5 PBKDF2 key derivation function.
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001154 * DEPRECATED: Use POLARSSL_PKCS5_C instead
Paul Bakkerf518b162012-08-23 13:03:18 +00001155 *
1156 * Module: library/pbkdf2.c
1157 *
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001158 * Requires: POLARSSL_PKCS5_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001159 *
1160 * This module adds support for the PKCS#5 PBKDF2 key derivation function.
Paul Bakkerf518b162012-08-23 13:03:18 +00001161 */
Paul Bakker370e90c2013-04-08 15:19:43 +02001162#define POLARSSL_PBKDF2_C
Paul Bakkerf518b162012-08-23 13:03:18 +00001163
1164/**
Paul Bakkercff68422013-09-15 20:43:33 +02001165 * \def POLARSSL_PEM_PARSE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00001166 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001167 * Enable PEM decoding / parsing.
Paul Bakker96743fc2011-02-12 14:30:57 +00001168 *
1169 * Module: library/pem.c
1170 * Caller: library/x509parse.c
Paul Bakkercff68422013-09-15 20:43:33 +02001171 * library/pkparse.c
Paul Bakker96743fc2011-02-12 14:30:57 +00001172 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001173 * Requires: POLARSSL_BASE64_C
1174 *
Paul Bakkercff68422013-09-15 20:43:33 +02001175 * This modules adds support for decoding / parsing PEM files.
Paul Bakker96743fc2011-02-12 14:30:57 +00001176 */
Paul Bakkercff68422013-09-15 20:43:33 +02001177#define POLARSSL_PEM_PARSE_C
1178
1179/**
1180 * \def POLARSSL_PEM_WRITE_C
1181 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001182 * Enable PEM encoding / writing.
Paul Bakkercff68422013-09-15 20:43:33 +02001183 *
1184 * Module: library/pem.c
1185 * Caller: library/x509write.c
1186 * library/pkwrite.c
1187 *
1188 * Requires: POLARSSL_BASE64_C
1189 *
1190 * This modules adds support for encoding / writing PEM files.
1191 */
1192#define POLARSSL_PEM_WRITE_C
Paul Bakker96743fc2011-02-12 14:30:57 +00001193
1194/**
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001195 * \def POLARSSL_PK_C
1196 *
1197 * Enable the generic public (asymetric) key layer.
1198 *
1199 * Module: library/pk.c
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001200 * Caller: library/ssl_tls.c
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001201 * library/ssl_cli.c
1202 * library/ssl_srv.c
1203 *
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001204 * Requires: POLARSSL_RSA_C or POLARSSL_ECP_C
1205 *
Manuel Pégourié-Gonnardc40b4c32013-08-22 13:29:31 +02001206 * Uncomment to enable generic public key wrappers.
1207 */
1208#define POLARSSL_PK_C
1209
1210/**
Paul Bakker4606c732013-09-15 17:04:23 +02001211 * \def POLARSSL_PK_PARSE_C
1212 *
1213 * Enable the generic public (asymetric) key parser.
1214 *
1215 * Module: library/pkparse.c
1216 * Caller: library/x509parse.c
1217 *
1218 * Requires: POLARSSL_PK_C
1219 *
1220 * Uncomment to enable generic public key parse functions.
1221 */
1222#define POLARSSL_PK_PARSE_C
1223
1224/**
1225 * \def POLARSSL_PK_WRITE_C
1226 *
Paul Bakkerf20ba4b2013-09-16 22:46:20 +02001227 * Enable the generic public (asymetric) key writer.
Paul Bakker4606c732013-09-15 17:04:23 +02001228 *
1229 * Module: library/pkwrite.c
1230 * Caller: library/x509write.c
1231 *
1232 * Requires: POLARSSL_PK_C
1233 *
1234 * Uncomment to enable generic public key write functions.
1235 */
1236#define POLARSSL_PK_WRITE_C
1237
1238/**
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001239 * \def POLARSSL_PKCS5_C
1240 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001241 * Enable PKCS#5 functions.
Paul Bakkerb0c19a42013-06-24 19:26:38 +02001242 *
1243 * Module: library/pkcs5.c
1244 *
1245 * Requires: POLARSSL_MD_C
1246 *
1247 * This module adds support for the PKCS#5 functions.
1248 */
1249#define POLARSSL_PKCS5_C
1250
1251/**
Paul Bakker5690efc2011-05-26 13:16:06 +00001252 * \def POLARSSL_PKCS11_C
1253 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001254 * Enable wrapper for PKCS#11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001255 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001256 * Module: library/pkcs11.c
1257 * Caller: library/pk.c
Paul Bakker5690efc2011-05-26 13:16:06 +00001258 *
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001259 * Requires: POLARSSL_PK_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001260 *
Paul Bakkereb2c6582012-09-27 19:15:01 +00001261 * This module enables SSL/TLS PKCS #11 smartcard support.
Paul Bakker5690efc2011-05-26 13:16:06 +00001262 * Requires the presence of the PKCS#11 helper library (libpkcs11-helper)
1263#define POLARSSL_PKCS11_C
1264 */
1265
1266/**
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001267 * \def POLARSSL_PKCS12_C
1268 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001269 * Enable PKCS#12 PBE functions.
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001270 * Adds algorithms for parsing PKCS#8 encrypted private keys
1271 *
1272 * Module: library/pkcs12.c
1273 * Caller: library/x509parse.c
1274 *
Paul Bakkerb0713c72013-06-24 19:34:08 +02001275 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_CIPHER_C, POLARSSL_MD_C
1276 * Can use: POLARSSL_ARC4_C
Paul Bakkerf1f21fe2013-06-24 19:17:19 +02001277 *
1278 * This module enables PKCS#12 functions.
1279 */
1280#define POLARSSL_PKCS12_C
1281
1282/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001283 * \def POLARSSL_RSA_C
1284 *
1285 * Enable the RSA public-key cryptosystem.
1286 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001287 * Module: library/rsa.c
1288 * Caller: library/ssl_cli.c
1289 * library/ssl_srv.c
1290 * library/ssl_tls.c
1291 * library/x509.c
1292 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001293 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001294 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001295 * This module is required for SSL/TLS and MD5-signed certificates.
1296 */
Paul Bakker40e46942009-01-03 21:51:57 +00001297#define POLARSSL_RSA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001298
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001299/**
1300 * \def POLARSSL_SHA1_C
1301 *
1302 * Enable the SHA1 cryptographic hash algorithm.
1303 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001304 * Module: library/sha1.c
1305 * Caller: library/ssl_cli.c
1306 * library/ssl_srv.c
1307 * library/ssl_tls.c
1308 * library/x509parse.c
1309 *
1310 * This module is required for SSL/TLS and SHA1-signed certificates.
1311 */
Paul Bakker40e46942009-01-03 21:51:57 +00001312#define POLARSSL_SHA1_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001313
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001314/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001315 * \def POLARSSL_SHA256_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001316 *
1317 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001318 * (Used to be POLARSSL_SHA2_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001319 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001320 * Module: library/sha256.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001321 * Caller: library/md_wrap.c
1322 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001323 *
1324 * This module adds support for SHA-224 and SHA-256.
Paul Bakker769075d2012-11-24 11:26:46 +01001325 * This module is required for the SSL/TLS 1.2 PRF function.
Paul Bakker5121ce52009-01-03 21:22:43 +00001326 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001327#define POLARSSL_SHA256_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001328
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001329/**
Paul Bakker9e36f042013-06-30 14:34:05 +02001330 * \def POLARSSL_SHA512_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001331 *
1332 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
Paul Bakker9e36f042013-06-30 14:34:05 +02001333 * (Used to be POLARSSL_SHA4_C)
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001334 *
Paul Bakker9e36f042013-06-30 14:34:05 +02001335 * Module: library/sha512.c
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001336 * Caller: library/md_wrap.c
1337 * library/x509parse.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001338 *
1339 * This module adds support for SHA-384 and SHA-512.
1340 */
Paul Bakker9e36f042013-06-30 14:34:05 +02001341#define POLARSSL_SHA512_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001342
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001343/**
Paul Bakker0a597072012-09-25 21:55:46 +00001344 * \def POLARSSL_SSL_CACHE_C
1345 *
1346 * Enable simple SSL cache implementation.
1347 *
1348 * Module: library/ssl_cache.c
1349 * Caller:
1350 *
1351 * Requires: POLARSSL_SSL_CACHE_C
1352 */
1353#define POLARSSL_SSL_CACHE_C
1354
1355/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001356 * \def POLARSSL_SSL_CLI_C
1357 *
1358 * Enable the SSL/TLS client code.
1359 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001360 * Module: library/ssl_cli.c
1361 * Caller:
1362 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001363 * Requires: POLARSSL_SSL_TLS_C
1364 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001365 * This module is required for SSL/TLS client support.
1366 */
Paul Bakker40e46942009-01-03 21:51:57 +00001367#define POLARSSL_SSL_CLI_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001368
Paul Bakker9a736322012-11-14 12:39:52 +00001369/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001370 * \def POLARSSL_SSL_SRV_C
1371 *
1372 * Enable the SSL/TLS server code.
1373 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001374 * Module: library/ssl_srv.c
1375 * Caller:
1376 *
Paul Bakker5690efc2011-05-26 13:16:06 +00001377 * Requires: POLARSSL_SSL_TLS_C
1378 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001379 * This module is required for SSL/TLS server support.
1380 */
Paul Bakker40e46942009-01-03 21:51:57 +00001381#define POLARSSL_SSL_SRV_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001382
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001383/**
1384 * \def POLARSSL_SSL_TLS_C
1385 *
Paul Bakkere29ab062011-05-18 13:26:54 +00001386 * Enable the generic SSL/TLS code.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001387 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001388 * Module: library/ssl_tls.c
1389 * Caller: library/ssl_cli.c
1390 * library/ssl_srv.c
1391 *
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001392 * Requires: POLARSSL_CIPHER_C, POLARSSL_MD_C
Paul Bakker577e0062013-08-28 11:57:20 +02001393 * and at least one of the POLARSSL_SSL_PROTO_* defines
Paul Bakker5690efc2011-05-26 13:16:06 +00001394 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001395 * This module is required for SSL/TLS.
1396 */
Paul Bakker40e46942009-01-03 21:51:57 +00001397#define POLARSSL_SSL_TLS_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001398
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001399/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001400 * \def POLARSSL_TIMING_C
1401 *
1402 * Enable the portable timing interface.
1403 *
Paul Bakker5121ce52009-01-03 21:22:43 +00001404 * Module: library/timing.c
1405 * Caller: library/havege.c
1406 *
1407 * This module is used by the HAVEGE random number generator.
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001408 */
Paul Bakkerdcbfdcc2013-09-10 16:16:50 +02001409#define POLARSSL_TIMING_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001410
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001411/**
1412 * \def POLARSSL_VERSION_C
1413 *
1414 * Enable run-time version information.
1415 *
Paul Bakker0a62cd12011-01-21 11:00:08 +00001416 * Module: library/version.c
1417 *
1418 * This module provides run-time version information.
1419 */
1420#define POLARSSL_VERSION_C
1421
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001422/**
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001423 * \def POLARSSL_X509_USE_C
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001424 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001425 * Enable X.509 core for using certificates.
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001426 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001427 * Module: library/x509.c
1428 * Caller: library/x509_crl.c
1429 * library/x509_crt.c
1430 * library/x509_csr.c
Paul Bakker5121ce52009-01-03 21:22:43 +00001431 *
Paul Bakkerc70b9822013-04-07 22:00:46 +02001432 * Requires: POLARSSL_ASN1_PARSE_C, POLARSSL_BIGNUM_C, POLARSSL_OID_C,
Paul Bakker4606c732013-09-15 17:04:23 +02001433 * POLARSSL_PK_PARSE_C
Paul Bakker5690efc2011-05-26 13:16:06 +00001434 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001435 * This module is required for the X.509 parsing modules.
Paul Bakker5121ce52009-01-03 21:22:43 +00001436 */
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001437#define POLARSSL_X509_USE_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001438
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001439/**
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001440 * \def POLARSSL_X509_CRT_PARSE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001441 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001442 * Enable X.509 certificate parsing.
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001443 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001444 * Module: library/x509_crt.c
1445 * Caller: library/ssl_cli.c
1446 * library/ssl_srv.c
1447 * library/ssl_tls.c
1448 *
1449 * Requires: POLARSSL_X509_USE_C
1450 *
1451 * This module is required for X.509 certificate parsing.
1452 */
1453#define POLARSSL_X509_CRT_PARSE_C
1454
1455/**
1456 * \def POLARSSL_X509_CRL_PARSE_C
1457 *
1458 * Enable X.509 CRL parsing.
1459 *
1460 * Module: library/x509_crl.c
1461 * Caller: library/x509_crt.c
1462 *
1463 * Requires: POLARSSL_X509_USE_C
1464 *
1465 * This module is required for X.509 CRL parsing.
1466 */
1467#define POLARSSL_X509_CRL_PARSE_C
1468
1469/**
1470 * \def POLARSSL_X509_CSR_PARSE_C
1471 *
1472 * Enable X.509 Certificate Signing Request (CSR) parsing.
1473 *
1474 * Module: library/x509_csr.c
1475 * Caller: library/x509_crt_write.c
1476 *
1477 * Requires: POLARSSL_X509_USE_C
1478 *
1479 * This module is used for reading X.509 certificate request.
1480 */
1481#define POLARSSL_X509_CSR_PARSE_C
1482
1483/**
1484 * \def POLARSSL_X509_CREATE_C
1485 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001486 * Enable X.509 core for creating certificates.
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001487 *
1488 * Module: library/x509_create.c
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001489 *
Paul Bakker4606c732013-09-15 17:04:23 +02001490 * Requires: POLARSSL_BIGNUM_C, POLARSSL_OID_C, POLARSSL_PK_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001491 *
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001492 * This module is the basis for creating X.509 certificates and CSRs.
1493 */
1494#define POLARSSL_X509_CREATE_C
1495
1496/**
1497 * \def POLARSSL_X509_CRT_WRITE_C
1498 *
1499 * Enable creating X.509 certificates.
1500 *
1501 * Module: library/x509_crt_write.c
1502 *
1503 * Requires: POLARSSL_CREATE_C
1504 *
1505 * This module is required for X.509 certificate creation.
1506 */
1507#define POLARSSL_X509_CRT_WRITE_C
1508
1509/**
1510 * \def POLARSSL_X509_CSR_WRITE_C
1511 *
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001512 * Enable creating X.509 Certificate Signing Requests (CSR).
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001513 *
1514 * Module: library/x509_csr_write.c
1515 *
1516 * Requires: POLARSSL_CREATE_C
1517 *
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001518 * This module is required for X.509 certificate request writing.
1519 */
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001520#define POLARSSL_X509_CSR_WRITE_C
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001521
1522/**
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001523 * \def POLARSSL_XTEA_C
Paul Bakker5121ce52009-01-03 21:22:43 +00001524 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00001525 * Enable the XTEA block cipher.
1526 *
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001527 * Module: library/xtea.c
1528 * Caller:
1529 */
1530#define POLARSSL_XTEA_C
Manuel Pégourié-Gonnard39d2adb2012-10-31 09:26:55 +01001531
Manuel Pégourié-Gonnard09fff7e2013-09-20 13:45:36 +02001532/* \} name SECTION: PolarSSL modules */
Paul Bakker7a7c78f2009-01-04 18:15:48 +00001533
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001534/**
1535 * \name SECTION: Module configuration options
1536 *
1537 * This section allows for the setting of module specific sizes and
1538 * configuration options. The default values are already present in the
1539 * relevant header files and should suffice for the regular use cases.
1540 * Our advice is to enable POLARSSL_CONFIG_OPTIONS and change values here
1541 * only if you have a good reason and know the consequences.
1542 *
1543 * If POLARSSL_CONFIG_OPTIONS is undefined here the options in the module
1544 * header file take precedence.
1545 *
1546 * Please check the respective header file for documentation on these
1547 * parameters (to prevent duplicate documentation).
1548 *
1549 * Uncomment POLARSSL_CONFIG_OPTIONS to enable using the values defined here.
1550 * \{
1551 */
1552//#define POLARSSL_CONFIG_OPTIONS /**< Enable config.h module value configuration */
1553
1554#if defined(POLARSSL_CONFIG_OPTIONS)
1555
1556// MPI / BIGNUM options
1557//
1558#define POLARSSL_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
1559#define POLARSSL_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
1560
1561// CTR_DRBG options
1562//
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001563#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 +02001564#define CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
1565#define CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
1566#define CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
1567#define CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
1568
1569// Entropy options
1570//
1571#define ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */
1572#define ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
1573
Paul Bakker6e339b52013-07-03 13:37:05 +02001574// Memory options
1575#define MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
1576#define POLARSSL_MEMORY_STDMALLOC malloc /**< Default allocator to use, can be undefined */
1577#define POLARSSL_MEMORY_STDFREE free /**< Default free to use, can be undefined */
1578
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001579// SSL Cache options
1580//
1581#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
1582#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
1583
1584// SSL options
1585//
1586#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
Paul Bakker606b4ba2013-08-14 16:52:14 +02001587#define SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
Paul Bakker9bcf16c2013-06-24 19:31:17 +02001588
1589#endif /* POLARSSL_CONFIG_OPTIONS */
1590
1591/* \} name */
1592
Paul Bakker7ad00f92013-04-18 23:05:25 +02001593/*
1594 * Sanity checks on defines and dependencies
1595 */
1596#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
1597#error "POLARSSL_DHM_C defined, but not all prerequisites"
1598#endif
1599
1600#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
1601#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
1602#endif
1603
1604#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
1605#error "POLARSSL_ECDH_C defined, but not all prerequisites"
1606#endif
1607
Manuel Pégourié-Gonnard4846f5e2013-08-08 14:36:15 +02001608#if defined(POLARSSL_ECDSA_C) && \
1609 ( !defined(POLARSSL_ECP_C) || \
1610 !defined(POLARSSL_ASN1_PARSE_C) || \
1611 !defined(POLARSSL_ASN1_WRITE_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001612#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
1613#endif
1614
1615#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
1616#error "POLARSSL_ECP_C defined, but not all prerequisites"
1617#endif
1618
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001619#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
1620 !defined(POLARSSL_SHA256_C))
Paul Bakker7ad00f92013-04-18 23:05:25 +02001621#error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
1622#endif
Paul Bakkerfb08fd22013-08-27 15:06:26 +02001623#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
1624 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
1625#error "CTR_DRBG_ENTROPY_LEN value too high"
1626#endif
1627#if defined(POLARSSL_ENTROPY_C) && !defined(POLARSSL_SHA512_C) && \
1628 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
1629#error "CTR_DRBG_ENTROPY_LEN value too high"
1630#endif
Paul Bakker7ad00f92013-04-18 23:05:25 +02001631
1632#if defined(POLARSSL_GCM_C) && !defined(POLARSSL_AES_C)
1633#error "POLARSSL_GCM_C defined, but not all prerequisites"
1634#endif
1635
Paul Bakkerecd54fb2013-07-03 14:48:29 +02001636#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
1637#error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
1638#endif
1639
Paul Bakkere07f41d2013-04-19 09:08:57 +02001640#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
1641#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
1642#endif
1643
1644#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1645 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +02001646 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) || \
1647 !defined(POLARSSL_X509_CRL_PARSE_C) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001648#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
1649#endif
1650
1651#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1652 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +02001653 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) || \
1654 !defined(POLARSSL_X509_CRL_PARSE_C) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001655#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
1656#endif
1657
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +02001658#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
1659 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +02001660 !defined(POLARSSL_X509_CRT_PARSE_C) || \
1661 !defined(POLARSSL_X509_CRL_PARSE_C) )
Manuel Pégourié-Gonnard32ea60a2013-08-17 17:39:04 +02001662#error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
1663#endif
1664
Paul Bakkere07f41d2013-04-19 09:08:57 +02001665#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001666 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +02001667 !defined(POLARSSL_PKCS1_V15) || !defined(POLARSSL_X509_CRL_PARSE_C) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001668#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
1669#endif
1670
1671#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001672 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
Manuel Pégourié-Gonnard1032c1d2013-09-18 17:18:34 +02001673 !defined(POLARSSL_PKCS1_V15) || !defined(POLARSSL_X509_CRL_PARSE_C) )
Paul Bakkere07f41d2013-04-19 09:08:57 +02001674#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
1675#endif
1676
Paul Bakker6e339b52013-07-03 13:37:05 +02001677#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && !defined(POLARSSL_MEMORY_C)
1678#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
1679#endif
1680
Paul Bakker7ad00f92013-04-18 23:05:25 +02001681#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
1682#error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
1683#endif
1684
Paul Bakkercff68422013-09-15 20:43:33 +02001685#if defined(POLARSSL_PEM_PARSE_C) && !defined(POLARSSL_BASE64_C)
1686#error "POLARSSL_PEM_PARSE_C defined, but not all prerequisites"
1687#endif
1688
1689#if defined(POLARSSL_PEM_WRITE_C) && !defined(POLARSSL_BASE64_C)
1690#error "POLARSSL_PEM_WRITE_C defined, but not all prerequisites"
Paul Bakker7ad00f92013-04-18 23:05:25 +02001691#endif
1692
Paul Bakker4606c732013-09-15 17:04:23 +02001693#if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C)
1694#error "POLARSSL_PK_PARSE_C defined, but not all prerequisites"
1695#endif
1696
1697#if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C)
1698#error "POLARSSL_PK_WRITE_C defined, but not all prerequisites"
1699#endif
1700
Manuel Pégourié-Gonnard51be5592013-08-22 13:35:53 +02001701#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
Paul Bakker7ad00f92013-04-18 23:05:25 +02001702#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
1703#endif
1704
1705#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1706 !defined(POLARSSL_OID_C) )
1707#error "POLARSSL_RSA_C defined, but not all prerequisites"
1708#endif
1709
1710#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
1711#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
1712#endif
1713
Paul Bakker577e0062013-08-28 11:57:20 +02001714#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \
Manuel Pégourié-Gonnard1a483832013-09-20 12:29:15 +02001715 !defined(POLARSSL_MD_C) )
Paul Bakker7ad00f92013-04-18 23:05:25 +02001716#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
1717#endif
1718
1719#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
1720#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
1721#endif
1722
Paul Bakkerd2f068e2013-08-27 21:19:20 +02001723#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
1724 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
1725 !defined(POLARSSL_SSL_PROTO_TLS1_2))
1726#error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
1727#endif
1728
1729#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1730 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
1731#error "Illegal protocol selection"
1732#endif
1733
1734#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
1735 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
1736#error "Illegal protocol selection"
1737#endif
1738
1739#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
1740 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
1741 !defined(POLARSSL_SSL_PROTO_TLS1_1)))
1742#error "Illegal protocol selection"
1743#endif
1744
Paul Bakker59da0a42013-08-19 13:27:17 +02001745#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
Manuel Pégourié-Gonnard92cb1d32013-09-13 16:24:20 +02001746 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) || \
1747 !defined(POLARSSL_CIPHER_MODE_CBC) )
Paul Bakker59da0a42013-08-19 13:27:17 +02001748#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
1749#endif
1750
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001751#if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
Paul Bakker7ad00f92013-04-18 23:05:25 +02001752 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
Paul Bakker4606c732013-09-15 17:04:23 +02001753 !defined(POLARSSL_PK_PARSE_C) )
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001754#error "POLARSSL_X509_USE_C defined, but not all prerequisites"
Paul Bakker7ad00f92013-04-18 23:05:25 +02001755#endif
1756
Paul Bakker7c6b2c32013-09-16 13:49:26 +02001757#if defined(POLARSSL_X509_CREATE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
1758 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
1759 !defined(POLARSSL_PK_WRITE_C) )
1760#error "POLARSSL_X509_CREATE_C defined, but not all prerequisites"
1761#endif
1762
1763#if defined(POLARSSL_X509_CRT_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
1764#error "POLARSSL_X509_CRT_PARSE_C defined, but not all prerequisites"
1765#endif
1766
1767#if defined(POLARSSL_X509_CRL_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
1768#error "POLARSSL_X509_CRL_PARSE_C defined, but not all prerequisites"
1769#endif
1770
1771#if defined(POLARSSL_X509_CSR_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
1772#error "POLARSSL_X509_CSR_PARSE_C defined, but not all prerequisites"
1773#endif
1774
1775#if defined(POLARSSL_X509_CRT_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
1776#error "POLARSSL_X509_CRT_WRITE_C defined, but not all prerequisites"
1777#endif
1778
1779#if defined(POLARSSL_X509_CSR_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
1780#error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites"
Paul Bakker7ad00f92013-04-18 23:05:25 +02001781#endif
1782
Paul Bakker5121ce52009-01-03 21:22:43 +00001783#endif /* config.h */