From 7fb54c567456f3501ed711bbb72d1d2de2d130da Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 10 Nov 2021 21:04:24 +0100 Subject: [PATCH] More explicit output for the test program Without that, the logs were a bit hard to understand if you didn't know what to expect. Signed-off-by: Gilles Peskine --- programs/test/dlopen.c | 10 ++++++---- programs/test/dlopen_demo.sh | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/programs/test/dlopen.c b/programs/test/dlopen.c index ecd7f0fbc..ee3a9d255 100644 --- a/programs/test/dlopen.c +++ b/programs/test/dlopen.c @@ -68,7 +68,8 @@ int main( void ) const int *ciphersuites = ssl_list_ciphersuites( ); for( n = 0; ciphersuites[n] != 0; n++ ) /* nothing to do, we're just counting */; - mbedtls_printf( "%u ciphersuites\n", n ); + mbedtls_printf( "dlopen(%s): %u ciphersuites\n", + TLS_SO_FILENAME, n ); dlclose( tls_so ); CHECK_DLERROR( "dlclose", TLS_SO_FILENAME ); #endif /* MBEDTLS_SSL_TLS_C */ @@ -79,8 +80,8 @@ int main( void ) const mbedtls_x509_crt_profile *profile = dlsym( x509_so, "mbedtls_x509_crt_profile_default" ); CHECK_DLERROR( "dlsym", "mbedtls_x509_crt_profile_default" ); - mbedtls_printf( "Allowed md mask: %08x\n", - (unsigned) profile->allowed_mds ); + mbedtls_printf( "dlopen(%s): Allowed md mask: %08x\n", + X509_SO_FILENAME, (unsigned) profile->allowed_mds ); dlclose( x509_so ); CHECK_DLERROR( "dlclose", X509_SO_FILENAME ); #endif /* MBEDTLS_X509_CRT_PARSE_C */ @@ -94,7 +95,8 @@ int main( void ) const int *mds = md_list( ); for( n = 0; mds[n] != 0; n++ ) /* nothing to do, we're just counting */; - mbedtls_printf( "%u hashes\n", n ); + mbedtls_printf( "dlopen(%s): %u hashes\n", + CRYPTO_SO_FILENAME, n ); dlclose( crypto_so ); CHECK_DLERROR( "dlclose", CRYPTO_SO_FILENAME ); #endif /* MBEDTLS_MD_C */ diff --git a/programs/test/dlopen_demo.sh b/programs/test/dlopen_demo.sh index f488dfbb3..2dde3ebed 100755 --- a/programs/test/dlopen_demo.sh +++ b/programs/test/dlopen_demo.sh @@ -41,4 +41,6 @@ else fi export DYLD_LIBRARY_PATH +echo "Running dynamic loading test program: $program" +echo "Loading libraries from: $library_dir" "$program"