Avoid truncating peer cert info in ssl_server2

This commit is contained in:
Manuel Pégourié-Gonnard 2015-06-27 14:38:51 +02:00
parent f659d2cd40
commit 1c5b9fc19f

View file

@ -1993,10 +1993,12 @@ reset:
else else
mbedtls_printf( " ok\n" ); mbedtls_printf( " ok\n" );
if( mbedtls_ssl_get_peer_cert( &ssl ) ) if( mbedtls_ssl_get_peer_cert( &ssl ) != NULL )
{ {
char crt_buf[512];
mbedtls_printf( " . Peer certificate information ...\n" ); mbedtls_printf( " . Peer certificate information ...\n" );
mbedtls_x509_crt_info( (char *) buf, sizeof( buf ) - 1, " ", mbedtls_x509_crt_info( crt_buf, sizeof( crt_buf ), " ",
mbedtls_ssl_get_peer_cert( &ssl ) ); mbedtls_ssl_get_peer_cert( &ssl ) );
mbedtls_printf( "%s\n", buf ); mbedtls_printf( "%s\n", buf );
} }