From d1004f02e68908f4e22f1a0f854df4fd306c855b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 7 Aug 2015 10:46:54 +0200 Subject: [PATCH] Fix printed output of some selftests --- library/hmac_drbg.c | 5 +---- library/rsa.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/library/hmac_drbg.c b/library/hmac_drbg.c index 072f5f7b3..4f31421a5 100644 --- a/library/hmac_drbg.c +++ b/library/hmac_drbg.c @@ -408,10 +408,7 @@ int mbedtls_hmac_drbg_update_seed_file( mbedtls_hmac_drbg_context *ctx, const ch /* Dummy checkup routine */ int mbedtls_hmac_drbg_self_test( int verbose ) { - - if( verbose != 0 ) - mbedtls_printf( "\n" ); - + (void) verbose; return( 0 ); } #else diff --git a/library/rsa.c b/library/rsa.c index 559c41065..a8f0df95b 100644 --- a/library/rsa.c +++ b/library/rsa.c @@ -1642,9 +1642,12 @@ int mbedtls_rsa_self_test( int verbose ) return( 1 ); } + if( verbose != 0 ) + mbedtls_printf( "passed\n" ); + #if defined(MBEDTLS_SHA1_C) if( verbose != 0 ) - mbedtls_printf( "passed\n PKCS#1 data sign : " ); + mbedtls_printf( "PKCS#1 data sign : " ); mbedtls_sha1( rsa_plaintext, PT_LEN, sha1sum ); @@ -1670,9 +1673,12 @@ int mbedtls_rsa_self_test( int verbose ) } if( verbose != 0 ) - mbedtls_printf( "passed\n\n" ); + mbedtls_printf( "passed\n" ); #endif /* MBEDTLS_SHA1_C */ + if( verbose != 0 ) + mbedtls_printf( "\n" ); + cleanup: mbedtls_rsa_free( &rsa ); #else /* MBEDTLS_PKCS1_V15 */