Depend on PEM_PARsE_C when using test_cas_pem

This commit is contained in:
Manuel Pégourié-Gonnard 2015-03-27 11:08:49 +01:00
parent da1619d345
commit b5410dbd96
7 changed files with 20 additions and 16 deletions

View file

@ -128,12 +128,12 @@ int main( int argc, char *argv[] )
polarssl_printf( " . Loading the CA root certificate ..." ); polarssl_printf( " . Loading the CA root certificate ..." );
fflush( stdout ); fflush( stdout );
#if defined(POLARSSL_CERTS_C) #if defined(POLARSSL_CERTS_C) && defined(POLARSSL_PEM_PARSE_C)
ret = x509_crt_parse( &cacert, (const unsigned char *) test_cas_pem, ret = x509_crt_parse( &cacert, (const unsigned char *) test_cas_pem,
test_cas_pem_len ); test_cas_pem_len );
#else #else
ret = 1; ret = 1;
polarssl_printf("POLARSSL_CERTS_C not defined."); polarssl_printf("POLARSSL_CERTS_C or POLARSSL_PEM_PARSE_C not defined.");
#endif #endif
if( ret < 0 ) if( ret < 0 )

View file

@ -37,7 +37,7 @@
!defined(POLARSSL_SSL_COOKIE_C) || !defined(POLARSSL_NET_C) || \ !defined(POLARSSL_SSL_COOKIE_C) || !defined(POLARSSL_NET_C) || \
!defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_CTR_DRBG_C) || \ !defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_CTR_DRBG_C) || \
!defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_RSA_C) || \ !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_RSA_C) || \
!defined(POLARSSL_CERTS_C) !defined(POLARSSL_CERTS_C) || !defined(POLARSSL_PEM_PARSE_C)
#include <stdio.h> #include <stdio.h>
int main( void ) int main( void )
@ -46,7 +46,7 @@ int main( void )
"POLARSSL_SSL_COOKIE_C and/or POLARSSL_NET_C and/or " "POLARSSL_SSL_COOKIE_C and/or POLARSSL_NET_C and/or "
"POLARSSL_ENTROPY_C and/or POLARSSL_CTR_DRBG_C and/or " "POLARSSL_ENTROPY_C and/or POLARSSL_CTR_DRBG_C and/or "
"POLARSSL_X509_CRT_PARSE_C and/or POLARSSL_RSA_C and/or " "POLARSSL_X509_CRT_PARSE_C and/or POLARSSL_RSA_C and/or "
"POLARSSL_CERTS_C not defined.\n" ); "POLARSSL_CERTS_C and/or POLARSSL_PEM_PARSE_C not defined.\n" );
return( 0 ); return( 0 );
} }
#else #else

View file

@ -119,12 +119,12 @@ int main( void )
polarssl_printf( " . Loading the CA root certificate ..." ); polarssl_printf( " . Loading the CA root certificate ..." );
fflush( stdout ); fflush( stdout );
#if defined(POLARSSL_CERTS_C) #if defined(POLARSSL_CERTS_C) && defined(POLARSSL_PEM_PARSE_C)
ret = x509_crt_parse( &cacert, (const unsigned char *) test_cas_pem, ret = x509_crt_parse( &cacert, (const unsigned char *) test_cas_pem,
test_cas_pem_len ); test_cas_pem_len );
#else #else
ret = 1; ret = 1;
polarssl_printf("POLARSSL_CERTS_C not defined."); polarssl_printf("POLARSSL_CERTS_C or POLARSSL_PEM_PARSE_C not defined.");
#endif #endif
if( ret < 0 ) if( ret < 0 )

View file

