diff options
Diffstat (limited to 'src')
| -rwxr-xr-x | src/regress/usr.bin/openssl/appstest.sh | 122 |
1 files changed, 1 insertions, 121 deletions
diff --git a/src/regress/usr.bin/openssl/appstest.sh b/src/regress/usr.bin/openssl/appstest.sh index 8c0e75deb4..26ba920044 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.61 2024/01/26 11:58:36 job Exp $ | 3 | # $OpenBSD: appstest.sh,v 1.62 2024/03/02 11:53:55 tb Exp $ |
| 4 | # | 4 | # |
| 5 | # Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org> | 5 | # Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org> |
| 6 | # | 6 | # |
| @@ -786,40 +786,6 @@ __EOF__ | |||
| 786 | -out $sv_ecdsa_csr.verify.out | 786 | -out $sv_ecdsa_csr.verify.out |
| 787 | check_exit_status $? | 787 | check_exit_status $? |
| 788 | 788 | ||
| 789 | # GOST certificate | ||
| 790 | |||
| 791 | sv_gost_key=$server_dir/sv_gost_key.pem | ||
| 792 | sv_gost_csr=$server_dir/sv_gost_csr.pem | ||
| 793 | sv_gost_pass=test-gost-pass | ||
| 794 | |||
| 795 | if [ $mingw = 0 ] ; then | ||
| 796 | subj='/C=JP/ST=Tokyo/O=TEST_DUMMY_COMPANY/CN=gost.test-dummy.com/' | ||
| 797 | else | ||
| 798 | subj='//C=JP\ST=Tokyo\O=TEST_DUMMY_COMPANY\CN=gost.test-dummy.com\' | ||
| 799 | fi | ||
| 800 | |||
| 801 | start_message "genpkey ... generate server key#4" | ||
| 802 | |||
| 803 | $openssl_bin genpkey -algorithm GOST2001 -pkeyopt paramset:A \ | ||
| 804 | -pkeyopt dgst:streebog512 -out $sv_gost_key | ||
| 805 | check_exit_status $? | ||
| 806 | |||
| 807 | start_message "req ... generate server csr#4" | ||
| 808 | |||
| 809 | $openssl_bin req -new -subj $subj -streebog512 \ | ||
| 810 | -key $sv_gost_key -keyform pem -passin pass:$sv_gost_pass \ | ||
| 811 | -addext 'subjectAltName = DNS:gost.test-dummy.com' \ | ||
| 812 | -out $sv_gost_csr -outform pem | ||
| 813 | check_exit_status $? | ||
| 814 | |||
| 815 | start_message "req ... verify server csr#4" | ||
| 816 | |||
| 817 | $openssl_bin req -verify -in $sv_gost_csr -inform pem \ | ||
| 818 | -newhdr -noout -pubkey -subject -modulus -text \ | ||
| 819 | -nameopt multiline -reqopt compatible \ | ||
| 820 | -out $sv_gost_csr.verify.out | ||
| 821 | check_exit_status $? | ||
| 822 | |||
| 823 | #---------#---------#---------#---------#---------#---------#--------- | 789 | #---------#---------#---------#---------#---------#---------#--------- |
| 824 | 790 | ||
| 825 | # --- CA operations (issue cert for server) --- | 791 | # --- CA operations (issue cert for server) --- |
| @@ -923,13 +889,6 @@ __EOF__ | |||
| 923 | -in $sv_ecdsa_csr -out $sv_ecdsa_cert > $sv_ecdsa_cert.log 2>&1 | 889 | -in $sv_ecdsa_csr -out $sv_ecdsa_cert > $sv_ecdsa_cert.log 2>&1 |
| 924 | check_exit_status $? | 890 | check_exit_status $? |
| 925 | 891 | ||
| 926 | start_message "ca ... issue cert for server csr#4" | ||
| 927 | |||
| 928 | sv_gost_cert=$server_dir/sv_gost_cert.pem | ||
| 929 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ | ||
| 930 | -in $sv_gost_csr -out $sv_gost_cert > $sv_gost_cert.log 2>&1 | ||
| 931 | check_exit_status $? | ||
| 932 | |||
| 933 | #---------#---------#---------#---------#---------#---------#--------- | 892 | #---------#---------#---------#---------#---------#---------#--------- |
| 934 | 893 | ||
| 935 | # --- CA operations (revoke cert and generate crl) --- | 894 | # --- CA operations (revoke cert and generate crl) --- |
| @@ -1084,27 +1043,6 @@ __EOF__ | |||
| 1084 | -out $cl_ecdsa_csr -outform pem | 1043 | -out $cl_ecdsa_csr -outform pem |
| 1085 | check_exit_status $? | 1044 | check_exit_status $? |
| 1086 | 1045 | ||
| 1087 | start_message "req ... generate private key and csr for user3" | ||
| 1088 | |||
| 1089 | cl_gost_key=$user1_dir/cl_gost_key.pem | ||
| 1090 | cl_gost_csr=$user1_dir/cl_gost_csr.pem | ||
| 1091 | cl_gost_pass=test-user1-pass | ||
| 1092 | |||
| 1093 | if [ $mingw = 0 ] ; then | ||
| 1094 | subj='/C=JP/ST=Tokyo/O=TEST_DUMMY_COMPANY/CN=user3.test-dummy.com/' | ||
| 1095 | else | ||
| 1096 | subj='//C=JP\ST=Tokyo\O=TEST_DUMMY_COMPANY\CN=user3.test-dummy.com\' | ||
| 1097 | fi | ||
| 1098 | |||
| 1099 | $openssl_bin genpkey -algorithm GOST2001 -pkeyopt paramset:A \ | ||
| 1100 | -pkeyopt dgst:streebog512 -out $cl_gost_key | ||
| 1101 | check_exit_status $? | ||
| 1102 | |||
| 1103 | $openssl_bin req -new -subj $subj -streebog512 \ | ||
| 1104 | -key $cl_gost_key -keyform pem -passin pass:$cl_gost_pass \ | ||
| 1105 | -out $cl_gost_csr -outform pem | ||
| 1106 | check_exit_status $? | ||
| 1107 | |||
| 1108 | #---------#---------#---------#---------#---------#---------#--------- | 1046 | #---------#---------#---------#---------#---------#---------#--------- |
| 1109 | 1047 | ||
| 1110 | # --- CA operations (issue cert for user1) --- | 1048 | # --- CA operations (issue cert for user1) --- |
| @@ -1123,13 +1061,6 @@ __EOF__ | |||
| 1123 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ | 1061 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ |
| 1124 | -in $cl_ecdsa_csr -out $cl_ecdsa_cert > $cl_ecdsa_cert.log 2>&1 | 1062 | -in $cl_ecdsa_csr -out $cl_ecdsa_cert > $cl_ecdsa_cert.log 2>&1 |
| 1125 | check_exit_status $? | 1063 | check_exit_status $? |
| 1126 | |||
| 1127 | start_message "ca ... issue cert for user3" | ||
| 1128 | |||
| 1129 | cl_gost_cert=$user1_dir/cl_gost_cert.pem | ||
| 1130 | $openssl_bin ca -batch -cert $ca_cert -keyfile $ca_key -key $ca_pass \ | ||
| 1131 | -in $cl_gost_csr -out $cl_gost_cert > $cl_gost_cert.log 2>&1 | ||
| 1132 | check_exit_status $? | ||
| 1133 | } | 1064 | } |
| 1134 | 1065 | ||
| 1135 | function test_tsa { | 1066 | function test_tsa { |
| @@ -1530,10 +1461,6 @@ function test_sc_by_protocol_version { | |||
| 1530 | msg=$3 | 1461 | msg=$3 |
| 1531 | cid=$4 | 1462 | cid=$4 |
| 1532 | 1463 | ||
| 1533 | if [ $gost_tests = 1 ] && [ $ver = "tls1_3" -o $sc != 00 ] ; then | ||
| 1534 | return | ||
| 1535 | fi | ||
| 1536 | |||
| 1537 | groups_and_cipher="" | 1464 | groups_and_cipher="" |
| 1538 | if [ $ver = "tls1_3" ] ; then | 1465 | if [ $ver = "tls1_3" ] ; then |
| 1539 | # Expect HelloRetryRequest | 1466 | # Expect HelloRetryRequest |
| @@ -1596,10 +1523,6 @@ function test_sc_all_cipher { | |||
| 1596 | sc=$1 | 1523 | sc=$1 |
| 1597 | ver=$2 | 1524 | ver=$2 |
| 1598 | 1525 | ||
| 1599 | if [ $gost_tests = 1 ] && [ $ver = "tls1_3" -o $sc != 00 ] ; then | ||
| 1600 | return | ||
| 1601 | fi | ||
| 1602 | |||
| 1603 | copt=cipher | 1526 | copt=cipher |
| 1604 | ciphers=$user1_dir/ciphers_${sc}_${ver} | 1527 | ciphers=$user1_dir/ciphers_${sc}_${ver} |
| 1605 | 1528 | ||
| @@ -1616,8 +1539,6 @@ function test_sc_all_cipher { | |||
| 1616 | if [ $s_id = "0" ] ; then | 1539 | if [ $s_id = "0" ] ; then |
| 1617 | if [ $ecdsa_tests = 1 ] ; then | 1540 | if [ $ecdsa_tests = 1 ] ; then |
| 1618 | cipher_string="ECDSA+TLSv1.2:!TLSv1.3" | 1541 | cipher_string="ECDSA+TLSv1.2:!TLSv1.3" |
| 1619 | elif [ $gost_tests = 1 ] ; then | ||
| 1620 | cipher_string="kGOST:!NULL:!TLSv1.3" | ||
| 1621 | else | 1542 | else |
| 1622 | cipher_string="ALL:!ECDSA:!kGOST:!TLSv1.3" | 1543 | cipher_string="ALL:!ECDSA:!kGOST:!TLSv1.3" |
| 1623 | fi | 1544 | fi |
| @@ -1629,8 +1550,6 @@ function test_sc_all_cipher { | |||
| 1629 | if [ $c_id = "0" ] ; then | 1550 | if [ $c_id = "0" ] ; then |
| 1630 | if [ $ecdsa_tests = 1 ] ; then | 1551 | if [ $ecdsa_tests = 1 ] ; then |
| 1631 | cipher_string="ECDSA+TLSv1.2:!TLSv1.3" | 1552 | cipher_string="ECDSA+TLSv1.2:!TLSv1.3" |
| 1632 | elif [ $gost_tests = 1 ] ; then | ||
| 1633 | cipher_string="kGOST:!NULL:!TLSv1.3" | ||
| 1634 | else | 1553 | else |
| 1635 | cipher_string="ALL:!ECDSA:!kGOST:!TLSv1.3" | 1554 | cipher_string="ALL:!ECDSA:!kGOST:!TLSv1.3" |
| 1636 | fi | 1555 | fi |
| @@ -1665,10 +1584,6 @@ function test_sc_session_reuse { | |||
| 1665 | sc=$1 | 1584 | sc=$1 |
| 1666 | ver=$2 | 1585 | ver=$2 |
| 1667 | 1586 | ||
| 1668 | if [ $gost_tests = 1 ] && [ $ver = "tls1_3" -o $sc != 00 ] ; then | ||
| 1669 | return | ||
| 1670 | fi | ||
| 1671 | |||
| 1672 | sess_dat=$user1_dir/s_client_${sc}_${ver}_sess.dat | 1587 | sess_dat=$user1_dir/s_client_${sc}_${ver}_sess.dat |
| 1673 | 1588 | ||
| 1674 | # Get session ticket to reuse | 1589 | # Get session ticket to reuse |
| @@ -1716,10 +1631,6 @@ function test_sc_verify { | |||
| 1716 | sc=$1 | 1631 | sc=$1 |
| 1717 | ver=$2 | 1632 | ver=$2 |
| 1718 | 1633 | ||
| 1719 | if [ $gost_tests = 1 ] && [ $ver = "tls1_3" -o $sc != 00 ] ; then | ||
| 1720 | return | ||
| 1721 | fi | ||
| 1722 | |||
| 1723 | # invalid verification pattern | 1634 | # invalid verification pattern |
| 1724 | 1635 | ||
| 1725 | s_client_out=$user1_dir/s_client_${sc}_${ver}_tls_invalid.out | 1636 | s_client_out=$user1_dir/s_client_${sc}_${ver}_tls_invalid.out |
| @@ -1750,11 +1661,6 @@ function test_sc_verify { | |||
| 1750 | crt=$cl_ecdsa_cert | 1661 | crt=$cl_ecdsa_cert |
| 1751 | key=$cl_ecdsa_key | 1662 | key=$cl_ecdsa_key |
| 1752 | pwd=$cl_ecdsa_pass | 1663 | pwd=$cl_ecdsa_pass |
| 1753 | elif [ $gost_tests = 1 ] ; then | ||
| 1754 | echo "Using GOST client certificate" | ||
| 1755 | crt=$cl_gost_cert | ||
| 1756 | key=$cl_gost_key | ||
| 1757 | pwd=$cl_gost_pass | ||
| 1758 | else | 1664 | else |
| 1759 | echo "Using RSA client certificate" | 1665 | echo "Using RSA client certificate" |
| 1760 | crt=$cl_rsa_cert | 1666 | crt=$cl_rsa_cert |
| @@ -1806,11 +1712,6 @@ function test_server_client { | |||
| 1806 | crt=$sv_ecdsa_cert | 1712 | crt=$sv_ecdsa_cert |
| 1807 | key=$sv_ecdsa_key | 1713 | key=$sv_ecdsa_key |
| 1808 | pwd=$sv_ecdsa_pass | 1714 | pwd=$sv_ecdsa_pass |
| 1809 | elif [ $gost_tests = 1 ] ; then | ||
| 1810 | echo "Using GOST certificate" | ||
| 1811 | crt=$sv_gost_cert | ||
| 1812 | key=$sv_gost_key | ||
| 1813 | pwd=$sv_gost_pass | ||
| 1814 | else | 1715 | else |
| 1815 | echo "Using RSA certificate" | 1716 | echo "Using RSA certificate" |
| 1816 | crt=$sv_rsa_cert | 1717 | crt=$sv_rsa_cert |
| @@ -1846,14 +1747,6 @@ function test_server_client { | |||
| 1846 | test_sc_verify $sc tls1_2 | 1747 | test_sc_verify $sc tls1_2 |
| 1847 | test_sc_verify $sc tls1_3 | 1748 | test_sc_verify $sc tls1_3 |
| 1848 | 1749 | ||
| 1849 | # s_time | ||
| 1850 | if [ $gost_tests != 1 ] ; then | ||
| 1851 | start_message "s_time ... connect to TLS/SSL test server" | ||
| 1852 | $c_bin s_time -connect $host:$port -CApath $ca_dir -time 1 \ | ||
| 1853 | > $server_dir/s_time_${sc}.log | ||
| 1854 | check_exit_status $? | ||
| 1855 | fi | ||
| 1856 | |||
| 1857 | stop_s_server | 1750 | stop_s_server |
| 1858 | } | 1751 | } |
| 1859 | 1752 | ||
| @@ -1891,11 +1784,6 @@ function test_server_client_dtls { | |||
| 1891 | crt=$sv_ecdsa_cert | 1784 | crt=$sv_ecdsa_cert |
| 1892 | key=$sv_ecdsa_key | 1785 | key=$sv_ecdsa_key |
| 1893 | pwd=$sv_ecdsa_pass | 1786 | pwd=$sv_ecdsa_pass |
| 1894 | elif [ $gost_tests = 1 ] ; then | ||
| 1895 | echo "Using GOST certificate" | ||
| 1896 | crt=$sv_gost_cert | ||
| 1897 | key=$sv_gost_key | ||
| 1898 | pwd=$sv_gost_pass | ||
| 1899 | else | 1787 | else |
| 1900 | echo "Using RSA certificate" | 1788 | echo "Using RSA certificate" |
| 1901 | crt=$sv_rsa_cert | 1789 | crt=$sv_rsa_cert |
| @@ -1949,11 +1837,6 @@ function test_gnutls { | |||
| 1949 | crt=$sv_ecdsa_cert | 1837 | crt=$sv_ecdsa_cert |
| 1950 | key=$sv_ecdsa_key | 1838 | key=$sv_ecdsa_key |
| 1951 | sni=ecdsa.test-dummy.com | 1839 | sni=ecdsa.test-dummy.com |
| 1952 | elif [ $gost_tests = 1 ] ; then | ||
| 1953 | echo "Using GOST certificate" | ||
| 1954 | crt=$sv_gost_cert | ||
| 1955 | key=$sv_gost_key | ||
| 1956 | sni=gost.test-dummy.com | ||
| 1957 | else | 1840 | else |
| 1958 | echo "Using RSA certificate" | 1841 | echo "Using RSA certificate" |
| 1959 | crt=$sv_rsa_cert | 1842 | crt=$sv_rsa_cert |
| @@ -2036,7 +1919,6 @@ other_openssl_bin=${OTHER_OPENSSL:-/usr/local/bin/eopenssl11} | |||
| 2036 | other_openssl_version=`$other_openssl_bin version | cut -b 1-10` | 1919 | other_openssl_version=`$other_openssl_bin version | cut -b 1-10` |
| 2037 | 1920 | ||
| 2038 | ecdsa_tests=0 | 1921 | ecdsa_tests=0 |
| 2039 | gost_tests=0 | ||
| 2040 | interop_tests=0 | 1922 | interop_tests=0 |
| 2041 | gnutls_tests=0 | 1923 | gnutls_tests=0 |
| 2042 | no_long_tests=0 | 1924 | no_long_tests=0 |
| @@ -2045,10 +1927,8 @@ while [ "$1" != "" ]; do | |||
| 2045 | case $1 in | 1927 | case $1 in |
| 2046 | -e | --ecdsa) shift | 1928 | -e | --ecdsa) shift |
| 2047 | ecdsa_tests=1 | 1929 | ecdsa_tests=1 |
| 2048 | gost_tests=0 | ||
| 2049 | ;; | 1930 | ;; |
| 2050 | -g | --gost) shift | 1931 | -g | --gost) shift |
| 2051 | gost_tests=1 | ||
| 2052 | ecdsa_tests=0 | 1932 | ecdsa_tests=0 |
| 2053 | ;; | 1933 | ;; |
| 2054 | -i | --interop) shift | 1934 | -i | --interop) shift |
