Additional corner cases for testing pathlen constrains. Just in case.
backport of ef4f258
diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function
index 5d82f44..e19294a 100644
--- a/tests/suites/test_suite_x509parse.function
+++ b/tests/suites/test_suite_x509parse.function
@@ -445,13 +445,15 @@
/* END_CASE */
/* BEGIN_CASE depends_on:POLARSSL_FS_IO:POLARSSL_X509_CRT_PARSE_C */
-void x509_crt_verify_chain( char *chain_paths, char *trusted_ca, int ret )
+void x509_crt_verify_chain( char *chain_paths, char *trusted_ca, int flags_result )
{
char* act;
int flags;
- int res;
+ int result, res;
x509_crt trusted, chain;
+ result = flags_result ? POLARSSL_ERR_X509_CERT_VERIFY_FAILED : 0;
+
x509_crt_init( &chain );
x509_crt_init( &trusted );
@@ -461,7 +463,8 @@
res = x509_crt_verify( &chain, &trusted, NULL, NULL, &flags, NULL, NULL );
- TEST_ASSERT( ret == res );
+ TEST_ASSERT( res == result );
+ TEST_ASSERT( flags == flags_result );
exit:
x509_crt_free( &trusted );