@ -43,7 +43,7 @@
defined(POLARSSL_SSL_SRV_C) && defined(POLARSSL_NET_C) && \ defined(POLARSSL_SSL_SRV_C) && defined(POLARSSL_NET_C) && \
defined(POLARSSL_RSA_C) && defined(POLARSSL_CTR_DRBG_C) && \ defined(POLARSSL_RSA_C) && defined(POLARSSL_CTR_DRBG_C) && \
defined(POLARSSL_X509_CRT_PARSE_C) && defined(POLARSSL_TIMING_C) && \ defined(POLARSSL_X509_CRT_PARSE_C) && defined(POLARSSL_TIMING_C) && \
defined(POLARSSL_FS_IO) defined(POLARSSL_FS_IO) && defined(POLARSSL_PEM_PARSE_C)
#include "mbedtls/entropy.h" #include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/ctr_drbg.h"
#include "mbedtls/certs.h" #include "mbedtls/certs.h"
@ -81,7 +81,7 @@ int main( int argc, char *argv[] )
"and/or POLARSSL_SSL_TLS_C and/or POLARSSL_SSL_SRV_C and/or " "and/or POLARSSL_SSL_TLS_C and/or POLARSSL_SSL_SRV_C and/or "
"POLARSSL_NET_C and/or POLARSSL_RSA_C and/or " "POLARSSL_NET_C and/or POLARSSL_RSA_C and/or "
"POLARSSL_CTR_DRBG_C and/or POLARSSL_X509_CRT_PARSE_C and/or " "POLARSSL_CTR_DRBG_C and/or POLARSSL_X509_CRT_PARSE_C and/or "
"POLARSSL_TIMING_C not defined.\n"); "POLARSSL_TIMING_C and/or POLARSSL_PEM_PARSE_C not defined.\n");
return( 0 ); return( 0 );
} }
#elif defined(_WIN32) #elif defined(_WIN32)

View file

@ -556,13 +556,13 @@ int main( int argc, char *argv[] )
ret = pk_parse_keyfile( &pkey, opt.key_file, "" ); ret = pk_parse_keyfile( &pkey, opt.key_file, "" );
else else
#endif #endif
#if defined(POLARSSL_CERTS_C) #if defined(POLARSSL_CERTS_C) && defined(POLARSSL_PEM_PARSE_C)
ret = pk_parse_key( &pkey, (const unsigned char *) test_cli_key, ret = pk_parse_key( &pkey, (const unsigned char *) test_cli_key,
test_cli_key_len, NULL, 0 ); test_cli_key_len, NULL, 0 );
#else #else
{ {
ret = -1; ret = -1;
polarssl_printf("POLARSSL_CERTS_C not defined."); polarssl_printf("POLARSSL_CERTS_C or POLARSSL_PEM_PARSE_C not defined.");
} }
#endif #endif
if( ret != 0 ) if( ret != 0 )

View file

@ -45,7 +45,8 @@
defined(POLARSSL_SSL_SRV_C) && defined(POLARSSL_NET_C) && \ defined(POLARSSL_SSL_SRV_C) && defined(POLARSSL_NET_C) && \
defined(POLARSSL_RSA_C) && defined(POLARSSL_CTR_DRBG_C) && \ defined(POLARSSL_RSA_C) && defined(POLARSSL_CTR_DRBG_C) && \
defined(POLARSSL_X509_CRT_PARSE_C) && defined(POLARSSL_FS_IO) && \ defined(POLARSSL_X509_CRT_PARSE_C) && defined(POLARSSL_FS_IO) && \
defined(POLARSSL_THREADING_C) && defined(POLARSSL_THREADING_PTHREAD) defined(POLARSSL_THREADING_C) && defined(POLARSSL_THREADING_PTHREAD) && \
defined(POLARSSL_PEM_PARSE_C)
#include "mbedtls/entropy.h" #include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/ctr_drbg.h"
#include "mbedtls/certs.h" #include "mbedtls/certs.h"
@ -81,7 +82,8 @@
!defined(POLARSSL_SSL_SRV_C) || !defined(POLARSSL_NET_C) || \ !defined(POLARSSL_SSL_SRV_C) || !defined(POLARSSL_NET_C) || \
!defined(POLARSSL_RSA_C) || !defined(POLARSSL_CTR_DRBG_C) || \ !defined(POLARSSL_RSA_C) || !defined(POLARSSL_CTR_DRBG_C) || \
!defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_FS_IO) || \ !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_FS_IO) || \
!defined(POLARSSL_THREADING_C) || !defined(POLARSSL_THREADING_PTHREAD) !defined(POLARSSL_THREADING_C) || !defined(POLARSSL_THREADING_PTHREAD) || \
!defined(POLARSSL_PEM_PARSE_C)
int main( void ) int main( void )
{ {
polarssl_printf("POLARSSL_BIGNUM_C and/or POLARSSL_CERTS_C and/or POLARSSL_ENTROPY_C " polarssl_printf("POLARSSL_BIGNUM_C and/or POLARSSL_CERTS_C and/or POLARSSL_ENTROPY_C "
@ -89,7 +91,7 @@ int main( void )
"POLARSSL_NET_C and/or POLARSSL_RSA_C and/or " "POLARSSL_NET_C and/or POLARSSL_RSA_C and/or "
"POLARSSL_CTR_DRBG_C and/or POLARSSL_X509_CRT_PARSE_C and/or " "POLARSSL_CTR_DRBG_C and/or POLARSSL_X509_CRT_PARSE_C and/or "
"POLARSSL_THREADING_C and/or POLARSSL_THREADING_PTHREAD " "POLARSSL_THREADING_C and/or POLARSSL_THREADING_PTHREAD "
"not defined.\n"); "and/or POLARSSL_PEM_PARSE_C not defined.\n");
return( 0 ); return( 0 );
} }
#else #else

