summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinoguchi <>2021-04-27 10:13:04 +0000
committerinoguchi <>2021-04-27 10:13:04 +0000
commit9a6275ff251f261dce1f56d6b354a82ba5bfcebd (patch)
tree726341632e870b9dcc551d7d09892d0fdbde31a5
parent6a744b8196550e9cfe1325ade8096c8849e75d67 (diff)
downloadopenbsd-9a6275ff251f261dce1f56d6b354a82ba5bfcebd.tar.gz
openbsd-9a6275ff251f261dce1f56d6b354a82ba5bfcebd.tar.bz2
openbsd-9a6275ff251f261dce1f56d6b354a82ba5bfcebd.zip
Add DTLS test in appstest.sh
-rwxr-xr-xsrc/regress/usr.bin/openssl/appstest.sh71
1 files changed, 70 insertions, 1 deletions
diff --git a/src/regress/usr.bin/openssl/appstest.sh b/src/regress/usr.bin/openssl/appstest.sh
index c4a0bf50cc..db5cfe2bde 100755
--- a/src/regress/usr.bin/openssl/appstest.sh
+++ b/src/regress/usr.bin/openssl/appstest.sh
@@ -1,6 +1,6 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# $OpenBSD: appstest.sh,v 1.48 2021/04/24 00:10:43 inoguchi Exp $ 3# $OpenBSD: appstest.sh,v 1.49 2021/04/27 10:13:04 inoguchi Exp $
4# 4#
5# Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org> 5# Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org>
6# 6#
@@ -1762,6 +1762,70 @@ function test_server_client {
1762 stop_s_server 1762 stop_s_server
1763} 1763}
1764 1764
1765function test_server_client_dtls {
1766 # --- client/server operations (DTLS) ---
1767 section_message "client/server operations (DTLS)"
1768
1769 s_id="$1"
1770 c_id="$2"
1771 sc="$1$2"
1772
1773 test_pause_sec=0.2
1774
1775 if [ $s_id = "0" ] ; then
1776 s_bin=$openssl_bin
1777 else
1778 s_bin=$other_openssl_bin
1779 fi
1780
1781 if [ $c_id = "0" ] ; then
1782 c_bin=$openssl_bin
1783 else
1784 c_bin=$other_openssl_bin
1785 fi
1786
1787 echo "s_server is [`$s_bin version`]"
1788 echo "s_client is [`$c_bin version`]"
1789
1790 host="localhost"
1791 port=4433
1792 s_server_out=$server_dir/s_server_${sc}_dtls.out
1793
1794 if [ $ecdsa_tests = 1 ] ; then
1795 echo "Using ECDSA certificate"
1796 crt=$sv_ecdsa_cert
1797 key=$sv_ecdsa_key
1798 pwd=$sv_ecdsa_pass
1799 elif [ $gost_tests = 1 ] ; then
1800 echo "Using GOST certificate"
1801 crt=$sv_gost_cert
1802 key=$sv_gost_key
1803 pwd=$sv_gost_pass
1804 else
1805 echo "Using RSA certificate"
1806 crt=$sv_rsa_cert
1807 key=$sv_rsa_key
1808 pwd=$sv_rsa_pass
1809 fi
1810
1811 start_message "s_server ... start DTLS test server"
1812 $s_bin s_server -accept $port -CAfile $ca_cert \
1813 -cert $crt -key $key -pass pass:$pwd \
1814 -context "appstest.sh" -id_prefix "APPSTEST.SH" -crl_check \
1815 -alpn "http/1.1,spdy/3" -cipher ALL -4 \
1816 -msg -tlsextdebug -verify 3 -groups X25519:P-384:P-256 \
1817 -status -servername xyz -cert2 $crt -key2 $key -dtls -quiet \
1818 > $s_server_out 2>&1 &
1819 check_exit_status $?
1820 s_server_pid=$!
1821 echo "s_server pid = [ $s_server_pid ]"
1822 sleep 1
1823
1824 # test by protocol version
1825 test_sc_by_protocol_version $sc dtls1_2 'Protocol : DTLSv1.2$' $c_id
1826
1827 stop_s_server
1828}
1765function test_speed { 1829function test_speed {
1766 # === PERFORMANCE === 1830 # === PERFORMANCE ===
1767 section_message "PERFORMANCE" 1831 section_message "PERFORMANCE"
@@ -1874,6 +1938,11 @@ if [ $interop_tests = 1 ] ; then
1874 test_server_client 0 1 1938 test_server_client 0 1
1875 test_server_client 1 0 1939 test_server_client 1 0
1876fi 1940fi
1941test_server_client_dtls 0 0
1942if [ $interop_tests = 1 ] ; then
1943 test_server_client_dtls 0 1
1944 test_server_client_dtls 1 0
1945fi
1877test_speed 1946test_speed
1878test_version 1947test_version
1879 1948