aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenjiro Nakayama <nakayamakenjiro@gmail.com>2026-07-18 15:19:03 +0900
committerKenjiro Nakayama <nakayamakenjiro@gmail.com>2026-07-18 15:38:45 +0900
commitbb72ae26c912e28ea828891ee1a721b831c10d59 (patch)
treee5c4c02a6a45a79c3bf2f9522dd0baa2e438e132
parentf3df640db86aa89a5bc3239e3b7c5db90bfc2aa3 (diff)
downloadportable-bb72ae26c912e28ea828891ee1a721b831c10d59.tar.gz
portable-bb72ae26c912e28ea828891ee1a721b831c10d59.tar.bz2
portable-bb72ae26c912e28ea828891ee1a721b831c10d59.zip
Run x509_verify only when perl is available
The x509_verify wrapper uses make-dir-roots.pl to prepare the hashed CApath roots directory. This introduced a perl dependency for running the test suite from release tarballs. Detect perl during configure and CMake configuration, and only register x509_verify when perl is available.
-rw-r--r--CMakeLists.txt1
-rw-r--r--configure.ac3
-rw-r--r--tests/CMakeLists.txt4
-rw-r--r--tests/Makefile.am3
-rwxr-xr-xtests/x509_verify.sh6
5 files changed, 14 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a7e97d9..3a23b98 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,7 @@ include(cmake_export_symbol)
32include(GNUInstallDirs) 32include(GNUInstallDirs)
33 33
34enable_testing() 34enable_testing()
35find_program(PERL_EXECUTABLE perl perl5)
35 36
36file(READ ${CMAKE_CURRENT_SOURCE_DIR}/ssl/VERSION SSL_VERSION) 37file(READ ${CMAKE_CURRENT_SOURCE_DIR}/ssl/VERSION SSL_VERSION)
37string(STRIP ${SSL_VERSION} SSL_VERSION) 38string(STRIP ${SSL_VERSION} SSL_VERSION)
diff --git a/configure.ac b/configure.ac
index c0ad033..9012535 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,9 @@ AC_PROG_CC([cc gcc])
32AM_PROG_CC_C_O 32AM_PROG_CC_C_O
33LT_INIT([pic-only]) 33LT_INIT([pic-only])
34 34
35AC_CHECK_PROGS([PERL], [perl perl5])
36AM_CONDITIONAL([HAVE_PERL], [test "x$PERL" != x])
37
35CHECK_OS_OPTIONS 38CHECK_OS_OPTIONS
36 39
37CHECK_C_HARDENING_OPTIONS 40CHECK_C_HARDENING_OPTIONS
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index c1f32a4..5aaebd9 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -935,11 +935,11 @@ add_platform_test(valid_handshakes_terminate valid_handshakes_terminate)
935add_executable(x509_verify x509_verify.c) 935add_executable(x509_verify x509_verify.c)
936target_link_libraries(x509_verify ${OPENSSL_TEST_LIBS}) 936target_link_libraries(x509_verify ${OPENSSL_TEST_LIBS})
937add_dependencies(x509_verify openssl) 937add_dependencies(x509_verify openssl)
938if(NOT WIN32 AND NOT EMSCRIPTEN) 938if(NOT WIN32 AND NOT EMSCRIPTEN AND PERL_EXECUTABLE)
939 add_test(NAME x509_verify COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/x509_verify.sh 939 add_test(NAME x509_verify COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/x509_verify.sh
940 $<TARGET_FILE:x509_verify> $<TARGET_FILE:openssl>) 940 $<TARGET_FILE:x509_verify> $<TARGET_FILE:openssl>)
941 set_tests_properties(x509_verify PROPERTIES 941 set_tests_properties(x509_verify PROPERTIES
942 ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}" 942 ENVIRONMENT "srcdir=${TEST_SOURCE_DIR};PERL=${PERL_EXECUTABLE}"
943 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 943 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
944 # This test depends on certificate times that can exceed 32-bit time_t 944 # This test depends on certificate times that can exceed 32-bit time_t
945 # range, so match the existing time tests and expect failure there. 945 # range, so match the existing time tests and expect failure there.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6373934..96a850f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -94,6 +94,7 @@ libtest_la_SOURCES = empty.c
94 94
95LDADD = libtest.la $(PLATFORM_LDADD) $(PROG_LDADD) 95LDADD = libtest.la $(PLATFORM_LDADD) $(PROG_LDADD)
96 96
97TESTS_ENVIRONMENT = PERL='$(PERL)'
97TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh 98TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
98 99
99TESTS = 100TESTS =
@@ -919,6 +920,7 @@ check_PROGRAMS += valid_handshakes_terminate
919valid_handshakes_terminate_SOURCES = valid_handshakes_terminate.c 920valid_handshakes_terminate_SOURCES = valid_handshakes_terminate.c
920 921
921# x509_verify 922# x509_verify
923if HAVE_PERL
922# This test depends on certificate times that can exceed 32-bit time_t 924# This test depends on certificate times that can exceed 32-bit time_t
923# range, so match the existing time tests and expect failure there. 925# range, so match the existing time tests and expect failure there.
924if SMALL_TIME_T 926if SMALL_TIME_T
@@ -926,6 +928,7 @@ XFAIL_TESTS += x509_verify.sh
926endif 928endif
927TESTS += x509_verify.sh 929TESTS += x509_verify.sh
928check_PROGRAMS += x509_verify 930check_PROGRAMS += x509_verify
931endif
929x509_verify_SOURCES = x509_verify.c 932x509_verify_SOURCES = x509_verify.c
930EXTRA_DIST += x509_verify.sh 933EXTRA_DIST += x509_verify.sh
931EXTRA_DIST += make-dir-roots.pl 934EXTRA_DIST += make-dir-roots.pl
diff --git a/tests/x509_verify.sh b/tests/x509_verify.sh
index cc5446c..b43063f 100755
--- a/tests/x509_verify.sh
+++ b/tests/x509_verify.sh
@@ -20,6 +20,10 @@ if [ -z "$srcdir" ]; then
20 srcdir=. 20 srcdir=.
21fi 21fi
22 22
23if [ -z "$PERL" ]; then
24 PERL=perl
25fi
26
23case "$srcdir" in 27case "$srcdir" in
24/*) 28/*)
25 certs_path="$srcdir/certs" 29 certs_path="$srcdir/certs"
@@ -69,7 +73,7 @@ trap cleanup EXIT
69rm -rf "$workdir" 73rm -rf "$workdir"
70mkdir "$workdir" 74mkdir "$workdir"
71 75
72perl "$make_dir_roots" "$certs_path" "$workdir" 76"$PERL" "$make_dir_roots" "$certs_path" "$workdir"
73 77
74( 78(
75 cd "$workdir" 79 cd "$workdir"