Fix error reporting in pkey/pk_* programs

This commit is contained in:
Manuel Pégourié-Gonnard 2015-08-27 22:03:33 +02:00
parent ce7a08ba49
commit cf9ab63863
4 changed files with 20 additions and 8 deletions

View file

@ -151,8 +151,11 @@ exit:
mbedtls_entropy_free( &entropy ); mbedtls_entropy_free( &entropy );
#if defined(MBEDTLS_ERROR_C) #if defined(MBEDTLS_ERROR_C)
mbedtls_strerror( ret, (char *) buf, sizeof(buf) ); if( ret != 0 )
mbedtls_printf( " ! Last error was: %s\n", buf ); {
mbedtls_strerror( ret, (char *) buf, sizeof(buf) );
mbedtls_printf( " ! Last error was: %s\n", buf );
}
#endif #endif
#if defined(_WIN32) #if defined(_WIN32)

View file

@ -151,8 +151,11 @@ exit:
mbedtls_entropy_free( &entropy ); mbedtls_entropy_free( &entropy );
#if defined(MBEDTLS_ERROR_C) #if defined(MBEDTLS_ERROR_C)
mbedtls_strerror( ret, (char *) buf, sizeof(buf) ); if( ret != 0 )
mbedtls_printf( " ! Last error was: %s\n", buf ); {
mbedtls_strerror( ret, (char *) buf, sizeof(buf) );
mbedtls_printf( " ! Last error was: %s\n", buf );
}
#endif #endif
#if defined(_WIN32) #if defined(_WIN32)

View file

@ -156,8 +156,11 @@ exit:
mbedtls_entropy_free( &entropy ); mbedtls_entropy_free( &entropy );
#if defined(MBEDTLS_ERROR_C) #if defined(MBEDTLS_ERROR_C)
mbedtls_strerror( ret, (char *) buf, sizeof(buf) ); if( ret != 0 )
mbedtls_printf( " ! Last error was: %s\n", buf ); {
mbedtls_strerror( ret, (char *) buf, sizeof(buf) );
mbedtls_printf( " ! Last error was: %s\n", buf );
}
#endif #endif
#if defined(_WIN32) #if defined(_WIN32)

View file

@ -132,8 +132,11 @@ exit:
mbedtls_pk_free( &pk ); mbedtls_pk_free( &pk );
#if defined(MBEDTLS_ERROR_C) #if defined(MBEDTLS_ERROR_C)
mbedtls_strerror( ret, (char *) buf, sizeof(buf) ); if( ret != 0 )
mbedtls_printf( " ! Last error was: %s\n", buf ); {
mbedtls_strerror( ret, (char *) buf, sizeof(buf) );
mbedtls_printf( " ! Last error was: %s\n", buf );
}
#endif #endif
#if defined(_WIN32) #if defined(_WIN32)