Update network_transport files based on MbedTLSv3.6.3 (#1340)

Update network_transport files based on MbedTLSv3.6.3
This commit is contained in:
Rahul Kar
2025-04-21 20:21:08 +05:30
committed by GitHub
parent 1325aaaad6
commit 0cbfaab47d
2 changed files with 25 additions and 13 deletions

View File

@ -462,6 +462,13 @@ static void setOptionalConfigurations( SSLContext_t * pSslContext,
{ {
mbedtlsError = mbedtls_ssl_set_hostname( &( pSslContext->context ), mbedtlsError = mbedtls_ssl_set_hostname( &( pSslContext->context ),
pHostName ); pHostName );
}
/* MbedTLS-3.6.3 requires calling the mbedtls_ssl_set_hostname() before calling mbedtls_ssl_handshake(). */
else
{
mbedtlsError = mbedtls_ssl_set_hostname( &( pSslContext->context ),
NULL );
}
if( mbedtlsError != 0 ) if( mbedtlsError != 0 )
{ {
@ -469,7 +476,6 @@ static void setOptionalConfigurations( SSLContext_t * pSslContext,
mbedtlsHighLevelCodeOrDefault( mbedtlsError ), mbedtlsHighLevelCodeOrDefault( mbedtlsError ),
mbedtlsLowLevelCodeOrDefault( mbedtlsError ) ) ); mbedtlsLowLevelCodeOrDefault( mbedtlsError ) ) );
} }
}
/* Set Maximum Fragment Length if enabled. */ /* Set Maximum Fragment Length if enabled. */
#ifdef MBEDTLS_SSL_MAX_FRAGMENT_LENGTH #ifdef MBEDTLS_SSL_MAX_FRAGMENT_LENGTH

View File

@ -463,6 +463,13 @@ static TlsTransportStatus_t tlsSetup( NetworkContext_t * pNetworkContext,
{ {
mbedtlsError = mbedtls_ssl_set_hostname( &( pTlsTransportParams->sslContext.context ), mbedtlsError = mbedtls_ssl_set_hostname( &( pTlsTransportParams->sslContext.context ),
pHostName ); pHostName );
}
/* MbedTLS-3.6.3 requires calling the mbedtls_ssl_set_hostname() before calling mbedtls_ssl_handshake(). */
else
{
mbedtlsError = mbedtls_ssl_set_hostname( &( pTlsTransportParams->sslContext.context ),
NULL );
}
if( mbedtlsError != 0 ) if( mbedtlsError != 0 )
{ {
@ -473,7 +480,6 @@ static TlsTransportStatus_t tlsSetup( NetworkContext_t * pNetworkContext,
returnStatus = TLS_TRANSPORT_INTERNAL_ERROR; returnStatus = TLS_TRANSPORT_INTERNAL_ERROR;
} }
} }
}
/* Set Maximum Fragment Length if enabled. */ /* Set Maximum Fragment Length if enabled. */
#ifdef MBEDTLS_SSL_MAX_FRAGMENT_LENGTH #ifdef MBEDTLS_SSL_MAX_FRAGMENT_LENGTH