x509_crt_parse() did not increase total_failed on PEM error
Result was that PEM errors in files with multiple certificates were not
detectable by the user.
diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function
index 26b0f70..89b40b7 100644
--- a/tests/suites/test_suite_x509parse.function
+++ b/tests/suites/test_suite_x509parse.function
@@ -4,6 +4,7 @@
#include <polarssl/x509_csr.h>
#include <polarssl/pem.h>
#include <polarssl/oid.h>
+#include <polarssl/base64.h>
int verify_none( void *data, x509_crt *crt, int certificate_depth, int *flags )
{
@@ -216,6 +217,20 @@
}
/* END_CASE */
+/* BEGIN_CASE depends_on:POLARSSL_X509_CRT_PARSE_C:POLARSSL_FS_IO */
+void x509parse_crt_file( char *crt_file, int result )
+{
+ x509_crt crt;
+
+ x509_crt_init( &crt );
+
+ TEST_ASSERT( x509_crt_parse_file( &crt, crt_file ) == result );
+
+exit:
+ x509_crt_free( &crt );
+}
+/* END_CASE */
+
/* BEGIN_CASE depends_on:POLARSSL_X509_CRT_PARSE_C */
void x509parse_crt( char *crt_data, char *result_str, int result )
{