mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 08:16:33 +01:00
Add tests for x509_crt_parse_path()
This commit is contained in:
parent
76f03118c4
commit
fbae2a1f53
8 changed files with 304 additions and 0 deletions
|
|
@ -224,6 +224,27 @@ void x509parse_crl( char *crl_data, char *result_str, int result )
|
|||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:POLARSSL_FS_IO:POLARSSL_X509_CRT_PARSE_C */
|
||||
void x509_crt_parse_path( char *crt_path, int ret, int nb_crt )
|
||||
{
|
||||
x509_crt chain, *cur;
|
||||
int i;
|
||||
|
||||
x509_crt_init( &chain );
|
||||
|
||||
TEST_ASSERT( x509_crt_parse_path( &chain, crt_path ) == ret );
|
||||
|
||||
/* Check how many certs we got */
|
||||
for( i = 0, cur = &chain; cur != NULL; cur = cur->next )
|
||||
if( cur->raw.p != NULL )
|
||||
i++;
|
||||
|
||||
TEST_ASSERT( i == nb_crt );
|
||||
|
||||
x509_crt_init( &chain );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:POLARSSL_X509_CRT_PARSE_C:POLARSSL_SELF_TEST */
|
||||
void x509_selftest()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue