From 3ca5085f1089013688d24769e41f1d3cd0a97333 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Fri, 7 Jun 2019 22:31:59 +0200 Subject: [PATCH] Code review Typo rproduce -> reproducible Call mbedtls_entropy_func --- programs/ssl/ssl_client2.c | 6 +++--- programs/ssl/ssl_server2.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index 5a4baa3da..189d0cf5c 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -567,13 +567,13 @@ int dummy_entropy( void *data, unsigned char *output, size_t len ) size_t i; (void) data; - //ret = mbedtls_entropy_func( data, output, len ); + ret = mbedtls_entropy_func( data, output, len ); for ( i = 0; i < len; i++ ) { //replace result with pseudo random output[i] = (unsigned char) rand(); } - return( 0 ); + return( ret ); } #if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK) @@ -2013,7 +2013,7 @@ int main( int argc, char *argv[] ) #if defined(MBEDTLS_PLATFORM_TIME_ALT) mbedtls_platform_set_time( dummy_constant_time ); #else - fprintf( stderr, "Warning: reproduce without constant time\n" ); + fprintf( stderr, "Warning: reproducible without constant time\n" ); #endif } else diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 573b62422..30fa6f5ba 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -679,12 +679,12 @@ int dummy_entropy( void *data, unsigned char *output, size_t len ) size_t i; (void) data; - //ret = mbedtls_entropy_func( data, output, len ); + ret = mbedtls_entropy_func( data, output, len ); for (i = 0; i < len; i++ ) { //replace result with pseudo random output[i] = (unsigned char) rand(); } - return( 0 ); + return( ret ); } #if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK) @@ -2832,7 +2832,7 @@ int main( int argc, char *argv[] ) #if defined(MBEDTLS_PLATFORM_TIME_ALT) mbedtls_platform_set_time( dummy_constant_time ); #else - fprintf( stderr, "Warning: reproduce without constant time\n" ); + fprintf( stderr, "Warning: reproducible without constant time\n" ); #endif } else