blob: 407cd571ae00dadcca536c7025b6cbd9a9961932 [file] [log] [blame]
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +02001/**
2 * \file check_config.h
3 *
4 * \brief Consistency checks for configuration options
5 *
Manuel Pégourié-Gonnard6fb81872015-07-27 11:11:48 +02006 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +02007 * SPDX-License-Identifier: Apache-2.0
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
10 * not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020020 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000021 * This file is part of mbed TLS (https://tls.mbed.org)
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020022 */
23
24/*
25 * It is recommended to include this file from your config.h
26 * in order to catch dependency issues early.
27 */
28
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020029#ifndef MBEDTLS_CHECK_CONFIG_H
30#define MBEDTLS_CHECK_CONFIG_H
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020031
Manuel Pégourié-Gonnardd14acbc2015-05-29 11:26:37 +020032/*
33 * We assume CHAR_BIT is 8 in many places. In practice, this is true on our
34 * target platforms, so not an issue, but let's just be extra sure.
35 */
36#include <limits.h>
37#if CHAR_BIT != 8
38#error "mbed TLS requires a platform with 8-bit chars"
39#endif
40
Manuel Pégourié-Gonnard9db28872015-06-26 10:52:01 +020041#if defined(_WIN32)
42#if !defined(MBEDTLS_PLATFORM_C)
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +020043#error "MBEDTLS_PLATFORM_C is required on Windows"
44#endif
45
Manuel Pégourié-Gonnard9db28872015-06-26 10:52:01 +020046/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as
47 * it would confuse config.pl. */
48#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
49 !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
50#define MBEDTLS_PLATFORM_SNPRINTF_ALT
51#endif
52#endif /* _WIN32 */
53
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020054#if defined(TARGET_LIKE_MBED) && \
55 ( defined(MBEDTLS_NET_C) || defined(MBEDTLS_TIMING_C) )
56#error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS"
57#endif
58
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020059#if defined(MBEDTLS_DEPRECATED_WARNING) && \
Manuel Pégourié-Gonnard757ca002015-03-23 15:24:07 +010060 !defined(__GNUC__) && !defined(__clang__)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020061#error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang"
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +010062#endif
63
Manuel Pégourié-Gonnard60c793b2015-06-18 20:52:58 +020064#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME)
65#error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense"
66#endif
67
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020068#if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM)
69#error "MBEDTLS_AESNI_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020070#endif
71
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020072#if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C)
73#error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020074#endif
75
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020076#if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C)
77#error "MBEDTLS_DHM_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020078#endif
79
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020080#if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C)
81#error "MBEDTLS_ECDH_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020082#endif
83
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020084#if defined(MBEDTLS_ECDSA_C) && \
85 ( !defined(MBEDTLS_ECP_C) || \
86 !defined(MBEDTLS_ASN1_PARSE_C) || \
87 !defined(MBEDTLS_ASN1_WRITE_C) )
88#error "MBEDTLS_ECDSA_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020089#endif
90
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +020091#if defined(MBEDTLS_ECJPAKE_C) && \
92 ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) )
93#error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites"
94#endif
95
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020096#if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C)
97#error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020098#endif
99
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200100#if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \
101 !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \
102 !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \
103 !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \
104 !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \
105 !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \
106 !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \
107 !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \
108 !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \
109 !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \
110 !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \
111 !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) ) )
112#error "MBEDTLS_ECP_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200113#endif
114
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200115#if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \
116 !defined(MBEDTLS_SHA256_C))
117#error "MBEDTLS_ENTROPY_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200118#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200119#if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \
120 defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64)
121#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200122#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200123#if defined(MBEDTLS_ENTROPY_C) && \
124 ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \
125 && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32)
126#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200127#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200128#if defined(MBEDTLS_ENTROPY_C) && \
129 defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C)
130#error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200131#endif
132
Janos Follath53de7842016-06-08 15:29:18 +0100133#if defined(MBEDTLS_TEST_WO_ENTROPY)
134#warning "MBEDTLS_TEST_WO_ENTROPY defined, this build provides no security!"
135#if !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES)
136#error "MBEDTLS_TEST_WO_ENTROPY defined, but not all prerequisites"
137#endif
138#if defined(MBEDTLS_ENTROPY_NV_SEED) || defined(MBEDTLS_ENTROPY_HARDWARE_ALT) || \
139 defined(MBEDTLS_HAVEGE_C)
140#error "MBEDTLS_TEST_WO_ENTROPY defined, but entropy sources too"
141#endif
142#endif
143
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200144#if defined(MBEDTLS_GCM_C) && ( \
145 !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) )
146#error "MBEDTLS_GCM_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200147#endif
148
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200149#if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C)
150#error "MBEDTLS_HAVEGE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200151#endif
152
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200153#if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C)
154#error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200155#endif
156
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200157#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \
158 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) )
159#error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200160#endif
161
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200162#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \
163 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) )
164#error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200165#endif
166
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200167#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C)
168#error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200169#endif
170
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200171#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \
172 !defined(MBEDTLS_ECDH_C)
173#error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200174#endif
175
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200176#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
177 ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \
178 !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) )
179#error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200180#endif
181
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200182#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
183 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \
184 !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) )
185#error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200186#endif
187
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200188#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
189 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \
190 !defined(MBEDTLS_X509_CRT_PARSE_C) )
191#error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200192#endif
193
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200194#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
195 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
196 !defined(MBEDTLS_PKCS1_V15) )
197#error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200198#endif
199
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200200#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \
201 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
202 !defined(MBEDTLS_PKCS1_V15) )
203#error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200204#endif
205
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200206#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \
207 ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) || \
208 !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) )
209#error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites"
210#endif
211
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200212#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \
213 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
214#error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200215#endif
216
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200217#if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM)
218#error "MBEDTLS_PADLOCK_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200219#endif
220
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200221#if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C)
222#error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200223#endif
224
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200225#if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C)
226#error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200227#endif
228
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200229#if defined(MBEDTLS_PK_C) && \
230 ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) )
231#error "MBEDTLS_PK_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard94de3312015-01-28 16:32:36 +0000232#endif
233
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200234#if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C)
235#error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200236#endif
237
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200238#if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C)
239#error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200240#endif
241
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200242#if defined(MBEDTLS_PKCS11_C) && !defined(MBEDTLS_PK_C)
243#error "MBEDTLS_PKCS11_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200244#endif
245
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200246#if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C)
247#error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000248#endif
249
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200250#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C)
251#error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000252#endif
253
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200254#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\
255 ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\
256 defined(MBEDTLS_PLATFORM_EXIT_ALT) )
257#error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously"
Rich Evans4cc8a222015-02-03 11:26:31 +0000258#endif
259
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200260#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
261#error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000262#endif
263
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200264#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
265#error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000266#endif
267
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200268#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\
269 ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\
270 defined(MBEDTLS_PLATFORM_FPRINTF_ALT) )
271#error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously"
Rich Evans4cc8a222015-02-03 11:26:31 +0000272#endif
273
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200274#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
275 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
276#error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000277#endif
278
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200279#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
280 defined(MBEDTLS_PLATFORM_STD_FREE)
281#error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously"
Rich Evans4cc8a222015-02-03 11:26:31 +0000282#endif
283
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200284#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO)
285#error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is"
Rich Evans16f8cd82015-02-06 16:14:34 +0000286#endif
287
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200288#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200289 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200290#error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000291#endif
292
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200293#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
294 defined(MBEDTLS_PLATFORM_STD_CALLOC)
295#error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously"
Rich Evans4cc8a222015-02-03 11:26:31 +0000296#endif
297
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200298#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO)
299#error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is"
Rich Evans16f8cd82015-02-06 16:14:34 +0000300#endif
301
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200302#if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C)
303#error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000304#endif
305
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200306#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
307#error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000308#endif
309
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200310#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
311#error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000312#endif
313
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200314#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\
315 ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\
316 defined(MBEDTLS_PLATFORM_PRINTF_ALT) )
317#error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously"
Rich Evans4cc8a222015-02-03 11:26:31 +0000318#endif
319
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200320#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
321#error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000322#endif
323
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200324#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
325#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000326#endif
327
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200328#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\
329 ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\
330 defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) )
331#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously"
Rich Evans4cc8a222015-02-03 11:26:31 +0000332#endif
333
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200334#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\
335 !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS)
336#error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000337#endif
338
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200339#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY)
340#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000341#endif
342
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200343#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY)
344#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000345#endif
346
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200347#if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY)
348#error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000349#endif
350
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200351#if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\
352 !defined(MBEDTLS_PLATFORM_EXIT_ALT)
353#error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000354#endif
355
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200356#if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\
357 !defined(MBEDTLS_PLATFORM_FPRINTF_ALT)
358#error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000359#endif
360
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200361#if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\
362 !defined(MBEDTLS_PLATFORM_PRINTF_ALT)
363#error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000364#endif
365
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200366#if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\
367 !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT)
368#error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000369#endif
370
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200371#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
372 !defined(MBEDTLS_OID_C) )
373#error "MBEDTLS_RSA_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200374#endif
375
Paul Bakker4fde40f2016-05-09 15:13:04 +0100376#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \
Paul Bakker37068a72016-05-09 14:36:33 +0100377 !defined(MBEDTLS_PKCS1_V15) )
378#error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled"
379#endif
380
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200381#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \
382 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) )
383#error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites"
Manuel Pégourié-Gonnard9df5c962014-01-24 14:37:29 +0100384#endif
385
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200386#if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) || \
387 !defined(MBEDTLS_SHA1_C) )
388#error "MBEDTLS_SSL_PROTO_SSL3 defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200389#endif
390
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200391#if defined(MBEDTLS_SSL_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) || \
392 !defined(MBEDTLS_SHA1_C) )
393#error "MBEDTLS_SSL_PROTO_TLS1 defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200394#endif
395
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200396#if defined(MBEDTLS_SSL_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) || \
397 !defined(MBEDTLS_SHA1_C) )
398#error "MBEDTLS_SSL_PROTO_TLS1_1 defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200399#endif
400
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200401#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \
402 !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) )
403#error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200404#endif
405
Manuel Pégourié-Gonnard5a8d56d2015-05-13 10:10:00 +0200406#if defined(MBEDTLS_SSL_PROTO_DTLS) && \
407 !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
408 !defined(MBEDTLS_SSL_PROTO_TLS1_2)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200409#error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites"
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100410#endif
411
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200412#if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C)
413#error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200414#endif
415
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200416#if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \
417 !defined(MBEDTLS_MD_C) )
418#error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200419#endif
420
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200421#if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C)
422#error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200423#endif
424
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200425#if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \
426 !defined(MBEDTLS_SSL_PROTO_TLS1) && !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
427 !defined(MBEDTLS_SSL_PROTO_TLS1_2))
428#error "MBEDTLS_SSL_TLS_C defined, but no protocols are active"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200429#endif
430
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200431#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \
432 defined(MBEDTLS_SSL_PROTO_TLS1_1) && !defined(MBEDTLS_SSL_PROTO_TLS1))
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200433#error "Illegal protocol selection"
434#endif
435
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200436#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \
437 defined(MBEDTLS_SSL_PROTO_TLS1_2) && !defined(MBEDTLS_SSL_PROTO_TLS1_1))
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200438#error "Illegal protocol selection"
439#endif
440
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200441#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \
442 defined(MBEDTLS_SSL_PROTO_TLS1_2) && (!defined(MBEDTLS_SSL_PROTO_TLS1) || \
443 !defined(MBEDTLS_SSL_PROTO_TLS1_1)))
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200444#error "Illegal protocol selection"
445#endif
446
Manuel Pégourié-Gonnarde057d3b2015-05-20 10:59:43 +0200447#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200448#error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites"
Manuel Pégourié-Gonnard82202f02014-07-23 00:28:58 +0200449#endif
450
Manuel Pégourié-Gonnard62c74bb2015-09-08 17:50:29 +0200451#if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \
Manuel Pégourié-Gonnardddfe5d22015-09-09 12:46:16 +0200452 !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
Manuel Pégourié-Gonnard62c74bb2015-09-08 17:50:29 +0200453#error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites"
454#endif
455
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200456#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \
457 ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
458#error "MBEDTLS_SSL_DTLS_ANTI_REPLAY defined, but not all prerequisites"
Manuel Pégourié-Gonnard8464a462014-09-24 14:05:32 +0200459#endif
460
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200461#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) && \
462 ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
463#error "MBEDTLS_SSL_DTLS_BADMAC_LIMIT defined, but not all prerequisites"
Manuel Pégourié-Gonnardb0643d12014-10-14 18:30:36 +0200464#endif
465
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200466#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \
467 !defined(MBEDTLS_SSL_PROTO_TLS1) && \
468 !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
469 !defined(MBEDTLS_SSL_PROTO_TLS1_2)
470#error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites"
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100471#endif
472
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200473#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \
474 !defined(MBEDTLS_SSL_PROTO_TLS1) && \
475 !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
476 !defined(MBEDTLS_SSL_PROTO_TLS1_2)
477#error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites"
Manuel Pégourié-Gonnard769c6b62014-10-28 14:13:55 +0100478#endif
479
Manuel Pégourié-Gonnard4214e3a2015-05-25 19:34:49 +0200480#if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C)
Manuel Pégourié-Gonnard0c0f11f2015-05-20 09:55:50 +0200481#error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200482#endif
483
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200484#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) && \
485 !defined(MBEDTLS_SSL_PROTO_SSL3) && !defined(MBEDTLS_SSL_PROTO_TLS1)
486#error "MBEDTLS_SSL_CBC_RECORD_SPLITTING defined, but not all prerequisites"
Manuel Pégourié-Gonnardd76314c2015-01-07 12:39:44 +0100487#endif
488
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200489#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \
490 !defined(MBEDTLS_X509_CRT_PARSE_C)
491#error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200492#endif
493
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200494#if defined(MBEDTLS_THREADING_PTHREAD)
495#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
496#error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200497#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200498#define MBEDTLS_THREADING_IMPL
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200499#endif
500
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200501#if defined(MBEDTLS_THREADING_ALT)
502#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
503#error "MBEDTLS_THREADING_ALT defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200504#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200505#define MBEDTLS_THREADING_IMPL
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200506#endif
507
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200508#if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL)
509#error "MBEDTLS_THREADING_C defined, single threading implementation required"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200510#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200511#undef MBEDTLS_THREADING_IMPL
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200512
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200513#if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C)
514#error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200515#endif
516
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200517#if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
518 !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \
519 !defined(MBEDTLS_PK_PARSE_C) )
520#error "MBEDTLS_X509_USE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200521#endif
522
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200523#if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
524 !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \
525 !defined(MBEDTLS_PK_WRITE_C) )
526#error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200527#endif
528
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200529#if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
530#error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200531#endif
532
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200533#if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
534#error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200535#endif
536
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200537#if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
538#error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200539#endif
540
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200541#if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
542#error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200543#endif
544
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200545#if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
546#error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200547#endif
548
Manuel Pégourié-Gonnardf78e4de2015-05-29 10:52:14 +0200549/*
550 * Avoid warning from -pedantic. This is a convenient place for this
551 * workaround since this is included by every single file before the
552 * #if defined(MBEDTLS_xxx_C) that results in emtpy translation units.
553 */
554typedef int mbedtls_iso_c_forbids_empty_translation_units;
555
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200556#endif /* MBEDTLS_CHECK_CONFIG_H */