1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Additional corner cases for testing pathlen constrains. Just in case.

This commit is contained in:
Janos Follath
2015-10-11 16:17:27 +02:00
parent 822b2c33b9
commit ef4f2588f3
26 changed files with 505 additions and 5 deletions

View File

@ -428,13 +428,15 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO:MBEDTLS_X509_CRT_PARSE_C */
void mbedtls_x509_crt_verify_chain( char *chain_paths, char *trusted_ca, int ret )
void mbedtls_x509_crt_verify_chain( char *chain_paths, char *trusted_ca, int flags_result )
{
char* act;
uint32_t flags;
int res;
int result, res;
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 );
@ -443,8 +445,9 @@ void mbedtls_x509_crt_verify_chain( char *chain_paths, char *trusted_ca, int re
TEST_ASSERT( mbedtls_x509_crt_parse_file( &trusted, trusted_ca ) == 0 );
res = mbedtls_x509_crt_verify( &chain, &trusted, NULL, NULL, &flags, NULL, NULL );
TEST_ASSERT( ret == res );
TEST_ASSERT( res == ( result ) );
TEST_ASSERT( flags == (uint32_t)( flags_result ) );
exit:
mbedtls_x509_crt_free( &trusted );