1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Added test case for pathlen constrains in intermediate certificates

This commit is contained in:
Janos Follath
2015-10-11 10:25:22 +02:00
parent c4e7d8a381
commit 822b2c33b9
6 changed files with 104 additions and 0 deletions

View File

@ -427,6 +427,31 @@ 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 )
{
char* act;
uint32_t flags;
int res;
mbedtls_x509_crt trusted, chain;
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 );
res = mbedtls_x509_crt_verify( &chain, &trusted, NULL, NULL, &flags, NULL, NULL );
TEST_ASSERT( ret == res );
exit:
mbedtls_x509_crt_free( &trusted );
mbedtls_x509_crt_free( &chain );
}
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_X509_USE_C */
void x509_oid_desc( char *oid_str, char *ref_desc )
{