diff options
| author | inoguchi <> | 2020-05-14 12:29:55 +0000 |
|---|---|---|
| committer | inoguchi <> | 2020-05-14 12:29:55 +0000 |
| commit | 7bd2c1cc61a91e85c5f5f52664f8ffe6d5a67eb5 (patch) | |
| tree | d90967906ff592fccd7972729b7a868811c74b3f /src | |
| parent | 85564cbdaaead9999e493a60665d8f6a911aeb69 (diff) | |
| download | openbsd-7bd2c1cc61a91e85c5f5f52664f8ffe6d5a67eb5.tar.gz openbsd-7bd2c1cc61a91e85c5f5f52664f8ffe6d5a67eb5.tar.bz2 openbsd-7bd2c1cc61a91e85c5f5f52664f8ffe6d5a67eb5.zip | |
Factor out the protocol version test in appstest.sh
OTHER_OPENSSL default to eopenssl11
Diffstat (limited to '')
| -rwxr-xr-x | src/regress/usr.bin/openssl/appstest.sh | 75 |
1 files changed, 26 insertions, 49 deletions
diff --git a/src/regress/usr.bin/openssl/appstest.sh b/src/regress/usr.bin/openssl/appstest.sh index ceefa0eccf..42113d46dd 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.32 2020/01/26 12:37:06 inoguchi Exp $ | 3 | # $OpenBSD: appstest.sh,v 1.33 2020/05/14 12:29:55 inoguchi Exp $ |
| 4 | # | 4 | # |
| 5 | # Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org> | 5 | # Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org> |
| 6 | # | 6 | # |
| @@ -1274,6 +1274,25 @@ function test_pkcs { | |||
| 1274 | check_exit_status $? | 1274 | check_exit_status $? |
| 1275 | } | 1275 | } |
| 1276 | 1276 | ||
| 1277 | function test_server_client_by_protocol_version { | ||
| 1278 | ver=$1 | ||
| 1279 | msg=$2 | ||
| 1280 | |||
| 1281 | s_client_out=$user1_dir/s_client_${sc}_${ver}.out | ||
| 1282 | |||
| 1283 | start_message "s_client ... connect to TLS/SSL test server by $ver" | ||
| 1284 | sleep $test_pause_sec | ||
| 1285 | $c_bin s_client -connect $host:$port -CAfile $ca_cert \ | ||
| 1286 | -$ver -msg -tlsextdebug < /dev/null > $s_client_out 2>&1 | ||
| 1287 | check_exit_status $? | ||
| 1288 | |||
| 1289 | grep "$msg" $s_client_out > /dev/null | ||
| 1290 | check_exit_status $? | ||
| 1291 | |||
| 1292 | grep 'Verify return code: 0 (ok)' $s_client_out > /dev/null | ||
| 1293 | check_exit_status $? | ||
| 1294 | } | ||
| 1295 | |||
| 1277 | function test_server_client { | 1296 | function test_server_client { |
| 1278 | # --- client/server operations (TLS) --- | 1297 | # --- client/server operations (TLS) --- |
| 1279 | section_message "client/server operations (TLS)" | 1298 | section_message "client/server operations (TLS)" |
| @@ -1322,53 +1341,11 @@ function test_server_client { | |||
| 1322 | echo "s_server pid = [ $s_server_pid ]" | 1341 | echo "s_server pid = [ $s_server_pid ]" |
| 1323 | sleep 1 | 1342 | sleep 1 |
| 1324 | 1343 | ||
| 1325 | # protocol = TLSv1 | 1344 | # test by protocol version |
| 1326 | 1345 | test_server_client_by_protocol_version tls1 'Protocol : TLSv1$' | |
| 1327 | s_client_out=$user1_dir/s_client_${sc}_tls_1_0.out | 1346 | test_server_client_by_protocol_version tls1_1 'Protocol : TLSv1\.1$' |
| 1328 | 1347 | test_server_client_by_protocol_version tls1_2 'Protocol : TLSv1\.2$' | |
| 1329 | start_message "s_client ... connect to TLS/SSL test server by TLSv1" | 1348 | test_server_client_by_protocol_version tls1_3 'Protocol : TLSv1\.3$' |
| 1330 | sleep $test_pause_sec | ||
| 1331 | $c_bin s_client -connect $host:$port -CAfile $ca_cert \ | ||
| 1332 | -tls1 -msg -tlsextdebug < /dev/null > $s_client_out 2>&1 | ||
| 1333 | check_exit_status $? | ||
| 1334 | |||
| 1335 | grep 'Protocol : TLSv1$' $s_client_out > /dev/null | ||
| 1336 | check_exit_status $? | ||
| 1337 | |||
| 1338 | grep 'Verify return code: 0 (ok)' $s_client_out > /dev/null | ||
| 1339 | check_exit_status $? | ||
| 1340 | |||
| 1341 | # protocol = TLSv1.1 | ||
| 1342 | |||
| 1343 | s_client_out=$user1_dir/s_client_${sc}_tls_1_1.out | ||
| 1344 | |||
| 1345 | start_message "s_client ... connect to TLS/SSL test server by TLSv1.1" | ||
| 1346 | sleep $test_pause_sec | ||
| 1347 | $c_bin s_client -connect $host:$port -CAfile $ca_cert \ | ||
| 1348 | -tls1_1 -msg -tlsextdebug < /dev/null > $s_client_out 2>&1 | ||
| 1349 | check_exit_status $? | ||
| 1350 | |||
| 1351 | grep 'Protocol : TLSv1\.1$' $s_client_out > /dev/null | ||
| 1352 | check_exit_status $? | ||
| 1353 | |||
| 1354 | grep 'Verify return code: 0 (ok)' $s_client_out > /dev/null | ||
| 1355 | check_exit_status $? | ||
| 1356 | |||
| 1357 | # protocol = TLSv1.2 | ||
| 1358 | |||
| 1359 | s_client_out=$user1_dir/s_client_${sc}_tls_1_2.out | ||
| 1360 | |||
| 1361 | start_message "s_client ... connect to TLS/SSL test server by TLSv1.2" | ||
| 1362 | sleep $test_pause_sec | ||
| 1363 | $c_bin s_client -connect $host:$port -CAfile $ca_cert \ | ||
| 1364 | -tls1_2 -msg -tlsextdebug < /dev/null > $s_client_out 2>&1 | ||
| 1365 | check_exit_status $? | ||
| 1366 | |||
| 1367 | grep 'Protocol : TLSv1\.2$' $s_client_out > /dev/null | ||
| 1368 | check_exit_status $? | ||
| 1369 | |||
| 1370 | grep 'Verify return code: 0 (ok)' $s_client_out > /dev/null | ||
| 1371 | check_exit_status $? | ||
| 1372 | 1349 | ||
| 1373 | # all available ciphers with random order | 1350 | # all available ciphers with random order |
| 1374 | 1351 | ||
| @@ -1499,7 +1476,7 @@ function test_version { | |||
| 1499 | #---------#---------#---------#---------#---------#---------#---------#--------- | 1476 | #---------#---------#---------#---------#---------#---------#---------#--------- |
| 1500 | 1477 | ||
| 1501 | openssl_bin=${OPENSSL:-/usr/bin/openssl} | 1478 | openssl_bin=${OPENSSL:-/usr/bin/openssl} |
| 1502 | other_openssl_bin=${OTHER_OPENSSL:-/usr/local/bin/eopenssl} | 1479 | other_openssl_bin=${OTHER_OPENSSL:-/usr/local/bin/eopenssl11} |
| 1503 | 1480 | ||
| 1504 | interop_tests=0 | 1481 | interop_tests=0 |
| 1505 | no_long_tests=0 | 1482 | no_long_tests=0 |
