diff options
author | inoguchi <> | 2018-08-23 14:54:28 +0000 |
---|---|---|
committer | inoguchi <> | 2018-08-23 14:54:28 +0000 |
commit | 6749df7059cca7454eb13a7ef01cd5396226c4fc (patch) | |
tree | 7b555f8eb61807ca0ae5ab3b76d1349894c031fc /src | |
parent | f8934d14f52bfac2b569919ddfa210b7cfd8180a (diff) | |
download | openbsd-6749df7059cca7454eb13a7ef01cd5396226c4fc.tar.gz openbsd-6749df7059cca7454eb13a7ef01cd5396226c4fc.tar.bz2 openbsd-6749df7059cca7454eb13a7ef01cd5396226c4fc.zip |
Check reusing SSL/TLS session ticket by regression test
- Added checking for session ticket reusing with using openssl(1) s_server and
s_client command in appstest.sh
- Confirm certificate verification status.
- Save s_server message to log file.
ok tb@ and jsing@
Diffstat (limited to 'src')
-rwxr-xr-x | src/regress/usr.bin/openssl/appstest.sh | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/src/regress/usr.bin/openssl/appstest.sh b/src/regress/usr.bin/openssl/appstest.sh index f82b0bef24..6ec3170aaa 100755 --- a/src/regress/usr.bin/openssl/appstest.sh +++ b/src/regress/usr.bin/openssl/appstest.sh | |||
@@ -917,26 +917,56 @@ section_message "client/server operations" | |||
917 | 917 | ||
918 | host="localhost" | 918 | host="localhost" |
919 | port=4433 | 919 | port=4433 |
920 | sess_log=$user1_dir/s_client_sess.log | 920 | sess_dat=$user1_dir/s_client_sess.dat |
921 | s_client_out=$user1_dir/s_client.out | 921 | s_server_out=$server_dir/s_server.out |
922 | s_client_1_out=$user1_dir/s_client_1.out | ||
923 | s_client_2_out=$user1_dir/s_client_2.out | ||
924 | s_client_3_out=$user1_dir/s_client_3.out | ||
922 | 925 | ||
923 | start_message "s_server ... start SSL/TLS test server" | 926 | start_message "s_server ... start SSL/TLS test server" |
924 | $openssl_bin s_server -accept $port -CAfile $ca_cert \ | 927 | $openssl_bin s_server -accept $port -CAfile $ca_cert \ |
925 | -cert $server_cert -key $server_key -pass pass:$server_pass \ | 928 | -cert $server_cert -key $server_key -pass pass:$server_pass \ |
926 | -context "appstest.sh" -id_prefix "APPSTEST.SH" \ | 929 | -context "appstest.sh" -id_prefix "APPSTEST.SH" \ |
927 | -crl_check -no_ssl2 -no_ssl3 -no_tls1 \ | 930 | -crl_check -no_ssl2 -no_ssl3 -no_tls1 \ |
928 | -nextprotoneg "http/1.1,spdy/3" -alpn "http/1.1,spdy/3" \ | 931 | -nextprotoneg "http/1.1,spdy/3" -alpn "http/1.1,spdy/3" -www \ |
929 | -www -quiet & | 932 | -msg -tlsextdebug > $s_server_out 2>&1 & |
930 | check_exit_status $? | 933 | check_exit_status $? |
931 | s_server_pid=$! | 934 | s_server_pid=$! |
932 | echo "s_server pid = [ $s_server_pid ]" | 935 | echo "s_server pid = [ $s_server_pid ]" |
933 | sleep 1 | 936 | sleep 1 |
934 | 937 | ||
935 | start_message "s_client ... connect to SSL/TLS test server" | 938 | start_message "s_client ... connect to SSL/TLS test server" |
936 | $openssl_bin s_client -connect $host:$port -CAfile $ca_cert \ | 939 | $openssl_bin s_client -connect $host:$port -CAfile $ca_cert -pause -prexit \ |
937 | -showcerts -crl_check -issuer_checks -policy_check -pause -prexit \ | ||
938 | -nextprotoneg "spdy/3,http/1.1" -alpn "spdy/3,http/1.1" \ | 940 | -nextprotoneg "spdy/3,http/1.1" -alpn "spdy/3,http/1.1" \ |
939 | -sess_out $sess_log < /dev/null > $s_client_out 2>&1 | 941 | -sess_out $sess_dat \ |
942 | -msg -tlsextdebug < /dev/null > $s_client_1_out 2>&1 | ||
943 | check_exit_status $? | ||
944 | |||
945 | grep 'New, TLSv1/SSLv3' $s_client_1_out > /dev/null | ||
946 | check_exit_status $? | ||
947 | |||
948 | grep 'Verify return code: 0 (ok)' $s_client_1_out > /dev/null | ||
949 | check_exit_status $? | ||
950 | |||
951 | start_message "s_client ... connect to SSL/TLS test server reusing session id" | ||
952 | $openssl_bin s_client -connect $host:$port -CAfile $ca_cert -pause -prexit \ | ||
953 | -sess_in $sess_dat \ | ||
954 | -msg -tlsextdebug < /dev/null > $s_client_2_out 2>&1 | ||
955 | check_exit_status $? | ||
956 | |||
957 | grep 'Reused, TLSv1/SSLv3' $s_client_2_out > /dev/null | ||
958 | check_exit_status $? | ||
959 | |||
960 | grep 'Verify return code: 0 (ok)' $s_client_2_out > /dev/null | ||
961 | check_exit_status $? | ||
962 | |||
963 | start_message "s_client ... connect to SSL/TLS test server but verify error" | ||
964 | $openssl_bin s_client -connect $host:$port -CAfile $ca_cert -pause -prexit \ | ||
965 | -showcerts -crl_check -issuer_checks -policy_check \ | ||
966 | -msg -tlsextdebug < /dev/null > $s_client_3_out 2>&1 | ||
967 | check_exit_status $? | ||
968 | |||
969 | grep 'Verify return code: 24 (invalid CA certificate)' $s_client_3_out > /dev/null | ||
940 | check_exit_status $? | 970 | check_exit_status $? |
941 | 971 | ||
942 | start_message "s_time ... connect to SSL/TLS test server" | 972 | start_message "s_time ... connect to SSL/TLS test server" |
@@ -944,7 +974,7 @@ $openssl_bin s_time -connect $host:$port -CAfile $ca_cert -time 2 | |||
944 | check_exit_status $? | 974 | check_exit_status $? |
945 | 975 | ||
946 | start_message "sess_id" | 976 | start_message "sess_id" |
947 | $openssl_bin sess_id -in $sess_log -text -out $sess_log.out | 977 | $openssl_bin sess_id -in $sess_dat -text -out $sess_dat.out |
948 | check_exit_status $? | 978 | check_exit_status $? |
949 | 979 | ||
950 | sleep 1 | 980 | sleep 1 |