1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Call Certificate writing generic handler only if necessary

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron
2022-03-09 07:00:13 +01:00
parent 3f20b77517
commit 5bb8fc830a
2 changed files with 24 additions and 79 deletions

View File

@ -1928,10 +1928,15 @@ static int ssl_tls13_write_client_certificate( mbedtls_ssl_context *ssl )
mbedtls_ssl_set_outbound_transform( ssl, ssl->handshake->transform_handshake );
#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
return( mbedtls_ssl_tls13_write_certificate( ssl ) );
#else
return( 0 );
if( ssl->handshake->client_auth )
return( mbedtls_ssl_tls13_write_certificate( ssl ) );
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_CLIENT_FINISHED );
MBEDTLS_SSL_DEBUG_MSG( 2, ( "No certificate message to send." ) );
#endif
return( 0 );
}
#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)