From cef4ad2509f6c19f6c3e9cf4e6a077bac9d98280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 29 Apr 2014 12:39:06 +0200 Subject: [PATCH 1/4] Adapt sources to configurable config.h name --- include/polarssl/aes.h | 4 ++++ include/polarssl/arc4.h | 4 ++++ include/polarssl/asn1.h | 4 ++++ include/polarssl/bignum.h | 4 ++++ include/polarssl/blowfish.h | 4 ++++ include/polarssl/camellia.h | 4 ++++ include/polarssl/cipher.h | 4 ++++ include/polarssl/cipher_wrap.h | 4 ++++ include/polarssl/compat-1.2.h | 4 ++++ include/polarssl/debug.h | 4 ++++ include/polarssl/des.h | 4 ++++ include/polarssl/entropy.h | 4 ++++ include/polarssl/entropy_poll.h | 4 ++++ include/polarssl/md2.h | 4 ++++ include/polarssl/md4.h | 4 ++++ include/polarssl/md5.h | 4 ++++ include/polarssl/md_wrap.h | 4 ++++ include/polarssl/memory.h | 4 ++++ include/polarssl/memory_buffer_alloc.h | 4 ++++ include/polarssl/oid.h | 4 ++++ include/polarssl/pk.h | 4 ++++ include/polarssl/pk_wrap.h | 4 ++++ include/polarssl/pkcs11.h | 4 ++++ include/polarssl/platform.h | 4 ++++ include/polarssl/ripemd160.h | 4 ++++ include/polarssl/rsa.h | 4 ++++ include/polarssl/sha1.h | 4 ++++ include/polarssl/sha256.h | 4 ++++ include/polarssl/sha512.h | 4 ++++ include/polarssl/ssl.h | 4 ++++ include/polarssl/threading.h | 4 ++++ include/polarssl/timing.h | 4 ++++ include/polarssl/version.h | 4 ++++ include/polarssl/x509.h | 4 ++++ include/polarssl/x509_crl.h | 4 ++++ include/polarssl/x509_crt.h | 4 ++++ include/polarssl/x509_csr.h | 4 ++++ include/polarssl/xtea.h | 4 ++++ library/aes.c | 4 ++++ library/aesni.c | 4 ++++ library/arc4.c | 4 ++++ library/asn1parse.c | 4 ++++ library/asn1write.c | 4 ++++ library/base64.c | 4 ++++ library/bignum.c | 4 ++++ library/blowfish.c | 4 ++++ library/camellia.c | 4 ++++ library/certs.c | 4 ++++ library/cipher.c | 4 ++++ library/cipher_wrap.c | 4 ++++ library/ctr_drbg.c | 4 ++++ library/debug.c | 4 ++++ library/des.c | 4 ++++ library/dhm.c | 4 ++++ library/ecdh.c | 4 ++++ library/ecdsa.c | 4 ++++ library/ecp.c | 4 ++++ library/ecp_curves.c | 4 ++++ library/entropy.c | 4 ++++ library/entropy_poll.c | 4 ++++ library/error.c | 4 ++++ library/gcm.c | 4 ++++ library/havege.c | 4 ++++ library/hmac_drbg.c | 4 ++++ library/md.c | 4 ++++ library/md2.c | 4 ++++ library/md4.c | 4 ++++ library/md5.c | 4 ++++ library/md_wrap.c | 4 ++++ library/memory_buffer_alloc.c | 4 ++++ library/net.c | 4 ++++ library/oid.c | 4 ++++ library/padlock.c | 4 ++++ library/pbkdf2.c | 4 ++++ library/pem.c | 4 ++++ library/pk.c | 4 ++++ library/pk_wrap.c | 4 ++++ library/pkcs12.c | 4 ++++ library/pkcs5.c | 4 ++++ library/pkparse.c | 4 ++++ library/pkwrite.c | 4 ++++ library/platform.c | 4 ++++ library/ripemd160.c | 4 ++++ library/rsa.c | 4 ++++ library/sha1.c | 4 ++++ library/sha256.c | 4 ++++ library/sha512.c | 4 ++++ library/ssl_cache.c | 4 ++++ library/ssl_ciphersuites.c | 4 ++++ library/ssl_cli.c | 4 ++++ library/ssl_srv.c | 4 ++++ library/ssl_tls.c | 4 ++++ library/threading.c | 4 ++++ library/timing.c | 4 ++++ library/version.c | 4 ++++ library/version_features.c | 4 ++++ library/x509.c | 4 ++++ library/x509_create.c | 4 ++++ library/x509_crl.c | 4 ++++ library/x509_crt.c | 4 ++++ library/x509_csr.c | 4 ++++ library/x509write_crt.c | 4 ++++ library/x509write_csr.c | 4 ++++ library/xtea.c | 4 ++++ programs/aes/aescrypt2.c | 4 ++++ programs/aes/crypt_and_hash.c | 4 ++++ programs/hash/generic_sum.c | 4 ++++ programs/hash/hello.c | 4 ++++ programs/hash/md5sum.c | 4 ++++ programs/hash/sha1sum.c | 4 ++++ programs/hash/sha2sum.c | 4 ++++ programs/pkey/dh_client.c | 4 ++++ programs/pkey/dh_genprime.c | 4 ++++ programs/pkey/dh_server.c | 4 ++++ programs/pkey/ecdsa.c | 4 ++++ programs/pkey/gen_key.c | 4 ++++ programs/pkey/key_app.c | 4 ++++ programs/pkey/key_app_writer.c | 4 ++++ programs/pkey/mpi_demo.c | 4 ++++ programs/pkey/pk_decrypt.c | 4 ++++ programs/pkey/pk_encrypt.c | 4 ++++ programs/pkey/pk_sign.c | 4 ++++ programs/pkey/pk_verify.c | 4 ++++ programs/pkey/rsa_decrypt.c | 4 ++++ programs/pkey/rsa_encrypt.c | 4 ++++ programs/pkey/rsa_genkey.c | 4 ++++ programs/pkey/rsa_sign.c | 4 ++++ programs/pkey/rsa_sign_pss.c | 4 ++++ programs/pkey/rsa_verify.c | 4 ++++ programs/pkey/rsa_verify_pss.c | 4 ++++ programs/random/gen_entropy.c | 4 ++++ programs/random/gen_random_ctr_drbg.c | 4 ++++ programs/random/gen_random_havege.c | 4 ++++ programs/ssl/ssl_client1.c | 4 ++++ programs/ssl/ssl_client2.c | 4 ++++ programs/ssl/ssl_fork_server.c | 4 ++++ programs/ssl/ssl_mail_client.c | 4 ++++ programs/ssl/ssl_pthread_server.c | 4 ++++ programs/ssl/ssl_server.c | 4 ++++ programs/ssl/ssl_server2.c | 4 ++++ programs/test/benchmark.c | 4 ++++ programs/test/o_p_test.c | 4 ++++ programs/test/selftest.c | 4 ++++ programs/test/ssl_cert_test.c | 4 ++++ programs/test/ssl_test.c | 4 ++++ programs/util/pem2der.c | 4 ++++ programs/util/strerror.c | 4 ++++ programs/x509/cert_app.c | 4 ++++ programs/x509/cert_req.c | 4 ++++ programs/x509/cert_write.c | 4 ++++ programs/x509/crl_app.c | 4 ++++ programs/x509/req_app.c | 4 ++++ scripts/data_files/error.fmt | 6 +++++- scripts/data_files/version_features.fmt | 4 ++++ tests/scripts/generate_code.pl | 4 ++++ 155 files changed, 621 insertions(+), 1 deletion(-) diff --git a/include/polarssl/aes.h b/include/polarssl/aes.h index ffba7bf2e..9b8a5fa78 100644 --- a/include/polarssl/aes.h +++ b/include/polarssl/aes.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_AES_H #define POLARSSL_AES_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/arc4.h b/include/polarssl/arc4.h index 9333265d3..baa4f6c4f 100644 --- a/include/polarssl/arc4.h +++ b/include/polarssl/arc4.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_ARC4_H #define POLARSSL_ARC4_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/asn1.h b/include/polarssl/asn1.h index 45fd6cd87..517cd5b11 100644 --- a/include/polarssl/asn1.h +++ b/include/polarssl/asn1.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_ASN1_H #define POLARSSL_ASN1_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_BIGNUM_C) #include "bignum.h" diff --git a/include/polarssl/bignum.h b/include/polarssl/bignum.h index 681a1de8b..bfd4ce067 100644 --- a/include/polarssl/bignum.h +++ b/include/polarssl/bignum.h @@ -30,7 +30,11 @@ #include #include +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32) #include diff --git a/include/polarssl/blowfish.h b/include/polarssl/blowfish.h index 45b138764..8c470ed31 100644 --- a/include/polarssl/blowfish.h +++ b/include/polarssl/blowfish.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_BLOWFISH_H #define POLARSSL_BLOWFISH_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/camellia.h b/include/polarssl/camellia.h index c98512f3d..a768c61b1 100644 --- a/include/polarssl/camellia.h +++ b/include/polarssl/camellia.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_CAMELLIA_H #define POLARSSL_CAMELLIA_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/cipher.h b/include/polarssl/cipher.h index c7ad5b780..c8b8490df 100644 --- a/include/polarssl/cipher.h +++ b/include/polarssl/cipher.h @@ -30,7 +30,11 @@ #ifndef POLARSSL_CIPHER_H #define POLARSSL_CIPHER_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_GCM_C) #define POLARSSL_CIPHER_MODE_AEAD diff --git a/include/polarssl/cipher_wrap.h b/include/polarssl/cipher_wrap.h index 63bd093fc..49d2661d1 100644 --- a/include/polarssl/cipher_wrap.h +++ b/include/polarssl/cipher_wrap.h @@ -29,7 +29,11 @@ #ifndef POLARSSL_CIPHER_WRAP_H #define POLARSSL_CIPHER_WRAP_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "cipher.h" #ifdef __cplusplus diff --git a/include/polarssl/compat-1.2.h b/include/polarssl/compat-1.2.h index 0cc63cac4..7ebc9c159 100644 --- a/include/polarssl/compat-1.2.h +++ b/include/polarssl/compat-1.2.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_COMPAT_1_2_H #define POLARSSL_COMPAT_1_2_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif // Comment out to disable prototype change warnings #define SHOW_PROTOTYPE_CHANGE_WARNINGS diff --git a/include/polarssl/debug.h b/include/polarssl/debug.h index 599ce43f7..7b51cbbf6 100644 --- a/include/polarssl/debug.h +++ b/include/polarssl/debug.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_DEBUG_H #define POLARSSL_DEBUG_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "ssl.h" #if defined(POLARSSL_ECP_C) #include "ecp.h" diff --git a/include/polarssl/des.h b/include/polarssl/des.h index d29bd1dee..7499b5328 100644 --- a/include/polarssl/des.h +++ b/include/polarssl/des.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_DES_H #define POLARSSL_DES_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/entropy.h b/include/polarssl/entropy.h index 4485d3e63..4f4f8f71f 100644 --- a/include/polarssl/entropy.h +++ b/include/polarssl/entropy.h @@ -29,7 +29,11 @@ #include +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SHA512_C) && !defined(POLARSSL_ENTROPY_FORCE_SHA256) #include "sha512.h" diff --git a/include/polarssl/entropy_poll.h b/include/polarssl/entropy_poll.h index 011659829..92efa0045 100644 --- a/include/polarssl/entropy_poll.h +++ b/include/polarssl/entropy_poll.h @@ -29,7 +29,11 @@ #include +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #ifdef __cplusplus extern "C" { diff --git a/include/polarssl/md2.h b/include/polarssl/md2.h index a8e23d0da..3792a4dc3 100644 --- a/include/polarssl/md2.h +++ b/include/polarssl/md2.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_MD2_H #define POLARSSL_MD2_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/md4.h b/include/polarssl/md4.h index a1b5d459e..b0434dd5c 100644 --- a/include/polarssl/md4.h +++ b/include/polarssl/md4.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_MD4_H #define POLARSSL_MD4_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/md5.h b/include/polarssl/md5.h index df2a61b8a..bb0ebf37d 100644 --- a/include/polarssl/md5.h +++ b/include/polarssl/md5.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_MD5_H #define POLARSSL_MD5_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/md_wrap.h b/include/polarssl/md_wrap.h index d681a0ca2..634bb7d5d 100644 --- a/include/polarssl/md_wrap.h +++ b/include/polarssl/md_wrap.h @@ -29,7 +29,11 @@ #ifndef POLARSSL_MD_WRAP_H #define POLARSSL_MD_WRAP_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "md.h" #ifdef __cplusplus diff --git a/include/polarssl/memory.h b/include/polarssl/memory.h index 64690bed9..3af39511b 100644 --- a/include/polarssl/memory.h +++ b/include/polarssl/memory.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_MEMORY_H #define POLARSSL_MEMORY_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/memory_buffer_alloc.h b/include/polarssl/memory_buffer_alloc.h index 68477a477..c44975258 100644 --- a/include/polarssl/memory_buffer_alloc.h +++ b/include/polarssl/memory_buffer_alloc.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_MEMORY_BUFFER_ALLOC_H #define POLARSSL_MEMORY_BUFFER_ALLOC_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/oid.h b/include/polarssl/oid.h index d825f4c94..b1d33b66b 100644 --- a/include/polarssl/oid.h +++ b/include/polarssl/oid.h @@ -28,7 +28,11 @@ #define POLARSSL_OID_H #include +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "asn1.h" #include "pk.h" #if defined(POLARSSL_CIPHER_C) diff --git a/include/polarssl/pk.h b/include/polarssl/pk.h index cebe0574d..7014e420e 100644 --- a/include/polarssl/pk.h +++ b/include/polarssl/pk.h @@ -28,7 +28,11 @@ #ifndef POLARSSL_PK_H #define POLARSSL_PK_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "md.h" diff --git a/include/polarssl/pk_wrap.h b/include/polarssl/pk_wrap.h index 91a671e02..7baafb95d 100644 --- a/include/polarssl/pk_wrap.h +++ b/include/polarssl/pk_wrap.h @@ -28,7 +28,11 @@ #ifndef POLARSSL_PK_WRAP_H #define POLARSSL_PK_WRAP_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "pk.h" diff --git a/include/polarssl/pkcs11.h b/include/polarssl/pkcs11.h index 707d00a81..1e4ed383c 100644 --- a/include/polarssl/pkcs11.h +++ b/include/polarssl/pkcs11.h @@ -29,7 +29,11 @@ #ifndef POLARSSL_PKCS11_H #define POLARSSL_PKCS11_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PKCS11_C) diff --git a/include/polarssl/platform.h b/include/polarssl/platform.h index b61aad021..fd9b80a12 100644 --- a/include/polarssl/platform.h +++ b/include/polarssl/platform.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_PLATFORM_H #define POLARSSL_PLATFORM_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/ripemd160.h b/include/polarssl/ripemd160.h index 2d760c3df..754322d6e 100644 --- a/include/polarssl/ripemd160.h +++ b/include/polarssl/ripemd160.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_RIPEMD160_H #define POLARSSL_RIPEMD160_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/rsa.h b/include/polarssl/rsa.h index d8c8341c9..ce84c1c27 100644 --- a/include/polarssl/rsa.h +++ b/include/polarssl/rsa.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_RSA_H #define POLARSSL_RSA_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "bignum.h" #include "md.h" diff --git a/include/polarssl/sha1.h b/include/polarssl/sha1.h index e1d8e27ca..f5e91a464 100644 --- a/include/polarssl/sha1.h +++ b/include/polarssl/sha1.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_SHA1_H #define POLARSSL_SHA1_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/sha256.h b/include/polarssl/sha256.h index 89df578e9..f3c00fa20 100644 --- a/include/polarssl/sha256.h +++ b/include/polarssl/sha256.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_SHA256_H #define POLARSSL_SHA256_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/sha512.h b/include/polarssl/sha512.h index 2c61637ee..b8908af22 100644 --- a/include/polarssl/sha512.h +++ b/include/polarssl/sha512.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_SHA512_H #define POLARSSL_SHA512_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/ssl.h b/include/polarssl/ssl.h index eb7ac511e..401908a39 100644 --- a/include/polarssl/ssl.h +++ b/include/polarssl/ssl.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_SSL_H #define POLARSSL_SSL_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "net.h" #include "bignum.h" diff --git a/include/polarssl/threading.h b/include/polarssl/threading.h index 87071523d..1fc9f9826 100644 --- a/include/polarssl/threading.h +++ b/include/polarssl/threading.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_THREADING_H #define POLARSSL_THREADING_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/include/polarssl/timing.h b/include/polarssl/timing.h index 09624fcf1..383120efe 100644 --- a/include/polarssl/timing.h +++ b/include/polarssl/timing.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_TIMING_H #define POLARSSL_TIMING_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if !defined(POLARSSL_TIMING_ALT) // Regular implementation diff --git a/include/polarssl/version.h b/include/polarssl/version.h index bae12443f..1c504fafb 100644 --- a/include/polarssl/version.h +++ b/include/polarssl/version.h @@ -31,7 +31,11 @@ #ifndef POLARSSL_VERSION_H #define POLARSSL_VERSION_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif /** * The version number x.y.z is split into three parts. diff --git a/include/polarssl/x509.h b/include/polarssl/x509.h index f2b8a0c0b..e13f38f78 100644 --- a/include/polarssl/x509.h +++ b/include/polarssl/x509.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_X509_H #define POLARSSL_X509_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "asn1.h" #include "pk.h" diff --git a/include/polarssl/x509_crl.h b/include/polarssl/x509_crl.h index 0c79916af..0fee59b83 100644 --- a/include/polarssl/x509_crl.h +++ b/include/polarssl/x509_crl.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_X509_CRL_H #define POLARSSL_X509_CRL_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "x509.h" diff --git a/include/polarssl/x509_crt.h b/include/polarssl/x509_crt.h index 8e6338197..0081d36c4 100644 --- a/include/polarssl/x509_crt.h +++ b/include/polarssl/x509_crt.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_X509_CRT_H #define POLARSSL_X509_CRT_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "x509.h" diff --git a/include/polarssl/x509_csr.h b/include/polarssl/x509_csr.h index 7e3830087..b66058760 100644 --- a/include/polarssl/x509_csr.h +++ b/include/polarssl/x509_csr.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_X509_CSR_H #define POLARSSL_X509_CSR_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "x509.h" diff --git a/include/polarssl/xtea.h b/include/polarssl/xtea.h index 95854d122..07118d977 100644 --- a/include/polarssl/xtea.h +++ b/include/polarssl/xtea.h @@ -27,7 +27,11 @@ #ifndef POLARSSL_XTEA_H #define POLARSSL_XTEA_H +#if !defined(POLARSSL_CONFIG_FILE) #include "config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/library/aes.c b/library/aes.c index fb211fe3c..f0a25bc52 100644 --- a/library/aes.c +++ b/library/aes.c @@ -29,7 +29,11 @@ * http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_AES_C) diff --git a/library/aesni.c b/library/aesni.c index e396d4395..9d21c85d4 100644 --- a/library/aesni.c +++ b/library/aesni.c @@ -28,7 +28,11 @@ * [CLMUL-WP] http://software.intel.com/en-us/articles/intel-carry-less-multiplication-instruction-and-its-usage-for-computing-the-gcm-mode/ */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_AESNI_C) diff --git a/library/arc4.c b/library/arc4.c index 536ea8ccc..dbf0c7ed4 100644 --- a/library/arc4.c +++ b/library/arc4.c @@ -28,7 +28,11 @@ * http://groups.google.com/group/sci.crypt/msg/10a300c9d21afca0 */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ARC4_C) diff --git a/library/asn1parse.c b/library/asn1parse.c index c9ce75acc..8b8e2df2c 100644 --- a/library/asn1parse.c +++ b/library/asn1parse.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ASN1_PARSE_C) diff --git a/library/asn1write.c b/library/asn1write.c index 626e0ff68..314c9f93b 100644 --- a/library/asn1write.c +++ b/library/asn1write.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ASN1_WRITE_C) diff --git a/library/base64.c b/library/base64.c index ee9c05c5d..103d81475 100644 --- a/library/base64.c +++ b/library/base64.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_BASE64_C) diff --git a/library/bignum.c b/library/bignum.c index 5fbb7d354..ac7f25c01 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -30,7 +30,11 @@ * http://math.libtomcrypt.com/files/tommath.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_BIGNUM_C) diff --git a/library/blowfish.c b/library/blowfish.c index 910d610d1..733c9fac3 100644 --- a/library/blowfish.c +++ b/library/blowfish.c @@ -29,7 +29,11 @@ * */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_BLOWFISH_C) diff --git a/library/camellia.c b/library/camellia.c index f007a46a3..4bf0b2939 100644 --- a/library/camellia.c +++ b/library/camellia.c @@ -29,7 +29,11 @@ * http://info.isl.ntt.co.jp/crypt/eng/camellia/dl/01espec.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_CAMELLIA_C) diff --git a/library/certs.c b/library/certs.c index 7409efad1..982226d41 100644 --- a/library/certs.c +++ b/library/certs.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_CERTS_C) diff --git a/library/cipher.c b/library/cipher.c index a103c263f..7534b2f78 100644 --- a/library/cipher.c +++ b/library/cipher.c @@ -27,7 +27,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_CIPHER_C) diff --git a/library/cipher_wrap.c b/library/cipher_wrap.c index 23065c4ba..2a79eeff5 100644 --- a/library/cipher_wrap.c +++ b/library/cipher_wrap.c @@ -27,7 +27,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_CIPHER_C) diff --git a/library/ctr_drbg.c b/library/ctr_drbg.c index 402780909..89b4c4c65 100644 --- a/library/ctr_drbg.c +++ b/library/ctr_drbg.c @@ -28,7 +28,11 @@ * http://csrc.nist.gov/publications/nistpubs/800-90/SP800-90revised_March2007.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_CTR_DRBG_C) diff --git a/library/debug.c b/library/debug.c index 60e39ed37..b768e6494 100644 --- a/library/debug.c +++ b/library/debug.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_DEBUG_C) diff --git a/library/des.c b/library/des.c index 7da3269d2..b8bb271dc 100644 --- a/library/des.c +++ b/library/des.c @@ -29,7 +29,11 @@ * http://csrc.nist.gov/publications/fips/fips46-3/fips46-3.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_DES_C) diff --git a/library/dhm.c b/library/dhm.c index 635e63e2a..5a38c148d 100644 --- a/library/dhm.c +++ b/library/dhm.c @@ -28,7 +28,11 @@ * http://www.cacr.math.uwaterloo.ca/hac/ (chapter 12) */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_DHM_C) diff --git a/library/ecdh.c b/library/ecdh.c index e35602db8..fa3259375 100644 --- a/library/ecdh.c +++ b/library/ecdh.c @@ -30,7 +30,11 @@ * RFC 4492 */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ECDH_C) diff --git a/library/ecdsa.c b/library/ecdsa.c index 6e45f2f1d..e467e37b3 100644 --- a/library/ecdsa.c +++ b/library/ecdsa.c @@ -29,7 +29,11 @@ * SEC1 http://www.secg.org/index.php?action=secg,docs_secg */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ECDSA_C) diff --git a/library/ecp.c b/library/ecp.c index 4823804fa..7e965d3c1 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -44,7 +44,11 @@ * */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ECP_C) diff --git a/library/ecp_curves.c b/library/ecp_curves.c index afb1dd74f..7fc07a09e 100644 --- a/library/ecp_curves.c +++ b/library/ecp_curves.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ECP_C) diff --git a/library/entropy.c b/library/entropy.c index d62fecf5e..238719bd8 100644 --- a/library/entropy.c +++ b/library/entropy.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ENTROPY_C) diff --git a/library/entropy_poll.c b/library/entropy_poll.c index badcfac5c..5c1dcc773 100644 --- a/library/entropy_poll.c +++ b/library/entropy_poll.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ENTROPY_C) diff --git a/library/error.c b/library/error.c index b2e834601..ed0f39eff 100644 --- a/library/error.c +++ b/library/error.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ERROR_C) diff --git a/library/gcm.c b/library/gcm.c index 1c6cf9f93..d5918a5dc 100644 --- a/library/gcm.c +++ b/library/gcm.c @@ -33,7 +33,11 @@ * [MGV] 4.1, pp. 12-13, to enhance speed without using too much memory. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_GCM_C) diff --git a/library/havege.c b/library/havege.c index 4d6f418ec..42aceda37 100644 --- a/library/havege.c +++ b/library/havege.c @@ -30,7 +30,11 @@ * Contact: seznec(at)irisa_dot_fr - orocheco(at)irisa_dot_fr */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_HAVEGE_C) diff --git a/library/hmac_drbg.c b/library/hmac_drbg.c index baef526b1..619b4464e 100644 --- a/library/hmac_drbg.c +++ b/library/hmac_drbg.c @@ -29,7 +29,11 @@ * References below are based on rev. 1 (January 2012). */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_HMAC_DRBG_C) diff --git a/library/md.c b/library/md.c index 5ab0fadd3..a05bf34b0 100644 --- a/library/md.c +++ b/library/md.c @@ -27,7 +27,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_MD_C) diff --git a/library/md2.c b/library/md2.c index f29877f90..1e1691d64 100644 --- a/library/md2.c +++ b/library/md2.c @@ -29,7 +29,11 @@ * http://www.ietf.org/rfc/rfc1319.txt */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_MD2_C) diff --git a/library/md4.c b/library/md4.c index 8ac6c0181..aa5f5391a 100644 --- a/library/md4.c +++ b/library/md4.c @@ -29,7 +29,11 @@ * http://www.ietf.org/rfc/rfc1320.txt */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_MD4_C) diff --git a/library/md5.c b/library/md5.c index c596e43b2..6ceab8a28 100644 --- a/library/md5.c +++ b/library/md5.c @@ -28,7 +28,11 @@ * http://www.ietf.org/rfc/rfc1321.txt */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_MD5_C) diff --git a/library/md_wrap.c b/library/md_wrap.c index a6c1bacbb..0b091e3c5 100644 --- a/library/md_wrap.c +++ b/library/md_wrap.c @@ -27,7 +27,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_MD_C) diff --git a/library/memory_buffer_alloc.c b/library/memory_buffer_alloc.c index 33ab5ac51..5176176dd 100644 --- a/library/memory_buffer_alloc.c +++ b/library/memory_buffer_alloc.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) diff --git a/library/net.c b/library/net.c index ff489864e..0bc2f68ae 100644 --- a/library/net.c +++ b/library/net.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_NET_C) diff --git a/library/oid.c b/library/oid.c index 2a61193c4..2b5293596 100644 --- a/library/oid.c +++ b/library/oid.c @@ -25,7 +25,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_OID_C) diff --git a/library/padlock.c b/library/padlock.c index 6e94532df..52b04f0f3 100644 --- a/library/padlock.c +++ b/library/padlock.c @@ -29,7 +29,11 @@ * programming_guide.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PADLOCK_C) diff --git a/library/pbkdf2.c b/library/pbkdf2.c index 09e56dfa3..65722742c 100644 --- a/library/pbkdf2.c +++ b/library/pbkdf2.c @@ -34,7 +34,11 @@ * http://tools.ietf.org/html/rfc6070 (Test vectors) */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PBKDF2_C) diff --git a/library/pem.c b/library/pem.c index 1cc23ba8d..2f639d04f 100644 --- a/library/pem.c +++ b/library/pem.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PEM_PARSE_C) || defined(POLARSSL_PEM_WRITE_C) #include "polarssl/pem.h" diff --git a/library/pk.c b/library/pk.c index 25c9d85e6..ce171073c 100644 --- a/library/pk.c +++ b/library/pk.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PK_C) diff --git a/library/pk_wrap.c b/library/pk_wrap.c index 2a4da03d8..513d96d7c 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PK_C) diff --git a/library/pkcs12.c b/library/pkcs12.c index 16821b03b..637c0578e 100644 --- a/library/pkcs12.c +++ b/library/pkcs12.c @@ -29,7 +29,11 @@ * ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12v1-1.asn */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PKCS12_C) diff --git a/library/pkcs5.c b/library/pkcs5.c index 2845f6812..db4e8cc5f 100644 --- a/library/pkcs5.c +++ b/library/pkcs5.c @@ -33,7 +33,11 @@ * http://tools.ietf.org/html/rfc6070 (Test vectors) */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PKCS5_C) diff --git a/library/pkparse.c b/library/pkparse.c index d0ae5d53b..ae8bddf03 100644 --- a/library/pkparse.c +++ b/library/pkparse.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PK_PARSE_C) diff --git a/library/pkwrite.c b/library/pkwrite.c index 4cbba10b7..aa04a5af0 100644 --- a/library/pkwrite.c +++ b/library/pkwrite.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PK_WRITE_C) diff --git a/library/platform.c b/library/platform.c index 8ea485d17..d57cbc828 100644 --- a/library/platform.c +++ b/library/platform.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_PLATFORM_C) diff --git a/library/ripemd160.c b/library/ripemd160.c index 10e60df84..f0e04a807 100644 --- a/library/ripemd160.c +++ b/library/ripemd160.c @@ -29,7 +29,11 @@ * http://ehash.iaik.tugraz.at/wiki/RIPEMD-160 */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_RIPEMD160_C) diff --git a/library/rsa.c b/library/rsa.c index 17861496d..9cfbe2abe 100644 --- a/library/rsa.c +++ b/library/rsa.c @@ -29,7 +29,11 @@ * http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_RSA_C) diff --git a/library/sha1.c b/library/sha1.c index f02d6e6ef..b89db3272 100644 --- a/library/sha1.c +++ b/library/sha1.c @@ -28,7 +28,11 @@ * http://www.itl.nist.gov/fipspubs/fip180-1.htm */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SHA1_C) diff --git a/library/sha256.c b/library/sha256.c index 638188f53..e3d3ea826 100644 --- a/library/sha256.c +++ b/library/sha256.c @@ -28,7 +28,11 @@ * http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SHA256_C) diff --git a/library/sha512.c b/library/sha512.c index 1bef2e90c..1d4b97706 100644 --- a/library/sha512.c +++ b/library/sha512.c @@ -28,7 +28,11 @@ * http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SHA512_C) diff --git a/library/ssl_cache.c b/library/ssl_cache.c index 4c7d3dbb0..69f7114de 100644 --- a/library/ssl_cache.c +++ b/library/ssl_cache.c @@ -27,7 +27,11 @@ * to store and retrieve the session information. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SSL_CACHE_C) diff --git a/library/ssl_ciphersuites.c b/library/ssl_ciphersuites.c index 25d192b7a..8018fe786 100644 --- a/library/ssl_ciphersuites.c +++ b/library/ssl_ciphersuites.c @@ -25,7 +25,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SSL_TLS_C) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index cd0d8c2a7..72299ee6f 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SSL_CLI_C) diff --git a/library/ssl_srv.c b/library/ssl_srv.c index acf2ef24c..21c4e2b05 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SSL_SRV_C) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index e9b102467..15245e422 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -31,7 +31,11 @@ * http://www.ietf.org/rfc/rfc4346.txt */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SSL_TLS_C) diff --git a/library/threading.c b/library/threading.c index 744fe27fa..5b25e015c 100644 --- a/library/threading.c +++ b/library/threading.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_THREADING_C) diff --git a/library/timing.c b/library/timing.c index d8b5b4628..f22591d47 100644 --- a/library/timing.c +++ b/library/timing.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SELF_TEST) && defined(POLARSSL_PLATFORM_C) #include "polarssl/platform.h" diff --git a/library/version.c b/library/version.c index c1080b781..120d62de4 100644 --- a/library/version.c +++ b/library/version.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_VERSION_C) diff --git a/library/version_features.c b/library/version_features.c index 238279860..d7d2d8fed 100644 --- a/library/version_features.c +++ b/library/version_features.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_VERSION_C) diff --git a/library/x509.c b/library/x509.c index 60e1cac81..1b06e21c6 100644 --- a/library/x509.c +++ b/library/x509.c @@ -34,7 +34,11 @@ * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_X509_USE_C) diff --git a/library/x509_create.c b/library/x509_create.c index 8e12c14cd..8f7a789ff 100644 --- a/library/x509_create.c +++ b/library/x509_create.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_X509_CREATE_C) diff --git a/library/x509_crl.c b/library/x509_crl.c index e3ebbff1a..6e46e1f53 100644 --- a/library/x509_crl.c +++ b/library/x509_crl.c @@ -34,7 +34,11 @@ * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_X509_CRL_PARSE_C) diff --git a/library/x509_crt.c b/library/x509_crt.c index 2c32122d3..d07236660 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -34,7 +34,11 @@ * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_X509_CRT_PARSE_C) diff --git a/library/x509_csr.c b/library/x509_csr.c index 4fb9ac228..7213fd23f 100644 --- a/library/x509_csr.c +++ b/library/x509_csr.c @@ -34,7 +34,11 @@ * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_X509_CSR_PARSE_C) diff --git a/library/x509write_crt.c b/library/x509write_crt.c index 15a1194ed..302b8771e 100644 --- a/library/x509write_crt.c +++ b/library/x509write_crt.c @@ -29,7 +29,11 @@ * - attributes: PKCS#9 v2.0 aka RFC 2985 */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_X509_CRT_WRITE_C) diff --git a/library/x509write_csr.c b/library/x509write_csr.c index 3a49aee94..6e7bed4a1 100644 --- a/library/x509write_csr.c +++ b/library/x509write_csr.c @@ -28,7 +28,11 @@ * - attributes: PKCS#9 v2.0 aka RFC 2985 */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_X509_CSR_WRITE_C) diff --git a/library/xtea.c b/library/xtea.c index 1bb6f29dd..58f970c7c 100644 --- a/library/xtea.c +++ b/library/xtea.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_XTEA_C) diff --git a/programs/aes/aescrypt2.c b/programs/aes/aescrypt2.c index 1239ca202..28f74d1a4 100644 --- a/programs/aes/aescrypt2.c +++ b/programs/aes/aescrypt2.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(_WIN32) #include diff --git a/programs/aes/crypt_and_hash.c b/programs/aes/crypt_and_hash.c index 859dc3382..3e89ba6fc 100644 --- a/programs/aes/crypt_and_hash.c +++ b/programs/aes/crypt_and_hash.c @@ -24,7 +24,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(_WIN32) #include diff --git a/programs/hash/generic_sum.c b/programs/hash/generic_sum.c index 498039b2b..b5de2a1d6 100644 --- a/programs/hash/generic_sum.c +++ b/programs/hash/generic_sum.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/hash/hello.c b/programs/hash/hello.c index 21c13874a..5bcfee9cd 100644 --- a/programs/hash/hello.c +++ b/programs/hash/hello.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/programs/hash/md5sum.c b/programs/hash/md5sum.c index 74296500c..ba7eea411 100644 --- a/programs/hash/md5sum.c +++ b/programs/hash/md5sum.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/hash/sha1sum.c b/programs/hash/sha1sum.c index bd3fd6e25..3a87b513b 100644 --- a/programs/hash/sha1sum.c +++ b/programs/hash/sha1sum.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/hash/sha2sum.c b/programs/hash/sha2sum.c index 2e6884dbf..3452054bd 100644 --- a/programs/hash/sha2sum.c +++ b/programs/hash/sha2sum.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/dh_client.c b/programs/pkey/dh_client.c index 66450b6d1..154f5e3f4 100644 --- a/programs/pkey/dh_client.c +++ b/programs/pkey/dh_client.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/dh_genprime.c b/programs/pkey/dh_genprime.c index 6d6e35a72..e75b33825 100644 --- a/programs/pkey/dh_genprime.c +++ b/programs/pkey/dh_genprime.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/programs/pkey/dh_server.c b/programs/pkey/dh_server.c index eb417daa1..c2fdbbfee 100644 --- a/programs/pkey/dh_server.c +++ b/programs/pkey/dh_server.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/ecdsa.c b/programs/pkey/ecdsa.c index 3dccfeb1d..0b4f8c42b 100644 --- a/programs/pkey/ecdsa.c +++ b/programs/pkey/ecdsa.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "polarssl/entropy.h" #include "polarssl/ctr_drbg.h" diff --git a/programs/pkey/gen_key.c b/programs/pkey/gen_key.c index 43ae6e16d..7c8efef6d 100644 --- a/programs/pkey/gen_key.c +++ b/programs/pkey/gen_key.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/key_app.c b/programs/pkey/key_app.c index b355069f7..27199ba90 100644 --- a/programs/pkey/key_app.c +++ b/programs/pkey/key_app.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/key_app_writer.c b/programs/pkey/key_app_writer.c index 269ddbd43..c35736f9c 100644 --- a/programs/pkey/key_app_writer.c +++ b/programs/pkey/key_app_writer.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/mpi_demo.c b/programs/pkey/mpi_demo.c index cc57f5fb1..2e9bf934c 100644 --- a/programs/pkey/mpi_demo.c +++ b/programs/pkey/mpi_demo.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/programs/pkey/pk_decrypt.c b/programs/pkey/pk_decrypt.c index bf3455dfc..8088c8f1c 100644 --- a/programs/pkey/pk_decrypt.c +++ b/programs/pkey/pk_decrypt.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/pk_encrypt.c b/programs/pkey/pk_encrypt.c index 149e7ddfe..ad005736c 100644 --- a/programs/pkey/pk_encrypt.c +++ b/programs/pkey/pk_encrypt.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/pk_sign.c b/programs/pkey/pk_sign.c index 4adb75371..2c355d939 100644 --- a/programs/pkey/pk_sign.c +++ b/programs/pkey/pk_sign.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/pk_verify.c b/programs/pkey/pk_verify.c index f2664a677..e97052094 100644 --- a/programs/pkey/pk_verify.c +++ b/programs/pkey/pk_verify.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/rsa_decrypt.c b/programs/pkey/rsa_decrypt.c index 02d30c8ed..c77d210e7 100644 --- a/programs/pkey/rsa_decrypt.c +++ b/programs/pkey/rsa_decrypt.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/rsa_encrypt.c b/programs/pkey/rsa_encrypt.c index 2ed27e23e..51a5ddb64 100644 --- a/programs/pkey/rsa_encrypt.c +++ b/programs/pkey/rsa_encrypt.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/rsa_genkey.c b/programs/pkey/rsa_genkey.c index 7711776ef..861e2c73f 100644 --- a/programs/pkey/rsa_genkey.c +++ b/programs/pkey/rsa_genkey.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include diff --git a/programs/pkey/rsa_sign.c b/programs/pkey/rsa_sign.c index ad907ddd3..068955778 100644 --- a/programs/pkey/rsa_sign.c +++ b/programs/pkey/rsa_sign.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/rsa_sign_pss.c b/programs/pkey/rsa_sign_pss.c index de33a6ea5..890a0b699 100644 --- a/programs/pkey/rsa_sign_pss.c +++ b/programs/pkey/rsa_sign_pss.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/rsa_verify.c b/programs/pkey/rsa_verify.c index cc3506d71..9c7c5ee7e 100644 --- a/programs/pkey/rsa_verify.c +++ b/programs/pkey/rsa_verify.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/pkey/rsa_verify_pss.c b/programs/pkey/rsa_verify_pss.c index 0969a5a22..84945c32a 100644 --- a/programs/pkey/rsa_verify_pss.c +++ b/programs/pkey/rsa_verify_pss.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/random/gen_entropy.c b/programs/random/gen_entropy.c index e0cbe528a..67679c85a 100644 --- a/programs/random/gen_entropy.c +++ b/programs/random/gen_entropy.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "polarssl/entropy.h" diff --git a/programs/random/gen_random_ctr_drbg.c b/programs/random/gen_random_ctr_drbg.c index 32b8521d3..ddd7737c1 100644 --- a/programs/random/gen_random_ctr_drbg.c +++ b/programs/random/gen_random_ctr_drbg.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "polarssl/entropy.h" #include "polarssl/ctr_drbg.h" diff --git a/programs/random/gen_random_havege.c b/programs/random/gen_random_havege.c index 9d3b56058..fd394117b 100644 --- a/programs/random/gen_random_havege.c +++ b/programs/random/gen_random_havege.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include "polarssl/havege.h" diff --git a/programs/ssl/ssl_client1.c b/programs/ssl/ssl_client1.c index a61ae64d9..e5a68e290 100644 --- a/programs/ssl/ssl_client1.c +++ b/programs/ssl/ssl_client1.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index 012403a40..62d29ad22 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/ssl/ssl_fork_server.c b/programs/ssl/ssl_fork_server.c index 927919416..554be1f9f 100644 --- a/programs/ssl/ssl_fork_server.c +++ b/programs/ssl/ssl_fork_server.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(_WIN32) #include diff --git a/programs/ssl/ssl_mail_client.c b/programs/ssl/ssl_mail_client.c index 64006ec62..455cca9b4 100644 --- a/programs/ssl/ssl_mail_client.c +++ b/programs/ssl/ssl_mail_client.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/ssl/ssl_pthread_server.c b/programs/ssl/ssl_pthread_server.c index efb360c21..254505efa 100644 --- a/programs/ssl/ssl_pthread_server.c +++ b/programs/ssl/ssl_pthread_server.c @@ -24,7 +24,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(_WIN32) #include diff --git a/programs/ssl/ssl_server.c b/programs/ssl/ssl_server.c index 5b86f9ba1..fcc518c7c 100644 --- a/programs/ssl/ssl_server.c +++ b/programs/ssl/ssl_server.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(_WIN32) #include diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 44f04a41d..48d5d30de 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_SSL_SERVER_NAME_INDICATION) && defined(POLARSSL_FS_IO) #define POLARSSL_SNI diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c index 2f359ad34..7077518b1 100644 --- a/programs/test/benchmark.c +++ b/programs/test/benchmark.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/test/o_p_test.c b/programs/test/o_p_test.c index 3a6c693bb..14789401f 100644 --- a/programs/test/o_p_test.c +++ b/programs/test/o_p_test.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/test/selftest.c b/programs/test/selftest.c index ba6e1d5c4..a2e7f7539 100644 --- a/programs/test/selftest.c +++ b/programs/test/selftest.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/test/ssl_cert_test.c b/programs/test/ssl_cert_test.c index 57f5f844f..2553dba01 100644 --- a/programs/test/ssl_cert_test.c +++ b/programs/test/ssl_cert_test.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/test/ssl_test.c b/programs/test/ssl_test.c index 79bab943c..069dc8a0d 100644 --- a/programs/test/ssl_test.c +++ b/programs/test/ssl_test.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/util/pem2der.c b/programs/util/pem2der.c index a755694e6..5386fdb9c 100644 --- a/programs/util/pem2der.c +++ b/programs/util/pem2der.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/util/strerror.c b/programs/util/strerror.c index 91f5c9e67..b56eaaef6 100644 --- a/programs/util/strerror.c +++ b/programs/util/strerror.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/x509/cert_app.c b/programs/x509/cert_app.c index c43e662af..72618e666 100644 --- a/programs/x509/cert_app.c +++ b/programs/x509/cert_app.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/x509/cert_req.c b/programs/x509/cert_req.c index f56cae8e7..6a0467ae2 100644 --- a/programs/x509/cert_req.c +++ b/programs/x509/cert_req.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/x509/cert_write.c b/programs/x509/cert_write.c index 31b52054f..e50a99dfe 100644 --- a/programs/x509/cert_write.c +++ b/programs/x509/cert_write.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/x509/crl_app.c b/programs/x509/crl_app.c index 0e4cd8801..b1f0a02a3 100644 --- a/programs/x509/crl_app.c +++ b/programs/x509/crl_app.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/programs/x509/req_app.c b/programs/x509/req_app.c index 1f9d62841..91bb2dc26 100644 --- a/programs/x509/req_app.c +++ b/programs/x509/req_app.c @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #include #include diff --git a/scripts/data_files/error.fmt b/scripts/data_files/error.fmt index 969cd95a0..30ee257a5 100644 --- a/scripts/data_files/error.fmt +++ b/scripts/data_files/error.fmt @@ -1,7 +1,7 @@ /* * Error message information * - * Copyright (C) 2006-2012, Brainspark B.V. + * Copyright (C) 2006-2014, Brainspark B.V. * * This file is part of PolarSSL (http://www.polarssl.org) * Lead Maintainer: Paul Bakker @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_ERROR_C) diff --git a/scripts/data_files/version_features.fmt b/scripts/data_files/version_features.fmt index 099e82ad2..c6a424f5d 100644 --- a/scripts/data_files/version_features.fmt +++ b/scripts/data_files/version_features.fmt @@ -23,7 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if !defined(POLARSSL_CONFIG_FILE) #include "polarssl/config.h" +#else +#include POLARSSL_CONFIG_FILE +#endif #if defined(POLARSSL_VERSION_C) diff --git a/tests/scripts/generate_code.pl b/tests/scripts/generate_code.pl index 6c2ac6e0f..6cba14f51 100755 --- a/tests/scripts/generate_code.pl +++ b/tests/scripts/generate_code.pl @@ -59,7 +59,11 @@ $/ = $line_separator; open(TEST_FILE, ">$test_file") or die "Opening destination file '$test_file': $!"; print TEST_FILE << "END"; +#if !defined(POLARSSL_CONFIG_FILE) #include +#else +#include POLARSSL_CONFIG_FILE +#endif $suite_pre_code $suite_header From 0bc1f23dfd095cd0c34028c50c2a2c528cd8162f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 30 Apr 2014 11:53:50 +0200 Subject: [PATCH 2/4] Adapt script and instructions for alt config.h --- configs/README.txt | 24 +++++++++++ configs/config-mini-tls1_1.h | 14 +++++-- configs/config-psk-rc4-tls1_0.h | 13 ++++-- configs/config-suite-b.h | 14 +++++-- scripts/activate-config.pl | 69 +++---------------------------- tests/scripts/test-ref-configs.pl | 2 +- 6 files changed, 59 insertions(+), 77 deletions(-) create mode 100644 configs/README.txt diff --git a/configs/README.txt b/configs/README.txt new file mode 100644 index 000000000..7527fdb68 --- /dev/null +++ b/configs/README.txt @@ -0,0 +1,24 @@ +This directory contains example configuration files. + +The examples are generally focused on a particular usage case (eg, support for +a restricted number of ciphersuites) and aim at minimizing resource usage for +this target. They can be used as a basis for custom configurations. + +These files are complete replacements for the default config.h. To use one of +them, you can pick one of the following methods: + +1. Replace the default file include/polarssl/config.h with the chosen one. + +2. Define POLARSSL_CONFIG_FILE and adjust the include path accordingly. + For example, using make: + + CFLAGS="-I$PWD/configs -DPOLARSSL_CONFIG_FILE=''" make + + Or, using cmake: + + rm CMakeCache.txt + CFLAGS="-I$PWD/configs -DPOLARSSL_CONFIG_FILE=''" cmake . + make + +Note that the second method also works if you want to keep your custom +configuration file outside the PolarSSL tree. diff --git a/configs/config-mini-tls1_1.h b/configs/config-mini-tls1_1.h index 81a95f063..f6016e85b 100644 --- a/configs/config-mini-tls1_1.h +++ b/configs/config-mini-tls1_1.h @@ -2,10 +2,17 @@ * Minimal configuration for TLS 1.1 (RFC 4346), implementing only the * required ciphersuite: TLS_RSA_WITH_3DES_EDE_CBC_SHA * - * Can be activated with: - * scripts/activate-config.pl configs/config-mini-tls1_1.h + * See README.txt for usage instructions. */ +#ifndef POLARSSL_CONFIG_H +#define POLARSSL_CONFIG_H + +/* System support */ +#define POLARSSL_HAVE_ASM +#define POLARSSL_HAVE_TIME +#define POLARSSL_HAVE_IPV6 + /* PolarSSL feature support */ #define POLARSSL_CIPHER_MODE_CBC #define POLARSSL_PKCS1_V15 @@ -44,5 +51,4 @@ /* For testing with compat.sh */ #define POLARSSL_FS_IO -/* marker for activate-config.pl - * \} name SECTION: PolarSSL modules */ +#endif /* POLARSSL_CONFIG_H */ diff --git a/configs/config-psk-rc4-tls1_0.h b/configs/config-psk-rc4-tls1_0.h index 1da378c3c..260b71341 100644 --- a/configs/config-psk-rc4-tls1_0.h +++ b/configs/config-psk-rc4-tls1_0.h @@ -2,10 +2,16 @@ * Custom compact configuration for TLS 1.0 with PSK and RC4 * Distinguishing features: no bignum, no PK, no X509. * - * Can be activated with: - * scripts/activate-config.pl configs/config-mini-tls1_1.h + * See README.txt for usage instructions. */ +#ifndef POLARSSL_CONFIG_H +#define POLARSSL_CONFIG_H + +/* System support */ +#define POLARSSL_HAVE_TIME +#define POLARSSL_HAVE_IPV6 + /* PolarSSL feature support */ #define POLARSSL_KEY_EXCHANGE_PSK_ENABLED #define POLARSSL_SSL_PROTO_TLS1 @@ -28,5 +34,4 @@ #define POLARSSL_SSL_SRV_C #define POLARSSL_SSL_TLS_C -/* marker for activate-config.pl - * \} name SECTION: PolarSSL modules */ +#endif /* POLARSSL_CONFIG_H */ diff --git a/configs/config-suite-b.h b/configs/config-suite-b.h index 2bfb0e124..7f085f4ff 100644 --- a/configs/config-suite-b.h +++ b/configs/config-suite-b.h @@ -1,10 +1,17 @@ /* * Minimal configuration for TLS NSA Suite B Profile (RFC 6460) * - * Can be activated with: - * scripts/activate-config.pl configs/config-mini-tls1_1.h + * See README.txt for usage instructions. */ +#ifndef POLARSSL_CONFIG_H +#define POLARSSL_CONFIG_H + +/* System support */ +#define POLARSSL_HAVE_ASM +#define POLARSSL_HAVE_TIME +#define POLARSSL_HAVE_IPV6 + /* PolarSSL feature support */ #define POLARSSL_ECP_DP_SECP256R1_ENABLED #define POLARSSL_ECP_DP_SECP384R1_ENABLED @@ -44,5 +51,4 @@ /* For testing with compat.sh */ #define POLARSSL_FS_IO -/* marker for activate-config.pl - * \} name SECTION: PolarSSL modules */ +#endif /* POLARSSL_CONFIG_H */ diff --git a/scripts/activate-config.pl b/scripts/activate-config.pl index caa8cdc13..5b4e8f508 100755 --- a/scripts/activate-config.pl +++ b/scripts/activate-config.pl @@ -1,68 +1,9 @@ #!/usr/bin/perl +# DEPRECATED! +# # activate a pre-defined configuration -use warnings; -use strict; - -my $config_h = "include/polarssl/config.h"; - -exit( main() ); - -sub read_default { - open my $fh, '<', $config_h or die "Failed to read $config_h: $!\n"; - - my (@pre, @post); - my $state = 'pre'; - - while( my $line = <$fh> ) { - if( $state eq 'pre' ) { - push @pre, $line; - $state = 'skip' if $line =~ /} name SECTION: System support/; - } - elsif( $state eq 'skip' ) { - $state = 'post' if $line =~/} name SECTION: PolarSSL modules/; - } - else { - push @post, $line; - } - } - - die "Failed to parse $config_h\n" if( $state ne 'post' ); - - close $fh; - - push @pre, "\n"; - - return \@pre, \@post; -} - -sub read_custom { - my ($file_name) = @_; - - open my $fh, '<', $file_name or die "Failed to read $file_name: $!\n"; - my @content = <$fh>; - close $fh; - - return \@content; -} - -sub write_custom { - my ($pre, $mid, $post) = @_; - - open my $fh, '>', $config_h or die "Failed to write $config_h: $!\n"; - print $fh @$pre; - print $fh @$mid; - print $fh @$post; - close $fh; -} - -sub main { - my $custom_file_name = $ARGV[0]; - - my ($pre, $post) = read_default(); - my $mine = read_custom( $custom_file_name ); - write_custom( $pre, $mine, $post ); - - return 0; -} +print "This script is deprecated!\n"; +print "See configs/README.txt regarding alternative config.h usage\n"; +exit 1; diff --git a/tests/scripts/test-ref-configs.pl b/tests/scripts/test-ref-configs.pl index 4577252f6..42131be3a 100755 --- a/tests/scripts/test-ref-configs.pl +++ b/tests/scripts/test-ref-configs.pl @@ -49,7 +49,7 @@ while( my ($conf, $args) = each %configs ) { print "* Testing configuration: $conf\n"; print "******************************************\n"; - system( "scripts/activate-config.pl configs/$conf" ) + system( "cp configs/$conf $config_h" ) and abort "Failed to activate $conf\n"; system( "make" ) and abort "Failed to build: $conf\n"; From 827b6cee7fcf768aed04323ebbd3834b4e1e5136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 30 Apr 2014 12:05:29 +0200 Subject: [PATCH 3/4] Minor cleanups in test-ref-configs.pl --- tests/scripts/test-ref-configs.pl | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/tests/scripts/test-ref-configs.pl b/tests/scripts/test-ref-configs.pl index 42131be3a..6f609252a 100755 --- a/tests/scripts/test-ref-configs.pl +++ b/tests/scripts/test-ref-configs.pl @@ -4,29 +4,34 @@ # - build # - run test suite # - run compat.sh +# +# Usage: tests/scripts/test-ref-configs.pl [config-name [...]] use warnings; use strict; my %configs = ( - 'config-psk-rc4-tls1_0.h' => '-m tls1 -f \'^PSK.*RC4\|TLS-PSK.*RC4\'', + 'config-psk-rc4-tls1_0.h' + => '-m tls1 -f \'^PSK.*RC4\|TLS-PSK.*RC4\'', 'config-mini-tls1_1.h' - => '-m tls1_1 -f \'^DES-CBC3-SHA$\|^TLS-RSA-WITH-3DES-EDE-CBC-SHA$\'', - 'config-suite-b.h' => "-m tls1_2 -f 'ECDHE-ECDSA.*AES.*GCM'", + => '-m tls1_1 -f \'^DES-CBC3-SHA$\|^TLS-RSA-WITH-3DES-EDE-CBC-SHA$\'', + 'config-suite-b.h' + => "-m tls1_2 -f 'ECDHE-ECDSA.*AES.*GCM'", ); +# If no config-name is provided, use all known configs. +# Otherwise, use the provided names only. if ($#ARGV >= 0) { - # filter configs - my @filtered_keys; - my %filtered_configs; + my %configs_ori = ( %configs ); + %configs = (); - foreach my $filter (@ARGV) { - push (@filtered_keys, $filter); + foreach my $conf_name (@ARGV) { + if( ! exists $configs_ori{$conf_name} ) { + die "Unknown configuration: $conf_name\n"; + } else { + $configs{$conf_name} = $configs_ori{$conf_name}; + } } - @filtered_keys = grep { exists $configs{$ARGV[0]} } @filtered_keys; - @filtered_configs{@filtered_keys} = @configs{@filtered_keys}; - - %configs = %filtered_configs; } -d 'library' && -d 'include' && -d 'tests' or die "Must be run from root\n"; From 14d55951ef99d9a221de955a0b5fabd72bd153df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 30 Apr 2014 12:35:08 +0200 Subject: [PATCH 4/4] Split config checks to separate file --- configs/config-mini-tls1_1.h | 2 + configs/config-psk-rc4-tls1_0.h | 2 + configs/config-suite-b.h | 2 + include/polarssl/check_config.h | 322 ++++++++++++++++++++++++++++++++ include/polarssl/config.h | 295 +---------------------------- visualc/VS2010/PolarSSL.vcxproj | 1 + visualc/VS6/polarssl.dsp | 4 + 7 files changed, 335 insertions(+), 293 deletions(-) create mode 100644 include/polarssl/check_config.h diff --git a/configs/config-mini-tls1_1.h b/configs/config-mini-tls1_1.h index f6016e85b..fd1b0e8dc 100644 --- a/configs/config-mini-tls1_1.h +++ b/configs/config-mini-tls1_1.h @@ -51,4 +51,6 @@ /* For testing with compat.sh */ #define POLARSSL_FS_IO +#include "check_config.h" + #endif /* POLARSSL_CONFIG_H */ diff --git a/configs/config-psk-rc4-tls1_0.h b/configs/config-psk-rc4-tls1_0.h index 260b71341..6a06dc7f8 100644 --- a/configs/config-psk-rc4-tls1_0.h +++ b/configs/config-psk-rc4-tls1_0.h @@ -34,4 +34,6 @@ #define POLARSSL_SSL_SRV_C #define POLARSSL_SSL_TLS_C +#include "check_config.h" + #endif /* POLARSSL_CONFIG_H */ diff --git a/configs/config-suite-b.h b/configs/config-suite-b.h index 7f085f4ff..bfd604807 100644 --- a/configs/config-suite-b.h +++ b/configs/config-suite-b.h @@ -51,4 +51,6 @@ /* For testing with compat.sh */ #define POLARSSL_FS_IO +#include "check_config.h" + #endif /* POLARSSL_CONFIG_H */ diff --git a/include/polarssl/check_config.h b/include/polarssl/check_config.h new file mode 100644 index 000000000..ee4a5c444 --- /dev/null +++ b/include/polarssl/check_config.h @@ -0,0 +1,322 @@ +/** + * \file check_config.h + * + * \brief Consistency checks for configuration options + * + * Copyright (C) 2006-2014, Brainspark B.V. + * + * This file is part of PolarSSL (http://www.polarssl.org) + * Lead Maintainer: Paul Bakker + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* + * It is recommended to include this file from your config.h + * in order to catch dependency issues early. + */ + +#ifndef POLARSSL_CHECK_CONFIG_H +#define POLARSSL_CHECK_CONFIG_H + +#if defined(POLARSSL_AESNI_C) && !defined(POLARSSL_HAVE_ASM) +#error "POLARSSL_AESNI_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_CERTS_C) && !defined(POLARSSL_PEM_PARSE_C) +#error "POLARSSL_CERTS_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C) +#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C) +#error "POLARSSL_DHM_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C) +#error "POLARSSL_ECDH_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_ECDSA_C) && \ + ( !defined(POLARSSL_ECP_C) || \ + !defined(POLARSSL_ASN1_PARSE_C) || \ + !defined(POLARSSL_ASN1_WRITE_C) ) +#error "POLARSSL_ECDSA_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_ECDSA_DETERMINISTIC) && !defined(POLARSSL_HMAC_DRBG_C) +#error "POLARSSL_ECDSA_DETERMINISTIC defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_ECP_C) && ( !defined(POLARSSL_BIGNUM_C) || ( \ + !defined(POLARSSL_ECP_DP_SECP192R1_ENABLED) && \ + !defined(POLARSSL_ECP_DP_SECP224R1_ENABLED) && \ + !defined(POLARSSL_ECP_DP_SECP256R1_ENABLED) && \ + !defined(POLARSSL_ECP_DP_SECP384R1_ENABLED) && \ + !defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) && \ + !defined(POLARSSL_ECP_DP_BP256R1_ENABLED) && \ + !defined(POLARSSL_ECP_DP_BP384R1_ENABLED) && \ + !defined(POLARSSL_ECP_DP_BP512R1_ENABLED) && \ + !defined(POLARSSL_ECP_DP_M255_ENABLED) && \ + !defined(POLARSSL_ECP_DP_SECP192K1_ENABLED) && \ + !defined(POLARSSL_ECP_DP_SECP224K1_ENABLED) && \ + !defined(POLARSSL_ECP_DP_SECP256K1_ENABLED) ) ) +#error "POLARSSL_ECP_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \ + !defined(POLARSSL_SHA256_C)) +#error "POLARSSL_ENTROPY_C defined, but not all prerequisites" +#endif +#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \ + defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64) +#error "CTR_DRBG_ENTROPY_LEN value too high" +#endif +#if defined(POLARSSL_ENTROPY_C) && \ + ( !defined(POLARSSL_SHA512_C) || defined(POLARSSL_ENTROPY_FORCE_SHA256) ) \ + && defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32) +#error "CTR_DRBG_ENTROPY_LEN value too high" +#endif +#if defined(POLARSSL_ENTROPY_C) && \ + defined(POLARSSL_ENTROPY_FORCE_SHA256) && !defined(POLARSSL_SHA256_C) +#error "POLARSSL_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_GCM_C) && ( \ + !defined(POLARSSL_AES_C) && !defined(POLARSSL_CAMELLIA_C) ) +#error "POLARSSL_GCM_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C) +#error "POLARSSL_HAVEGE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_HMAC_DRBG) && !defined(POLARSSL_MD_C) +#error "POLARSSL_HMAC_DRBG_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ + ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ) +#error "POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ + ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ) +#error "POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C) +#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ + !defined(POLARSSL_ECDH_C) +#error "POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ + ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \ + !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) ) +#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ + ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \ + !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) ) +#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ + ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \ + !defined(POLARSSL_X509_CRT_PARSE_C) ) +#error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ + ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\ + !defined(POLARSSL_PKCS1_V15) ) +#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \ + ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\ + !defined(POLARSSL_PKCS1_V15) ) +#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && \ + ( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) ) +#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_PADLOCK_C) && !defined(POLARSSL_HAVE_ASM) +#error "POLARSSL_PADLOCK_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C) +#error "POLARSSL_PBKDF2_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_PEM_PARSE_C) && !defined(POLARSSL_BASE64_C) +#error "POLARSSL_PEM_PARSE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_PEM_WRITE_C) && !defined(POLARSSL_BASE64_C) +#error "POLARSSL_PEM_WRITE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C) +#error "POLARSSL_PK_PARSE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C) +#error "POLARSSL_PK_WRITE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C) +#error "POLARSSL_PKCS11_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \ + !defined(POLARSSL_OID_C) ) +#error "POLARSSL_RSA_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_PROTO_SSL3) && ( !defined(POLARSSL_MD5_C) || \ + !defined(POLARSSL_SHA1_C) ) +#error "POLARSSL_SSL_PROTO_SSL3 defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_PROTO_TLS1) && ( !defined(POLARSSL_MD5_C) || \ + !defined(POLARSSL_SHA1_C) ) +#error "POLARSSL_SSL_PROTO_TLS1 defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_PROTO_TLS1_1) && ( !defined(POLARSSL_MD5_C) || \ + !defined(POLARSSL_SHA1_C) ) +#error "POLARSSL_SSL_PROTO_TLS1_1 defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_PROTO_TLS1_2) && ( !defined(POLARSSL_SHA1_C) && \ + !defined(POLARSSL_SHA256_C) && !defined(POLARSSL_SHA512_C) ) +#error "POLARSSL_SSL_PROTO_TLS1_2 defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C) +#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \ + !defined(POLARSSL_MD_C) ) +#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C) +#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \ + !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \ + !defined(POLARSSL_SSL_PROTO_TLS1_2)) +#error "POLARSSL_SSL_TLS_C defined, but no protocols are active" +#endif + +#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \ + defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1)) +#error "Illegal protocol selection" +#endif + +#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \ + defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1)) +#error "Illegal protocol selection" +#endif + +#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \ + defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \ + !defined(POLARSSL_SSL_PROTO_TLS1_1))) +#error "Illegal protocol selection" +#endif + +#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \ + ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) || \ + !defined(POLARSSL_CIPHER_MODE_CBC) ) +#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_SERVER_NAME_INDICATION) && \ + !defined(POLARSSL_X509_CRT_PARSE_C) +#error "POLARSSL_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_THREADING_PTHREAD) +#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL) +#error "POLARSSL_THREADING_PTHREAD defined, but not all prerequisites" +#endif +#define POLARSSL_THREADING_IMPL +#endif + +#if defined(POLARSSL_THREADING_ALT) +#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL) +#error "POLARSSL_THREADING_ALT defined, but not all prerequisites" +#endif +#define POLARSSL_THREADING_IMPL +#endif + +#if defined(POLARSSL_THREADING_C) && !defined(POLARSSL_THREADING_IMPL) +#error "POLARSSL_THREADING_C defined, single threading implementation required" +#endif +#undef POLARSSL_THREADING_IMPL + +#if defined(POLARSSL_VERSION_FEATURES) && !defined(POLARSSL_VERSION_C) +#error "POLARSSL_VERSION_FEATURES defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) || \ + !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \ + !defined(POLARSSL_PK_PARSE_C) ) +#error "POLARSSL_X509_USE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_X509_CREATE_C) && ( !defined(POLARSSL_BIGNUM_C) || \ + !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \ + !defined(POLARSSL_PK_WRITE_C) ) +#error "POLARSSL_X509_CREATE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_X509_CRT_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) ) +#error "POLARSSL_X509_CRT_PARSE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_X509_CRL_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) ) +#error "POLARSSL_X509_CRL_PARSE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_X509_CSR_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) ) +#error "POLARSSL_X509_CSR_PARSE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_X509_CRT_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) ) +#error "POLARSSL_X509_CRT_WRITE_C defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_X509_CSR_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) ) +#error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites" +#endif + +#endif /* POLARSSL_CHECK_CONFIG_H */ diff --git a/include/polarssl/config.h b/include/polarssl/config.h index 002d24582..500d04173 100644 --- a/include/polarssl/config.h +++ b/include/polarssl/config.h @@ -2115,297 +2115,6 @@ /* \} name SECTION: Module configuration options */ -/** - * \name SECTION: Sanity checks - * - * Sanity checks on defines and dependencies - */ -#if defined(POLARSSL_AESNI_C) && !defined(POLARSSL_HAVE_ASM) -#error "POLARSSL_AESNI_C defined, but not all prerequisites" -#endif +#include "check_config.h" -#if defined(POLARSSL_CERTS_C) && !defined(POLARSSL_PEM_PARSE_C) -#error "POLARSSL_CERTS_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_CTR_DRBG_C) && !defined(POLARSSL_AES_C) -#error "POLARSSL_CTR_DRBG_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_DHM_C) && !defined(POLARSSL_BIGNUM_C) -#error "POLARSSL_DHM_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_ECDH_C) && !defined(POLARSSL_ECP_C) -#error "POLARSSL_ECDH_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_ECDSA_C) && \ - ( !defined(POLARSSL_ECP_C) || \ - !defined(POLARSSL_ASN1_PARSE_C) || \ - !defined(POLARSSL_ASN1_WRITE_C) ) -#error "POLARSSL_ECDSA_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_ECDSA_DETERMINISTIC) && !defined(POLARSSL_HMAC_DRBG_C) -#error "POLARSSL_ECDSA_DETERMINISTIC defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_ECP_C) && ( !defined(POLARSSL_BIGNUM_C) || ( \ - !defined(POLARSSL_ECP_DP_SECP192R1_ENABLED) && \ - !defined(POLARSSL_ECP_DP_SECP224R1_ENABLED) && \ - !defined(POLARSSL_ECP_DP_SECP256R1_ENABLED) && \ - !defined(POLARSSL_ECP_DP_SECP384R1_ENABLED) && \ - !defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) && \ - !defined(POLARSSL_ECP_DP_BP256R1_ENABLED) && \ - !defined(POLARSSL_ECP_DP_BP384R1_ENABLED) && \ - !defined(POLARSSL_ECP_DP_BP512R1_ENABLED) && \ - !defined(POLARSSL_ECP_DP_M255_ENABLED) && \ - !defined(POLARSSL_ECP_DP_SECP192K1_ENABLED) && \ - !defined(POLARSSL_ECP_DP_SECP224K1_ENABLED) && \ - !defined(POLARSSL_ECP_DP_SECP256K1_ENABLED) ) ) -#error "POLARSSL_ECP_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_ENTROPY_C) && (!defined(POLARSSL_SHA512_C) && \ - !defined(POLARSSL_SHA256_C)) -#error "POLARSSL_ENTROPY_C defined, but not all prerequisites" -#endif -#if defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SHA512_C) && \ - defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 64) -#error "CTR_DRBG_ENTROPY_LEN value too high" -#endif -#if defined(POLARSSL_ENTROPY_C) && \ - ( !defined(POLARSSL_SHA512_C) || defined(POLARSSL_ENTROPY_FORCE_SHA256) ) \ - && defined(POLARSSL_CONFIG_OPTIONS) && (CTR_DRBG_ENTROPY_LEN > 32) -#error "CTR_DRBG_ENTROPY_LEN value too high" -#endif -#if defined(POLARSSL_ENTROPY_C) && \ - defined(POLARSSL_ENTROPY_FORCE_SHA256) && !defined(POLARSSL_SHA256_C) -#error "POLARSSL_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_GCM_C) && ( \ - !defined(POLARSSL_AES_C) && !defined(POLARSSL_CAMELLIA_C) ) -#error "POLARSSL_GCM_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_HAVEGE_C) && !defined(POLARSSL_TIMING_C) -#error "POLARSSL_HAVEGE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_HMAC_DRBG) && !defined(POLARSSL_MD_C) -#error "POLARSSL_HMAC_DRBG_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ - ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ) -#error "POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ - ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ) -#error "POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(POLARSSL_DHM_C) -#error "POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ - !defined(POLARSSL_ECDH_C) -#error "POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ - ( !defined(POLARSSL_DHM_C) || !defined(POLARSSL_RSA_C) || \ - !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) ) -#error "POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ - ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_RSA_C) || \ - !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_PKCS1_V15) ) -#error "POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ - ( !defined(POLARSSL_ECDH_C) || !defined(POLARSSL_ECDSA_C) || \ - !defined(POLARSSL_X509_CRT_PARSE_C) ) -#error "POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ - ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\ - !defined(POLARSSL_PKCS1_V15) ) -#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \ - ( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\ - !defined(POLARSSL_PKCS1_V15) ) -#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C) && \ - ( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) ) -#error "POLARSSL_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_PADLOCK_C) && !defined(POLARSSL_HAVE_ASM) -#error "POLARSSL_PADLOCK_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_PBKDF2_C) && !defined(POLARSSL_MD_C) -#error "POLARSSL_PBKDF2_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_PEM_PARSE_C) && !defined(POLARSSL_BASE64_C) -#error "POLARSSL_PEM_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_PEM_WRITE_C) && !defined(POLARSSL_BASE64_C) -#error "POLARSSL_PEM_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_PK_PARSE_C) && !defined(POLARSSL_PK_C) -#error "POLARSSL_PK_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_PK_WRITE_C) && !defined(POLARSSL_PK_C) -#error "POLARSSL_PK_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_PKCS11_C) && !defined(POLARSSL_PK_C) -#error "POLARSSL_PKCS11_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \ - !defined(POLARSSL_OID_C) ) -#error "POLARSSL_RSA_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_SSL_PROTO_SSL3) && ( !defined(POLARSSL_MD5_C) || \ - !defined(POLARSSL_SHA1_C) ) -#error "POLARSSL_SSL_PROTO_SSL3 defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_SSL_PROTO_TLS1) && ( !defined(POLARSSL_MD5_C) || \ - !defined(POLARSSL_SHA1_C) ) -#error "POLARSSL_SSL_PROTO_TLS1 defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_SSL_PROTO_TLS1_1) && ( !defined(POLARSSL_MD5_C) || \ - !defined(POLARSSL_SHA1_C) ) -#error "POLARSSL_SSL_PROTO_TLS1_1 defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_SSL_PROTO_TLS1_2) && ( !defined(POLARSSL_SHA1_C) && \ - !defined(POLARSSL_SHA256_C) && !defined(POLARSSL_SHA512_C) ) -#error "POLARSSL_SSL_PROTO_TLS1_2 defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C) -#error "POLARSSL_SSL_CLI_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \ - !defined(POLARSSL_MD_C) ) -#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_SSL_SRV_C) && !defined(POLARSSL_SSL_TLS_C) -#error "POLARSSL_SSL_SRV_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_SSL_TLS_C) && (!defined(POLARSSL_SSL_PROTO_SSL3) && \ - !defined(POLARSSL_SSL_PROTO_TLS1) && !defined(POLARSSL_SSL_PROTO_TLS1_1) && \ - !defined(POLARSSL_SSL_PROTO_TLS1_2)) -#error "POLARSSL_SSL_TLS_C defined, but no protocols are active" -#endif - -#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \ - defined(POLARSSL_SSL_PROTO_TLS1_1) && !defined(POLARSSL_SSL_PROTO_TLS1)) -#error "Illegal protocol selection" -#endif - -#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_TLS1) && \ - defined(POLARSSL_SSL_PROTO_TLS1_2) && !defined(POLARSSL_SSL_PROTO_TLS1_1)) -#error "Illegal protocol selection" -#endif - -#if defined(POLARSSL_SSL_TLS_C) && (defined(POLARSSL_SSL_PROTO_SSL3) && \ - defined(POLARSSL_SSL_PROTO_TLS1_2) && (!defined(POLARSSL_SSL_PROTO_TLS1) || \ - !defined(POLARSSL_SSL_PROTO_TLS1_1))) -#error "Illegal protocol selection" -#endif - -#if defined(POLARSSL_SSL_SESSION_TICKETS) && defined(POLARSSL_SSL_TLS_C) && \ - ( !defined(POLARSSL_AES_C) || !defined(POLARSSL_SHA256_C) || \ - !defined(POLARSSL_CIPHER_MODE_CBC) ) -#error "POLARSSL_SSL_SESSION_TICKETS_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_SSL_SERVER_NAME_INDICATION) && \ - !defined(POLARSSL_X509_CRT_PARSE_C) -#error "POLARSSL_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_THREADING_PTHREAD) -#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL) -#error "POLARSSL_THREADING_PTHREAD defined, but not all prerequisites" -#endif -#define POLARSSL_THREADING_IMPL -#endif - -#if defined(POLARSSL_THREADING_ALT) -#if !defined(POLARSSL_THREADING_C) || defined(POLARSSL_THREADING_IMPL) -#error "POLARSSL_THREADING_ALT defined, but not all prerequisites" -#endif -#define POLARSSL_THREADING_IMPL -#endif - -#if defined(POLARSSL_THREADING_C) && !defined(POLARSSL_THREADING_IMPL) -#error "POLARSSL_THREADING_C defined, single threading implementation required" -#endif -#undef POLARSSL_THREADING_IMPL - -#if defined(POLARSSL_VERSION_FEATURES) && !defined(POLARSSL_VERSION_C) -#error "POLARSSL_VERSION_FEATURES defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) || \ - !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \ - !defined(POLARSSL_PK_PARSE_C) ) -#error "POLARSSL_X509_USE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_X509_CREATE_C) && ( !defined(POLARSSL_BIGNUM_C) || \ - !defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_WRITE_C) || \ - !defined(POLARSSL_PK_WRITE_C) ) -#error "POLARSSL_X509_CREATE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_X509_CRT_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) ) -#error "POLARSSL_X509_CRT_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_X509_CRL_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) ) -#error "POLARSSL_X509_CRL_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_X509_CSR_PARSE_C) && ( !defined(POLARSSL_X509_USE_C) ) -#error "POLARSSL_X509_CSR_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_X509_CRT_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) ) -#error "POLARSSL_X509_CRT_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(POLARSSL_X509_CSR_WRITE_C) && ( !defined(POLARSSL_X509_CREATE_C) ) -#error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites" -#endif - -/* \} name SECTION: Sanity checks */ - -#endif /* config.h */ +#endif /* POLARSSL_CONFIG_H */ diff --git a/visualc/VS2010/PolarSSL.vcxproj b/visualc/VS2010/PolarSSL.vcxproj index c944e3c11..7af2ac933 100644 --- a/visualc/VS2010/PolarSSL.vcxproj +++ b/visualc/VS2010/PolarSSL.vcxproj @@ -156,6 +156,7 @@ + diff --git a/visualc/VS6/polarssl.dsp b/visualc/VS6/polarssl.dsp index 38b33f8f2..205dfd647 100644 --- a/visualc/VS6/polarssl.dsp +++ b/visualc/VS6/polarssl.dsp @@ -413,6 +413,10 @@ SOURCE=..\..\include\polarssl\config.h # End Source File # Begin Source File +SOURCE=..\..\include\polarssl\check_config.h +# End Source File +# Begin Source File + SOURCE=..\..\include\polarssl\ctr_drbg.h # End Source File # Begin Source File