diff --git a/programs/x509/cert_app.c b/programs/x509/cert_app.c index 139a9a212..72f69ba93 100644 --- a/programs/x509/cert_app.c +++ b/programs/x509/cert_app.c @@ -34,11 +34,22 @@ #define polarssl_printf printf #endif -#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_ENTROPY_C) && \ - defined(POLARSSL_SSL_TLS_C) && defined(POLARSSL_SSL_CLI_C) && \ - defined(POLARSSL_NET_C) && defined(POLARSSL_RSA_C) && \ - defined(POLARSSL_X509_CRT_PARSE_C) && defined(POLARSSL_FS_IO) && \ - defined(POLARSSL_CTR_DRBG_C) +#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_ENTROPY_C) || \ + !defined(POLARSSL_SSL_TLS_C) || !defined(POLARSSL_SSL_CLI_C) || \ + !defined(POLARSSL_NET_C) || !defined(POLARSSL_RSA_C) || \ + !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_FS_IO) || \ + !defined(POLARSSL_CTR_DRBG_C) +int main( void ) +{ + polarssl_printf("POLARSSL_BIGNUM_C and/or POLARSSL_ENTROPY_C and/or " + "POLARSSL_SSL_TLS_C and/or POLARSSL_SSL_CLI_C and/or " + "POLARSSL_NET_C and/or POLARSSL_RSA_C and/or " + "POLARSSL_X509_CRT_PARSE_C and/or POLARSSL_FS_IO and/or " + "POLARSSL_CTR_DRBG_C not defined.\n"); + return( 0 ); +} +#else + #include "polarssl/entropy.h" #include "polarssl/ctr_drbg.h" #include "polarssl/net.h" @@ -48,7 +59,6 @@ #include #include #include -#endif #define MODE_NONE 0 #define MODE_FILE 1 @@ -84,21 +94,6 @@ " permissive=%%d default: 0 (disabled)\n" \ "\n" -#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_ENTROPY_C) || \ - !defined(POLARSSL_SSL_TLS_C) || !defined(POLARSSL_SSL_CLI_C) || \ - !defined(POLARSSL_NET_C) || !defined(POLARSSL_RSA_C) || \ - !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_FS_IO) || \ - !defined(POLARSSL_CTR_DRBG_C) -int main( void ) -{ - polarssl_printf("POLARSSL_BIGNUM_C and/or POLARSSL_ENTROPY_C and/or " - "POLARSSL_SSL_TLS_C and/or POLARSSL_SSL_CLI_C and/or " - "POLARSSL_NET_C and/or POLARSSL_RSA_C and/or " - "POLARSSL_X509_CRT_PARSE_C and/or POLARSSL_FS_IO and/or " - "POLARSSL_CTR_DRBG_C not defined.\n"); - return( 0 ); -} -#else /* * global options */ diff --git a/programs/x509/cert_req.c b/programs/x509/cert_req.c index 83766ea5a..8a545a4a2 100644 --- a/programs/x509/cert_req.c +++ b/programs/x509/cert_req.c @@ -33,9 +33,19 @@ #define polarssl_printf printf #endif -#if defined(POLARSSL_X509_CSR_WRITE_C) && defined(POLARSSL_FS_IO) && \ - defined(POLARSSL_PK_PARSE_C) && \ - defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_CTR_DRBG_C) +#if !defined(POLARSSL_X509_CSR_WRITE_C) || !defined(POLARSSL_FS_IO) || \ + !defined(POLARSSL_PK_PARSE_C) || \ + !defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_CTR_DRBG_C) +int main( void ) +{ + polarssl_printf( "POLARSSL_X509_CSR_WRITE_C and/or POLARSSL_FS_IO and/or " + "POLARSSL_PK_PARSE_C and/or " + "POLARSSL_ENTROPY_C and/or POLARSSL_CTR_DRBG_C " + "not defined.\n"); + return( 0 ); +} +#else + #include "polarssl/x509_csr.h" #include "polarssl/entropy.h" #include "polarssl/ctr_drbg.h" @@ -44,7 +54,6 @@ #include #include #include -#endif #define DFL_FILENAME "keyfile.key" #define DFL_DEBUG_LEVEL 0 @@ -80,18 +89,6 @@ " object_signing_ca\n" \ "\n" -#if !defined(POLARSSL_X509_CSR_WRITE_C) || !defined(POLARSSL_FS_IO) || \ - !defined(POLARSSL_PK_PARSE_C) || \ - !defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_CTR_DRBG_C) -int main( void ) -{ - polarssl_printf( "POLARSSL_X509_CSR_WRITE_C and/or POLARSSL_FS_IO and/or " - "POLARSSL_PK_PARSE_C and/or " - "POLARSSL_ENTROPY_C and/or POLARSSL_CTR_DRBG_C " - "not defined.\n"); - return( 0 ); -} -#else /* * global options */ diff --git a/programs/x509/cert_write.c b/programs/x509/cert_write.c index 5653da251..629051bc8 100644 --- a/programs/x509/cert_write.c +++ b/programs/x509/cert_write.c @@ -33,10 +33,20 @@ #define polarssl_printf printf #endif -#if defined(POLARSSL_X509_CRT_WRITE_C) && \ - defined(POLARSSL_X509_CRT_PARSE_C) && defined(POLARSSL_FS_IO) && \ - defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_CTR_DRBG_C) && \ - defined(POLARSSL_ERROR_C) +#if !defined(POLARSSL_X509_CRT_WRITE_C) || \ + !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_FS_IO) || \ + !defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_CTR_DRBG_C) || \ + !defined(POLARSSL_ERROR_C) +int main( void ) +{ + polarssl_printf( "POLARSSL_X509_CRT_WRITE_C and/or POLARSSL_X509_CRT_PARSE_C and/or " + "POLARSSL_FS_IO and/or " + "POLARSSL_ENTROPY_C and/or POLARSSL_CTR_DRBG_C and/or " + "POLARSSL_ERROR_C not defined.\n"); + return( 0 ); +} +#else + #include "polarssl/x509_crt.h" #include "polarssl/x509_csr.h" #include "polarssl/entropy.h" @@ -46,7 +56,6 @@ #include #include #include -#endif #if defined(POLARSSL_X509_CSR_PARSE_C) #define USAGE_CSR \ @@ -120,19 +129,6 @@ " object_signing_ca\n" \ "\n" -#if !defined(POLARSSL_X509_CRT_WRITE_C) || \ - !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_FS_IO) || \ - !defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_CTR_DRBG_C) || \ - !defined(POLARSSL_ERROR_C) -int main( void ) -{ - polarssl_printf( "POLARSSL_X509_CRT_WRITE_C and/or POLARSSL_X509_CRT_PARSE_C and/or " - "POLARSSL_FS_IO and/or " - "POLARSSL_ENTROPY_C and/or POLARSSL_CTR_DRBG_C and/or " - "POLARSSL_ERROR_C not defined.\n"); - return( 0 ); -} -#else /* * global options */ diff --git a/programs/x509/crl_app.c b/programs/x509/crl_app.c index ff80a3d4e..ecd5e671d 100644 --- a/programs/x509/crl_app.c +++ b/programs/x509/crl_app.c @@ -33,14 +33,21 @@ #define polarssl_printf printf #endif -#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_RSA_C) && \ - defined(POLARSSL_X509_CRL_PARSE_C) && defined(POLARSSL_FS_IO) +#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) || \ + !defined(POLARSSL_X509_CRL_PARSE_C) || !defined(POLARSSL_FS_IO) +int main( void ) +{ + polarssl_printf("POLARSSL_BIGNUM_C and/or POLARSSL_RSA_C and/or " + "POLARSSL_X509_CRL_PARSE_C and/or POLARSSL_FS_IO not defined.\n"); + return( 0 ); +} +#else + #include "polarssl/x509_crl.h" #include #include #include -#endif #define DFL_FILENAME "crl.pem" #define DFL_DEBUG_LEVEL 0 @@ -51,15 +58,6 @@ " filename=%%s default: crl.pem\n" \ "\n" -#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) || \ - !defined(POLARSSL_X509_CRL_PARSE_C) || !defined(POLARSSL_FS_IO) -int main( void ) -{ - polarssl_printf("POLARSSL_BIGNUM_C and/or POLARSSL_RSA_C and/or " - "POLARSSL_X509_CRL_PARSE_C and/or POLARSSL_FS_IO not defined.\n"); - return( 0 ); -} -#else /* * global options */ diff --git a/programs/x509/req_app.c b/programs/x509/req_app.c index 1164fd6fd..31660f938 100644 --- a/programs/x509/req_app.c +++ b/programs/x509/req_app.c @@ -33,14 +33,21 @@ #define polarssl_printf printf #endif -#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_RSA_C) && \ - defined(POLARSSL_X509_CSR_PARSE_C) && defined(POLARSSL_FS_IO) +#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) || \ + !defined(POLARSSL_X509_CSR_PARSE_C) || !defined(POLARSSL_FS_IO) +int main( void ) +{ + polarssl_printf("POLARSSL_BIGNUM_C and/or POLARSSL_RSA_C and/or " + "POLARSSL_X509_CSR_PARSE_C and/or POLARSSL_FS_IO not defined.\n"); + return( 0 ); +} +#else + #include "polarssl/x509_csr.h" #include #include #include -#endif #define DFL_FILENAME "cert.req" #define DFL_DEBUG_LEVEL 0 @@ -51,15 +58,6 @@ " filename=%%s default: cert.req\n" \ "\n" -#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) || \ - !defined(POLARSSL_X509_CSR_PARSE_C) || !defined(POLARSSL_FS_IO) -int main( void ) -{ - polarssl_printf("POLARSSL_BIGNUM_C and/or POLARSSL_RSA_C and/or " - "POLARSSL_X509_CSR_PARSE_C and/or POLARSSL_FS_IO not defined.\n"); - return( 0 ); -} -#else /* * global options */