Rename test_ca_list to test_cas_pem

This commit is contained in:
Manuel Pégourié-Gonnard 2015-03-27 10:23:53 +01:00
parent 2f165060f0
commit a958d69a70
10 changed files with 25 additions and 19 deletions

View file

@ -6,7 +6,9 @@ Features
* Support for DTLS 1.0 and 1.2 (RFC 6347).
API Changes
* Test certificates in cert.s are no longer guaranteed to be nul-terminated
* test_ca_list (from certs.h) is renamed to test_cas_pem and is only
available if POLARSSL_PEM_PARSE_C is defined (it never worked without).
* Test certificates in certs.c are no longer guaranteed to be nul-terminated
strings; use the new *_len variables instead of strlen().
* md_init_ctx() is deprecated in favour of md_setup(), that adds a third
argument (allowing memory savings if HMAC is not used)

View file

@ -30,9 +30,11 @@
extern "C" {
#endif
#if defined(POLARSSL_PEM_PARSE_C)
/* Concatenation of all CA certificates in PEM format if available */
extern const char test_ca_list[];
extern const size_t test_ca_list_len;
extern const char test_cas_pem[];
extern const size_t test_cas_pem_len;
#endif
/* List of all CA certificates, terminated by NULL */
extern const char * test_cas[];

View file

@ -301,9 +301,11 @@ const char test_dhm_params[] =
const size_t test_dhm_params_len = sizeof( test_dhm_params );
#endif
#if defined(POLARSSL_PEM_PARSE_C)
/* Concatenation of all available CA certificates */
const char test_ca_list[] = TEST_CA_CRT_RSA TEST_CA_CRT_EC;
const size_t test_ca_list_len = sizeof( test_ca_list );
const char test_cas_pem[] = TEST_CA_CRT_RSA TEST_CA_CRT_EC;
const size_t test_cas_pem_len = sizeof( test_cas_pem );
#endif
/* List of all available CA certificates */
const char * test_cas[] = {

View file

@ -129,8 +129,8 @@ int main( int argc, char *argv[] )
fflush( stdout );
#if defined(POLARSSL_CERTS_C)
ret = x509_crt_parse( &cacert, (const unsigned char *) test_ca_list,
test_ca_list_len );
ret = x509_crt_parse( &cacert, (const unsigned char *) test_cas_pem,
test_cas_pem_len );
#else
ret = 1;
polarssl_printf("POLARSSL_CERTS_C not defined.");

View file

@ -135,8 +135,8 @@ int main( void )
goto exit;
}
ret = x509_crt_parse( &srvcert, (const unsigned char *) test_ca_list,
test_ca_list_len );
ret = x509_crt_parse( &srvcert, (const unsigned char *) test_cas_pem,
test_cas_pem_len );
if( ret != 0 )
{
printf( " failed\n ! x509_crt_parse returned %d\n\n", ret );

View file

@ -120,8 +120,8 @@ int main( void )
fflush( stdout );
#if defined(POLARSSL_CERTS_C)
ret = x509_crt_parse( &cacert, (const unsigned char *) test_ca_list,
test_ca_list_len );
ret = x509_crt_parse( &cacert, (const unsigned char *) test_cas_pem,
test_cas_pem_len );
#else
ret = 1;
polarssl_printf("POLARSSL_CERTS_C not defined.");

View file

@ -161,8 +161,8 @@ int main( void )
goto exit;
}
ret = x509_crt_parse( &srvcert, (const unsigned char *) test_ca_list,
test_ca_list_len );
ret = x509_crt_parse( &srvcert, (const unsigned char *) test_cas_pem,
test_cas_pem_len );
if( ret != 0 )
{
polarssl_printf( " failed\n ! x509_crt_parse returned %d\n\n", ret );

View file

@ -507,8 +507,8 @@ int main( int argc, char *argv[] )
else
#endif
#if defined(POLARSSL_CERTS_C)
ret = x509_crt_parse( &cacert, (const unsigned char *) test_ca_list,
test_ca_list_len );
ret = x509_crt_parse( &cacert, (const unsigned char *) test_cas_pem,
test_cas_pem_len );
#else
{
ret = 1;

View file

@ -424,8 +424,8 @@ int main( void )
goto exit;
}
ret = x509_crt_parse( &srvcert, (const unsigned char *) test_ca_list,
test_ca_list_len );
ret = x509_crt_parse( &srvcert, (const unsigned char *) test_cas_pem,
test_cas_pem_len );
if( ret != 0 )
{
polarssl_printf( " failed\n ! x509_crt_parse returned %d\n\n", ret );

View file

@ -139,8 +139,8 @@ int main( void )
goto exit;
}
ret = x509_crt_parse( &srvcert, (const unsigned char *) test_ca_list,
test_ca_list_len );
ret = x509_crt_parse( &srvcert, (const unsigned char *) test_cas_pem,
test_cas_pem_len );
if( ret != 0 )
{
polarssl_printf( " failed\n ! x509_crt_parse returned %d\n\n", ret );