blob: 33687c689bdbf6d206737ba8132ebba7a50a54e6 [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
Darryl Greena40a1012018-01-05 15:33:17 +00005 */
6/*
Thomas Fossati656864b2016-07-17 08:51:22 +01007 * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +02008 * SPDX-License-Identifier: Apache-2.0
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020021 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000022 * This file is part of mbed TLS (https://tls.mbed.org)
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020023 */
24
25/*
26 * It is recommended to include this file from your config.h
27 * in order to catch dependency issues early.
28 */
29
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020030#ifndef MBEDTLS_CHECK_CONFIG_H
31#define MBEDTLS_CHECK_CONFIG_H
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020032
Manuel Pégourié-Gonnardd14acbc2015-05-29 11:26:37 +020033/*
34 * We assume CHAR_BIT is 8 in many places. In practice, this is true on our
35 * target platforms, so not an issue, but let's just be extra sure.
36 */
37#include <limits.h>
38#if CHAR_BIT != 8
39#error "mbed TLS requires a platform with 8-bit chars"
40#endif
41
Manuel Pégourié-Gonnard9db28872015-06-26 10:52:01 +020042#if defined(_WIN32)
43#if !defined(MBEDTLS_PLATFORM_C)
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +020044#error "MBEDTLS_PLATFORM_C is required on Windows"
45#endif
46
Manuel Pégourié-Gonnard9db28872015-06-26 10:52:01 +020047/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as
Gilles Peskine5d46f6a2019-07-27 23:52:53 +020048 * it would confuse config.py. */
Manuel Pégourié-Gonnard9db28872015-06-26 10:52:01 +020049#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
50 !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
51#define MBEDTLS_PLATFORM_SNPRINTF_ALT
52#endif
k-stachowiak6b5ef482019-01-07 16:53:29 +010053
54#if !defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) && \
55 !defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO)
56#define MBEDTLS_PLATFORM_VSNPRINTF_ALT
57#endif
Manuel Pégourié-Gonnard9db28872015-06-26 10:52:01 +020058#endif /* _WIN32 */
59
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020060#if defined(TARGET_LIKE_MBED) && \
61 ( defined(MBEDTLS_NET_C) || defined(MBEDTLS_TIMING_C) )
62#error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS"
63#endif
64
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020065#if defined(MBEDTLS_DEPRECATED_WARNING) && \
Manuel Pégourié-Gonnard757ca002015-03-23 15:24:07 +010066 !defined(__GNUC__) && !defined(__clang__)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020067#error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang"
Manuel Pégourié-Gonnardc70581c2015-03-23 13:58:27 +010068#endif
69
Manuel Pégourié-Gonnard60c793b2015-06-18 20:52:58 +020070#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME)
71#error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense"
72#endif
73
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020074#if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM)
75#error "MBEDTLS_AESNI_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020076#endif
77
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020078#if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C)
79#error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020080#endif
81
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020082#if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C)
83#error "MBEDTLS_DHM_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020084#endif
85
Hanno Beckere89353a2017-11-20 16:36:41 +000086#if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) && !defined(MBEDTLS_SSL_TRUNCATED_HMAC)
87#error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT defined, but not all prerequisites"
88#endif
89
Brian Murray53e23b62016-09-13 14:00:15 -070090#if defined(MBEDTLS_CMAC_C) && \
Simon Butcher69283e52016-10-06 12:49:58 +010091 !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C)
Brian Murray53e23b62016-09-13 14:00:15 -070092#error "MBEDTLS_CMAC_C defined, but not all prerequisites"
93#endif
94
Ron Eldor466a57f2018-05-03 16:54:28 +030095#if defined(MBEDTLS_NIST_KW_C) && \
96 ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) )
97#error "MBEDTLS_NIST_KW_C defined, but not all prerequisites"
98#endif
99
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200100#if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C)
101#error "MBEDTLS_ECDH_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200102#endif
103
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200104#if defined(MBEDTLS_ECDSA_C) && \
105 ( !defined(MBEDTLS_ECP_C) || \
106 !defined(MBEDTLS_ASN1_PARSE_C) || \
107 !defined(MBEDTLS_ASN1_WRITE_C) )
108#error "MBEDTLS_ECDSA_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200109#endif
110
Manuel Pégourié-Gonnard4d8685b2015-08-05 15:44:42 +0200111#if defined(MBEDTLS_ECJPAKE_C) && \
112 ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) )
113#error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites"
114#endif
115
Ron Eldor5ed8c1e2018-11-05 14:04:26 +0200116#if defined(MBEDTLS_ECP_RESTARTABLE) && \
Hanno Becker85fd9132019-02-22 12:50:35 +0000117 ( defined(MBEDTLS_USE_PSA_CRYPTO) || \
Hanno Becker1ce51e42019-02-22 10:25:47 +0000118 defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \
Ron Eldor5ed8c1e2018-11-05 14:04:26 +0200119 defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \
120 defined(MBEDTLS_ECDSA_SIGN_ALT) || \
121 defined(MBEDTLS_ECDSA_VERIFY_ALT) || \
122 defined(MBEDTLS_ECDSA_GENKEY_ALT) || \
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500123 defined(MBEDTLS_ECP_INTERNAL_ALT) || \
Ron Eldor5ed8c1e2018-11-05 14:04:26 +0200124 defined(MBEDTLS_ECP_ALT) )
Hanno Becker1ce51e42019-02-22 10:25:47 +0000125#error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative or PSA-based ECP implementation"
Ron Eldor5ed8c1e2018-11-05 14:04:26 +0200126#endif
127
Gilles Peskine43f564f2019-02-22 12:14:02 +0100128#if defined(MBEDTLS_ECP_RESTARTABLE) && \
129 ! defined(MBEDTLS_ECDH_LEGACY_CONTEXT)
130#error "MBEDTLS_ECP_RESTARTABLE defined, but not MBEDTLS_ECDH_LEGACY_CONTEXT"
131#endif
132
Christoph M. Wintersteiger9c1b56b2019-04-15 11:09:33 +0100133#if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED) && \
134 defined(MBEDTLS_ECDH_LEGACY_CONTEXT)
135#error "MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED defined, but MBEDTLS_ECDH_LEGACY_CONTEXT not disabled"
136#endif
137
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200138#if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C)
139#error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200140#endif
141
k-stachowiak5dbe7ca2019-05-31 20:13:58 +0200142#if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200143 !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \
144 !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \
145 !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \
146 !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \
147 !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \
148 !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \
149 !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \
150 !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \
151 !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \
152 !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \
k-stachowiak5dbe7ca2019-05-31 20:13:58 +0200153 !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) && \
154 !defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) && \
155 !defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) ) )
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200156#error "MBEDTLS_ECP_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200157#endif
158
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500159#if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C)
160#error "MBEDTLS_PK_PARSE_C defined, but not all prerequesites"
161#endif
162
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200163#if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \
164 !defined(MBEDTLS_SHA256_C))
165#error "MBEDTLS_ENTROPY_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200166#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200167#if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \
168 defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64)
169#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200170#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200171#if defined(MBEDTLS_ENTROPY_C) && \
172 ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \
173 && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32)
174#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200175#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200176#if defined(MBEDTLS_ENTROPY_C) && \
177 defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C)
178#error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200179#endif
180
Simon Butcherab5df402016-06-11 02:31:21 +0100181#if defined(MBEDTLS_TEST_NULL_ENTROPY) && \
182 ( !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) )
183#error "MBEDTLS_TEST_NULL_ENTROPY defined, but not all prerequisites"
Janos Follath53de7842016-06-08 15:29:18 +0100184#endif
Simon Butcherab5df402016-06-11 02:31:21 +0100185#if defined(MBEDTLS_TEST_NULL_ENTROPY) && \
186 ( defined(MBEDTLS_ENTROPY_NV_SEED) || defined(MBEDTLS_ENTROPY_HARDWARE_ALT) || \
187 defined(MBEDTLS_HAVEGE_C) )
188#error "MBEDTLS_TEST_NULL_ENTROPY defined, but entropy sources too"
Janos Follath53de7842016-06-08 15:29:18 +0100189#endif
190
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200191#if defined(MBEDTLS_GCM_C) && ( \
192 !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) )
193#error "MBEDTLS_GCM_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200194#endif
195
Janos Follathc44ab972016-11-18 16:38:23 +0000196#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
Janos Follathb0697532016-08-18 12:38:46 +0100197#error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites"
198#endif
199
Janos Follathc44ab972016-11-18 16:38:23 +0000200#if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
Janos Follathb0697532016-08-18 12:38:46 +0100201#error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites"
202#endif
203
Janos Follathc44ab972016-11-18 16:38:23 +0000204#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
Janos Follathb0697532016-08-18 12:38:46 +0100205#error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites"
206#endif
207
Janos Follathc44ab972016-11-18 16:38:23 +0000208#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
Janos Follathb0697532016-08-18 12:38:46 +0100209#error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites"
210#endif
211
Janos Follathc44ab972016-11-18 16:38:23 +0000212#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
Janos Follathb0697532016-08-18 12:38:46 +0100213#error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites"
214#endif
215
Janos Follathc44ab972016-11-18 16:38:23 +0000216#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
Janos Follathb0697532016-08-18 12:38:46 +0100217#error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites"
218#endif
219
Janos Follathc44ab972016-11-18 16:38:23 +0000220#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
Janos Follathb0697532016-08-18 12:38:46 +0100221#error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites"
222#endif
223
Janos Follathc44ab972016-11-18 16:38:23 +0000224#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
Janos Follathb0697532016-08-18 12:38:46 +0100225#error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites"
226#endif
227
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200228#if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C)
229#error "MBEDTLS_HAVEGE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200230#endif
231
Thomas Fossati656864b2016-07-17 08:51:22 +0100232#if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C)
233#error "MBEDTLS_HKDF_C defined, but not all prerequisites"
234#endif
235
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200236#if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C)
237#error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200238#endif
239
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200240#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \
241 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) )
242#error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200243#endif
244
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200245#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \
246 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) )
247#error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200248#endif
249
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200250#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C)
251#error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200252#endif
253
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200254#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \
255 !defined(MBEDTLS_ECDH_C)
256#error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200257#endif
258
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200259#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
260 ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \
261 !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) )
262#error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200263#endif
264
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200265#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
266 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \
267 !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) )
268#error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200269#endif
270
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200271#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
272 ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \
273 !defined(MBEDTLS_X509_CRT_PARSE_C) )
274#error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200275#endif
276
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200277#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
278 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
279 !defined(MBEDTLS_PKCS1_V15) )
280#error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200281#endif
282
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200283#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \
284 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
285 !defined(MBEDTLS_PKCS1_V15) )
286#error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200287#endif
288
Manuel Pégourié-Gonnard557535d2015-09-15 17:53:32 +0200289#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \
290 ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) || \
291 !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) )
292#error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites"
293#endif
294
Hanno Beckerfe4ef0c2019-02-26 11:43:09 +0000295#if defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED) && \
296 !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) && \
297 ( !defined(MBEDTLS_SHA256_C) && \
298 !defined(MBEDTLS_SHA512_C) && \
299 !defined(MBEDTLS_SHA1_C) )
300#error "!MBEDTLS_SSL_KEEP_PEER_CERTIFICATE requires MBEDTLS_SHA512_C, MBEDTLS_SHA256_C or MBEDTLS_SHA1_C"
301#endif
302
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200303#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \
304 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
305#error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200306#endif
307
Hanno Beckeraf46c5f2019-02-26 13:50:21 +0000308#if defined(MBEDTLS_MEMORY_BACKTRACE) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
309#error "MBEDTLS_MEMORY_BACKTRACE defined, but not all prerequesites"
310#endif
311
Hanno Beckerbfaa7182019-06-03 16:31:32 +0100312#if defined(MBEDTLS_MEMORY_DEBUG) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
313#error "MBEDTLS_MEMORY_DEBUG defined, but not all prerequesites"
314#endif
315
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200316#if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM)
317#error "MBEDTLS_PADLOCK_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200318#endif
319
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200320#if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C)
321#error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200322#endif
323
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200324#if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C)
325#error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200326#endif
327
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200328#if defined(MBEDTLS_PK_C) && \
329 ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) )
330#error "MBEDTLS_PK_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard94de3312015-01-28 16:32:36 +0000331#endif
332
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200333#if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C)
334#error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200335#endif
336
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200337#if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C)
338#error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200339#endif
340
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200341#if defined(MBEDTLS_PKCS11_C) && !defined(MBEDTLS_PK_C)
342#error "MBEDTLS_PKCS11_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200343#endif
344
Manuel Pégourié-Gonnard320f4d92020-02-04 09:17:29 +0100345#if defined(MBEDTLS_PKCS11_C)
346#if defined(MBEDTLS_DEPRECATED_REMOVED)
347#error "MBEDTLS_PKCS11_C is deprecated and will be removed in a future version of Mbed TLS"
348#elif defined(MBEDTLS_DEPRECATED_WARNING)
349#warning "MBEDTLS_PKCS11_C is deprecated and will be removed in a future version of Mbed TLS"
350#endif
351#endif /* MBEDTLS_PKCS11_C */
352
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200353#if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C)
354#error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000355#endif
356
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200357#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C)
358#error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000359#endif
360
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200361#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\
362 ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\
363 defined(MBEDTLS_PLATFORM_EXIT_ALT) )
364#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 +0000365#endif
366
Andres Amaya Garcia1e4ec662016-07-20 10:16:25 +0100367#if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\
368 ( !defined(MBEDTLS_PLATFORM_C) ||\
369 !defined(MBEDTLS_HAVE_TIME) )
370#error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites"
371#endif
372
373#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\
374 ( !defined(MBEDTLS_PLATFORM_C) ||\
375 !defined(MBEDTLS_HAVE_TIME) )
376#error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites"
377#endif
378
379#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\
380 ( !defined(MBEDTLS_PLATFORM_C) ||\
381 !defined(MBEDTLS_HAVE_TIME) )
382#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites"
383#endif
384
385#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\
386 ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\
387 defined(MBEDTLS_PLATFORM_TIME_ALT) )
388#error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously"
389#endif
390
391#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\
392 ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\
393 defined(MBEDTLS_PLATFORM_TIME_ALT) )
394#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously"
395#endif
396
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200397#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
398#error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000399#endif
400
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200401#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
402#error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000403#endif
404
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200405#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\
406 ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\
407 defined(MBEDTLS_PLATFORM_FPRINTF_ALT) )
408#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 +0000409#endif
410
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200411#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
412 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
413#error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000414#endif
415
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200416#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
417 defined(MBEDTLS_PLATFORM_STD_FREE)
418#error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously"
Rich Evans4cc8a222015-02-03 11:26:31 +0000419#endif
420
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200421#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO)
422#error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is"
Rich Evans16f8cd82015-02-06 16:14:34 +0000423#endif
424
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200425#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200426 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200427#error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000428#endif
429
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200430#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
431 defined(MBEDTLS_PLATFORM_STD_CALLOC)
432#error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously"
Rich Evans4cc8a222015-02-03 11:26:31 +0000433#endif
434
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200435#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO)
436#error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is"
Rich Evans16f8cd82015-02-06 16:14:34 +0000437#endif
438
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200439#if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C)
440#error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000441#endif
442
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200443#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
444#error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000445#endif
446
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200447#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
448#error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000449#endif
450
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200451#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\
452 ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\
453 defined(MBEDTLS_PLATFORM_PRINTF_ALT) )
454#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 +0000455#endif
456
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200457#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
458#error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000459#endif
460
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200461#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
462#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites"
Rich Evans4cc8a222015-02-03 11:26:31 +0000463#endif
464
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200465#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\
466 ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\
467 defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) )
468#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 +0000469#endif
470
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200471#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\
472 !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS)
473#error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000474#endif
475
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200476#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY)
477#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000478#endif
479
Manuel Pégourié-Gonnarda7f80332015-05-27 20:26:40 +0200480#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY)
481#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000482#endif
483
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200484#if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY)
485#error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000486#endif
487
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200488#if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\
489 !defined(MBEDTLS_PLATFORM_EXIT_ALT)
490#error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000491#endif
492
Andres Amaya Garcia1e4ec662016-07-20 10:16:25 +0100493#if defined(MBEDTLS_PLATFORM_STD_TIME) &&\
494 ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\
495 !defined(MBEDTLS_HAVE_TIME) )
496#error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites"
497#endif
498
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200499#if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\
500 !defined(MBEDTLS_PLATFORM_FPRINTF_ALT)
501#error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000502#endif
503
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200504#if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\
505 !defined(MBEDTLS_PLATFORM_PRINTF_ALT)
506#error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000507#endif
508
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200509#if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\
510 !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT)
511#error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites"
Rich Evansc0b6da32015-02-03 10:58:06 +0000512#endif
513
Paul Bakkercf0a9f92016-06-01 11:25:44 +0100514#if defined(MBEDTLS_ENTROPY_NV_SEED) &&\
515 ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) )
516#error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites"
517#endif
518
519#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\
520 !defined(MBEDTLS_ENTROPY_NV_SEED)
521#error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites"
522#endif
523
524#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\
525 !defined(MBEDTLS_PLATFORM_NV_SEED_ALT)
526#error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites"
527#endif
528
529#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\
530 !defined(MBEDTLS_PLATFORM_NV_SEED_ALT)
531#error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites"
532#endif
533
534#if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\
535 ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\
536 defined(MBEDTLS_PLATFORM_NV_SEED_ALT) )
537#error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously"
538#endif
539
540#if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\
541 ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\
542 defined(MBEDTLS_PLATFORM_NV_SEED_ALT) )
543#error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously"
544#endif
545
Jaeden Amero484ee332018-10-25 17:38:05 +0100546#if defined(MBEDTLS_PSA_CRYPTO_C) && \
547 !( defined(MBEDTLS_CTR_DRBG_C) && \
548 defined(MBEDTLS_ENTROPY_C) )
549#error "MBEDTLS_PSA_CRYPTO_C defined, but not all prerequisites"
550#endif
551
Andrzej Kurekc6905232019-02-05 05:23:41 -0500552#if defined(MBEDTLS_PSA_CRYPTO_SPM) && !defined(MBEDTLS_PSA_CRYPTO_C)
553#error "MBEDTLS_PSA_CRYPTO_SPM defined, but not all prerequisites"
554#endif
555
Andrzej Kurekc6905232019-02-05 05:23:41 -0500556#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \
Jaeden Amero57f4d9e2019-03-15 16:14:19 +0000557 ! defined(MBEDTLS_PSA_CRYPTO_C)
Andrzej Kurekc6905232019-02-05 05:23:41 -0500558#error "MBEDTLS_PSA_CRYPTO_STORAGE_C defined, but not all prerequisites"
559#endif
560
Jaeden Amero57f4d9e2019-03-15 16:14:19 +0000561#if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \
562 !( defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \
563 defined(MBEDTLS_ENTROPY_NV_SEED) )
564#error "MBEDTLS_PSA_INJECT_ENTROPY defined, but not all prerequisites"
Andrzej Kurekc6905232019-02-05 05:23:41 -0500565#endif
566
Jaeden Amero57f4d9e2019-03-15 16:14:19 +0000567#if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \
568 !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES)
569#error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with actual entropy sources"
570#endif
571
572#if defined(MBEDTLS_PSA_ITS_FILE_C) && \
573 !defined(MBEDTLS_FS_IO)
574#error "MBEDTLS_PSA_ITS_FILE_C defined, but not all prerequisites"
Andrzej Kurekc6905232019-02-05 05:23:41 -0500575#endif
576
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200577#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
578 !defined(MBEDTLS_OID_C) )
579#error "MBEDTLS_RSA_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200580#endif
581
Paul Bakker4fde40f2016-05-09 15:13:04 +0100582#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \
Paul Bakker37068a72016-05-09 14:36:33 +0100583 !defined(MBEDTLS_PKCS1_V15) )
584#error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled"
585#endif
586
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200587#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \
588 ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) )
589#error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites"
Manuel Pégourié-Gonnard9df5c962014-01-24 14:37:29 +0100590#endif
591
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200592#if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) || \
593 !defined(MBEDTLS_SHA1_C) )
594#error "MBEDTLS_SSL_PROTO_SSL3 defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200595#endif
596
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200597#if defined(MBEDTLS_SSL_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) || \
598 !defined(MBEDTLS_SHA1_C) )
599#error "MBEDTLS_SSL_PROTO_TLS1 defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200600#endif
601
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200602#if defined(MBEDTLS_SSL_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) || \
603 !defined(MBEDTLS_SHA1_C) )
604#error "MBEDTLS_SSL_PROTO_TLS1_1 defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200605#endif
606
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200607#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \
608 !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) )
609#error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200610#endif
611
Manuel Pégourié-Gonnard5a8d56d2015-05-13 10:10:00 +0200612#if defined(MBEDTLS_SSL_PROTO_DTLS) && \
613 !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
614 !defined(MBEDTLS_SSL_PROTO_TLS1_2)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200615#error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites"
Manuel Pégourié-Gonnard0b1ff292014-02-06 13:04:16 +0100616#endif
617
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200618#if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C)
619#error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200620#endif
621
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200622#if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \
623 !defined(MBEDTLS_MD_C) )
624#error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200625#endif
626
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200627#if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C)
628#error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200629#endif
630
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200631#if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \
632 !defined(MBEDTLS_SSL_PROTO_TLS1) && !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
633 !defined(MBEDTLS_SSL_PROTO_TLS1_2))
634#error "MBEDTLS_SSL_TLS_C defined, but no protocols are active"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200635#endif
636
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200637#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \
638 defined(MBEDTLS_SSL_PROTO_TLS1_1) && !defined(MBEDTLS_SSL_PROTO_TLS1))
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200639#error "Illegal protocol selection"
640#endif
641
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200642#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \
643 defined(MBEDTLS_SSL_PROTO_TLS1_2) && !defined(MBEDTLS_SSL_PROTO_TLS1_1))
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200644#error "Illegal protocol selection"
645#endif
646
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200647#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \
648 defined(MBEDTLS_SSL_PROTO_TLS1_2) && (!defined(MBEDTLS_SSL_PROTO_TLS1) || \
649 !defined(MBEDTLS_SSL_PROTO_TLS1_1)))
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200650#error "Illegal protocol selection"
651#endif
652
Manuel Pégourié-Gonnarde057d3b2015-05-20 10:59:43 +0200653#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200654#error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites"
Manuel Pégourié-Gonnard82202f02014-07-23 00:28:58 +0200655#endif
656
Manuel Pégourié-Gonnard62c74bb2015-09-08 17:50:29 +0200657#if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \
Manuel Pégourié-Gonnardddfe5d22015-09-09 12:46:16 +0200658 !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
Manuel Pégourié-Gonnard62c74bb2015-09-08 17:50:29 +0200659#error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites"
660#endif
661
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200662#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \
663 ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
664#error "MBEDTLS_SSL_DTLS_ANTI_REPLAY defined, but not all prerequisites"
Manuel Pégourié-Gonnard8464a462014-09-24 14:05:32 +0200665#endif
666
Hanno Beckera0e20d02019-05-15 14:03:01 +0100667#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \
Hanno Beckerbb47cd92019-04-09 15:14:28 +0100668 ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
Hanno Beckera0e20d02019-05-15 14:03:01 +0100669#error "MBEDTLS_SSL_DTLS_CONNECTION_ID defined, but not all prerequisites"
Hanno Beckerbb47cd92019-04-09 15:14:28 +0100670#endif
671
Hanno Beckera0e20d02019-05-15 14:03:01 +0100672#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \
Hanno Becker189a0132019-04-25 16:47:57 +0100673 defined(MBEDTLS_SSL_CID_IN_LEN_MAX) && \
674 MBEDTLS_SSL_CID_IN_LEN_MAX > 255
675#error "MBEDTLS_SSL_CID_IN_LEN_MAX too large (max 255)"
676#endif
677
Hanno Beckera0e20d02019-05-15 14:03:01 +0100678#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \
Hanno Becker189a0132019-04-25 16:47:57 +0100679 defined(MBEDTLS_SSL_CID_OUT_LEN_MAX) && \
680 MBEDTLS_SSL_CID_OUT_LEN_MAX > 255
681#error "MBEDTLS_SSL_CID_OUT_LEN_MAX too large (max 255)"
682#endif
683
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200684#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) && \
685 ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
686#error "MBEDTLS_SSL_DTLS_BADMAC_LIMIT defined, but not all prerequisites"
Manuel Pégourié-Gonnardb0643d12014-10-14 18:30:36 +0200687#endif
688
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200689#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \
690 !defined(MBEDTLS_SSL_PROTO_TLS1) && \
691 !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
692 !defined(MBEDTLS_SSL_PROTO_TLS1_2)
693#error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites"
Manuel Pégourié-Gonnard699cafa2014-10-27 13:57:03 +0100694#endif
695
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200696#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \
697 !defined(MBEDTLS_SSL_PROTO_TLS1) && \
698 !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
699 !defined(MBEDTLS_SSL_PROTO_TLS1_2)
700#error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites"
Manuel Pégourié-Gonnard769c6b62014-10-28 14:13:55 +0100701#endif
702
Manuel Pégourié-Gonnard4214e3a2015-05-25 19:34:49 +0200703#if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C)
Manuel Pégourié-Gonnard0c0f11f2015-05-20 09:55:50 +0200704#error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200705#endif
706
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200707#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) && \
708 !defined(MBEDTLS_SSL_PROTO_SSL3) && !defined(MBEDTLS_SSL_PROTO_TLS1)
709#error "MBEDTLS_SSL_CBC_RECORD_SPLITTING defined, but not all prerequisites"
Manuel Pégourié-Gonnardd76314c2015-01-07 12:39:44 +0100710#endif
711
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200712#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \
713 !defined(MBEDTLS_X509_CRT_PARSE_C)
714#error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200715#endif
716
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200717#if defined(MBEDTLS_THREADING_PTHREAD)
718#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
719#error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200720#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200721#define MBEDTLS_THREADING_IMPL
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200722#endif
723
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200724#if defined(MBEDTLS_THREADING_ALT)
725#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
726#error "MBEDTLS_THREADING_ALT defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200727#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200728#define MBEDTLS_THREADING_IMPL
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200729#endif
730
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200731#if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL)
732#error "MBEDTLS_THREADING_C defined, single threading implementation required"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200733#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200734#undef MBEDTLS_THREADING_IMPL
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200735
Manuel Pégourié-Gonnardaeefa492018-10-22 12:14:52 +0200736#if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_PSA_CRYPTO_C)
737#error "MBEDTLS_USE_PSA_CRYPTO defined, but not all prerequisites"
738#endif
739
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200740#if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C)
741#error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200742#endif
743
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200744#if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
745 !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \
746 !defined(MBEDTLS_PK_PARSE_C) )
747#error "MBEDTLS_X509_USE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200748#endif
749
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200750#if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
751 !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \
752 !defined(MBEDTLS_PK_WRITE_C) )
753#error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200754#endif
755
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200756#if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
757#error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200758#endif
759
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200760#if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
761#error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200762#endif
763
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200764#if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
765#error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200766#endif
767
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200768#if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
769#error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200770#endif
771
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200772#if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
773#error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +0200774#endif
775
Andres Amaya Garciad7fce002017-07-20 11:49:32 +0100776#if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64)
777#error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously"
778#endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */
779
Andres Amaya Garcia93db11a2017-07-20 12:11:19 +0100780#if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \
781 defined(MBEDTLS_HAVE_ASM)
Andres Amaya Garciab39467d2017-07-20 13:21:15 +0100782#error "MBEDTLS_HAVE_INT32/MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously"
Andres Amaya Garciad7fce002017-07-20 11:49:32 +0100783#endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */
784
Andres Amaya Garcia88c2cc72018-11-29 09:56:02 +0000785#if defined(MBEDTLS_SSL_PROTO_SSL3)
Andres Amaya Garciae58532e2018-12-05 20:29:07 +0000786#if defined(MBEDTLS_DEPRECATED_REMOVED)
Andres Amaya Garcia835b2992019-01-15 19:36:00 +0000787#error "MBEDTLS_SSL_PROTO_SSL3 is deprecated and will be removed in a future version of Mbed TLS"
Andres Amaya Garciae58532e2018-12-05 20:29:07 +0000788#elif defined(MBEDTLS_DEPRECATED_WARNING)
Andres Amaya Garcia835b2992019-01-15 19:36:00 +0000789#warning "MBEDTLS_SSL_PROTO_SSL3 is deprecated and will be removed in a future version of Mbed TLS"
Andres Amaya Garcia88c2cc72018-11-29 09:56:02 +0000790#endif
791#endif /* MBEDTLS_SSL_PROTO_SSL3 */
792
Andres Amaya Garcia09634242018-11-29 09:55:41 +0000793#if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO)
Andres Amaya Garciae58532e2018-12-05 20:29:07 +0000794#if defined(MBEDTLS_DEPRECATED_REMOVED)
Andres Amaya Garcia835b2992019-01-15 19:36:00 +0000795#error "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO is deprecated and will be removed in a future version of Mbed TLS"
Andres Amaya Garciae58532e2018-12-05 20:29:07 +0000796#elif defined(MBEDTLS_DEPRECATED_WARNING)
Andres Amaya Garcia835b2992019-01-15 19:36:00 +0000797#warning "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO is deprecated and will be removed in a future version of Mbed TLS"
Andres Amaya Garcia09634242018-11-29 09:55:41 +0000798#endif
799#endif /* MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO */
800
Andres Amaya Garcia84b4e792018-12-05 22:39:38 +0000801#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL)
802#if defined(MBEDTLS_DEPRECATED_REMOVED)
Andres Amaya Garciada154092019-01-15 18:43:48 +0000803#error "MBEDTLS_SSL_HW_RECORD_ACCEL is deprecated and will be removed in a future version of Mbed TLS"
Andres Amaya Garcia84b4e792018-12-05 22:39:38 +0000804#elif defined(MBEDTLS_DEPRECATED_WARNING)
Andres Amaya Garciada154092019-01-15 18:43:48 +0000805#warning "MBEDTLS_SSL_HW_RECORD_ACCEL is deprecated and will be removed in a future version of Mbed TLS"
Andres Amaya Garcia84b4e792018-12-05 22:39:38 +0000806#endif
807#endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */
808
Manuel Pégourié-Gonnardf78e4de2015-05-29 10:52:14 +0200809/*
810 * Avoid warning from -pedantic. This is a convenient place for this
811 * workaround since this is included by every single file before the
Antonin Décimo36e89b52019-01-23 15:24:37 +0100812 * #if defined(MBEDTLS_xxx_C) that results in empty translation units.
Manuel Pégourié-Gonnardf78e4de2015-05-29 10:52:14 +0200813 */
814typedef int mbedtls_iso_c_forbids_empty_translation_units;
815
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200816#endif /* MBEDTLS_CHECK_CONFIG_H */