Example program to test AES-GCM functionality. Used for a workshop

Dependencies:   mbed

Committer:
HannesTschofenig
Date:
Thu Sep 27 06:34:22 2018 +0000
Revision:
0:796d0f61a05b
Example AES-GCM test program

Who changed what in which revision?

UserRevisionLine numberNew contents of line
HannesTschofenig 0:796d0f61a05b 1 /**
HannesTschofenig 0:796d0f61a05b 2 * \file check_config.h
HannesTschofenig 0:796d0f61a05b 3 *
HannesTschofenig 0:796d0f61a05b 4 * \brief Consistency checks for configuration options
HannesTschofenig 0:796d0f61a05b 5 *
HannesTschofenig 0:796d0f61a05b 6 * Copyright (C) 2006-2014, Brainspark B.V.
HannesTschofenig 0:796d0f61a05b 7 *
HannesTschofenig 0:796d0f61a05b 8 * This file is part of PolarSSL (http://www.polarssl.org)
HannesTschofenig 0:796d0f61a05b 9 * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
HannesTschofenig 0:796d0f61a05b 10 *
HannesTschofenig 0:796d0f61a05b 11 * All rights reserved.
HannesTschofenig 0:796d0f61a05b 12 *
HannesTschofenig 0:796d0f61a05b 13 * This program is free software; you can redistribute it and/or modify
HannesTschofenig 0:796d0f61a05b 14 * it under the terms of the GNU General Public License as published by
HannesTschofenig 0:796d0f61a05b 15 * the Free Software Foundation; either version 2 of the License, or
HannesTschofenig 0:796d0f61a05b 16 * (at your option) any later version.
HannesTschofenig 0:796d0f61a05b 17 *
HannesTschofenig 0:796d0f61a05b 18 * This program is distributed in the hope that it will be useful,
HannesTschofenig 0:796d0f61a05b 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
HannesTschofenig 0:796d0f61a05b 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
HannesTschofenig 0:796d0f61a05b 21 * GNU General Public License for more details.
HannesTschofenig 0:796d0f61a05b 22 *
HannesTschofenig 0:796d0f61a05b 23 * You should have received a copy of the GNU General Public License along
HannesTschofenig 0:796d0f61a05b 24 * with this program; if not, write to the Free Software Foundation, Inc.,
HannesTschofenig 0:796d0f61a05b 25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
HannesTschofenig 0:796d0f61a05b 26 */
HannesTschofenig 0:796d0f61a05b 27
HannesTschofenig 0:796d0f61a05b 28 /*
HannesTschofenig 0:796d0f61a05b 29 * It is recommended to include this file from your config.h
HannesTschofenig 0:796d0f61a05b 30 * in order to catch dependency issues early.
HannesTschofenig 0:796d0f61a05b 31 */
HannesTschofenig 0:796d0f61a05b 32
HannesTschofenig 0:796d0f61a05b 33 #ifndef POLARSSL_CHECK_CONFIG_H
HannesTschofenig 0:796d0f61a05b 34 #define POLARSSL_CHECK_CONFIG_H
HannesTschofenig 0:796d0f61a05b 35
HannesTschofenig 0:796d0f61a05b 36 #if defined(POLARSSL_AESNI_C) && !defined(POLARSSL_HAVE_ASM)
HannesTschofenig 0:796d0f61a05b 37 #error "POLARSSL_AESNI_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 38 #endif
HannesTschofenig 0:796d0f61a05b 39
HannesTschofenig 0:796d0f61a05b 40 #if defined(POLARSSL_CERTS_C) && !defined(POLARSSL_PEM_PARSE_C)
HannesTschofenig 0:796d0f61a05b 41 #error "POLARSSL_CERTS_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 42 #endif
HannesTschofenig 0:796d0f61a05b 43
HannesTschofenig 0:796d0f61a05b 44 #if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C)
HannesTschofenig 0:796d0f61a05b 45 #error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 46 #endif
HannesTschofenig 0:796d0f61a05b 47
HannesTschofenig 0:796d0f61a05b 48 #if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C)
HannesTschofenig 0:796d0f61a05b 49 #error "POLARSSL_DHM_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 50 #endif
HannesTschofenig 0:796d0f61a05b 51
HannesTschofenig 0:796d0f61a05b 52 #if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C)
HannesTschofenig 0:796d0f61a05b 53 #error "POLARSSL_ECDH_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 54 #endif
HannesTschofenig 0:796d0f61a05b 55
HannesTschofenig 0:796d0f61a05b 56 #if defined(POLARSSL_ECDSA_C) && \
HannesTschofenig 0:796d0f61a05b 57 ( !defined(POLARSSL_ECP_C) || \
HannesTschofenig 0:796d0f61a05b 58 !defined(POLARSSL_ASN1_PARSE_C) || \
HannesTschofenig 0:796d0f61a05b 59 !defined(POLARSSL_ASN1_WRITE_C) )
HannesTschofenig 0:796d0f61a05b 60 #error "POLARSSL_ECDSA_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 61 #endif
HannesTschofenig 0:796d0f61a05b 62
HannesTschofenig 0:796d0f61a05b 63 #if defined(POLARSSL_ECDSA_DETERMINISTIC) && !defined(POLARSSL_HMAC_DRBG_C)
HannesTschofenig 0:796d0f61a05b 64 #error "POLARSSL_ECDSA_DETERMINISTIC defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 65 #endif
HannesTschofenig 0:796d0f61a05b 66
HannesTschofenig 0:796d0f61a05b 67 #if defined(POLARSSL_ECP_C) && ( !defined(POLARSSL_BIGNUM_C) || ( \
HannesTschofenig 0:796d0f61a05b 68 !defined(POLARSSL_ECP_DP_SECP192R1_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 69 !defined(POLARSSL_ECP_DP_SECP224R1_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 70 !defined(POLARSSL_ECP_DP_SECP256R1_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 71 !defined(POLARSSL_ECP_DP_SECP384R1_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 72 !defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 73 !defined(POLARSSL_ECP_DP_BP256R1_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 74 !defined(POLARSSL_ECP_DP_BP384R1_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 75 !defined(POLARSSL_ECP_DP_BP512R1_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 76 !defined(POLARSSL_ECP_DP_SECP192K1_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 77 !defined(POLARSSL_ECP_DP_SECP224K1_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 78 !defined(POLARSSL_ECP_DP_SECP256K1_ENABLED) ) )
HannesTschofenig 0:796d0f61a05b 79 #error "POLARSSL_ECP_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 80 #endif
HannesTschofenig 0:796d0f61a05b 81
HannesTschofenig 0:796d0f61a05b 82 #if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \
HannesTschofenig 0:796d0f61a05b 83 !defined(POLARSSL_SHA256_C))
HannesTschofenig 0:796d0f61a05b 84 #error "POLARSSL_ENTROPY_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 85 #endif
HannesTschofenig 0:796d0f61a05b 86 #if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \
HannesTschofenig 0:796d0f61a05b 87 defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64)
HannesTschofenig 0:796d0f61a05b 88 #error "CTR_DRBG_ENTROPY_LEN value too high"
HannesTschofenig 0:796d0f61a05b 89 #endif
HannesTschofenig 0:796d0f61a05b 90 #if defined(POLARSSL_ENTROPY_C) && \
HannesTschofenig 0:796d0f61a05b 91 ( !defined(POLARSSL_SHA512_C) || defined(POLARSSL_ENTROPY_FORCE_SHA256) ) \
HannesTschofenig 0:796d0f61a05b 92 && defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32)
HannesTschofenig 0:796d0f61a05b 93 #error "CTR_DRBG_ENTROPY_LEN value too high"
HannesTschofenig 0:796d0f61a05b 94 #endif
HannesTschofenig 0:796d0f61a05b 95 #if defined(POLARSSL_ENTROPY_C) && \
HannesTschofenig 0:796d0f61a05b 96 defined(POLARSSL_ENTROPY_FORCE_SHA256) && !defined(POLARSSL_SHA256_C)
HannesTschofenig 0:796d0f61a05b 97 #error "POLARSSL_ENTROPY_FORCE_SHA256 defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 98 #endif
HannesTschofenig 0:796d0f61a05b 99
HannesTschofenig 0:796d0f61a05b 100 #if defined(POLARSSL_GCM_C) && ( \
HannesTschofenig 0:796d0f61a05b 101 !defined(POLARSSL_AES_C) && !defined(POLARSSL_CAMELLIA_C) )
HannesTschofenig 0:796d0f61a05b 102 #error "POLARSSL_GCM_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 103 #endif
HannesTschofenig 0:796d0f61a05b 104
HannesTschofenig 0:796d0f61a05b 105 #if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C)
HannesTschofenig 0:796d0f61a05b 106 #error "POLARSSL_HAVEGE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 107 #endif
HannesTschofenig 0:796d0f61a05b 108
HannesTschofenig 0:796d0f61a05b 109 #if defined(POLARSSL_HMAC_DRBG) && !defined(POLARSSL_MD_C)
HannesTschofenig 0:796d0f61a05b 110 #error "POLARSSL_HMAC_DRBG_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 111 #endif
HannesTschofenig 0:796d0f61a05b 112
HannesTschofenig 0:796d0f61a05b 113 #if defined(POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 114 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) )
HannesTschofenig 0:796d0f61a05b 115 #error "POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 116 #endif
HannesTschofenig 0:796d0f61a05b 117
HannesTschofenig 0:796d0f61a05b 118 #if defined(POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 119 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) )
HannesTschofenig 0:796d0f61a05b 120 #error "POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 121 #endif
HannesTschofenig 0:796d0f61a05b 122
HannesTschofenig 0:796d0f61a05b 123 #if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C)
HannesTschofenig 0:796d0f61a05b 124 #error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 125 #endif
HannesTschofenig 0:796d0f61a05b 126
HannesTschofenig 0:796d0f61a05b 127 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 128 !defined(POLARSSL_ECDH_C)
HannesTschofenig 0:796d0f61a05b 129 #error "POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 130 #endif
HannesTschofenig 0:796d0f61a05b 131
HannesTschofenig 0:796d0f61a05b 132 #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 133 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \
HannesTschofenig 0:796d0f61a05b 134 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
HannesTschofenig 0:796d0f61a05b 135 #error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 136 #endif
HannesTschofenig 0:796d0f61a05b 137
HannesTschofenig 0:796d0f61a05b 138 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 139 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \
HannesTschofenig 0:796d0f61a05b 140 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) )
HannesTschofenig 0:796d0f61a05b 141 #error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 142 #endif
HannesTschofenig 0:796d0f61a05b 143
HannesTschofenig 0:796d0f61a05b 144 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 145 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \
HannesTschofenig 0:796d0f61a05b 146 !defined(POLARSSL_X509_CRT_PARSE_C) )
HannesTschofenig 0:796d0f61a05b 147 #error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 148 #endif
HannesTschofenig 0:796d0f61a05b 149
HannesTschofenig 0:796d0f61a05b 150 #if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 151 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
HannesTschofenig 0:796d0f61a05b 152 !defined(POLARSSL_PKCS1_V15) )
HannesTschofenig 0:796d0f61a05b 153 #error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 154 #endif
HannesTschofenig 0:796d0f61a05b 155
HannesTschofenig 0:796d0f61a05b 156 #if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
HannesTschofenig 0:796d0f61a05b 157 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
HannesTschofenig 0:796d0f61a05b 158 !defined(POLARSSL_PKCS1_V15) )
HannesTschofenig 0:796d0f61a05b 159 #error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 160 #endif
HannesTschofenig 0:796d0f61a05b 161
HannesTschofenig 0:796d0f61a05b 162 #if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && \
HannesTschofenig 0:796d0f61a05b 163 ( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) )
HannesTschofenig 0:796d0f61a05b 164 #error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 165 #endif
HannesTschofenig 0:796d0f61a05b 166
HannesTschofenig 0:796d0f61a05b 167 #if defined(POLARSSL_PADLOCK_C) && !defined(POLARSSL_HAVE_ASM)
HannesTschofenig 0:796d0f61a05b 168 #error "POLARSSL_PADLOCK_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 169 #endif
HannesTschofenig 0:796d0f61a05b 170
HannesTschofenig 0:796d0f61a05b 171 #if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C)
HannesTschofenig 0:796d0f61a05b 172 #error "POLARSSL_PBKDF2_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 173 #endif
HannesTschofenig 0:796d0f61a05b 174
HannesTschofenig 0:796d0f61a05b 175 #if defined(POLARSSL_PEM_PARSE_C) && !defined(POLARSSL_BASE64_C)
HannesTschofenig 0:796d0f61a05b 176 #error "POLARSSL_PEM_PARSE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 177 #endif
HannesTschofenig 0:796d0f61a05b 178
HannesTschofenig 0:796d0f61a05b 179 #if defined(POLARSSL_PEM_WRITE_C) && !defined(POLARSSL_BASE64_C)
HannesTschofenig 0:796d0f61a05b 180 #error "POLARSSL_PEM_WRITE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 181 #endif
HannesTschofenig 0:796d0f61a05b 182
HannesTschofenig 0:796d0f61a05b 183 #if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C)
HannesTschofenig 0:796d0f61a05b 184 #error "POLARSSL_PK_PARSE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 185 #endif
HannesTschofenig 0:796d0f61a05b 186
HannesTschofenig 0:796d0f61a05b 187 #if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C)
HannesTschofenig 0:796d0f61a05b 188 #error "POLARSSL_PK_WRITE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 189 #endif
HannesTschofenig 0:796d0f61a05b 190
HannesTschofenig 0:796d0f61a05b 191 #if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C)
HannesTschofenig 0:796d0f61a05b 192 #error "POLARSSL_PKCS11_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 193 #endif
HannesTschofenig 0:796d0f61a05b 194
HannesTschofenig 0:796d0f61a05b 195 #if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
HannesTschofenig 0:796d0f61a05b 196 !defined(POLARSSL_OID_C) )
HannesTschofenig 0:796d0f61a05b 197 #error "POLARSSL_RSA_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 198 #endif
HannesTschofenig 0:796d0f61a05b 199
HannesTschofenig 0:796d0f61a05b 200 #if defined(POLARSSL_SSL_PROTO_SSL3) && ( !defined(POLARSSL_MD5_C) || \
HannesTschofenig 0:796d0f61a05b 201 !defined(POLARSSL_SHA1_C) )
HannesTschofenig 0:796d0f61a05b 202 #error "POLARSSL_SSL_PROTO_SSL3 defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 203 #endif
HannesTschofenig 0:796d0f61a05b 204
HannesTschofenig 0:796d0f61a05b 205 #if defined(POLARSSL_SSL_PROTO_TLS1) && ( !defined(POLARSSL_MD5_C) || \
HannesTschofenig 0:796d0f61a05b 206 !defined(POLARSSL_SHA1_C) )
HannesTschofenig 0:796d0f61a05b 207 #error "POLARSSL_SSL_PROTO_TLS1 defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 208 #endif
HannesTschofenig 0:796d0f61a05b 209
HannesTschofenig 0:796d0f61a05b 210 #if defined(POLARSSL_SSL_PROTO_TLS1_1) && ( !defined(POLARSSL_MD5_C) || \
HannesTschofenig 0:796d0f61a05b 211 !defined(POLARSSL_SHA1_C) )
HannesTschofenig 0:796d0f61a05b 212 #error "POLARSSL_SSL_PROTO_TLS1_1 defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 213 #endif
HannesTschofenig 0:796d0f61a05b 214
HannesTschofenig 0:796d0f61a05b 215 #if defined(POLARSSL_SSL_PROTO_TLS1_2) && ( !defined(POLARSSL_SHA1_C) && \
HannesTschofenig 0:796d0f61a05b 216 !defined(POLARSSL_SHA256_C) && !defined(POLARSSL_SHA512_C) )
HannesTschofenig 0:796d0f61a05b 217 #error "POLARSSL_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 218 #endif
HannesTschofenig 0:796d0f61a05b 219
HannesTschofenig 0:796d0f61a05b 220 #if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C)
HannesTschofenig 0:796d0f61a05b 221 #error "POLARSSL_SSL_CLI_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 222 #endif
HannesTschofenig 0:796d0f61a05b 223
HannesTschofenig 0:796d0f61a05b 224 #if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \
HannesTschofenig 0:796d0f61a05b 225 !defined(POLARSSL_MD_C) )
HannesTschofenig 0:796d0f61a05b 226 #error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 227 #endif
HannesTschofenig 0:796d0f61a05b 228
HannesTschofenig 0:796d0f61a05b 229 #if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C)
HannesTschofenig 0:796d0f61a05b 230 #error "POLARSSL_SSL_SRV_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 231 #endif
HannesTschofenig 0:796d0f61a05b 232
HannesTschofenig 0:796d0f61a05b 233 #if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \
HannesTschofenig 0:796d0f61a05b 234 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \
HannesTschofenig 0:796d0f61a05b 235 !defined(POLARSSL_SSL_PROTO_TLS1_2))
HannesTschofenig 0:796d0f61a05b 236 #error "POLARSSL_SSL_TLS_C defined, but no protocols are active"
HannesTschofenig 0:796d0f61a05b 237 #endif
HannesTschofenig 0:796d0f61a05b 238
HannesTschofenig 0:796d0f61a05b 239 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
HannesTschofenig 0:796d0f61a05b 240 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1))
HannesTschofenig 0:796d0f61a05b 241 #error "Illegal protocol selection"
HannesTschofenig 0:796d0f61a05b 242 #endif
HannesTschofenig 0:796d0f61a05b 243
HannesTschofenig 0:796d0f61a05b 244 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \
HannesTschofenig 0:796d0f61a05b 245 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1))
HannesTschofenig 0:796d0f61a05b 246 #error "Illegal protocol selection"
HannesTschofenig 0:796d0f61a05b 247 #endif
HannesTschofenig 0:796d0f61a05b 248
HannesTschofenig 0:796d0f61a05b 249 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \
HannesTschofenig 0:796d0f61a05b 250 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \
HannesTschofenig 0:796d0f61a05b 251 !defined(POLARSSL_SSL_PROTO_TLS1_1)))
HannesTschofenig 0:796d0f61a05b 252 #error "Illegal protocol selection"
HannesTschofenig 0:796d0f61a05b 253 #endif
HannesTschofenig 0:796d0f61a05b 254
HannesTschofenig 0:796d0f61a05b 255 #if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \
HannesTschofenig 0:796d0f61a05b 256 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) || \
HannesTschofenig 0:796d0f61a05b 257 !defined(POLARSSL_CIPHER_MODE_CBC) )
HannesTschofenig 0:796d0f61a05b 258 #error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 259 #endif
HannesTschofenig 0:796d0f61a05b 260
HannesTschofenig 0:796d0f61a05b 261 #if defined(POLARSSL_SSL_SERVER_NAME_INDICATION) && \
HannesTschofenig 0:796d0f61a05b 262 !defined(POLARSSL_X509_CRT_PARSE_C)
HannesTschofenig 0:796d0f61a05b 263 #error "POLARSSL_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 264 #endif
HannesTschofenig 0:796d0f61a05b 265
HannesTschofenig 0:796d0f61a05b 266 #if defined(POLARSSL_THREADING_PTHREAD)
HannesTschofenig 0:796d0f61a05b 267 #if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
HannesTschofenig 0:796d0f61a05b 268 #error "POLARSSL_THREADING_PTHREAD defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 269 #endif
HannesTschofenig 0:796d0f61a05b 270 #define POLARSSL_THREADING_IMPL
HannesTschofenig 0:796d0f61a05b 271 #endif
HannesTschofenig 0:796d0f61a05b 272
HannesTschofenig 0:796d0f61a05b 273 #if defined(POLARSSL_THREADING_ALT)
HannesTschofenig 0:796d0f61a05b 274 #if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL)
HannesTschofenig 0:796d0f61a05b 275 #error "POLARSSL_THREADING_ALT defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 276 #endif
HannesTschofenig 0:796d0f61a05b 277 #define POLARSSL_THREADING_IMPL
HannesTschofenig 0:796d0f61a05b 278 #endif
HannesTschofenig 0:796d0f61a05b 279
HannesTschofenig 0:796d0f61a05b 280 #if defined(POLARSSL_THREADING_C) && !defined(POLARSSL_THREADING_IMPL)
HannesTschofenig 0:796d0f61a05b 281 #error "POLARSSL_THREADING_C defined, single threading implementation required"
HannesTschofenig 0:796d0f61a05b 282 #endif
HannesTschofenig 0:796d0f61a05b 283 #undef POLARSSL_THREADING_IMPL
HannesTschofenig 0:796d0f61a05b 284
HannesTschofenig 0:796d0f61a05b 285 #if defined(POLARSSL_VERSION_FEATURES) && !defined(POLARSSL_VERSION_C)
HannesTschofenig 0:796d0f61a05b 286 #error "POLARSSL_VERSION_FEATURES defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 287 #endif
HannesTschofenig 0:796d0f61a05b 288
HannesTschofenig 0:796d0f61a05b 289 #if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
HannesTschofenig 0:796d0f61a05b 290 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
HannesTschofenig 0:796d0f61a05b 291 !defined(POLARSSL_PK_PARSE_C) )
HannesTschofenig 0:796d0f61a05b 292 #error "POLARSSL_X509_USE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 293 #endif
HannesTschofenig 0:796d0f61a05b 294
HannesTschofenig 0:796d0f61a05b 295 #if defined(POLARSSL_X509_CREATE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
HannesTschofenig 0:796d0f61a05b 296 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \
HannesTschofenig 0:796d0f61a05b 297 !defined(POLARSSL_PK_WRITE_C) )
HannesTschofenig 0:796d0f61a05b 298 #error "POLARSSL_X509_CREATE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 299 #endif
HannesTschofenig 0:796d0f61a05b 300
HannesTschofenig 0:796d0f61a05b 301 #if defined(POLARSSL_X509_CRT_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
HannesTschofenig 0:796d0f61a05b 302 #error "POLARSSL_X509_CRT_PARSE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 303 #endif
HannesTschofenig 0:796d0f61a05b 304
HannesTschofenig 0:796d0f61a05b 305 #if defined(POLARSSL_X509_CRL_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
HannesTschofenig 0:796d0f61a05b 306 #error "POLARSSL_X509_CRL_PARSE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 307 #endif
HannesTschofenig 0:796d0f61a05b 308
HannesTschofenig 0:796d0f61a05b 309 #if defined(POLARSSL_X509_CSR_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) )
HannesTschofenig 0:796d0f61a05b 310 #error "POLARSSL_X509_CSR_PARSE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 311 #endif
HannesTschofenig 0:796d0f61a05b 312
HannesTschofenig 0:796d0f61a05b 313 #if defined(POLARSSL_X509_CRT_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
HannesTschofenig 0:796d0f61a05b 314 #error "POLARSSL_X509_CRT_WRITE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 315 #endif
HannesTschofenig 0:796d0f61a05b 316
HannesTschofenig 0:796d0f61a05b 317 #if defined(POLARSSL_X509_CSR_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) )
HannesTschofenig 0:796d0f61a05b 318 #error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites"
HannesTschofenig 0:796d0f61a05b 319 #endif
HannesTschofenig 0:796d0f61a05b 320
HannesTschofenig 0:796d0f61a05b 321 #endif /* POLARSSL_CHECK_CONFIG_H */
HannesTschofenig 0:796d0f61a05b 322
HannesTschofenig 0:796d0f61a05b 323