Commit def638aa2d for openssl.org
commit def638aa2d6895d36648cbccfb16444e24311683
Author: Andrew Dinh <andrewd@openssl.org>
Date: Tue Aug 4 22:55:07 2026 +0700
fix module extension on non-.so platforms
pathed.cnf and nocache-and-default.cnf hardcoded "p_test.so", but
provider modules use the platform's DSO extension (e.g. .dylib on
macOS), so the file never existed there.
Convert both configs to build-time templates to
fill in the correct extension.
Update prov_config_test.c's presence check to use DSO_EXTENSION, and
have 30-test_prov_config.t read the generated build-tree file.
Assisted-by: Claude:claude-sonnet-5
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Bob Beck <beck@openssl.org>
MergeDate: Fri Aug 7 01:45:49 2026
(Merged from https://github.com/openssl/openssl/pull/32192)
diff --git a/.gitignore b/.gitignore
index 2c221ee7bd..9d2c2006d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -296,6 +296,8 @@ providers/implementations/rands/test_rng.inc
/test-runs
/test/buildtest_*
/test/provider_internal_test.cnf
+/test/pathed.cnf
+/test/nocache-and-default.cnf
/test/fipsmodule.cnf
/providers/fipsmodule.cnf
diff --git a/test/build.info b/test/build.info
index 6694b97e5d..19cf81e726 100644
--- a/test/build.info
+++ b/test/build.info
@@ -1295,6 +1295,10 @@ IF[{- !$disabled{tests} -}]
ENDIF
DEPEND[]=provider_internal_test.cnf
GENERATE[provider_internal_test.cnf]=provider_internal_test.cnf.in
+ DEPEND[]=pathed.cnf
+ GENERATE[pathed.cnf]=pathed.cnf.in
+ DEPEND[]=nocache-and-default.cnf
+ GENERATE[nocache-and-default.cnf]=nocache-and-default.cnf.in
PROGRAMS{noinst}=provider_fallback_test
SOURCE[provider_fallback_test]=provider_fallback_test.c
diff --git a/test/nocache-and-default.cnf b/test/nocache-and-default.cnf.in
similarity index 80%
rename from test/nocache-and-default.cnf
rename to test/nocache-and-default.cnf.in
index cf5ca8d114..b379a09ecd 100644
--- a/test/nocache-and-default.cnf
+++ b/test/nocache-and-default.cnf.in
@@ -1,3 +1,4 @@
+{- use platform -}
openssl_conf = openssl_init
# Comment out the next line to ignore configuration errors
@@ -11,7 +12,7 @@ test = test_sect
default = default_sect
[test_sect]
-module = ../test/p_test.so
+module = ../test/{- platform->dso("p_test") -}
activate = true
[default_sect]
diff --git a/test/pathed.cnf b/test/pathed.cnf.in
similarity index 83%
rename from test/pathed.cnf
rename to test/pathed.cnf.in
index 07bdc1fdb2..661299ad09 100644
--- a/test/pathed.cnf
+++ b/test/pathed.cnf.in
@@ -1,3 +1,4 @@
+{- use platform -}
openssl_conf = openssl_init
# Comment out the next line to ignore configuration errors
@@ -12,7 +13,7 @@ legacy = legacy_sect
test = test_sect
[test_sect]
-module = ../test/p_test.so
+module = ../test/{- platform->dso("p_test") -}
activate = false
[default_sect]
diff --git a/test/prov_config_test.c b/test/prov_config_test.c
index d271ae4539..c7a1e19498 100644
--- a/test/prov_config_test.c
+++ b/test/prov_config_test.c
@@ -10,6 +10,7 @@
#include <sys/stat.h>
#include <openssl/evp.h>
#include <openssl/conf.h>
+#include "crypto/dso_conf.h"
#include "testutil.h"
static char *configfile = NULL;
@@ -67,7 +68,7 @@ err:
return testresult;
}
-#define P_TEST_PATH "/../test/p_test.so"
+#define P_TEST_PATH "/../test/p_test" DSO_EXTENSION
static int test_path_config(void)
{
OSSL_LIB_CTX *ctx = NULL;
diff --git a/test/recipes/30-test_prov_config.t b/test/recipes/30-test_prov_config.t
index 1ef8736209..773ea06146 100644
--- a/test/recipes/30-test_prov_config.t
+++ b/test/recipes/30-test_prov_config.t
@@ -8,7 +8,7 @@
use OpenSSL::Test::Simple;
-use OpenSSL::Test qw/:DEFAULT srctop_file srctop_dir bldtop_dir/;
+use OpenSSL::Test qw/:DEFAULT srctop_file srctop_dir bldtop_dir bldtop_file/;
use OpenSSL::Test::Utils;
BEGIN {
@@ -24,7 +24,7 @@ plan tests => 2;
ok(run(test(["prov_config_test", srctop_file("test", "default.cnf"),
srctop_file("test", "recursive.cnf"),
- srctop_file("test", "pathed.cnf")])),
+ bldtop_file("test", "pathed.cnf")])),
"running prov_config_test default.cnf");
SKIP: {
@@ -32,6 +32,6 @@ SKIP: {
ok(run(test(["prov_config_test", srctop_file("test", "fips.cnf"),
srctop_file("test", "recursive.cnf"),
- srctop_file("test", "pathed.cnf")])),
+ bldtop_file("test", "pathed.cnf")])),
"running prov_config_test fips.cnf");
}