mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
- Handle empty certificate subject names
This commit is contained in:
@@ -39,6 +39,7 @@ Bugfix
|
|||||||
#52)
|
#52)
|
||||||
* Handle encryption with private key and decryption with public key as per
|
* Handle encryption with private key and decryption with public key as per
|
||||||
RFC 2313
|
RFC 2313
|
||||||
|
* Handle empty certificate subject names
|
||||||
|
|
||||||
Security
|
Security
|
||||||
* Fixed potential memory corruption on miscrafted client messages (found by
|
* Fixed potential memory corruption on miscrafted client messages (found by
|
||||||
|
@@ -1263,7 +1263,7 @@ int x509parse_crt_der( x509_cert *crt, const unsigned char *buf, size_t buflen )
|
|||||||
return( POLARSSL_ERR_X509_CERT_INVALID_FORMAT + ret );
|
return( POLARSSL_ERR_X509_CERT_INVALID_FORMAT + ret );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( ret = x509_get_name( &p, p + len, &crt->subject ) ) != 0 )
|
if( len && ( ret = x509_get_name( &p, p + len, &crt->subject ) ) != 0 )
|
||||||
{
|
{
|
||||||
x509_free( crt );
|
x509_free( crt );
|
||||||
return( ret );
|
return( ret );
|
||||||
@@ -2518,6 +2518,12 @@ int x509parse_dn_gets( char *buf, size_t size, const x509_name *dn )
|
|||||||
|
|
||||||
while( name != NULL )
|
while( name != NULL )
|
||||||
{
|
{
|
||||||
|
if( !name->oid.p )
|
||||||
|
{
|
||||||
|
name = name->next;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if( name != dn )
|
if( name != dn )
|
||||||
{
|
{
|
||||||
ret = snprintf( p, n, ", " );
|
ret = snprintf( p, n, ", " );
|
||||||
|
Reference in New Issue
Block a user