aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2025-02-03 22:40:26 +0100
committerTheo Buehler <tb@openbsd.org>2025-02-03 22:40:26 +0100
commit7e7df6a1ab74e29594358aed9ac5f149cd284213 (patch)
treecf1f907def158f637926f95cfe22572c2e139d41
parent7e58cd8d51dbc517d562d11f256a8102fb04e748 (diff)
parent5bbae88080d65f9e81ef31c28e356f202d3cb03a (diff)
downloadportable-7e7df6a1ab74e29594358aed9ac5f149cd284213.tar.gz
portable-7e7df6a1ab74e29594358aed9ac5f149cd284213.tar.bz2
portable-7e7df6a1ab74e29594358aed9ac5f149cd284213.zip
Land #1139 - link renegotiation test to build
-rw-r--r--.gitignore1
-rw-r--r--tests/CMakeLists.txt12
-rw-r--r--tests/Makefile.am6
-rw-r--r--tests/renegotiation_test.bat14
-rwxr-xr-xtests/renegotiation_test.sh15
5 files changed, 48 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 9a562e7..aedfede 100644
--- a/.gitignore
+++ b/.gitignore
@@ -120,6 +120,7 @@ tests/mlkem*
120tests/mont* 120tests/mont*
121tests/parse* 121tests/parse*
122tests/policy* 122tests/policy*
123tests/renegotiation_test*
123tests/rfc3779* 124tests/rfc3779*
124tests/rfc5280time* 125tests/rfc5280time*
125tests/ssl_get_shared_ciphers* 126tests/ssl_get_shared_ciphers*
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index f4fd85d..fde5406 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -662,6 +662,18 @@ add_executable(record_layer_test record_layer_test.c)
662target_link_libraries(record_layer_test ${OPENSSL_TEST_LIBS}) 662target_link_libraries(record_layer_test ${OPENSSL_TEST_LIBS})
663add_platform_test(record_layer_test record_layer_test) 663add_platform_test(record_layer_test record_layer_test)
664 664
665# renegotiation_test
666set(RENEGOTIATION_TEST_SRC renegotiation_test.c)
667add_executable(renegotiation_test ${RENEGOTIATION_TEST_SRC})
668target_link_libraries(renegotiation_test ${OPENSSL_TEST_LIBS})
669prepare_emscripten_test_target(renegotiation_test)
670if(NOT MSVC)
671 add_test(NAME renegotiation_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/renegotiation_test.sh)
672else()
673 add_test(NAME renegotiation_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/renegotiation_test.bat $<TARGET_FILE:renegotiation_test>)
674endif()
675set_tests_properties(renegotiation_test PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}")
676
665# rfc3779 677# rfc3779
666add_executable(rfc3779 rfc3779.c) 678add_executable(rfc3779 rfc3779.c)
667target_link_libraries(rfc3779 ${OPENSSL_TEST_LIBS}) 679target_link_libraries(rfc3779 ${OPENSSL_TEST_LIBS})
diff --git a/tests/Makefile.am b/tests/Makefile.am
index eeac7e1..f3414f6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -688,6 +688,12 @@ TESTS += record_layer_test
688check_PROGRAMS += record_layer_test 688check_PROGRAMS += record_layer_test
689record_layer_test_SOURCES = record_layer_test.c 689record_layer_test_SOURCES = record_layer_test.c
690 690
691# renegotiation_test
692TESTS += renegotiation_test.sh
693check_PROGRAMS += renegotiation_test
694renegotiation_test_SOURCES = renegotiation_test.c
695EXTRA_DIST += renegotiation_test.sh renegotiation_test.bat
696
691# rfc3779 697# rfc3779
692TESTS += rfc3779 698TESTS += rfc3779
693rfc3779_CPPFLAGS = $(AM_CPPFLAGS) 699rfc3779_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/tests/renegotiation_test.bat b/tests/renegotiation_test.bat
new file mode 100644
index 0000000..0086046
--- /dev/null
+++ b/tests/renegotiation_test.bat
@@ -0,0 +1,14 @@
1@echo off
2setlocal enabledelayedexpansion
3REM renegotiation_test.bat
4
5set renegotiation_test_bin=%1
6set renegotiation_test_bin=%renegotiation_test_bin:/=\%
7if not exist %renegotiation_test_bin% exit /b 1
8
9%renegotiation_test_bin% %srcdir%\server1-rsa.pem %srcdir%\server1-rsa-chain.pem %srcdir%\ca-root-rsa.pem
10if !errorlevel! neq 0 (
11 exit /b 1
12)
13
14endlocal
diff --git a/tests/renegotiation_test.sh b/tests/renegotiation_test.sh
new file mode 100755
index 0000000..bbf27c8
--- /dev/null
+++ b/tests/renegotiation_test.sh
@@ -0,0 +1,15 @@
1#!/bin/sh
2set -e
3
4renegotiation_test_bin=./renegotiation_test
5if [ -e ./renegotiation_test.exe ]; then
6 renegotiation_test_bin=./renegotiation_test.exe
7elif [ -e ./renegotiation_test.js ]; then
8 renegotiation_test_bin="node ./renegotiation_test.js"
9fi
10
11if [ -z $srcdir ]; then
12 srcdir=.
13fi
14
15$renegotiation_test_bin $srcdir/server1-rsa.pem $srcdir/server1-rsa-chain.pem $srcdir/ca-root-rsa.pem