1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Support faulty X509 v1 certificates with extensions

(POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3)
This commit is contained in:
Paul Bakker
2013-09-23 15:01:36 +02:00
parent 15b9b3a7e0
commit c27c4e2efb
5 changed files with 44 additions and 0 deletions

View File

@ -697,15 +697,19 @@ static int x509_crt_parse_der_core( x509_crt *crt, const unsigned char *buf,
}
}
#if !defined(POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3)
if( crt->version == 3 )
{
#endif
ret = x509_get_crt_ext( &p, end, crt);
if( ret != 0 )
{
x509_crt_free( crt );
return( ret );
}
#if !defined(POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3)
}
#endif
if( p != end )
{