Merge pull request #5695 from mprse/tls_1_3_remove_redundant_check

ssl_tls13_generate_and_write_ecdh_key_exchange(): remove redundant check
This commit is contained in:
Manuel Pégourié-Gonnard 2022-04-06 09:27:18 +02:00 committed by GitHub
commit fff641a273
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View file

@ -2222,6 +2222,8 @@ static inline int psa_ssl_status_to_mbedtls( psa_status_t status )
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
case PSA_ERROR_BAD_STATE:
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
case PSA_ERROR_BUFFER_TOO_SMALL:
return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
default:
return( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
}

View file

@ -262,12 +262,6 @@ static int ssl_tls13_generate_and_write_ecdh_key_exchange(
}
if( own_pubkey_len > (size_t)( end - buf ) )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "No space in the buffer for ECDH public key." ) );
return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
}
*out_len = own_pubkey_len;
return( 0 );