diff options
| author | inoguchi <> | 2020-05-17 01:43:27 +0000 |
|---|---|---|
| committer | inoguchi <> | 2020-05-17 01:43:27 +0000 |
| commit | 817fddb24c286c20a4eb6ee5c746d72ec4496245 (patch) | |
| tree | bb8cafcda6dcd8b5b43a765cef0411c96d31c902 /src | |
| parent | 2f27662c9a6b30669154b14006545945ecaead1f (diff) | |
| download | openbsd-817fddb24c286c20a4eb6ee5c746d72ec4496245.tar.gz openbsd-817fddb24c286c20a4eb6ee5c746d72ec4496245.tar.bz2 openbsd-817fddb24c286c20a4eb6ee5c746d72ec4496245.zip | |
Fix server client test with TLSv1.3 in appstest.sh
Diffstat (limited to 'src')
| -rwxr-xr-x | src/regress/usr.bin/openssl/appstest.sh | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/src/regress/usr.bin/openssl/appstest.sh b/src/regress/usr.bin/openssl/appstest.sh index 8527401ef0..9fb143d429 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.37 2020/05/15 15:44:16 inoguchi Exp $ | 3 | # $OpenBSD: appstest.sh,v 1.38 2020/05/17 01:43:27 inoguchi Exp $ |
| 4 | # | 4 | # |
| 5 | # Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org> | 5 | # Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org> |
| 6 | # | 6 | # |
| @@ -1340,38 +1340,45 @@ function test_sc_all_cipher { | |||
| 1340 | sc=$1 | 1340 | sc=$1 |
| 1341 | ver=$2 | 1341 | ver=$2 |
| 1342 | 1342 | ||
| 1343 | s_ciph=$server_dir/s_ciph_${sc}_${ver} | 1343 | copt=cipher |
| 1344 | cipher_string="" | 1344 | ciphers=$user1_dir/ciphers_${sc}_${ver} |
| 1345 | if [ $s_id = "0" ] ; then | 1345 | |
| 1346 | if [ $ver = "tls1_3" ] ; then | 1346 | if [ $ver = "tls1_3" ] ; then |
| 1347 | cipher_string="TLSv1.3" | 1347 | if [ $c_id = "0" ] ; then |
| 1348 | echo "AEAD-AES256-GCM-SHA384" > $ciphers | ||
| 1349 | echo "AEAD-CHACHA20-POLY1305-SHA256" >> $ciphers | ||
| 1350 | echo "AEAD-AES128-GCM-SHA256" >> $ciphers | ||
| 1348 | else | 1351 | else |
| 1352 | echo "TLS_AES_256_GCM_SHA384" > $ciphers | ||
| 1353 | echo "TLS_CHACHA20_POLY1305_SHA256" >> $ciphers | ||
| 1354 | echo "TLS_AES_128_GCM_SHA256" >> $ciphers | ||
| 1355 | copt=ciphersuites | ||
| 1356 | fi | ||
| 1357 | else | ||
| 1358 | s_ciph=$server_dir/s_ciph_${sc}_${ver} | ||
| 1359 | cipher_string="" | ||
| 1360 | if [ $s_id = "0" ] ; then | ||
| 1349 | if [ $ecdsa_tests = 0 ] ; then | 1361 | if [ $ecdsa_tests = 0 ] ; then |
| 1350 | cipher_string="ALL:!ECDSA:!kGOST:!TLSv1.3" | 1362 | cipher_string="ALL:!ECDSA:!kGOST:!TLSv1.3" |
| 1351 | else | 1363 | else |
| 1352 | cipher_string="ECDSA+TLSv1.2:!TLSv1.3" | 1364 | cipher_string="ECDSA+TLSv1.2:!TLSv1.3" |
| 1353 | fi | 1365 | fi |
| 1354 | fi | 1366 | fi |
| 1355 | fi | 1367 | $s_bin ciphers -v $cipher_string | awk '{print $1}' > $s_ciph |
| 1356 | $s_bin ciphers -v $cipher_string | awk '{print $1}' > $s_ciph | ||
| 1357 | 1368 | ||
| 1358 | c_ciph=$user1_dir/c_ciph_${sc}_${ver} | 1369 | c_ciph=$user1_dir/c_ciph_${sc}_${ver} |
| 1359 | cipher_string="" | 1370 | cipher_string="" |
| 1360 | if [ $c_id = "0" ] ; then | 1371 | if [ $c_id = "0" ] ; then |
| 1361 | if [ $ver = "tls1_3" ] ; then | ||
| 1362 | cipher_string="TLSv1.3" | ||
| 1363 | else | ||
| 1364 | if [ $ecdsa_tests = 0 ] ; then | 1372 | if [ $ecdsa_tests = 0 ] ; then |
| 1365 | cipher_string="ALL:!ECDSA:!kGOST:!TLSv1.3" | 1373 | cipher_string="ALL:!ECDSA:!kGOST:!TLSv1.3" |
| 1366 | else | 1374 | else |
| 1367 | cipher_string="ECDSA+TLSv1.2:!TLSv1.3" | 1375 | cipher_string="ECDSA+TLSv1.2:!TLSv1.3" |
| 1368 | fi | 1376 | fi |
| 1369 | fi | 1377 | fi |
| 1370 | fi | 1378 | $c_bin ciphers -v $cipher_string | awk '{print $1}' > $c_ciph |
| 1371 | $c_bin ciphers -v $cipher_string | awk '{print $1}' > $c_ciph | ||
| 1372 | 1379 | ||
| 1373 | ciphers=$user1_dir/ciphers_${sc}_${ver} | 1380 | grep -x -f $s_ciph $c_ciph | sort -R > $ciphers |
| 1374 | grep -x -f $s_ciph $c_ciph | sort -R > $ciphers | 1381 | fi |
| 1375 | 1382 | ||
| 1376 | cnum=0 | 1383 | cnum=0 |
| 1377 | for c in `cat $ciphers` ; do | 1384 | for c in `cat $ciphers` ; do |
| @@ -1382,11 +1389,11 @@ function test_sc_all_cipher { | |||
| 1382 | start_message "s_client ... connect to TLS/SSL test server with [ $cnstr ] $ver $c" | 1389 | start_message "s_client ... connect to TLS/SSL test server with [ $cnstr ] $ver $c" |
| 1383 | sleep $test_pause_sec | 1390 | sleep $test_pause_sec |
| 1384 | $c_bin s_client -connect $host:$port -CAfile $ca_cert \ | 1391 | $c_bin s_client -connect $host:$port -CAfile $ca_cert \ |
| 1385 | -$ver -cipher $c \ | 1392 | -$ver -$copt $c \ |
| 1386 | -msg -tlsextdebug < /dev/null > $s_client_out 2>&1 | 1393 | -msg -tlsextdebug < /dev/null > $s_client_out 2>&1 |
| 1387 | check_exit_status $? | 1394 | check_exit_status $? |
| 1388 | 1395 | ||
| 1389 | grep "Cipher : $c" $s_client_out > /dev/null | 1396 | grep "Cipher is $c" $s_client_out > /dev/null |
| 1390 | check_exit_status $? | 1397 | check_exit_status $? |
| 1391 | 1398 | ||
| 1392 | grep 'Verify return code: 0 (ok)' $s_client_out > /dev/null | 1399 | grep 'Verify return code: 0 (ok)' $s_client_out > /dev/null |
