From 521b7cb3883605740fb4727120f18810ba47d50b Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sun, 31 Mar 2019 15:26:26 +0200 Subject: [PATCH] Correct the checks of module availability in provider test programs Previously, the macro OPENSSL_NO_SHARED was defined of the test/p_test module wasn't built, but the provider test programs didn't check that macro. We rename it to OPENSSL_NO_MODULE, since that name describes the situation more than OPENSSL_NO_SHARED does, and use it. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/8623) --- test/build.info | 7 ++++--- test/provider_internal_test.c | 9 ++------- test/provider_test.c | 10 ++-------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/test/build.info b/test/build.info index 04b356bd7d..973536dc51 100644 --- a/test/build.info +++ b/test/build.info @@ -611,9 +611,10 @@ IF[{- !$disabled{tests} -}] SOURCE[p_test]=p_test.ld GENERATE[p_test.ld]=../util/providers.num ENDIF - ELSE - DEFINE[provider_test]=OPENSSL_NO_SHARED - DEFINE[provider_internal_test]=OPENSSL_NO_SHARED + ENDIF + IF[{- $disabled{module} || !$target{dso_scheme} -}] + DEFINE[provider_test]=OPENSSL_NO_MODULE + DEFINE[provider_internal_test]=OPENSSL_NO_MODULE ENDIF PROGRAMS{noinst}=params_test diff --git a/test/provider_internal_test.c b/test/provider_internal_test.c index 7f6bb20e49..cbb85c3687 100644 --- a/test/provider_internal_test.c +++ b/test/provider_internal_test.c @@ -11,11 +11,6 @@ #include "internal/provider.h" #include "testutil.h" -#if !defined(DSO_VMS) && !defined(DSO_DLCFN) && !defined(DSO_DL) \ - && !defined(DSO_WIN32) && !defined(DSO_DLFCN) -# define OPENSSL_NO_DSO -#endif - extern OSSL_provider_init_fn PROVIDER_INIT_FUNCTION_NAME; static char buf[256]; @@ -61,7 +56,7 @@ static int test_builtin_provider(void) && test_provider(prov); } -#ifndef OPENSSL_NO_DSO +#ifndef OPENSSL_NO_MODULE static int test_loaded_provider(void) { const char *name = "p_test"; @@ -76,7 +71,7 @@ static int test_loaded_provider(void) int setup_tests(void) { ADD_TEST(test_builtin_provider); -#ifndef OPENSSL_NO_DSO +#ifndef OPENSSL_NO_MODULE ADD_TEST(test_loaded_provider); #endif return 1; diff --git a/test/provider_test.c b/test/provider_test.c index cba7cbaa1d..ee6f94cbe1 100644 --- a/test/provider_test.c +++ b/test/provider_test.c @@ -11,12 +11,6 @@ #include #include "testutil.h" -#if !defined(DSO_VMS) && !defined(DSO_DLCFN) && !defined(DSO_DL) \ - && !defined(DSO_WIN32) && !defined(DSO_DLFCN) -# define OPENSSL_NO_DSO -#endif - - extern OSSL_provider_init_fn PROVIDER_INIT_FUNCTION_NAME; static char buf[256]; @@ -55,7 +49,7 @@ static int test_builtin_provider(void) && test_provider(name); } -#ifndef OPENSSL_NO_DSO +#ifndef OPENSSL_NO_MODULE static int test_loaded_provider(void) { const char *name = "p_test"; @@ -67,7 +61,7 @@ static int test_loaded_provider(void) int setup_tests(void) { ADD_TEST(test_builtin_provider); -#ifndef OPENSSL_NO_DSO +#ifndef OPENSSL_NO_MODULE ADD_TEST(test_loaded_provider); #endif return 1; -- 2.34.1