1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

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.
This commit is contained in:
Paul Bakker
2014-09-26 14:53:04 +02:00
parent 9e4ff953de
commit 5a5fa92bfe
6 changed files with 123 additions and 0 deletions

View File

@ -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 @@ exit:
}
/* 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 )
{