Go to the documentation of this file. 33 #ifndef POLARSSL_CHECK_CONFIG_H 34 #define POLARSSL_CHECK_CONFIG_H 36 #if defined(POLARSSL_AESNI_C) && !defined(POLARSSL_HAVE_ASM) 37 #error "POLARSSL_AESNI_C defined, but not all prerequisites" 40 #if defined(POLARSSL_CERTS_C) && !defined(POLARSSL_PEM_PARSE_C) 41 #error "POLARSSL_CERTS_C defined, but not all prerequisites" 44 #if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C) 45 #error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites" 48 #if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C) 49 #error "POLARSSL_DHM_C defined, but not all prerequisites" 52 #if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C) 53 #error "POLARSSL_ECDH_C defined, but not all prerequisites" 56 #if defined(POLARSSL_ECDSA_C) && \ 57 ( !defined(POLARSSL_ECP_C) || \ 58 !defined(POLARSSL_ASN1_PARSE_C) || \ 59 !defined(POLARSSL_ASN1_WRITE_C) ) 60 #error "POLARSSL_ECDSA_C defined, but not all prerequisites" 63 #if defined(POLARSSL_ECDSA_DETERMINISTIC) && !defined(POLARSSL_HMAC_DRBG_C) 64 #error "POLARSSL_ECDSA_DETERMINISTIC defined, but not all prerequisites" 67 #if defined(POLARSSL_ECP_C) && ( !defined(POLARSSL_BIGNUM_C) || ( \ 68 !defined(POLARSSL_ECP_DP_SECP192R1_ENABLED) && \ 69 !defined(POLARSSL_ECP_DP_SECP224R1_ENABLED) && \ 70 !defined(POLARSSL_ECP_DP_SECP256R1_ENABLED) && \ 71 !defined(POLARSSL_ECP_DP_SECP384R1_ENABLED) && \ 72 !defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) && \ 73 !defined(POLARSSL_ECP_DP_BP256R1_ENABLED) && \ 74 !defined(POLARSSL_ECP_DP_BP384R1_ENABLED) && \ 75 !defined(POLARSSL_ECP_DP_BP512R1_ENABLED) && \ 76 !defined(POLARSSL_ECP_DP_SECP192K1_ENABLED) && \ 77 !defined(POLARSSL_ECP_DP_SECP224K1_ENABLED) && \ 78 !defined(POLARSSL_ECP_DP_SECP256K1_ENABLED) ) ) 79 #error "POLARSSL_ECP_C defined, but not all prerequisites" 82 #if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \ 83 !defined(POLARSSL_SHA256_C)) 84 #error "POLARSSL_ENTROPY_C defined, but not all prerequisites" 86 #if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \ 87 defined(CTR_DRBG_ENTROPY_LEN) && (CTR_DRBG_ENTROPY_LEN > 64) 88 #error "CTR_DRBG_ENTROPY_LEN value too high" 90 #if defined(POLARSSL_ENTROPY_C) && \ 91 ( !defined(POLARSSL_SHA512_C) || defined(POLARSSL_ENTROPY_FORCE_SHA256) ) \ 92 && defined(CTR_DRBG_ENTROPY_LEN) && (CTR_DRBG_ENTROPY_LEN > 32) 93 #error "CTR_DRBG_ENTROPY_LEN value too high" 95 #if defined(POLARSSL_ENTROPY_C) && \ 96 defined(POLARSSL_ENTROPY_FORCE_SHA256) && !defined(POLARSSL_SHA256_C) 97 #error "POLARSSL_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" 100 #if defined(POLARSSL_GCM_C) && ( \ 101 !defined(POLARSSL_AES_C) && !defined(POLARSSL_CAMELLIA_C) ) 102 #error "POLARSSL_GCM_C defined, but not all prerequisites" 105 #if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C) 106 #error "POLARSSL_HAVEGE_C defined, but not all prerequisites" 109 #if defined(POLARSSL_HMAC_DRBG) && !defined(POLARSSL_MD_C) 110 #error "POLARSSL_HMAC_DRBG_C defined, but not all prerequisites" 113 #if defined(POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ 114 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ) 115 #error "POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites" 118 #if defined(POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ 119 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ) 120 #error "POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites" 123 #if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C) 124 #error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites" 127 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ 128 !defined(POLARSSL_ECDH_C) 129 #error "POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites" 132 #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ 133 ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \ 134 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) ) 135 #error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites" 138 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ 139 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \ 140 !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) ) 141 #error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites" 144 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ 145 ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \ 146 !defined(POLARSSL_X509_CRT_PARSE_C) ) 147 #error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites" 150 #if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ 151 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\ 152 !defined(POLARSSL_PKCS1_V15) ) 153 #error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites" 156 #if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \ 157 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\ 158 !defined(POLARSSL_PKCS1_V15) ) 159 #error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites" 162 #if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && \ 163 ( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) ) 164 #error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" 167 #if defined(POLARSSL_PADLOCK_C) && !defined(POLARSSL_HAVE_ASM) 168 #error "POLARSSL_PADLOCK_C defined, but not all prerequisites" 171 #if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C) 172 #error "POLARSSL_PBKDF2_C defined, but not all prerequisites" 175 #if defined(POLARSSL_PEM_PARSE_C) && !defined(POLARSSL_BASE64_C) 176 #error "POLARSSL_PEM_PARSE_C defined, but not all prerequisites" 179 #if defined(POLARSSL_PEM_WRITE_C) && !defined(POLARSSL_BASE64_C) 180 #error "POLARSSL_PEM_WRITE_C defined, but not all prerequisites" 183 #if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C) 184 #error "POLARSSL_PK_PARSE_C defined, but not all prerequisites" 187 #if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C) 188 #error "POLARSSL_PK_WRITE_C defined, but not all prerequisites" 191 #if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C) 192 #error "POLARSSL_PKCS11_C defined, but not all prerequisites" 195 #if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \ 196 !defined(POLARSSL_OID_C) ) 197 #error "POLARSSL_RSA_C defined, but not all prerequisites" 200 #if defined(POLARSSL_X509_RSASSA_PSS_SUPPORT) && \ 201 ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_PKCS1_V21) ) 202 #error "POLARSSL_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites" 205 #if defined(POLARSSL_SSL_PROTO_SSL3) && ( !defined(POLARSSL_MD5_C) || \ 206 !defined(POLARSSL_SHA1_C) ) 207 #error "POLARSSL_SSL_PROTO_SSL3 defined, but not all prerequisites" 210 #if defined(POLARSSL_SSL_PROTO_TLS1) && ( !defined(POLARSSL_MD5_C) || \ 211 !defined(POLARSSL_SHA1_C) ) 212 #error "POLARSSL_SSL_PROTO_TLS1 defined, but not all prerequisites" 215 #if defined(POLARSSL_SSL_PROTO_TLS1_1) && ( !defined(POLARSSL_MD5_C) || \ 216 !defined(POLARSSL_SHA1_C) ) 217 #error "POLARSSL_SSL_PROTO_TLS1_1 defined, but not all prerequisites" 220 #if defined(POLARSSL_SSL_PROTO_TLS1_2) && ( !defined(POLARSSL_SHA1_C) && \ 221 !defined(POLARSSL_SHA256_C) && !defined(POLARSSL_SHA512_C) ) 222 #error "POLARSSL_SSL_PROTO_TLS1_2 defined, but not all prerequisites" 225 #if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C) 226 #error "POLARSSL_SSL_CLI_C defined, but not all prerequisites" 229 #if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \ 230 !defined(POLARSSL_MD_C) ) 231 #error "POLARSSL_SSL_TLS_C defined, but not all prerequisites" 234 #if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C) 235 #error "POLARSSL_SSL_SRV_C defined, but not all prerequisites" 238 #if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \ 239 !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \ 240 !defined(POLARSSL_SSL_PROTO_TLS1_2)) 241 #error "POLARSSL_SSL_TLS_C defined, but no protocols are active" 244 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \ 245 defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1)) 246 #error "Illegal protocol selection" 249 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \ 250 defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1)) 251 #error "Illegal protocol selection" 254 #if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \ 255 defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \ 256 !defined(POLARSSL_SSL_PROTO_TLS1_1))) 257 #error "Illegal protocol selection" 260 #if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \ 261 ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) || \ 262 !defined(POLARSSL_CIPHER_MODE_CBC) ) 263 #error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites" 266 #if defined(POLARSSL_SSL_SERVER_NAME_INDICATION) && \ 267 !defined(POLARSSL_X509_CRT_PARSE_C) 268 #error "POLARSSL_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites" 271 #if defined(POLARSSL_THREADING_PTHREAD) 272 #if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL) 273 #error "POLARSSL_THREADING_PTHREAD defined, but not all prerequisites" 275 #define POLARSSL_THREADING_IMPL 278 #if defined(POLARSSL_THREADING_ALT) 279 #if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL) 280 #error "POLARSSL_THREADING_ALT defined, but not all prerequisites" 282 #define POLARSSL_THREADING_IMPL 285 #if defined(POLARSSL_THREADING_C) && !defined(POLARSSL_THREADING_IMPL) 286 #error "POLARSSL_THREADING_C defined, single threading implementation required" 288 #undef POLARSSL_THREADING_IMPL 290 #if defined(POLARSSL_VERSION_FEATURES) && !defined(POLARSSL_VERSION_C) 291 #error "POLARSSL_VERSION_FEATURES defined, but not all prerequisites" 294 #if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) || \ 295 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \ 296 !defined(POLARSSL_PK_PARSE_C) ) 297 #error "POLARSSL_X509_USE_C defined, but not all prerequisites" 300 #if defined(POLARSSL_X509_CREATE_C) && ( !defined(POLARSSL_BIGNUM_C) || \ 301 !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \ 302 !defined(POLARSSL_PK_WRITE_C) ) 303 #error "POLARSSL_X509_CREATE_C defined, but not all prerequisites" 306 #if defined(POLARSSL_X509_CRT_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) ) 307 #error "POLARSSL_X509_CRT_PARSE_C defined, but not all prerequisites" 310 #if defined(POLARSSL_X509_CRL_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) ) 311 #error "POLARSSL_X509_CRL_PARSE_C defined, but not all prerequisites" 314 #if defined(POLARSSL_X509_CSR_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) ) 315 #error "POLARSSL_X509_CSR_PARSE_C defined, but not all prerequisites" 318 #if defined(POLARSSL_X509_CRT_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) ) 319 #error "POLARSSL_X509_CRT_WRITE_C defined, but not all prerequisites" 322 #if defined(POLARSSL_X509_CSR_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) ) 323 #error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites"