Fix case where final special char exceeds buffer
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
parent
fd8cfe4f8e
commit
9b0e940135
@ -785,7 +785,7 @@ int mbedtls_x509_dn_gets( char *buf, size_t size, const mbedtls_x509_name *dn )
|
||||
if( c && strchr( ",=+<>#;\"\\", c ) )
|
||||
{
|
||||
if( j + 1 >= sizeof( s ) - 1 )
|
||||
continue;
|
||||
return( MBEDTLS_ERR_X509_BUFFER_TOO_SMALL );
|
||||
s[j++] = '\\';
|
||||
}
|
||||
if( c < 32 || c >= 127 )
|
||||
|
@ -399,6 +399,10 @@ X509 Get Modified DN #4 Name exactly 255 bytes, with comma requiring escaping
|
||||
depends_on:MBEDTLS_PEM_PARSE_C:MBEDTLS_RSA_C:MBEDTLS_SHA1_C
|
||||
mbedtls_x509_dn_gets_subject_replace:"data_files/server1.crt":"1234567890,1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234":"":MBEDTLS_ERR_X509_BUFFER_TOO_SMALL
|
||||
|
||||
X509 Get Modified DN #5 Name exactly 255 bytes, ending with comma requiring escaping
|
||||
depends_on:MBEDTLS_PEM_PARSE_C:MBEDTLS_RSA_C:MBEDTLS_SHA1_C
|
||||
mbedtls_x509_dn_gets_subject_replace:"data_files/server1.crt":"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234,":"":MBEDTLS_ERR_X509_BUFFER_TOO_SMALL
|
||||
|
||||
X509 Get Next DN #1 No Multivalue RDNs
|
||||
mbedtls_x509_dn_get_next:"C=NL, O=PolarSSL, CN=PolarSSL Server 1":0:"C O CN":3:"C=NL, O=PolarSSL, CN=PolarSSL Server 1"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user