mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-07-23 15:18:39 +00:00
Do not print any messages if query_config option is used
To preserve the behaviour of the query_config option all message is omitted it it is used. Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
parent
f1f7b29d76
commit
de47217580
|
@ -3313,7 +3313,7 @@ reconnect:
|
||||||
*/
|
*/
|
||||||
exit:
|
exit:
|
||||||
#ifdef MBEDTLS_ERROR_C
|
#ifdef MBEDTLS_ERROR_C
|
||||||
if( ret != 0 && opt.query_config_mode == DFL_QUERY_CONFIG_MODE )
|
if( ret != 0 )
|
||||||
{
|
{
|
||||||
char error_buf[100];
|
char error_buf[100];
|
||||||
mbedtls_strerror( ret, error_buf, 100 );
|
mbedtls_strerror( ret, error_buf, 100 );
|
||||||
|
@ -3354,7 +3354,8 @@ exit:
|
||||||
* immediately because of bad cmd line params,
|
* immediately because of bad cmd line params,
|
||||||
* for example). */
|
* for example). */
|
||||||
status = psa_destroy_key( slot );
|
status = psa_destroy_key( slot );
|
||||||
if( status != PSA_SUCCESS )
|
if( ( status != PSA_SUCCESS ) &&
|
||||||
|
( opt.query_config_mode == DFL_QUERY_CONFIG_MODE ) )
|
||||||
{
|
{
|
||||||
mbedtls_printf( "Failed to destroy key slot %u - error was %d",
|
mbedtls_printf( "Failed to destroy key slot %u - error was %d",
|
||||||
(unsigned) slot, (int) status );
|
(unsigned) slot, (int) status );
|
||||||
|
@ -3372,13 +3373,13 @@ exit:
|
||||||
mbedtls_memory_buffer_alloc_free();
|
mbedtls_memory_buffer_alloc_free();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
if( opt.query_config_mode == DFL_QUERY_CONFIG_MODE )
|
if( opt.query_config_mode == DFL_QUERY_CONFIG_MODE )
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
|
||||||
mbedtls_printf( " + Press Enter to exit this program.\n" );
|
mbedtls_printf( " + Press Enter to exit this program.\n" );
|
||||||
fflush( stdout ); getchar();
|
fflush( stdout ); getchar();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Shell can not handle large exit numbers -> 1 for errors
|
// Shell can not handle large exit numbers -> 1 for errors
|
||||||
if( ret < 0 )
|
if( ret < 0 )
|
||||||
|
|
|
@ -1734,7 +1734,6 @@ int main( int argc, char *argv[] )
|
||||||
psa_algorithm_t alg = 0;
|
psa_algorithm_t alg = 0;
|
||||||
psa_key_handle_t psk_slot = 0;
|
psa_key_handle_t psk_slot = 0;
|
||||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||||
int psk_free_ret = 0;
|
|
||||||
unsigned char psk[MBEDTLS_PSK_MAX_LEN];
|
unsigned char psk[MBEDTLS_PSK_MAX_LEN];
|
||||||
size_t psk_len = 0;
|
size_t psk_len = 0;
|
||||||
psk_entry *psk_info = NULL;
|
psk_entry *psk_info = NULL;
|
||||||
|
@ -4259,8 +4258,6 @@ close_notify:
|
||||||
* Cleanup and exit
|
* Cleanup and exit
|
||||||
*/
|
*/
|
||||||
exit:
|
exit:
|
||||||
if( opt.query_config_mode == DFL_QUERY_CONFIG_MODE )
|
|
||||||
{
|
|
||||||
#ifdef MBEDTLS_ERROR_C
|
#ifdef MBEDTLS_ERROR_C
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
{
|
{
|
||||||
|
@ -4270,6 +4267,8 @@ exit:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if( opt.query_config_mode == DFL_QUERY_CONFIG_MODE )
|
||||||
|
{
|
||||||
mbedtls_printf( " . Cleaning up..." );
|
mbedtls_printf( " . Cleaning up..." );
|
||||||
fflush( stdout );
|
fflush( stdout );
|
||||||
}
|
}
|
||||||
|
@ -4302,8 +4301,9 @@ exit:
|
||||||
sni_free( sni_info );
|
sni_free( sni_info );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED)
|
#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED)
|
||||||
if( ( psk_free_ret = psk_free( psk_info ) ) != 0 )
|
ret = psk_free( psk_info );
|
||||||
mbedtls_printf( "Failed to list of opaque PSKs - error was %d\n", psk_free_ret );
|
if( ( ret != 0 ) && ( opt.query_config_mode == DFL_QUERY_CONFIG_MODE ) )
|
||||||
|
mbedtls_printf( "Failed to list of opaque PSKs - error was %d\n", ret );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_FS_IO)
|
#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_FS_IO)
|
||||||
mbedtls_dhm_free( &dhm );
|
mbedtls_dhm_free( &dhm );
|
||||||
|
@ -4318,7 +4318,8 @@ exit:
|
||||||
* immediately because of bad cmd line params,
|
* immediately because of bad cmd line params,
|
||||||
* for example). */
|
* for example). */
|
||||||
status = psa_destroy_key( psk_slot );
|
status = psa_destroy_key( psk_slot );
|
||||||
if( status != PSA_SUCCESS )
|
if( ( status != PSA_SUCCESS ) &&
|
||||||
|
( opt.query_config_mode == DFL_QUERY_CONFIG_MODE ) )
|
||||||
{
|
{
|
||||||
mbedtls_printf( "Failed to destroy key slot %u - error was %d",
|
mbedtls_printf( "Failed to destroy key slot %u - error was %d",
|
||||||
(unsigned) psk_slot, (int) status );
|
(unsigned) psk_slot, (int) status );
|
||||||
|
|
Loading…
Reference in a new issue