Hannes Tschofenig / Mbed 2 deprecated aes-gcm-test-program

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers check_config.h Source File

check_config.h

Go to the documentation of this file.
00001 /**
00002  * \file check_config.h
00003  *
00004  * \brief Consistency checks for configuration options
00005  *
00006  *  Copyright (C) 2006-2014, Brainspark B.V.
00007  *
00008  *  This file is part of PolarSSL (http://www.polarssl.org)
00009  *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
00010  *
00011  *  All rights reserved.
00012  *
00013  *  This program is free software; you can redistribute it and/or modify
00014  *  it under the terms of the GNU General Public License as published by
00015  *  the Free Software Foundation; either version 2 of the License, or
00016  *  (at your option) any later version.
00017  *
00018  *  This program is distributed in the hope that it will be useful,
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *  GNU General Public License for more details.
00022  *
00023  *  You should have received a copy of the GNU General Public License along
00024  *  with this program; if not, write to the Free Software Foundation, Inc.,
00025  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00026  */
00027 
00028 /*
00029  * It is recommended to include this file from your config.h
00030  * in order to catch dependency issues early.
00031  */
00032 
00033 #ifndef POLARSSL_CHECK_CONFIG_H
00034 #define POLARSSL_CHECK_CONFIG_H
00035 
00036 #if defined(POLARSSL_AESNI_C) && !defined(POLARSSL_HAVE_ASM)
00037 #error "POLARSSL_AESNI_C defined, but not all prerequisites"
00038 #endif
00039 
00040 #if defined(POLARSSL_CERTS_C) && !defined(POLARSSL_PEM_PARSE_C)
00041 #error "POLARSSL_CERTS_C defined, but not all prerequisites"
00042 #endif
00043 
00044 #if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
00045 #error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
00046 #endif
00047 
00048 #if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
00049 #error "POLARSSL_DHM_C defined, but not all prerequisites"
00050 #endif
00051 
00052 #if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
00053 #error "POLARSSL_ECDH_C defined, but not all prerequisites"
00054 #endif
00055 
00056 #if defined(POLARSSL_ECDSA_C) &&            \
00057     ( !defined(POLARSSL_ECP_C) ||           \
00058       !defined(POLARSSL_ASN1_PARSE_C) ||    \
00059       !defined(POLARSSL_ASN1_WRITE_C) )
00060 #error "POLARSSL_ECDSA_C defined, but not all prerequisites"
00061 #endif
00062 
00063 #if defined(POLARSSL_ECDSA_DETERMINISTIC) && !defined(POLARSSL_HMAC_DRBG_C)
00064 #error "POLARSSL_ECDSA_DETERMINISTIC defined, but not all prerequisites"
00065 #endif
00066 
00067 #if defined(POLARSSL_ECP_C) && ( !defined(POLARSSL_BIGNUM_C) || (   \
00068     !defined(POLARSSL_ECP_DP_SECP192R1_ENABLED) &&                  \
00069     !defined(POLARSSL_ECP_DP_SECP224R1_ENABLED) &&                  \
00070     !defined(POLARSSL_ECP_DP_SECP256R1_ENABLED) &&                  \
00071     !defined(POLARSSL_ECP_DP_SECP384R1_ENABLED) &&                  \
00072     !defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) &&                  \
00073     !defined(POLARSSL_ECP_DP_BP256R1_ENABLED)   &&                  \
00074     !defined(POLARSSL_ECP_DP_BP384R1_ENABLED)   &&                  \
00075     !defined(POLARSSL_ECP_DP_BP512R1_ENABLED)   &&                  \
00076     !defined(POLARSSL_ECP_DP_SECP192K1_ENABLED) &&                  \
00077     !defined(POLARSSL_ECP_DP_SECP224K1_ENABLED) &&                  \
00078     !defined(POLARSSL_ECP_DP_SECP256K1_ENABLED) ) )
00079 #error "POLARSSL_ECP_C defined, but not all prerequisites"
00080 #endif
00081 
00082 #if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) &&      \
00083                                     !defined(POLARSSL_SHA256_C))
00084 #error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
00085 #endif
00086 #if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) &&         \
00087     defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
00088 #error "CTR_DRBG_ENTROPY_LEN value too high"
00089 #endif
00090 #if defined(POLARSSL_ENTROPY_C) &&                                            \
00091     ( !defined(POLARSSL_SHA512_C) || defined(POLARSSL_ENTROPY_FORCE_SHA256) ) \
00092     && defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
00093 #error "CTR_DRBG_ENTROPY_LEN value too high"
00094 #endif
00095 #if defined(POLARSSL_ENTROPY_C) && \
00096     defined(POLARSSL_ENTROPY_FORCE_SHA256) && !defined(POLARSSL_SHA256_C)
00097 #error "POLARSSL_ENTROPY_FORCE_SHA256 defined, but not all prerequisites"
00098 #endif
00099 
00100 #if defined(POLARSSL_GCM_C) && (                                        \
00101         !defined(POLARSSL_AES_C) && !defined(POLARSSL_CAMELLIA_C) )
00102 #error "POLARSSL_GCM_C defined, but not all prerequisites"
00103 #endif
00104 
00105 #if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
00106 #error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
00107 #endif
00108 
00109 #if defined(POLARSSL_HMAC_DRBG) && !defined(POLARSSL_MD_C)
00110 #error "POLARSSL_HMAC_DRBG_C defined, but not all prerequisites"
00111 #endif
00112 
00113 #if defined(POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) &&                 \
00114     ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) )
00115 #error "POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites"
00116 #endif
00117 
00118 #if defined(POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED) &&                 \
00119     ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) )
00120 #error "POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites"
00121 #endif
00122 
00123 #if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
00124 #error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
00125 #endif
00126 
00127 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED) &&                     \
00128     !defined(POLARSSL_ECDH_C)
00129 #error "POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites"
00130 #endif
00131 
00132 #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) &&                   \
00133     ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) ||           \
00134       !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
00135 #error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
00136 #endif
00137 
00138 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) &&                 \
00139     ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) ||          \
00140       !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
00141 #error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
00142 #endif
00143 
00144 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) &&                 \
00145     ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) ||          \
00146       !defined(POLARSSL_X509_CRT_PARSE_C) )
00147 #error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
00148 #endif
00149 
00150 #if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) &&                   \
00151     ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
00152       !defined(POLARSSL_PKCS1_V15) )
00153 #error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
00154 #endif
00155 
00156 #if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) &&                       \
00157     ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
00158       !defined(POLARSSL_PKCS1_V15) )
00159 #error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
00160 #endif
00161 
00162 #if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) &&                          \
00163     ( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) )
00164 #error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
00165 #endif
00166 
00167 #if defined(POLARSSL_PADLOCK_C) && !defined(POLARSSL_HAVE_ASM)
00168 #error "POLARSSL_PADLOCK_C defined, but not all prerequisites"
00169 #endif
00170 
00171 #if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
00172 #error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
00173 #endif
00174 
00175 #if defined(POLARSSL_PEM_PARSE_C) && !defined(POLARSSL_BASE64_C)
00176 #error "POLARSSL_PEM_PARSE_C defined, but not all prerequisites"
00177 #endif
00178 
00179 #if defined(POLARSSL_PEM_WRITE_C) && !defined(POLARSSL_BASE64_C)
00180 #error "POLARSSL_PEM_WRITE_C defined, but not all prerequisites"
00181 #endif
00182 
00183 #if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C)
00184 #error "POLARSSL_PK_PARSE_C defined, but not all prerequisites"
00185 #endif
00186 
00187 #if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C)
00188 #error "POLARSSL_PK_WRITE_C defined, but not all prerequisites"
00189 #endif
00190 
00191 #if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
00192 #error "POLARSSL_PKCS11_C defined, but not all prerequisites"
00193 #endif
00194 
00195 #if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) ||         \
00196     !defined(POLARSSL_OID_C) )
00197 #error "POLARSSL_RSA_C defined, but not all prerequisites"
00198 #endif
00199 
00200 #if defined(POLARSSL_SSL_PROTO_SSL3) && ( !defined(POLARSSL_MD5_C) ||     \
00201     !defined(POLARSSL_SHA1_C) )
00202 #error "POLARSSL_SSL_PROTO_SSL3 defined, but not all prerequisites"
00203 #endif
00204 
00205 #if defined(POLARSSL_SSL_PROTO_TLS1) && ( !defined(POLARSSL_MD5_C) ||     \
00206     !defined(POLARSSL_SHA1_C) )
00207 #error "POLARSSL_SSL_PROTO_TLS1 defined, but not all prerequisites"
00208 #endif
00209 
00210 #if defined(POLARSSL_SSL_PROTO_TLS1_1) && ( !defined(POLARSSL_MD5_C) ||     \
00211     !defined(POLARSSL_SHA1_C) )
00212 #error "POLARSSL_SSL_PROTO_TLS1_1 defined, but not all prerequisites"
00213 #endif
00214 
00215 #if defined(POLARSSL_SSL_PROTO_TLS1_2) && ( !defined(POLARSSL_SHA1_C) &&     \
00216     !defined(POLARSSL_SHA256_C) && !defined(POLARSSL_SHA512_C) )
00217 #error "POLARSSL_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
00218 #endif
00219 
00220 #if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
00221 #error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
00222 #endif
00223 
00224 #if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) ||     \
00225     !defined(POLARSSL_MD_C) )
00226 #error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
00227 #endif
00228 
00229 #if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
00230 #error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
00231 #endif
00232 
00233 #if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
00234     !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
00235     !defined(POLARSSL_SSL_PROTO_TLS1_2))
00236 #error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
00237 #endif
00238 
00239 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
00240     defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
00241 #error "Illegal protocol selection"
00242 #endif
00243 
00244 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
00245     defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
00246 #error "Illegal protocol selection"
00247 #endif
00248 
00249 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
00250     defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
00251     !defined(POLARSSL_SSL_PROTO_TLS1_1)))
00252 #error "Illegal protocol selection"
00253 #endif
00254 
00255 #if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
00256     ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) ||            \
00257       !defined(POLARSSL_CIPHER_MODE_CBC) )
00258 #error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
00259 #endif
00260 
00261 #if defined(POLARSSL_SSL_SERVER_NAME_INDICATION) && \
00262         !defined(POLARSSL_X509_CRT_PARSE_C)
00263 #error "POLARSSL_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites"
00264 #endif
00265 
00266 #if defined(POLARSSL_THREADING_PTHREAD)
00267 #if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
00268 #error "POLARSSL_THREADING_PTHREAD defined, but not all prerequisites"
00269 #endif
00270 #define POLARSSL_THREADING_IMPL
00271 #endif
00272 
00273 #if defined(POLARSSL_THREADING_ALT)
00274 #if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
00275 #error "POLARSSL_THREADING_ALT defined, but not all prerequisites"
00276 #endif
00277 #define POLARSSL_THREADING_IMPL
00278 #endif
00279 
00280 #if defined(POLARSSL_THREADING_C) && !defined(POLARSSL_THREADING_IMPL)
00281 #error "POLARSSL_THREADING_C defined, single threading implementation required"
00282 #endif
00283 #undef POLARSSL_THREADING_IMPL
00284 
00285 #if defined(POLARSSL_VERSION_FEATURES) && !defined(POLARSSL_VERSION_C)
00286 #error "POLARSSL_VERSION_FEATURES defined, but not all prerequisites"
00287 #endif
00288 
00289 #if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) ||  \
00290     !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) ||      \
00291     !defined(POLARSSL_PK_PARSE_C) )
00292 #error "POLARSSL_X509_USE_C defined, but not all prerequisites"
00293 #endif
00294 
00295 #if defined(POLARSSL_X509_CREATE_C) && ( !defined(POLARSSL_BIGNUM_C) ||  \
00296     !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) ||       \
00297     !defined(POLARSSL_PK_WRITE_C) )
00298 #error "POLARSSL_X509_CREATE_C defined, but not all prerequisites"
00299 #endif
00300 
00301 #if defined(POLARSSL_X509_CRT_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
00302 #error "POLARSSL_X509_CRT_PARSE_C defined, but not all prerequisites"
00303 #endif
00304 
00305 #if defined(POLARSSL_X509_CRL_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
00306 #error "POLARSSL_X509_CRL_PARSE_C defined, but not all prerequisites"
00307 #endif
00308 
00309 #if defined(POLARSSL_X509_CSR_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
00310 #error "POLARSSL_X509_CSR_PARSE_C defined, but not all prerequisites"
00311 #endif
00312 
00313 #if defined(POLARSSL_X509_CRT_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
00314 #error "POLARSSL_X509_CRT_WRITE_C defined, but not all prerequisites"
00315 #endif
00316 
00317 #if defined(POLARSSL_X509_CSR_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
00318 #error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites"
00319 #endif
00320 
00321 #endif /* POLARSSL_CHECK_CONFIG_H */
00322 
00323