From e670f90e486ca6e1e06727d212de72e7feae31f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 30 Oct 2015 09:23:19 +0100 Subject: [PATCH] Fix whitespace at EOL issues --- library/x509_crt.c | 8 ++++---- tests/suites/helpers.function | 2 +- tests/suites/test_suite_mpi.function | 4 ++-- tests/suites/test_suite_x509parse.data | 2 +- tests/suites/test_suite_x509parse.function | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/library/x509_crt.c b/library/x509_crt.c index 22bbf564f..efd4517fd 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -2014,9 +2014,9 @@ static int x509_crt_verify_child( unsigned char hash[MBEDTLS_MD_MAX_SIZE]; mbedtls_x509_crt *grandparent; const mbedtls_md_info_t *md_info; - + /* Counting intermediate self signed certificates */ - if( ( path_cnt != 0 ) && x509_name_cmp( &child->issuer, &child->subject ) == 0 ) + if( ( path_cnt != 0 ) && x509_name_cmp( &child->issuer, &child->subject ) == 0 ) self_cnt++; /* path_cnt is 0 for the first intermediate CA */ @@ -2092,7 +2092,7 @@ static int x509_crt_verify_child( { /* +2 because the current step is not yet accounted for * and because max_pathlen is one higher than it should be. - * Also self signed certificates do not count to the limit. */ + * Also self signed certificates do not count to the limit. */ if( grandparent->max_pathlen > 0 && grandparent->max_pathlen < 2 + path_cnt - self_cnt ) { @@ -2243,7 +2243,7 @@ int mbedtls_x509_crt_verify_with_profile( mbedtls_x509_crt *crt, for( parent = crt->next; parent != NULL; parent = parent->next ) { /* +2 because the current step is not yet accounted for - * and because max_pathlen is one higher than it should be */ + * and because max_pathlen is one higher than it should be */ if( parent->max_pathlen > 0 && parent->max_pathlen < 2 + pathlen ) { diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function index ecb5f151f..8f681dbd4 100644 --- a/tests/suites/helpers.function +++ b/tests/suites/helpers.function @@ -212,7 +212,7 @@ typedef struct * This function returns random based on a buffer it receives. * * rng_state shall be a pointer to a rnd_buf_info structure. - * + * * The number of bytes released from the buffer on each call to * the random function is specified by per_call. (Can be between * 1 and 4) diff --git a/tests/suites/test_suite_mpi.function b/tests/suites/test_suite_mpi.function index 72b49408c..5dd6f0da4 100644 --- a/tests/suites/test_suite_mpi.function +++ b/tests/suites/test_suite_mpi.function @@ -89,7 +89,7 @@ void mbedtls_mpi_write_binary( int radix_X, char *input_X, char *input_A, mbedtls_mpi_init( &X ); TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 ); - + buflen = mbedtls_mpi_size( &X ); if( buflen > (size_t) output_size ) buflen = (size_t) output_size; @@ -542,7 +542,7 @@ void mbedtls_mpi_sub_abs( int radix_X, char *input_X, int radix_Y, char *input_Y TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 ); - + res = mbedtls_mpi_sub_abs( &Z, &X, &Y ); TEST_ASSERT( res == sub_result ); if( res == 0 ) diff --git a/tests/suites/test_suite_x509parse.data b/tests/suites/test_suite_x509parse.data index 795d33339..092608d97 100644 --- a/tests/suites/test_suite_x509parse.data +++ b/tests/suites/test_suite_x509parse.data @@ -788,7 +788,7 @@ X509 Certificate ASN1 (TBSCertificate, valid version tag, invalid length) x509parse_crt:"30163014a012021000000000000000000000000000000000":"":MBEDTLS_ERR_X509_INVALID_VERSION + MBEDTLS_ERR_ASN1_INVALID_LENGTH X509 Certificate ASN1 (TBSCertificate, valid version tag, no serial) -x509parse_crt:"30073005a003020104":"":MBEDTLS_ERR_X509_INVALID_SERIAL + MBEDTLS_ERR_ASN1_OUT_OF_DATA +x509parse_crt:"30073005a003020104":"":MBEDTLS_ERR_X509_INVALID_SERIAL + MBEDTLS_ERR_ASN1_OUT_OF_DATA X509 Certificate ASN1 (TBSCertificate, invalid length version tag) x509parse_crt:"30083006a00402010400":"":MBEDTLS_ERR_X509_INVALID_VERSION + MBEDTLS_ERR_ASN1_LENGTH_MISMATCH diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function index 5be8d48cc..688009d1e 100644 --- a/tests/suites/test_suite_x509parse.function +++ b/tests/suites/test_suite_x509parse.function @@ -433,16 +433,16 @@ void mbedtls_x509_crt_verify_chain( char *chain_paths, char *trusted_ca, int fl char* act; uint32_t flags; int result, res; - mbedtls_x509_crt trusted, chain; + mbedtls_x509_crt trusted, chain; result= flags_result?MBEDTLS_ERR_X509_CERT_VERIFY_FAILED:0; mbedtls_x509_crt_init( &chain ); mbedtls_x509_crt_init( &trusted ); - while( (act = strsep( &chain_paths, " " )) ) - TEST_ASSERT( mbedtls_x509_crt_parse_file( &chain, act ) == 0 ); - TEST_ASSERT( mbedtls_x509_crt_parse_file( &trusted, trusted_ca ) == 0 ); + while( (act = strsep( &chain_paths, " " )) ) + TEST_ASSERT( mbedtls_x509_crt_parse_file( &chain, act ) == 0 ); + TEST_ASSERT( mbedtls_x509_crt_parse_file( &trusted, trusted_ca ) == 0 ); res = mbedtls_x509_crt_verify( &chain, &trusted, NULL, NULL, &flags, NULL, NULL );