View file

@ -42,7 +42,8 @@
defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SSL_TLS_C) && \ defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_SSL_TLS_C) && \
defined(POLARSSL_SSL_SRV_C) && defined(POLARSSL_NET_C) && \ defined(POLARSSL_SSL_SRV_C) && defined(POLARSSL_NET_C) && \
defined(POLARSSL_RSA_C) && defined(POLARSSL_CTR_DRBG_C) && \ defined(POLARSSL_RSA_C) && defined(POLARSSL_CTR_DRBG_C) && \
defined(POLARSSL_X509_CRT_PARSE_C) && defined(POLARSSL_FS_IO) defined(POLARSSL_X509_CRT_PARSE_C) && defined(POLARSSL_FS_IO) && \
defined(POLARSSL_PEM_PARSE_C)
#include "mbedtls/entropy.h" #include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/ctr_drbg.h"
#include "mbedtls/certs.h" #include "mbedtls/certs.h"
@ -72,14 +73,15 @@
!defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_SSL_TLS_C) || \ !defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_SSL_TLS_C) || \
!defined(POLARSSL_SSL_SRV_C) || !defined(POLARSSL_NET_C) || \ !defined(POLARSSL_SSL_SRV_C) || !defined(POLARSSL_NET_C) || \
!defined(POLARSSL_RSA_C) || !defined(POLARSSL_CTR_DRBG_C) || \ !defined(POLARSSL_RSA_C) || !defined(POLARSSL_CTR_DRBG_C) || \
!defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_FS_IO) !defined(POLARSSL_X509_CRT_PARSE_C) || !defined(POLARSSL_FS_IO) || \
!defined(POLARSSL_PEM_PARSE_C)
int main( void ) int main( void )
{ {
polarssl_printf("POLARSSL_BIGNUM_C and/or POLARSSL_CERTS_C and/or POLARSSL_ENTROPY_C " polarssl_printf("POLARSSL_BIGNUM_C and/or POLARSSL_CERTS_C and/or POLARSSL_ENTROPY_C "
"and/or POLARSSL_SSL_TLS_C and/or POLARSSL_SSL_SRV_C and/or " "and/or POLARSSL_SSL_TLS_C and/or POLARSSL_SSL_SRV_C and/or "
"POLARSSL_NET_C and/or POLARSSL_RSA_C and/or " "POLARSSL_NET_C and/or POLARSSL_RSA_C and/or "
"POLARSSL_CTR_DRBG_C and/or POLARSSL_X509_CRT_PARSE_C " "POLARSSL_CTR_DRBG_C and/or POLARSSL_X509_CRT_PARSE_C "
"not defined.\n"); "and/or POLARSSL_PEM_PARSE_C not defined.\n");
return( 0 ); return( 0 );
} }
#else #else