2014-02-20 10:01:30 +00:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
2016-05-19 22:43:11 +00:00
|
|
|
|
# ssl-opt.sh
|
2014-02-20 10:01:30 +00:00
|
|
|
|
#
|
2016-05-19 22:43:11 +00:00
|
|
|
|
# This file is part of mbed TLS (https://tls.mbed.org)
|
|
|
|
|
#
|
|
|
|
|
# Copyright (c) 2016, ARM Limited, All Rights Reserved
|
|
|
|
|
#
|
|
|
|
|
# Purpose
|
|
|
|
|
#
|
|
|
|
|
# Executes tests to prove various TLS/SSL options and extensions.
|
|
|
|
|
#
|
|
|
|
|
# The goal is not to cover every ciphersuite/version, but instead to cover
|
|
|
|
|
# specific options (max fragment length, truncated hmac, etc) or procedures
|
|
|
|
|
# (session resumption from cache or ticket, renego, etc).
|
|
|
|
|
#
|
|
|
|
|
# The tests assume a build with default options, with exceptions expressed
|
|
|
|
|
# with a dependency. The tests focus on functionality and do not consider
|
|
|
|
|
# performance.
|
2014-02-20 10:01:30 +00:00
|
|
|
|
#
|
|
|
|
|
|
2014-02-25 16:14:15 +00:00
|
|
|
|
set -u
|
|
|
|
|
|
2019-07-03 12:51:04 +00:00
|
|
|
|
# Limit the size of each log to 10 GiB, in case of failures with this script
|
|
|
|
|
# where it may output seemingly unlimited length error logs.
|
|
|
|
|
ulimit -f 20971520
|
|
|
|
|
|
2019-01-23 14:24:37 +00:00
|
|
|
|
# default values, can be overridden by the environment
|
2014-02-27 11:25:54 +00:00
|
|
|
|
: ${P_SRV:=../programs/ssl/ssl_server2}
|
|
|
|
|
: ${P_CLI:=../programs/ssl/ssl_client2}
|
2014-09-05 15:45:19 +00:00
|
|
|
|
: ${P_PXY:=../programs/test/udp_proxy}
|
2014-03-13 17:47:44 +00:00
|
|
|
|
: ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system
|
2014-08-20 18:15:53 +00:00
|
|
|
|
: ${GNUTLS_CLI:=gnutls-cli}
|
|
|
|
|
: ${GNUTLS_SERV:=gnutls-serv}
|
2017-05-16 15:53:03 +00:00
|
|
|
|
: ${PERL:=perl}
|
2014-02-20 10:01:30 +00:00
|
|
|
|
|
2014-09-26 14:07:29 +00:00
|
|
|
|
O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key"
|
2014-03-13 17:47:44 +00:00
|
|
|
|
O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client"
|
2014-08-20 18:15:53 +00:00
|
|
|
|
G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key"
|
Fix CA encoding issue with gnutls-cli
In the 2.7 branch, test-ca.crt has all the components of its Subject name
encoded as PrintableString, because it's generated with our cert_write
program, and our code writes all components that way until Mbed TLS 2.14.
But the default RSA SHA-256 certificate, server2-sha256.crt, has the O and CN
components of its Issuer name encoded as UTF8String, because it was generated
with OpenSSL and that's what OpenSSL does, regardless of how those components
were encoded in the CA's Subject name.
This triggers some overly strict behaviour in some libraries, most notably NSS
and GnuTLS (of interest to us in ssl-opt.sh) which won't recognize the trusted
root as a possible parent for the presented certificate, see for example:
https://github.com/ARMmbed/mbedtls/issues/1033
Fortunately, we have at our disposal a version of test-ca.crt with encodings
matching the ones in server2-sha256.crt, in the file test-ca_utf8.crt. So
let's append that to gnutls-cli's list of trusted roots, so that it recognizes
certs signed by this CA but with the O and CN components as UTF8String.
Note: Since https://github.com/ARMmbed/mbedtls/pull/1641 was merged (in Mbed
TLS 2.14), we changed how we encode those components, so in the 2.16 branch,
cert_write generates test-ca.crt with encodings that matches the ones used by
openssl when generating server2-sha256.crt, so the issue of gnutls-cli
rejecting server2-sha256.crt is specific to the 2.7 branch.
2020-02-03 14:37:47 +00:00
|
|
|
|
G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12u.crt"
|
2017-05-16 15:53:03 +00:00
|
|
|
|
TCP_CLIENT="$PERL scripts/tcp_client.pl"
|
2014-02-25 16:14:15 +00:00
|
|
|
|
|
2014-02-21 08:47:37 +00:00
|
|
|
|
TESTS=0
|
|
|
|
|
FAILS=0
|
2014-08-14 12:31:29 +00:00
|
|
|
|
SKIPS=0
|
2014-02-21 08:47:37 +00:00
|
|
|
|
|
2015-03-09 17:05:11 +00:00
|
|
|
|
CONFIG_H='../include/mbedtls/config.h'
|
2014-04-07 11:24:21 +00:00
|
|
|
|
|
2014-02-26 15:35:27 +00:00
|
|
|
|
MEMCHECK=0
|
2014-03-13 18:17:53 +00:00
|
|
|
|
FILTER='.*'
|
2014-08-14 12:31:29 +00:00
|
|
|
|
EXCLUDE='^$'
|
2014-02-26 15:35:27 +00:00
|
|
|
|
|
2016-05-10 10:18:17 +00:00
|
|
|
|
SHOW_TEST_NUMBER=0
|
2016-05-10 09:50:43 +00:00
|
|
|
|
RUN_TEST_NUMBER=''
|
|
|
|
|
|
2016-05-10 10:47:13 +00:00
|
|
|
|
PRESERVE_LOGS=0
|
|
|
|
|
|
2017-04-14 15:55:28 +00:00
|
|
|
|
# Pick a "unique" server port in the range 10000-19999, and a proxy
|
|
|
|
|
# port which is this plus 10000. Each port number may be independently
|
|
|
|
|
# overridden by a command line option.
|
|
|
|
|
SRV_PORT=$(($$ % 10000 + 10000))
|
|
|
|
|
PXY_PORT=$((SRV_PORT + 10000))
|
|
|
|
|
|
2014-02-26 15:35:27 +00:00
|
|
|
|
print_usage() {
|
|
|
|
|
echo "Usage: $0 [options]"
|
2014-12-11 10:51:28 +00:00
|
|
|
|
printf " -h|--help\tPrint this help.\n"
|
|
|
|
|
printf " -m|--memcheck\tCheck memory leaks and errors.\n"
|
2017-04-14 15:55:28 +00:00
|
|
|
|
printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n"
|
|
|
|
|
printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n"
|
2016-05-10 09:50:43 +00:00
|
|
|
|
printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n"
|
2016-05-10 10:18:17 +00:00
|
|
|
|
printf " -s|--show-numbers\tShow test numbers in front of test names\n"
|
2016-05-10 10:47:13 +00:00
|
|
|
|
printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n"
|
2017-04-14 15:55:28 +00:00
|
|
|
|
printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n"
|
|
|
|
|
printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n"
|
2016-10-10 14:46:20 +00:00
|
|
|
|
printf " --seed\tInteger seed value to use for this test run\n"
|
2014-02-26 15:35:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get_options() {
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
|
case "$1" in
|
2014-03-13 18:17:53 +00:00
|
|
|
|
-f|--filter)
|
|
|
|
|
shift; FILTER=$1
|
|
|
|
|
;;
|
|
|
|
|
-e|--exclude)
|
|
|
|
|
shift; EXCLUDE=$1
|
|
|
|
|
;;
|
2014-02-26 15:35:27 +00:00
|
|
|
|
-m|--memcheck)
|
|
|
|
|
MEMCHECK=1
|
|
|
|
|
;;
|
2016-05-10 09:50:43 +00:00
|
|
|
|
-n|--number)
|
|
|
|
|
shift; RUN_TEST_NUMBER=$1
|
|
|
|
|
;;
|
2016-05-10 10:18:17 +00:00
|
|
|
|
-s|--show-numbers)
|
|
|
|
|
SHOW_TEST_NUMBER=1
|
|
|
|
|
;;
|
2016-05-10 10:47:13 +00:00
|
|
|
|
-p|--preserve-logs)
|
|
|
|
|
PRESERVE_LOGS=1
|
|
|
|
|
;;
|
2017-04-14 15:55:28 +00:00
|
|
|
|
--port)
|
|
|
|
|
shift; SRV_PORT=$1
|
|
|
|
|
;;
|
|
|
|
|
--proxy-port)
|
|
|
|
|
shift; PXY_PORT=$1
|
|
|
|
|
;;
|
2016-10-10 14:46:20 +00:00
|
|
|
|
--seed)
|
|
|
|
|
shift; SEED="$1"
|
|
|
|
|
;;
|
2014-02-26 15:35:27 +00:00
|
|
|
|
-h|--help)
|
|
|
|
|
print_usage
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
*)
|
2014-05-22 13:47:58 +00:00
|
|
|
|
echo "Unknown argument: '$1'"
|
2014-02-26 15:35:27 +00:00
|
|
|
|
print_usage
|
|
|
|
|
exit 1
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
shift
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-24 09:43:55 +00:00
|
|
|
|
# skip next test if the flag is not enabled in config.h
|
|
|
|
|
requires_config_enabled() {
|
|
|
|
|
if grep "^#define $1" $CONFIG_H > /dev/null; then :; else
|
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-08 15:51:08 +00:00
|
|
|
|
# skip next test if the flag is enabled in config.h
|
|
|
|
|
requires_config_disabled() {
|
|
|
|
|
if grep "^#define $1" $CONFIG_H > /dev/null; then
|
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-20 11:34:59 +00:00
|
|
|
|
# skip next test if OpenSSL doesn't support FALLBACK_SCSV
|
|
|
|
|
requires_openssl_with_fallback_scsv() {
|
|
|
|
|
if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then
|
|
|
|
|
if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null
|
|
|
|
|
then
|
|
|
|
|
OPENSSL_HAS_FBSCSV="YES"
|
|
|
|
|
else
|
|
|
|
|
OPENSSL_HAS_FBSCSV="NO"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then
|
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-20 18:15:53 +00:00
|
|
|
|
# skip next test if GnuTLS isn't available
|
|
|
|
|
requires_gnutls() {
|
|
|
|
|
if [ -z "${GNUTLS_AVAILABLE:-}" ]; then
|
2015-06-26 13:45:30 +00:00
|
|
|
|
if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then
|
2014-08-20 18:15:53 +00:00
|
|
|
|
GNUTLS_AVAILABLE="YES"
|
|
|
|
|
else
|
|
|
|
|
GNUTLS_AVAILABLE="NO"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
if [ "$GNUTLS_AVAILABLE" = "NO" ]; then
|
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-23 18:17:47 +00:00
|
|
|
|
# skip next test if IPv6 isn't available on this host
|
|
|
|
|
requires_ipv6() {
|
|
|
|
|
if [ -z "${HAS_IPV6:-}" ]; then
|
|
|
|
|
$P_SRV server_addr='::1' > $SRV_OUT 2>&1 &
|
|
|
|
|
SRV_PID=$!
|
|
|
|
|
sleep 1
|
|
|
|
|
kill $SRV_PID >/dev/null 2>&1
|
|
|
|
|
if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then
|
|
|
|
|
HAS_IPV6="NO"
|
|
|
|
|
else
|
|
|
|
|
HAS_IPV6="YES"
|
|
|
|
|
fi
|
|
|
|
|
rm -r $SRV_OUT
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$HAS_IPV6" = "NO" ]; then
|
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-24 13:17:31 +00:00
|
|
|
|
# skip the next test if valgrind is in use
|
|
|
|
|
not_with_valgrind() {
|
|
|
|
|
if [ "$MEMCHECK" -gt 0 ]; then
|
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-13 09:33:25 +00:00
|
|
|
|
# skip the next test if valgrind is NOT in use
|
|
|
|
|
only_with_valgrind() {
|
|
|
|
|
if [ "$MEMCHECK" -eq 0 ]; then
|
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-20 10:46:27 +00:00
|
|
|
|
# multiply the client timeout delay by the given factor for the next test
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time() {
|
2014-09-20 10:46:27 +00:00
|
|
|
|
CLI_DELAY_FACTOR=$1
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
# wait for the given seconds after the client finished in the next test
|
|
|
|
|
server_needs_more_time() {
|
|
|
|
|
SRV_DELAY_SECONDS=$1
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-21 08:20:14 +00:00
|
|
|
|
# print_name <name>
|
|
|
|
|
print_name() {
|
2016-05-10 10:18:17 +00:00
|
|
|
|
TESTS=$(( $TESTS + 1 ))
|
|
|
|
|
LINE=""
|
|
|
|
|
|
|
|
|
|
if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then
|
|
|
|
|
LINE="$TESTS "
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
LINE="$LINE$1"
|
|
|
|
|
printf "$LINE "
|
|
|
|
|
LEN=$(( 72 - `echo "$LINE" | wc -c` ))
|
2014-12-11 10:51:28 +00:00
|
|
|
|
for i in `seq 1 $LEN`; do printf '.'; done
|
|
|
|
|
printf ' '
|
2014-02-21 08:47:37 +00:00
|
|
|
|
|
2014-02-21 08:20:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# fail <message>
|
|
|
|
|
fail() {
|
|
|
|
|
echo "FAIL"
|
2014-02-27 14:37:24 +00:00
|
|
|
|
echo " ! $1"
|
2014-02-21 08:47:37 +00:00
|
|
|
|
|
2014-08-31 14:46:04 +00:00
|
|
|
|
mv $SRV_OUT o-srv-${TESTS}.log
|
|
|
|
|
mv $CLI_OUT o-cli-${TESTS}.log
|
2014-09-05 15:45:19 +00:00
|
|
|
|
if [ -n "$PXY_CMD" ]; then
|
|
|
|
|
mv $PXY_OUT o-pxy-${TESTS}.log
|
|
|
|
|
fi
|
|
|
|
|
echo " ! outputs saved to o-XXX-${TESTS}.log"
|
2014-02-21 08:47:37 +00:00
|
|
|
|
|
2018-03-29 10:04:20 +00:00
|
|
|
|
if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot -o "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then
|
2014-08-31 15:42:53 +00:00
|
|
|
|
echo " ! server output:"
|
|
|
|
|
cat o-srv-${TESTS}.log
|
2014-09-05 15:45:19 +00:00
|
|
|
|
echo " ! ========================================================"
|
2014-08-31 15:42:53 +00:00
|
|
|
|
echo " ! client output:"
|
|
|
|
|
cat o-cli-${TESTS}.log
|
2014-09-05 15:45:19 +00:00
|
|
|
|
if [ -n "$PXY_CMD" ]; then
|
|
|
|
|
echo " ! ========================================================"
|
|
|
|
|
echo " ! proxy output:"
|
|
|
|
|
cat o-pxy-${TESTS}.log
|
|
|
|
|
fi
|
|
|
|
|
echo ""
|
2014-08-31 15:42:53 +00:00
|
|
|
|
fi
|
|
|
|
|
|
2014-08-31 08:22:11 +00:00
|
|
|
|
FAILS=$(( $FAILS + 1 ))
|
2014-02-21 08:20:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-02-25 15:42:31 +00:00
|
|
|
|
# is_polar <cmd_line>
|
|
|
|
|
is_polar() {
|
|
|
|
|
echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-26 14:07:29 +00:00
|
|
|
|
# openssl s_server doesn't have -www with DTLS
|
|
|
|
|
check_osrv_dtls() {
|
|
|
|
|
if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then
|
|
|
|
|
NEEDS_INPUT=1
|
|
|
|
|
SRV_CMD="$( echo $SRV_CMD | sed s/-www// )"
|
|
|
|
|
else
|
|
|
|
|
NEEDS_INPUT=0
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# provide input to commands that need it
|
|
|
|
|
provide_input() {
|
|
|
|
|
if [ $NEEDS_INPUT -eq 0 ]; then
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
|
echo "HTTP/1.0 200 OK"
|
|
|
|
|
sleep 1
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-26 15:35:27 +00:00
|
|
|
|
# has_mem_err <log_file_name>
|
|
|
|
|
has_mem_err() {
|
|
|
|
|
if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" &&
|
|
|
|
|
grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null
|
|
|
|
|
then
|
|
|
|
|
return 1 # false: does not have errors
|
|
|
|
|
else
|
|
|
|
|
return 0 # true: has errors
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-02 14:42:57 +00:00
|
|
|
|
# Wait for process $2 named $3 to be listening on port $1. Print error to $4.
|
2017-12-14 17:58:42 +00:00
|
|
|
|
if type lsof >/dev/null 2>/dev/null; then
|
2019-09-02 14:42:57 +00:00
|
|
|
|
wait_app_start() {
|
2017-12-14 17:58:42 +00:00
|
|
|
|
START_TIME=$(date +%s)
|
2014-07-23 18:17:47 +00:00
|
|
|
|
if [ "$DTLS" -eq 1 ]; then
|
2017-12-14 17:58:42 +00:00
|
|
|
|
proto=UDP
|
2014-07-23 18:17:47 +00:00
|
|
|
|
else
|
2017-12-14 17:58:42 +00:00
|
|
|
|
proto=TCP
|
2014-07-23 18:17:47 +00:00
|
|
|
|
fi
|
2017-12-14 17:58:42 +00:00
|
|
|
|
# Make a tight loop, server normally takes less than 1s to start.
|
|
|
|
|
while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do
|
|
|
|
|
if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then
|
2019-09-02 14:42:57 +00:00
|
|
|
|
echo "$3 START TIMEOUT"
|
|
|
|
|
echo "$3 START TIMEOUT" >> $4
|
2017-12-14 17:58:42 +00:00
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
# Linux and *BSD support decimal arguments to sleep. On other
|
|
|
|
|
# OSes this may be a tight loop.
|
|
|
|
|
sleep 0.1 2>/dev/null || true
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
else
|
2019-09-02 14:42:57 +00:00
|
|
|
|
echo "Warning: lsof not available, wait_app_start = sleep"
|
|
|
|
|
wait_app_start() {
|
2014-06-20 16:41:11 +00:00
|
|
|
|
sleep "$START_DELAY"
|
2017-12-14 17:58:42 +00:00
|
|
|
|
}
|
|
|
|
|
fi
|
2014-06-20 16:41:11 +00:00
|
|
|
|
|
2019-09-02 14:42:57 +00:00
|
|
|
|
# Wait for server process $2 to be listening on port $1.
|
|
|
|
|
wait_server_start() {
|
|
|
|
|
wait_app_start $1 $2 "SERVER" $SRV_OUT
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Wait for proxy process $2 to be listening on port $1.
|
|
|
|
|
wait_proxy_start() {
|
|
|
|
|
wait_app_start $1 $2 "PROXY" $PXY_OUT
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-06 14:44:01 +00:00
|
|
|
|
# Given the client or server debug output, parse the unix timestamp that is
|
2017-09-14 11:41:29 +00:00
|
|
|
|
# included in the first 4 bytes of the random bytes and check that it's within
|
2017-09-06 14:44:01 +00:00
|
|
|
|
# acceptable bounds
|
|
|
|
|
check_server_hello_time() {
|
|
|
|
|
# Extract the time from the debug (lvl 3) output of the client
|
2017-09-15 14:49:24 +00:00
|
|
|
|
SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")"
|
2017-09-06 14:44:01 +00:00
|
|
|
|
# Get the Unix timestamp for now
|
|
|
|
|
CUR_TIME=$(date +'%s')
|
|
|
|
|
THRESHOLD_IN_SECS=300
|
|
|
|
|
|
|
|
|
|
# Check if the ServerHello time was printed
|
|
|
|
|
if [ -z "$SERVER_HELLO_TIME" ]; then
|
|
|
|
|
return 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Check the time in ServerHello is within acceptable bounds
|
|
|
|
|
if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then
|
|
|
|
|
# The time in ServerHello is at least 5 minutes before now
|
|
|
|
|
return 1
|
|
|
|
|
elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then
|
2017-09-14 11:41:29 +00:00
|
|
|
|
# The time in ServerHello is at least 5 minutes later than now
|
2017-09-06 14:44:01 +00:00
|
|
|
|
return 1
|
|
|
|
|
else
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-30 20:41:47 +00:00
|
|
|
|
# wait for client to terminate and set CLI_EXIT
|
|
|
|
|
# must be called right after starting the client
|
|
|
|
|
wait_client_done() {
|
|
|
|
|
CLI_PID=$!
|
|
|
|
|
|
2014-09-20 10:46:27 +00:00
|
|
|
|
CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR ))
|
|
|
|
|
CLI_DELAY_FACTOR=1
|
|
|
|
|
|
2015-08-04 18:57:59 +00:00
|
|
|
|
( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) &
|
2014-09-20 11:15:43 +00:00
|
|
|
|
DOG_PID=$!
|
2014-08-30 20:41:47 +00:00
|
|
|
|
|
|
|
|
|
wait $CLI_PID
|
|
|
|
|
CLI_EXIT=$?
|
|
|
|
|
|
2014-09-20 11:15:43 +00:00
|
|
|
|
kill $DOG_PID >/dev/null 2>&1
|
|
|
|
|
wait $DOG_PID
|
2014-08-30 20:41:47 +00:00
|
|
|
|
|
|
|
|
|
echo "EXIT: $CLI_EXIT" >> $CLI_OUT
|
2016-09-02 12:45:28 +00:00
|
|
|
|
|
|
|
|
|
sleep $SRV_DELAY_SECONDS
|
|
|
|
|
SRV_DELAY_SECONDS=0
|
2014-08-30 20:41:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-07-23 18:17:47 +00:00
|
|
|
|
# check if the given command uses dtls and sets global variable DTLS
|
|
|
|
|
detect_dtls() {
|
2014-09-05 15:45:19 +00:00
|
|
|
|
if echo "$1" | grep 'dtls=1\|-dtls1\|-u' >/dev/null; then
|
2014-07-23 18:17:47 +00:00
|
|
|
|
DTLS=1
|
|
|
|
|
else
|
|
|
|
|
DTLS=0
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-05 15:45:19 +00:00
|
|
|
|
# Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]]
|
2014-02-20 10:01:30 +00:00
|
|
|
|
# Options: -s pattern pattern that must be present in server output
|
|
|
|
|
# -c pattern pattern that must be present in client output
|
2016-10-13 23:48:33 +00:00
|
|
|
|
# -u pattern lines after pattern must be unique in client output
|
2017-09-06 14:38:07 +00:00
|
|
|
|
# -f call shell function on client output
|
2014-02-20 10:01:30 +00:00
|
|
|
|
# -S pattern pattern that must be absent in server output
|
|
|
|
|
# -C pattern pattern that must be absent in client output
|
2016-10-13 23:48:33 +00:00
|
|
|
|
# -U pattern lines after pattern must be unique in server output
|
2017-09-06 14:38:07 +00:00
|
|
|
|
# -F call shell function on server output
|
2014-02-20 10:01:30 +00:00
|
|
|
|
run_test() {
|
2014-02-25 16:14:15 +00:00
|
|
|
|
NAME="$1"
|
2014-09-05 15:45:19 +00:00
|
|
|
|
shift 1
|
2014-02-25 16:14:15 +00:00
|
|
|
|
|
2014-03-13 18:17:53 +00:00
|
|
|
|
if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then :
|
|
|
|
|
else
|
2014-10-14 20:34:08 +00:00
|
|
|
|
SKIP_NEXT="NO"
|
2014-03-13 18:17:53 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
|
2014-02-25 16:14:15 +00:00
|
|
|
|
print_name "$NAME"
|
2014-02-20 10:01:30 +00:00
|
|
|
|
|
2016-05-10 09:50:43 +00:00
|
|
|
|
# Do we only run numbered tests?
|
|
|
|
|
if [ "X$RUN_TEST_NUMBER" = "X" ]; then :
|
|
|
|
|
elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then :
|
|
|
|
|
else
|
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
|
fi
|
|
|
|
|
|
2014-08-14 12:31:29 +00:00
|
|
|
|
# should we skip?
|
|
|
|
|
if [ "X$SKIP_NEXT" = "XYES" ]; then
|
|
|
|
|
SKIP_NEXT="NO"
|
|
|
|
|
echo "SKIP"
|
2014-08-31 08:22:11 +00:00
|
|
|
|
SKIPS=$(( $SKIPS + 1 ))
|
2014-08-14 12:31:29 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
|
2014-09-05 15:45:19 +00:00
|
|
|
|
# does this test use a proxy?
|
|
|
|
|
if [ "X$1" = "X-p" ]; then
|
|
|
|
|
PXY_CMD="$2"
|
|
|
|
|
shift 2
|
|
|
|
|
else
|
|
|
|
|
PXY_CMD=""
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# get commands and client output
|
|
|
|
|
SRV_CMD="$1"
|
|
|
|
|
CLI_CMD="$2"
|
|
|
|
|
CLI_EXPECT="$3"
|
|
|
|
|
shift 3
|
|
|
|
|
|
|
|
|
|
# fix client port
|
|
|
|
|
if [ -n "$PXY_CMD" ]; then
|
|
|
|
|
CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g )
|
|
|
|
|
else
|
|
|
|
|
CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g )
|
|
|
|
|
fi
|
|
|
|
|
|
2014-07-23 18:17:47 +00:00
|
|
|
|
# update DTLS variable
|
|
|
|
|
detect_dtls "$SRV_CMD"
|
|
|
|
|
|
2014-02-26 15:35:27 +00:00
|
|
|
|
# prepend valgrind to our commands if active
|
|
|
|
|
if [ "$MEMCHECK" -gt 0 ]; then
|
|
|
|
|
if is_polar "$SRV_CMD"; then
|
|
|
|
|
SRV_CMD="valgrind --leak-check=full $SRV_CMD"
|
|
|
|
|
fi
|
|
|
|
|
if is_polar "$CLI_CMD"; then
|
|
|
|
|
CLI_CMD="valgrind --leak-check=full $CLI_CMD"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2015-08-04 18:57:59 +00:00
|
|
|
|
TIMES_LEFT=2
|
|
|
|
|
while [ $TIMES_LEFT -gt 0 ]; do
|
2015-08-04 19:01:37 +00:00
|
|
|
|
TIMES_LEFT=$(( $TIMES_LEFT - 1 ))
|
2015-08-04 18:57:59 +00:00
|
|
|
|
|
2015-08-04 19:01:37 +00:00
|
|
|
|
# run the commands
|
|
|
|
|
if [ -n "$PXY_CMD" ]; then
|
|
|
|
|
echo "$PXY_CMD" > $PXY_OUT
|
|
|
|
|
$PXY_CMD >> $PXY_OUT 2>&1 &
|
|
|
|
|
PXY_PID=$!
|
2019-09-02 14:42:57 +00:00
|
|
|
|
wait_proxy_start "$PXY_PORT" "$PXY_PID"
|
2015-08-04 19:01:37 +00:00
|
|
|
|
fi
|
2014-09-05 15:45:19 +00:00
|
|
|
|
|
2015-08-04 19:01:37 +00:00
|
|
|
|
check_osrv_dtls
|
|
|
|
|
echo "$SRV_CMD" > $SRV_OUT
|
|
|
|
|
provide_input | $SRV_CMD >> $SRV_OUT 2>&1 &
|
|
|
|
|
SRV_PID=$!
|
2017-12-14 17:58:42 +00:00
|
|
|
|
wait_server_start "$SRV_PORT" "$SRV_PID"
|
2014-08-30 20:41:47 +00:00
|
|
|
|
|
2015-08-04 19:01:37 +00:00
|
|
|
|
echo "$CLI_CMD" > $CLI_OUT
|
|
|
|
|
eval "$CLI_CMD" >> $CLI_OUT 2>&1 &
|
|
|
|
|
wait_client_done
|
2014-03-25 13:16:44 +00:00
|
|
|
|
|
2015-08-04 19:01:37 +00:00
|
|
|
|
# terminate the server (and the proxy)
|
|
|
|
|
kill $SRV_PID
|
|
|
|
|
wait $SRV_PID
|
|
|
|
|
if [ -n "$PXY_CMD" ]; then
|
|
|
|
|
kill $PXY_PID >/dev/null 2>&1
|
|
|
|
|
wait $PXY_PID
|
|
|
|
|
fi
|
2014-02-25 15:42:31 +00:00
|
|
|
|
|
2015-08-04 19:01:37 +00:00
|
|
|
|
# retry only on timeouts
|
|
|
|
|
if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then
|
|
|
|
|
printf "RETRY "
|
|
|
|
|
else
|
|
|
|
|
TIMES_LEFT=0
|
|
|
|
|
fi
|
2015-08-04 18:57:59 +00:00
|
|
|
|
done
|
|
|
|
|
|
2014-02-25 15:42:31 +00:00
|
|
|
|
# check if the client and server went at least to the handshake stage
|
2014-05-22 13:47:58 +00:00
|
|
|
|
# (useful to avoid tests with only negative assertions and non-zero
|
2014-02-25 15:42:31 +00:00
|
|
|
|
# expected client exit to incorrectly succeed in case of catastrophic
|
|
|
|
|
# failure)
|
2014-02-25 16:14:15 +00:00
|
|
|
|
if is_polar "$SRV_CMD"; then
|
2014-05-28 21:06:50 +00:00
|
|
|
|
if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :;
|
2014-02-25 15:42:31 +00:00
|
|
|
|
else
|
2014-10-27 12:57:03 +00:00
|
|
|
|
fail "server or client failed to reach handshake stage"
|
2014-02-25 15:42:31 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
fi
|
2014-02-25 16:14:15 +00:00
|
|
|
|
if is_polar "$CLI_CMD"; then
|
2014-05-28 21:06:50 +00:00
|
|
|
|
if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :;
|
2014-02-25 15:42:31 +00:00
|
|
|
|
else
|
2014-10-27 12:57:03 +00:00
|
|
|
|
fail "server or client failed to reach handshake stage"
|
2014-02-25 15:42:31 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2014-02-21 08:20:14 +00:00
|
|
|
|
# check server exit code
|
|
|
|
|
if [ $? != 0 ]; then
|
|
|
|
|
fail "server fail"
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
|
2014-02-20 10:01:30 +00:00
|
|
|
|
# check client exit code
|
2014-02-25 16:14:15 +00:00
|
|
|
|
if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \
|
|
|
|
|
\( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ]
|
2014-02-20 16:19:59 +00:00
|
|
|
|
then
|
2014-09-05 15:45:19 +00:00
|
|
|
|
fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)"
|
2014-02-20 10:01:30 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
|
2014-02-26 15:35:27 +00:00
|
|
|
|
# check other assertions
|
2014-08-21 17:38:32 +00:00
|
|
|
|
# lines beginning with == are added by valgrind, ignore them
|
2016-05-13 09:16:46 +00:00
|
|
|
|
# lines with 'Serious error when reading debug info', are valgrind issues as well
|
2014-02-20 10:01:30 +00:00
|
|
|
|
while [ $# -gt 0 ]
|
|
|
|
|
do
|
|
|
|
|
case $1 in
|
|
|
|
|
"-s")
|
2016-05-13 09:16:46 +00:00
|
|
|
|
if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else
|
2016-10-13 23:48:33 +00:00
|
|
|
|
fail "pattern '$2' MUST be present in the Server output"
|
2014-02-20 10:01:30 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"-c")
|
2016-05-13 09:16:46 +00:00
|
|
|
|
if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else
|
2016-10-13 23:48:33 +00:00
|
|
|
|
fail "pattern '$2' MUST be present in the Client output"
|
2014-02-20 10:01:30 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"-S")
|
2016-05-13 09:16:46 +00:00
|
|
|
|
if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then
|
2016-10-13 23:48:33 +00:00
|
|
|
|
fail "pattern '$2' MUST NOT be present in the Server output"
|
2014-02-20 10:01:30 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"-C")
|
2016-05-13 09:16:46 +00:00
|
|
|
|
if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then
|
2016-10-13 23:48:33 +00:00
|
|
|
|
fail "pattern '$2' MUST NOT be present in the Client output"
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
# The filtering in the following two options (-u and -U) do the following
|
|
|
|
|
# - ignore valgrind output
|
2019-01-23 14:24:37 +00:00
|
|
|
|
# - filter out everything but lines right after the pattern occurrences
|
2016-10-13 23:48:33 +00:00
|
|
|
|
# - keep one of each non-unique line
|
|
|
|
|
# - count how many lines remain
|
|
|
|
|
# A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1
|
|
|
|
|
# if there were no duplicates.
|
|
|
|
|
"-U")
|
|
|
|
|
if [ $(grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then
|
|
|
|
|
fail "lines following pattern '$2' must be unique in Server output"
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"-u")
|
|
|
|
|
if [ $(grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then
|
|
|
|
|
fail "lines following pattern '$2' must be unique in Client output"
|
2014-02-20 10:01:30 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
;;
|
2017-09-06 14:38:07 +00:00
|
|
|
|
"-F")
|
|
|
|
|
if ! $2 "$SRV_OUT"; then
|
|
|
|
|
fail "function call to '$2' failed on Server output"
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
"-f")
|
|
|
|
|
if ! $2 "$CLI_OUT"; then
|
|
|
|
|
fail "function call to '$2' failed on Client output"
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
;;
|
2014-02-20 10:01:30 +00:00
|
|
|
|
|
|
|
|
|
*)
|
2014-05-22 13:47:58 +00:00
|
|
|
|
echo "Unknown test: $1" >&2
|
2014-02-20 10:01:30 +00:00
|
|
|
|
exit 1
|
|
|
|
|
esac
|
|
|
|
|
shift 2
|
|
|
|
|
done
|
|
|
|
|
|
2014-02-26 15:35:27 +00:00
|
|
|
|
# check valgrind's results
|
|
|
|
|
if [ "$MEMCHECK" -gt 0 ]; then
|
2014-05-28 21:06:50 +00:00
|
|
|
|
if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then
|
2014-02-26 15:35:27 +00:00
|
|
|
|
fail "Server has memory errors"
|
|
|
|
|
return
|
|
|
|
|
fi
|
2014-05-28 21:06:50 +00:00
|
|
|
|
if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then
|
2014-02-26 15:35:27 +00:00
|
|
|
|
fail "Client has memory errors"
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2014-02-20 10:01:30 +00:00
|
|
|
|
# if we're here, everything is ok
|
|
|
|
|
echo "PASS"
|
2016-05-10 10:47:13 +00:00
|
|
|
|
if [ "$PRESERVE_LOGS" -gt 0 ]; then
|
|
|
|
|
mv $SRV_OUT o-srv-${TESTS}.log
|
|
|
|
|
mv $CLI_OUT o-cli-${TESTS}.log
|
2018-08-20 11:21:35 +00:00
|
|
|
|
if [ -n "$PXY_CMD" ]; then
|
|
|
|
|
mv $PXY_OUT o-pxy-${TESTS}.log
|
|
|
|
|
fi
|
2016-05-10 10:47:13 +00:00
|
|
|
|
fi
|
|
|
|
|
|
2014-09-05 15:45:19 +00:00
|
|
|
|
rm -f $SRV_OUT $CLI_OUT $PXY_OUT
|
2014-02-20 10:01:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-02-25 15:21:22 +00:00
|
|
|
|
cleanup() {
|
2014-09-05 15:45:19 +00:00
|
|
|
|
rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION
|
2014-09-20 11:15:43 +00:00
|
|
|
|
test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1
|
|
|
|
|
test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1
|
|
|
|
|
test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1
|
|
|
|
|
test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1
|
2014-02-25 15:21:22 +00:00
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-26 17:21:02 +00:00
|
|
|
|
#
|
|
|
|
|
# MAIN
|
|
|
|
|
#
|
|
|
|
|
|
2015-03-10 13:41:04 +00:00
|
|
|
|
if cd $( dirname $0 ); then :; else
|
|
|
|
|
echo "cd $( dirname $0 ) failed" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2014-03-28 09:12:38 +00:00
|
|
|
|
get_options "$@"
|
|
|
|
|
|
2014-02-27 11:25:54 +00:00
|
|
|
|
# sanity checks, avoid an avalanche of errors
|
|
|
|
|
if [ ! -x "$P_SRV" ]; then
|
|
|
|
|
echo "Command '$P_SRV' is not an executable file"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -x "$P_CLI" ]; then
|
|
|
|
|
echo "Command '$P_CLI' is not an executable file"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2014-09-05 15:45:19 +00:00
|
|
|
|
if [ ! -x "$P_PXY" ]; then
|
|
|
|
|
echo "Command '$P_PXY' is not an executable file"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2016-05-23 10:13:17 +00:00
|
|
|
|
if [ "$MEMCHECK" -gt 0 ]; then
|
|
|
|
|
if which valgrind >/dev/null 2>&1; then :; else
|
|
|
|
|
echo "Memcheck not possible. Valgrind not found"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
2014-03-13 17:47:44 +00:00
|
|
|
|
if which $OPENSSL_CMD >/dev/null 2>&1; then :; else
|
|
|
|
|
echo "Command '$OPENSSL_CMD' not found"
|
2014-02-27 11:25:54 +00:00
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2014-05-29 09:31:20 +00:00
|
|
|
|
# used by watchdog
|
|
|
|
|
MAIN_PID="$$"
|
|
|
|
|
|
2018-01-22 09:22:09 +00:00
|
|
|
|
# We use somewhat arbitrary delays for tests:
|
|
|
|
|
# - how long do we wait for the server to start (when lsof not available)?
|
|
|
|
|
# - how long do we allow for the client to finish?
|
|
|
|
|
# (not to check performance, just to avoid waiting indefinitely)
|
|
|
|
|
# Things are slower with valgrind, so give extra time here.
|
|
|
|
|
#
|
|
|
|
|
# Note: without lsof, there is a trade-off between the running time of this
|
|
|
|
|
# script and the risk of spurious errors because we didn't wait long enough.
|
|
|
|
|
# The watchdog delay on the other hand doesn't affect normal running time of
|
|
|
|
|
# the script, only the case where a client or server gets stuck.
|
2014-06-20 16:41:11 +00:00
|
|
|
|
if [ "$MEMCHECK" -gt 0 ]; then
|
2018-01-22 09:22:09 +00:00
|
|
|
|
START_DELAY=6
|
|
|
|
|
DOG_DELAY=60
|
2014-06-20 16:41:11 +00:00
|
|
|
|
else
|
2018-01-22 09:22:09 +00:00
|
|
|
|
START_DELAY=2
|
|
|
|
|
DOG_DELAY=20
|
2014-06-20 16:41:11 +00:00
|
|
|
|
fi
|
2018-01-22 09:22:09 +00:00
|
|
|
|
|
|
|
|
|
# some particular tests need more time:
|
|
|
|
|
# - for the client, we multiply the usual watchdog limit by a factor
|
|
|
|
|
# - for the server, we sleep for a number of seconds after the client exits
|
|
|
|
|
# see client_need_more_time() and server_needs_more_time()
|
2014-09-20 10:46:27 +00:00
|
|
|
|
CLI_DELAY_FACTOR=1
|
2016-09-02 12:45:28 +00:00
|
|
|
|
SRV_DELAY_SECONDS=0
|
2014-06-20 16:41:11 +00:00
|
|
|
|
|
2014-07-23 18:17:47 +00:00
|
|
|
|
# fix commands to use this port, force IPv4 while at it
|
2015-01-21 11:44:33 +00:00
|
|
|
|
# +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later
|
2014-09-05 15:45:19 +00:00
|
|
|
|
P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT"
|
|
|
|
|
P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT"
|
2016-10-10 14:46:20 +00:00
|
|
|
|
P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}"
|
2015-06-18 15:54:58 +00:00
|
|
|
|
O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem"
|
2014-09-05 15:45:19 +00:00
|
|
|
|
O_CLI="$O_CLI -connect localhost:+SRV_PORT"
|
|
|
|
|
G_SRV="$G_SRV -p $SRV_PORT"
|
2015-01-21 11:44:33 +00:00
|
|
|
|
G_CLI="$G_CLI -p +SRV_PORT localhost"
|
2014-05-28 20:59:30 +00:00
|
|
|
|
|
2017-05-10 08:13:59 +00:00
|
|
|
|
# Allow SHA-1, because many of our test certificates use it
|
|
|
|
|
P_SRV="$P_SRV allow_sha1=1"
|
|
|
|
|
P_CLI="$P_CLI allow_sha1=1"
|
|
|
|
|
|
2014-05-28 21:06:50 +00:00
|
|
|
|
# Also pick a unique name for intermediate files
|
|
|
|
|
SRV_OUT="srv_out.$$"
|
|
|
|
|
CLI_OUT="cli_out.$$"
|
2014-09-05 15:45:19 +00:00
|
|
|
|
PXY_OUT="pxy_out.$$"
|
2014-05-28 21:06:50 +00:00
|
|
|
|
SESSION="session.$$"
|
|
|
|
|
|
2014-08-14 12:31:29 +00:00
|
|
|
|
SKIP_NEXT="NO"
|
|
|
|
|
|
2014-02-25 15:21:22 +00:00
|
|
|
|
trap cleanup INT TERM HUP
|
2014-02-20 10:01:30 +00:00
|
|
|
|
|
2014-07-12 02:00:00 +00:00
|
|
|
|
# Basic test
|
|
|
|
|
|
2014-08-21 17:38:32 +00:00
|
|
|
|
# Checks that:
|
|
|
|
|
# - things work with all ciphersuites active (used with config-full in all.sh)
|
|
|
|
|
# - the expected (highest security) parameters are selected
|
|
|
|
|
# ("signature_algorithm ext: 6" means SHA-512 (highest common hash))
|
2014-07-12 02:00:00 +00:00
|
|
|
|
run_test "Default" \
|
2014-08-21 17:38:32 +00:00
|
|
|
|
"$P_SRV debug_level=3" \
|
2014-07-12 02:00:00 +00:00
|
|
|
|
"$P_CLI" \
|
|
|
|
|
0 \
|
2014-08-21 17:38:32 +00:00
|
|
|
|
-s "Protocol is TLSv1.2" \
|
|
|
|
|
-s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \
|
|
|
|
|
-s "client hello v3, signature_algorithm ext: 6" \
|
|
|
|
|
-s "ECDHE curve: secp521r1" \
|
|
|
|
|
-S "error" \
|
|
|
|
|
-C "error"
|
2014-07-12 02:00:00 +00:00
|
|
|
|
|
2015-01-22 13:34:21 +00:00
|
|
|
|
run_test "Default, DTLS" \
|
|
|
|
|
"$P_SRV dtls=1" \
|
|
|
|
|
"$P_CLI dtls=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Protocol is DTLSv1.2" \
|
|
|
|
|
-s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384"
|
|
|
|
|
|
2020-01-02 10:58:00 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_ZLIB_SUPPORT
|
|
|
|
|
run_test "Default (compression enabled)" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Allocating compression buffer" \
|
|
|
|
|
-c "Allocating compression buffer" \
|
|
|
|
|
-s "Record expansion is unknown (compression)" \
|
|
|
|
|
-c "Record expansion is unknown (compression)" \
|
|
|
|
|
-S "error" \
|
|
|
|
|
-C "error"
|
|
|
|
|
|
2017-09-06 14:44:01 +00:00
|
|
|
|
# Test current time in ServerHello
|
|
|
|
|
requires_config_enabled MBEDTLS_HAVE_TIME
|
|
|
|
|
run_test "Default, ServerHello contains gmt_unix_time" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Protocol is TLSv1.2" \
|
|
|
|
|
-s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \
|
|
|
|
|
-s "client hello v3, signature_algorithm ext: 6" \
|
|
|
|
|
-s "ECDHE curve: secp521r1" \
|
|
|
|
|
-S "error" \
|
|
|
|
|
-C "error" \
|
|
|
|
|
-f "check_server_hello_time" \
|
|
|
|
|
-F "check_server_hello_time"
|
|
|
|
|
|
2016-10-13 23:48:33 +00:00
|
|
|
|
# Test for uniqueness of IVs in AEAD ciphersuites
|
|
|
|
|
run_test "Unique IV in GCM" \
|
|
|
|
|
"$P_SRV exchanges=20 debug_level=4" \
|
|
|
|
|
"$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \
|
|
|
|
|
0 \
|
|
|
|
|
-u "IV used" \
|
|
|
|
|
-U "IV used"
|
|
|
|
|
|
2015-01-12 12:43:29 +00:00
|
|
|
|
# Tests for rc4 option
|
|
|
|
|
|
2016-05-19 21:12:18 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES
|
2015-01-12 12:43:29 +00:00
|
|
|
|
run_test "RC4: server disabled, client enabled" \
|
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
1 \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
-s "SSL - The server has no ciphersuites in common"
|
|
|
|
|
|
2016-05-19 21:12:18 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES
|
2015-03-24 08:50:15 +00:00
|
|
|
|
run_test "RC4: server half, client enabled" \
|
|
|
|
|
"$P_SRV arc4=1" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
1 \
|
|
|
|
|
-s "SSL - The server has no ciphersuites in common"
|
2015-01-12 12:43:29 +00:00
|
|
|
|
|
|
|
|
|
run_test "RC4: server enabled, client disabled" \
|
|
|
|
|
"$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI" \
|
|
|
|
|
1 \
|
|
|
|
|
-s "SSL - The server has no ciphersuites in common"
|
|
|
|
|
|
|
|
|
|
run_test "RC4: both enabled" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2015-01-12 12:43:29 +00:00
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
2015-01-14 16:20:46 +00:00
|
|
|
|
-S "SSL - None of the common ciphersuites is usable" \
|
2015-01-12 12:43:29 +00:00
|
|
|
|
-S "SSL - The server has no ciphersuites in common"
|
|
|
|
|
|
2018-08-17 08:54:10 +00:00
|
|
|
|
# Test empty CA list in CertificateRequest in TLS 1.1 and earlier
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1
|
|
|
|
|
run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \
|
|
|
|
|
"$G_SRV"\
|
|
|
|
|
"$P_CLI force_version=tls1_1" \
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1
|
|
|
|
|
run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \
|
|
|
|
|
"$G_SRV"\
|
|
|
|
|
"$P_CLI force_version=tls1" \
|
|
|
|
|
0
|
|
|
|
|
|
2017-05-09 13:59:24 +00:00
|
|
|
|
# Tests for SHA-1 support
|
|
|
|
|
|
2017-06-08 15:51:08 +00:00
|
|
|
|
requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
|
2017-05-09 13:59:24 +00:00
|
|
|
|
run_test "SHA-1 forbidden by default in server certificate" \
|
|
|
|
|
"$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \
|
|
|
|
|
"$P_CLI debug_level=2 allow_sha1=0" \
|
|
|
|
|
1 \
|
|
|
|
|
-c "The certificate is signed with an unacceptable hash"
|
|
|
|
|
|
2017-06-08 15:51:08 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
|
|
|
|
|
run_test "SHA-1 forbidden by default in server certificate" \
|
|
|
|
|
"$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \
|
|
|
|
|
"$P_CLI debug_level=2 allow_sha1=0" \
|
|
|
|
|
0
|
|
|
|
|
|
2017-05-09 13:59:24 +00:00
|
|
|
|
run_test "SHA-1 explicitly allowed in server certificate" \
|
|
|
|
|
"$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \
|
|
|
|
|
"$P_CLI allow_sha1=1" \
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
|
run_test "SHA-256 allowed by default in server certificate" \
|
|
|
|
|
"$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \
|
|
|
|
|
"$P_CLI allow_sha1=0" \
|
|
|
|
|
0
|
|
|
|
|
|
2017-06-08 15:51:08 +00:00
|
|
|
|
requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
|
2017-05-09 13:59:24 +00:00
|
|
|
|
run_test "SHA-1 forbidden by default in client certificate" \
|
|
|
|
|
"$P_SRV auth_mode=required allow_sha1=0" \
|
|
|
|
|
"$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \
|
|
|
|
|
1 \
|
|
|
|
|
-s "The certificate is signed with an unacceptable hash"
|
|
|
|
|
|
2017-06-08 15:51:08 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
|
|
|
|
|
run_test "SHA-1 forbidden by default in client certificate" \
|
|
|
|
|
"$P_SRV auth_mode=required allow_sha1=0" \
|
|
|
|
|
"$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \
|
|
|
|
|
0
|
|
|
|
|
|
2017-05-09 13:59:24 +00:00
|
|
|
|
run_test "SHA-1 explicitly allowed in client certificate" \
|
|
|
|
|
"$P_SRV auth_mode=required allow_sha1=1" \
|
|
|
|
|
"$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
|
run_test "SHA-256 allowed by default in client certificate" \
|
|
|
|
|
"$P_SRV auth_mode=required allow_sha1=0" \
|
|
|
|
|
"$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \
|
|
|
|
|
0
|
|
|
|
|
|
2014-02-20 16:19:59 +00:00
|
|
|
|
# Tests for Truncated HMAC extension
|
|
|
|
|
|
2015-01-09 11:39:35 +00:00
|
|
|
|
run_test "Truncated HMAC: client default, server default" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=4" \
|
2015-01-09 11:39:35 +00:00
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
0 \
|
2017-11-09 18:57:39 +00:00
|
|
|
|
-s "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-S "dumping 'expected mac' (10 bytes)"
|
2014-02-20 16:19:59 +00:00
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2015-01-09 11:39:35 +00:00
|
|
|
|
run_test "Truncated HMAC: client disabled, server default" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=4" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \
|
2014-02-20 10:01:30 +00:00
|
|
|
|
0 \
|
2017-11-09 18:57:39 +00:00
|
|
|
|
-s "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-S "dumping 'expected mac' (10 bytes)"
|
2015-01-09 11:39:35 +00:00
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2015-01-09 11:39:35 +00:00
|
|
|
|
run_test "Truncated HMAC: client enabled, server default" \
|
|
|
|
|
"$P_SRV debug_level=4" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \
|
2015-01-09 11:39:35 +00:00
|
|
|
|
0 \
|
2017-11-09 18:57:39 +00:00
|
|
|
|
-s "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-S "dumping 'expected mac' (10 bytes)"
|
2015-01-09 11:39:35 +00:00
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2015-01-09 11:39:35 +00:00
|
|
|
|
run_test "Truncated HMAC: client enabled, server disabled" \
|
|
|
|
|
"$P_SRV debug_level=4 trunc_hmac=0" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \
|
2015-01-09 11:39:35 +00:00
|
|
|
|
0 \
|
2017-11-09 18:57:39 +00:00
|
|
|
|
-s "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-S "dumping 'expected mac' (10 bytes)"
|
2015-01-09 11:39:35 +00:00
|
|
|
|
|
2017-11-17 15:46:24 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Truncated HMAC: client disabled, server enabled" \
|
|
|
|
|
"$P_SRV debug_level=4 trunc_hmac=1" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \
|
2017-11-17 15:46:24 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-S "dumping 'expected mac' (10 bytes)"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2015-01-09 11:39:35 +00:00
|
|
|
|
run_test "Truncated HMAC: client enabled, server enabled" \
|
|
|
|
|
"$P_SRV debug_level=4 trunc_hmac=1" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \
|
2015-01-09 11:39:35 +00:00
|
|
|
|
0 \
|
2017-11-09 18:57:39 +00:00
|
|
|
|
-S "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-s "dumping 'expected mac' (10 bytes)"
|
2014-02-20 10:43:46 +00:00
|
|
|
|
|
2017-11-10 09:16:05 +00:00
|
|
|
|
run_test "Truncated HMAC, DTLS: client default, server default" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=4" \
|
|
|
|
|
"$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-S "dumping 'expected mac' (10 bytes)"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Truncated HMAC, DTLS: client disabled, server default" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=4" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \
|
2017-11-10 09:16:05 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-S "dumping 'expected mac' (10 bytes)"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Truncated HMAC, DTLS: client enabled, server default" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=4" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \
|
2017-11-10 09:16:05 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-S "dumping 'expected mac' (10 bytes)"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Truncated HMAC, DTLS: client enabled, server disabled" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \
|
2017-11-10 09:16:05 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-S "dumping 'expected mac' (10 bytes)"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Truncated HMAC, DTLS: client disabled, server enabled" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \
|
2017-11-10 09:16:05 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-S "dumping 'expected mac' (10 bytes)"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Truncated HMAC, DTLS: client enabled, server enabled" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \
|
2015-01-09 11:39:35 +00:00
|
|
|
|
0 \
|
2017-11-09 18:57:39 +00:00
|
|
|
|
-S "dumping 'expected mac' (20 bytes)" \
|
|
|
|
|
-s "dumping 'expected mac' (10 bytes)"
|
2014-02-20 10:43:46 +00:00
|
|
|
|
|
2014-10-27 12:57:03 +00:00
|
|
|
|
# Tests for Encrypt-then-MAC extension
|
|
|
|
|
|
|
|
|
|
run_test "Encrypt then MAC: default" \
|
2014-10-28 12:08:59 +00:00
|
|
|
|
"$P_SRV debug_level=3 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2014-10-27 12:57:03 +00:00
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding encrypt_then_mac extension" \
|
|
|
|
|
-s "found encrypt then mac extension" \
|
|
|
|
|
-s "server hello, adding encrypt then mac extension" \
|
|
|
|
|
-c "found encrypt_then_mac extension" \
|
|
|
|
|
-c "using encrypt then mac" \
|
|
|
|
|
-s "using encrypt then mac"
|
|
|
|
|
|
|
|
|
|
run_test "Encrypt then MAC: client enabled, server disabled" \
|
2014-10-28 12:08:59 +00:00
|
|
|
|
"$P_SRV debug_level=3 etm=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2014-10-27 12:57:03 +00:00
|
|
|
|
"$P_CLI debug_level=3 etm=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding encrypt_then_mac extension" \
|
|
|
|
|
-s "found encrypt then mac extension" \
|
|
|
|
|
-S "server hello, adding encrypt then mac extension" \
|
|
|
|
|
-C "found encrypt_then_mac extension" \
|
|
|
|
|
-C "using encrypt then mac" \
|
|
|
|
|
-S "using encrypt then mac"
|
|
|
|
|
|
2014-11-04 14:44:06 +00:00
|
|
|
|
run_test "Encrypt then MAC: client enabled, aead cipher" \
|
|
|
|
|
"$P_SRV debug_level=3 etm=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \
|
|
|
|
|
"$P_CLI debug_level=3 etm=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding encrypt_then_mac extension" \
|
|
|
|
|
-s "found encrypt then mac extension" \
|
|
|
|
|
-S "server hello, adding encrypt then mac extension" \
|
|
|
|
|
-C "found encrypt_then_mac extension" \
|
|
|
|
|
-C "using encrypt then mac" \
|
|
|
|
|
-S "using encrypt then mac"
|
|
|
|
|
|
|
|
|
|
run_test "Encrypt then MAC: client enabled, stream cipher" \
|
|
|
|
|
"$P_SRV debug_level=3 etm=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_CLI debug_level=3 etm=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-11-04 14:44:06 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding encrypt_then_mac extension" \
|
|
|
|
|
-s "found encrypt then mac extension" \
|
|
|
|
|
-S "server hello, adding encrypt then mac extension" \
|
|
|
|
|
-C "found encrypt_then_mac extension" \
|
|
|
|
|
-C "using encrypt then mac" \
|
|
|
|
|
-S "using encrypt then mac"
|
|
|
|
|
|
2014-10-27 12:57:03 +00:00
|
|
|
|
run_test "Encrypt then MAC: client disabled, server enabled" \
|
2014-10-28 12:08:59 +00:00
|
|
|
|
"$P_SRV debug_level=3 etm=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2014-10-27 12:57:03 +00:00
|
|
|
|
"$P_CLI debug_level=3 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding encrypt_then_mac extension" \
|
|
|
|
|
-S "found encrypt then mac extension" \
|
|
|
|
|
-S "server hello, adding encrypt then mac extension" \
|
|
|
|
|
-C "found encrypt_then_mac extension" \
|
|
|
|
|
-C "using encrypt then mac" \
|
|
|
|
|
-S "using encrypt then mac"
|
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2014-10-27 12:57:03 +00:00
|
|
|
|
run_test "Encrypt then MAC: client SSLv3, server enabled" \
|
2015-01-14 16:20:46 +00:00
|
|
|
|
"$P_SRV debug_level=3 min_version=ssl3 \
|
2014-10-28 12:08:59 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2014-10-27 12:57:03 +00:00
|
|
|
|
"$P_CLI debug_level=3 force_version=ssl3" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding encrypt_then_mac extension" \
|
|
|
|
|
-S "found encrypt then mac extension" \
|
|
|
|
|
-S "server hello, adding encrypt then mac extension" \
|
|
|
|
|
-C "found encrypt_then_mac extension" \
|
|
|
|
|
-C "using encrypt then mac" \
|
|
|
|
|
-S "using encrypt then mac"
|
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2014-10-27 12:57:03 +00:00
|
|
|
|
run_test "Encrypt then MAC: client enabled, server SSLv3" \
|
2014-10-28 12:08:59 +00:00
|
|
|
|
"$P_SRV debug_level=3 force_version=ssl3 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2015-01-14 16:20:46 +00:00
|
|
|
|
"$P_CLI debug_level=3 min_version=ssl3" \
|
2014-10-27 12:57:03 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding encrypt_then_mac extension" \
|
2016-05-06 12:48:23 +00:00
|
|
|
|
-S "found encrypt then mac extension" \
|
2014-10-27 12:57:03 +00:00
|
|
|
|
-S "server hello, adding encrypt then mac extension" \
|
|
|
|
|
-C "found encrypt_then_mac extension" \
|
|
|
|
|
-C "using encrypt then mac" \
|
|
|
|
|
-S "using encrypt then mac"
|
|
|
|
|
|
2014-10-20 16:40:56 +00:00
|
|
|
|
# Tests for Extended Master Secret extension
|
|
|
|
|
|
|
|
|
|
run_test "Extended Master Secret: default" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding extended_master_secret extension" \
|
|
|
|
|
-s "found extended master secret extension" \
|
|
|
|
|
-s "server hello, adding extended master secret extension" \
|
|
|
|
|
-c "found extended_master_secret extension" \
|
|
|
|
|
-c "using extended master secret" \
|
|
|
|
|
-s "using extended master secret"
|
|
|
|
|
|
|
|
|
|
run_test "Extended Master Secret: client enabled, server disabled" \
|
|
|
|
|
"$P_SRV debug_level=3 extended_ms=0" \
|
|
|
|
|
"$P_CLI debug_level=3 extended_ms=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding extended_master_secret extension" \
|
|
|
|
|
-s "found extended master secret extension" \
|
|
|
|
|
-S "server hello, adding extended master secret extension" \
|
|
|
|
|
-C "found extended_master_secret extension" \
|
|
|
|
|
-C "using extended master secret" \
|
|
|
|
|
-S "using extended master secret"
|
|
|
|
|
|
|
|
|
|
run_test "Extended Master Secret: client disabled, server enabled" \
|
|
|
|
|
"$P_SRV debug_level=3 extended_ms=1" \
|
|
|
|
|
"$P_CLI debug_level=3 extended_ms=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding extended_master_secret extension" \
|
|
|
|
|
-S "found extended master secret extension" \
|
|
|
|
|
-S "server hello, adding extended master secret extension" \
|
|
|
|
|
-C "found extended_master_secret extension" \
|
|
|
|
|
-C "using extended master secret" \
|
|
|
|
|
-S "using extended master secret"
|
2014-10-24 13:12:31 +00:00
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2014-10-24 13:12:31 +00:00
|
|
|
|
run_test "Extended Master Secret: client SSLv3, server enabled" \
|
2015-01-14 16:20:46 +00:00
|
|
|
|
"$P_SRV debug_level=3 min_version=ssl3" \
|
2014-10-24 13:12:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 force_version=ssl3" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding extended_master_secret extension" \
|
|
|
|
|
-S "found extended master secret extension" \
|
|
|
|
|
-S "server hello, adding extended master secret extension" \
|
|
|
|
|
-C "found extended_master_secret extension" \
|
|
|
|
|
-C "using extended master secret" \
|
|
|
|
|
-S "using extended master secret"
|
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2014-10-24 13:12:31 +00:00
|
|
|
|
run_test "Extended Master Secret: client enabled, server SSLv3" \
|
|
|
|
|
"$P_SRV debug_level=3 force_version=ssl3" \
|
2015-01-14 16:20:46 +00:00
|
|
|
|
"$P_CLI debug_level=3 min_version=ssl3" \
|
2014-10-24 13:12:31 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding extended_master_secret extension" \
|
2016-05-06 12:48:23 +00:00
|
|
|
|
-S "found extended master secret extension" \
|
2014-10-24 13:12:31 +00:00
|
|
|
|
-S "server hello, adding extended master secret extension" \
|
|
|
|
|
-C "found extended_master_secret extension" \
|
|
|
|
|
-C "using extended master secret" \
|
|
|
|
|
-S "using extended master secret"
|
2014-10-20 16:40:56 +00:00
|
|
|
|
|
2014-10-20 11:34:59 +00:00
|
|
|
|
# Tests for FALLBACK_SCSV
|
|
|
|
|
|
|
|
|
|
run_test "Fallback SCSV: default" \
|
2015-08-04 10:44:10 +00:00
|
|
|
|
"$P_SRV debug_level=2" \
|
2014-10-20 11:34:59 +00:00
|
|
|
|
"$P_CLI debug_level=3 force_version=tls1_1" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "adding FALLBACK_SCSV" \
|
2014-10-20 12:05:28 +00:00
|
|
|
|
-S "received FALLBACK_SCSV" \
|
|
|
|
|
-S "inapropriate fallback" \
|
2014-10-20 11:34:59 +00:00
|
|
|
|
-C "is a fatal alert message (msg 86)"
|
|
|
|
|
|
|
|
|
|
run_test "Fallback SCSV: explicitly disabled" \
|
2015-08-04 10:44:10 +00:00
|
|
|
|
"$P_SRV debug_level=2" \
|
2014-10-20 11:34:59 +00:00
|
|
|
|
"$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "adding FALLBACK_SCSV" \
|
2014-10-20 12:05:28 +00:00
|
|
|
|
-S "received FALLBACK_SCSV" \
|
|
|
|
|
-S "inapropriate fallback" \
|
2014-10-20 11:34:59 +00:00
|
|
|
|
-C "is a fatal alert message (msg 86)"
|
|
|
|
|
|
|
|
|
|
run_test "Fallback SCSV: enabled" \
|
2015-08-04 10:44:10 +00:00
|
|
|
|
"$P_SRV debug_level=2" \
|
2014-10-20 11:34:59 +00:00
|
|
|
|
"$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \
|
2014-10-20 12:05:28 +00:00
|
|
|
|
1 \
|
|
|
|
|
-c "adding FALLBACK_SCSV" \
|
|
|
|
|
-s "received FALLBACK_SCSV" \
|
|
|
|
|
-s "inapropriate fallback" \
|
|
|
|
|
-c "is a fatal alert message (msg 86)"
|
|
|
|
|
|
|
|
|
|
run_test "Fallback SCSV: enabled, max version" \
|
2015-08-04 10:44:10 +00:00
|
|
|
|
"$P_SRV debug_level=2" \
|
2014-10-20 12:05:28 +00:00
|
|
|
|
"$P_CLI debug_level=3 fallback=1" \
|
2014-10-20 11:34:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "adding FALLBACK_SCSV" \
|
2014-10-20 12:05:28 +00:00
|
|
|
|
-s "received FALLBACK_SCSV" \
|
|
|
|
|
-S "inapropriate fallback" \
|
2014-10-20 11:34:59 +00:00
|
|
|
|
-C "is a fatal alert message (msg 86)"
|
|
|
|
|
|
|
|
|
|
requires_openssl_with_fallback_scsv
|
|
|
|
|
run_test "Fallback SCSV: default, openssl server" \
|
|
|
|
|
"$O_SRV" \
|
|
|
|
|
"$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "adding FALLBACK_SCSV" \
|
|
|
|
|
-C "is a fatal alert message (msg 86)"
|
|
|
|
|
|
|
|
|
|
requires_openssl_with_fallback_scsv
|
|
|
|
|
run_test "Fallback SCSV: enabled, openssl server" \
|
|
|
|
|
"$O_SRV" \
|
|
|
|
|
"$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \
|
|
|
|
|
1 \
|
|
|
|
|
-c "adding FALLBACK_SCSV" \
|
|
|
|
|
-c "is a fatal alert message (msg 86)"
|
|
|
|
|
|
2014-10-20 12:05:28 +00:00
|
|
|
|
requires_openssl_with_fallback_scsv
|
|
|
|
|
run_test "Fallback SCSV: disabled, openssl client" \
|
2015-08-04 10:44:10 +00:00
|
|
|
|
"$P_SRV debug_level=2" \
|
2014-10-20 12:05:28 +00:00
|
|
|
|
"$O_CLI -tls1_1" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "received FALLBACK_SCSV" \
|
|
|
|
|
-S "inapropriate fallback"
|
|
|
|
|
|
|
|
|
|
requires_openssl_with_fallback_scsv
|
|
|
|
|
run_test "Fallback SCSV: enabled, openssl client" \
|
2015-08-04 10:44:10 +00:00
|
|
|
|
"$P_SRV debug_level=2" \
|
2014-10-20 12:05:28 +00:00
|
|
|
|
"$O_CLI -tls1_1 -fallback_scsv" \
|
|
|
|
|
1 \
|
|
|
|
|
-s "received FALLBACK_SCSV" \
|
|
|
|
|
-s "inapropriate fallback"
|
|
|
|
|
|
|
|
|
|
requires_openssl_with_fallback_scsv
|
|
|
|
|
run_test "Fallback SCSV: enabled, max version, openssl client" \
|
2015-08-04 10:44:10 +00:00
|
|
|
|
"$P_SRV debug_level=2" \
|
2014-10-20 12:05:28 +00:00
|
|
|
|
"$O_CLI -fallback_scsv" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "received FALLBACK_SCSV" \
|
|
|
|
|
-S "inapropriate fallback"
|
|
|
|
|
|
2018-07-10 19:08:04 +00:00
|
|
|
|
# Test sending and receiving empty application data records
|
|
|
|
|
|
|
|
|
|
run_test "Encrypt then MAC: empty application data record" \
|
|
|
|
|
"$P_SRV auth_mode=none debug_level=4 etm=1" \
|
|
|
|
|
"$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \
|
|
|
|
|
-s "dumping 'input payload after decrypt' (0 bytes)" \
|
|
|
|
|
-c "0 bytes written in 1 fragments"
|
|
|
|
|
|
|
|
|
|
run_test "Default, no Encrypt then MAC: empty application data record" \
|
|
|
|
|
"$P_SRV auth_mode=none debug_level=4 etm=0" \
|
|
|
|
|
"$P_CLI auth_mode=none etm=0 request_size=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "dumping 'input payload after decrypt' (0 bytes)" \
|
|
|
|
|
-c "0 bytes written in 1 fragments"
|
|
|
|
|
|
|
|
|
|
run_test "Encrypt then MAC, DTLS: empty application data record" \
|
|
|
|
|
"$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \
|
|
|
|
|
"$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \
|
|
|
|
|
-s "dumping 'input payload after decrypt' (0 bytes)" \
|
|
|
|
|
-c "0 bytes written in 1 fragments"
|
|
|
|
|
|
|
|
|
|
run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \
|
|
|
|
|
"$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \
|
|
|
|
|
"$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "dumping 'input payload after decrypt' (0 bytes)" \
|
|
|
|
|
-c "0 bytes written in 1 fragments"
|
|
|
|
|
|
2017-05-16 15:53:03 +00:00
|
|
|
|
## ClientHello generated with
|
|
|
|
|
## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..."
|
|
|
|
|
## then manually twiddling the ciphersuite list.
|
|
|
|
|
## The ClientHello content is spelled out below as a hex string as
|
|
|
|
|
## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix".
|
|
|
|
|
## The expected response is an inappropriate_fallback alert.
|
|
|
|
|
requires_openssl_with_fallback_scsv
|
|
|
|
|
run_test "Fallback SCSV: beginning of list" \
|
|
|
|
|
"$P_SRV debug_level=2" \
|
|
|
|
|
"$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "received FALLBACK_SCSV" \
|
|
|
|
|
-s "inapropriate fallback"
|
|
|
|
|
|
|
|
|
|
requires_openssl_with_fallback_scsv
|
|
|
|
|
run_test "Fallback SCSV: end of list" \
|
|
|
|
|
"$P_SRV debug_level=2" \
|
|
|
|
|
"$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "received FALLBACK_SCSV" \
|
|
|
|
|
-s "inapropriate fallback"
|
|
|
|
|
|
|
|
|
|
## Here the expected response is a valid ServerHello prefix, up to the random.
|
|
|
|
|
requires_openssl_with_fallback_scsv
|
|
|
|
|
run_test "Fallback SCSV: not in list" \
|
|
|
|
|
"$P_SRV debug_level=2" \
|
|
|
|
|
"$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "received FALLBACK_SCSV" \
|
|
|
|
|
-S "inapropriate fallback"
|
|
|
|
|
|
2015-01-08 10:15:09 +00:00
|
|
|
|
# Tests for CBC 1/n-1 record splitting
|
|
|
|
|
|
|
|
|
|
run_test "CBC Record splitting: TLS 1.2, no splitting" \
|
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
request_size=123 force_version=tls1_2" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 123 bytes read" \
|
|
|
|
|
-S "Read from client: 1 bytes read" \
|
|
|
|
|
-S "122 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "CBC Record splitting: TLS 1.1, no splitting" \
|
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
request_size=123 force_version=tls1_1" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 123 bytes read" \
|
|
|
|
|
-S "Read from client: 1 bytes read" \
|
|
|
|
|
-S "122 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "CBC Record splitting: TLS 1.0, splitting" \
|
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
request_size=123 force_version=tls1" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "Read from client: 123 bytes read" \
|
|
|
|
|
-s "Read from client: 1 bytes read" \
|
|
|
|
|
-s "122 bytes read"
|
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2015-01-08 10:15:09 +00:00
|
|
|
|
run_test "CBC Record splitting: SSLv3, splitting" \
|
2015-01-14 16:20:46 +00:00
|
|
|
|
"$P_SRV min_version=ssl3" \
|
2015-01-08 10:15:09 +00:00
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
request_size=123 force_version=ssl3" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "Read from client: 123 bytes read" \
|
|
|
|
|
-s "Read from client: 1 bytes read" \
|
|
|
|
|
-s "122 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "CBC Record splitting: TLS 1.0 RC4, no splitting" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2015-01-08 10:15:09 +00:00
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \
|
|
|
|
|
request_size=123 force_version=tls1" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 123 bytes read" \
|
|
|
|
|
-S "Read from client: 1 bytes read" \
|
|
|
|
|
-S "122 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "CBC Record splitting: TLS 1.0, splitting disabled" \
|
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
request_size=123 force_version=tls1 recsplit=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 123 bytes read" \
|
|
|
|
|
-S "Read from client: 1 bytes read" \
|
|
|
|
|
-S "122 bytes read"
|
|
|
|
|
|
2015-01-13 19:56:15 +00:00
|
|
|
|
run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \
|
|
|
|
|
"$P_SRV nbio=2" \
|
|
|
|
|
"$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
request_size=123 force_version=tls1" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "Read from client: 123 bytes read" \
|
|
|
|
|
-s "Read from client: 1 bytes read" \
|
|
|
|
|
-s "122 bytes read"
|
|
|
|
|
|
2014-02-20 16:19:59 +00:00
|
|
|
|
# Tests for Session Tickets
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using tickets: basic" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=1" \
|
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
2014-02-20 10:43:46 +00:00
|
|
|
|
0 \
|
2014-02-20 21:50:56 +00:00
|
|
|
|
-c "client hello, adding session ticket extension" \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-s "server hello, adding session ticket extension" \
|
|
|
|
|
-c "found session_ticket extension" \
|
|
|
|
|
-c "parse new session ticket" \
|
2014-02-20 10:43:46 +00:00
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-s "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using tickets: cache disabled" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=1 cache_max=0" \
|
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
2014-02-21 08:18:13 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding session ticket extension" \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-s "server hello, adding session ticket extension" \
|
|
|
|
|
-c "found session_ticket extension" \
|
|
|
|
|
-c "parse new session ticket" \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-s "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using tickets: timeout" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \
|
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1 reco_delay=2" \
|
2014-02-21 08:18:13 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding session ticket extension" \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-s "server hello, adding session ticket extension" \
|
|
|
|
|
-c "found session_ticket extension" \
|
|
|
|
|
-c "parse new session ticket" \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-S "a session has been resumed" \
|
|
|
|
|
-C "a session has been resumed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using tickets: openssl server" \
|
2014-02-27 11:25:54 +00:00
|
|
|
|
"$O_SRV" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
2014-02-25 16:14:15 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding session ticket extension" \
|
|
|
|
|
-c "found session_ticket extension" \
|
|
|
|
|
-c "parse new session ticket" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using tickets: openssl client" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=1" \
|
2014-05-28 21:06:50 +00:00
|
|
|
|
"( $O_CLI -sess_out $SESSION; \
|
|
|
|
|
$O_CLI -sess_in $SESSION; \
|
|
|
|
|
rm -f $SESSION )" \
|
2014-02-25 16:14:15 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-s "server hello, adding session ticket extension" \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-s "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed"
|
|
|
|
|
|
2018-08-21 12:55:22 +00:00
|
|
|
|
# Tests for Session Tickets with DTLS
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using tickets, DTLS: basic" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 tickets=1" \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
"$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding session ticket extension" \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-s "server hello, adding session ticket extension" \
|
|
|
|
|
-c "found session_ticket extension" \
|
|
|
|
|
-c "parse new session ticket" \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-s "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using tickets, DTLS: cache disabled" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
"$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding session ticket extension" \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-s "server hello, adding session ticket extension" \
|
|
|
|
|
-c "found session_ticket extension" \
|
|
|
|
|
-c "parse new session ticket" \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-s "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using tickets, DTLS: timeout" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
"$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_delay=2" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding session ticket extension" \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-s "server hello, adding session ticket extension" \
|
|
|
|
|
-c "found session_ticket extension" \
|
|
|
|
|
-c "parse new session ticket" \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-S "a session has been resumed" \
|
|
|
|
|
-C "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using tickets, DTLS: openssl server" \
|
|
|
|
|
"$O_SRV -dtls1" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding session ticket extension" \
|
|
|
|
|
-c "found session_ticket extension" \
|
|
|
|
|
-c "parse new session ticket" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using tickets, DTLS: openssl client" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=1" \
|
|
|
|
|
"( $O_CLI -dtls1 -sess_out $SESSION; \
|
|
|
|
|
$O_CLI -dtls1 -sess_in $SESSION; \
|
|
|
|
|
rm -f $SESSION )" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-s "server hello, adding session ticket extension" \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-s "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed"
|
|
|
|
|
|
2014-02-20 21:50:56 +00:00
|
|
|
|
# Tests for Session Resume based on session-ID and cache
|
2014-02-20 16:19:59 +00:00
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using cache: tickets enabled on client" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=0" \
|
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
2014-02-20 10:43:46 +00:00
|
|
|
|
0 \
|
2014-02-20 21:50:56 +00:00
|
|
|
|
-c "client hello, adding session ticket extension" \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-S "server hello, adding session ticket extension" \
|
|
|
|
|
-C "found session_ticket extension" \
|
|
|
|
|
-C "parse new session ticket" \
|
2014-02-20 10:43:46 +00:00
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using cache: tickets enabled on server" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=1" \
|
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1" \
|
2014-02-20 10:43:46 +00:00
|
|
|
|
0 \
|
2014-02-20 21:50:56 +00:00
|
|
|
|
-C "client hello, adding session ticket extension" \
|
|
|
|
|
-S "found session ticket extension" \
|
|
|
|
|
-S "server hello, adding session ticket extension" \
|
|
|
|
|
-C "found session_ticket extension" \
|
|
|
|
|
-C "parse new session ticket" \
|
2014-02-20 10:43:46 +00:00
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
2014-02-20 13:50:42 +00:00
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using cache: cache_max=0" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=0 cache_max=0" \
|
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1" \
|
2014-02-20 21:50:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-S "a session has been resumed" \
|
|
|
|
|
-C "a session has been resumed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using cache: cache_max=1" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=0 cache_max=1" \
|
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1" \
|
2014-02-20 21:50:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
2015-05-04 08:55:47 +00:00
|
|
|
|
run_test "Session resume using cache: timeout > delay" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=0" \
|
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=0" \
|
2014-02-20 21:50:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using cache: timeout < delay" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=0 cache_timeout=1" \
|
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2" \
|
2014-02-20 20:32:41 +00:00
|
|
|
|
0 \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
2014-02-20 21:50:56 +00:00
|
|
|
|
-S "a session has been resumed" \
|
|
|
|
|
-C "a session has been resumed"
|
2014-02-20 20:32:41 +00:00
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using cache: no timeout" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=0 cache_timeout=0" \
|
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2" \
|
2014-02-20 20:32:41 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using cache: openssl client" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 tickets=0" \
|
2014-05-28 21:06:50 +00:00
|
|
|
|
"( $O_CLI -sess_out $SESSION; \
|
|
|
|
|
$O_CLI -sess_in $SESSION; \
|
|
|
|
|
rm -f $SESSION )" \
|
2014-02-25 16:57:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-S "server hello, adding session ticket extension" \
|
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Session resume using cache: openssl server" \
|
2014-02-27 11:25:54 +00:00
|
|
|
|
"$O_SRV" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1" \
|
2014-02-25 16:57:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "found session_ticket extension" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
-C "parse new session ticket" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
# Tests for Session Resume based on session-ID and cache, DTLS
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using cache, DTLS: tickets enabled on client" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=0" \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1 skip_close_notify=1" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding session ticket extension" \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-S "server hello, adding session ticket extension" \
|
|
|
|
|
-C "found session_ticket extension" \
|
|
|
|
|
-C "parse new session ticket" \
|
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using cache, DTLS: tickets enabled on server" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=1" \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding session ticket extension" \
|
|
|
|
|
-S "found session ticket extension" \
|
|
|
|
|
-S "server hello, adding session ticket extension" \
|
|
|
|
|
-C "found session_ticket extension" \
|
|
|
|
|
-C "parse new session ticket" \
|
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using cache, DTLS: cache_max=0" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-S "a session has been resumed" \
|
|
|
|
|
-C "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using cache, DTLS: cache_max=1" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using cache, DTLS: timeout > delay" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=0" \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=0" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using cache, DTLS: timeout < delay" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-S "a session has been resumed" \
|
|
|
|
|
-C "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using cache, DTLS: no timeout" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \
|
2018-08-21 12:55:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using cache, DTLS: openssl client" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=0" \
|
|
|
|
|
"( $O_CLI -dtls1 -sess_out $SESSION; \
|
|
|
|
|
$O_CLI -dtls1 -sess_in $SESSION; \
|
|
|
|
|
rm -f $SESSION )" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "found session ticket extension" \
|
|
|
|
|
-S "server hello, adding session ticket extension" \
|
|
|
|
|
-s "session successfully restored from cache" \
|
|
|
|
|
-S "session successfully restored from ticket" \
|
|
|
|
|
-s "a session has been resumed"
|
|
|
|
|
|
|
|
|
|
run_test "Session resume using cache, DTLS: openssl server" \
|
|
|
|
|
"$O_SRV -dtls1" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "found session_ticket extension" \
|
2014-02-25 16:57:59 +00:00
|
|
|
|
-C "parse new session ticket" \
|
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
2014-02-20 16:19:59 +00:00
|
|
|
|
# Tests for Max Fragment Length extension
|
|
|
|
|
|
2017-09-22 15:58:50 +00:00
|
|
|
|
MAX_CONTENT_LEN_EXPECT='16384'
|
|
|
|
|
MAX_CONTENT_LEN_CONFIG=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN)
|
|
|
|
|
|
|
|
|
|
if [ -n "$MAX_CONTENT_LEN_CONFIG" ] && [ "$MAX_CONTENT_LEN_CONFIG" -ne "$MAX_CONTENT_LEN_EXPECT" ]; then
|
|
|
|
|
printf "The ${CONFIG_H} file contains a value for the configuration of\n"
|
|
|
|
|
printf "MBEDTLS_SSL_MAX_CONTENT_LEN that is different from the script’s\n"
|
|
|
|
|
printf "test value of ${MAX_CONTENT_LEN_EXPECT}. \n"
|
|
|
|
|
printf "\n"
|
|
|
|
|
printf "The tests assume this value and if it changes, the tests in this\n"
|
|
|
|
|
printf "script should also be adjusted.\n"
|
|
|
|
|
printf "\n"
|
|
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2017-09-18 14:00:34 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2017-09-18 14:01:50 +00:00
|
|
|
|
run_test "Max fragment length: enabled, default" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
2014-02-20 13:50:42 +00:00
|
|
|
|
0 \
|
2015-08-31 16:30:52 +00:00
|
|
|
|
-c "Maximum fragment length is 16384" \
|
|
|
|
|
-s "Maximum fragment length is 16384" \
|
2014-02-20 13:50:42 +00:00
|
|
|
|
-C "client hello, adding max_fragment_length extension" \
|
|
|
|
|
-S "found max fragment length extension" \
|
|
|
|
|
-S "server hello, max_fragment_length extension" \
|
|
|
|
|
-C "found max_fragment_length extension"
|
|
|
|
|
|
2017-09-18 14:01:50 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
|
|
|
|
run_test "Max fragment length: enabled, default, larger message" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
2017-10-18 13:42:01 +00:00
|
|
|
|
"$P_CLI debug_level=3 request_size=16385" \
|
2017-09-18 14:01:50 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "Maximum fragment length is 16384" \
|
|
|
|
|
-s "Maximum fragment length is 16384" \
|
|
|
|
|
-C "client hello, adding max_fragment_length extension" \
|
|
|
|
|
-S "found max fragment length extension" \
|
|
|
|
|
-S "server hello, max_fragment_length extension" \
|
|
|
|
|
-C "found max_fragment_length extension" \
|
2017-10-18 13:42:01 +00:00
|
|
|
|
-c "16385 bytes written in 2 fragments" \
|
2017-09-18 14:01:50 +00:00
|
|
|
|
-s "16384 bytes read" \
|
2017-10-18 13:42:01 +00:00
|
|
|
|
-s "1 bytes read"
|
2017-09-18 14:01:50 +00:00
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
|
|
|
|
run_test "Max fragment length, DTLS: enabled, default, larger message" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1" \
|
2017-10-18 13:42:01 +00:00
|
|
|
|
"$P_CLI debug_level=3 dtls=1 request_size=16385" \
|
2017-09-18 14:01:50 +00:00
|
|
|
|
1 \
|
|
|
|
|
-c "Maximum fragment length is 16384" \
|
|
|
|
|
-s "Maximum fragment length is 16384" \
|
|
|
|
|
-C "client hello, adding max_fragment_length extension" \
|
|
|
|
|
-S "found max fragment length extension" \
|
|
|
|
|
-S "server hello, max_fragment_length extension" \
|
|
|
|
|
-C "found max_fragment_length extension" \
|
|
|
|
|
-c "fragment larger than.*maximum "
|
|
|
|
|
|
|
|
|
|
requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
|
|
|
|
run_test "Max fragment length: disabled, larger message" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
2017-10-18 13:42:01 +00:00
|
|
|
|
"$P_CLI debug_level=3 request_size=16385" \
|
2017-09-18 14:01:50 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "Maximum fragment length is 16384" \
|
|
|
|
|
-S "Maximum fragment length is 16384" \
|
2017-10-18 13:42:01 +00:00
|
|
|
|
-c "16385 bytes written in 2 fragments" \
|
2017-09-18 14:01:50 +00:00
|
|
|
|
-s "16384 bytes read" \
|
2017-10-18 13:42:01 +00:00
|
|
|
|
-s "1 bytes read"
|
2017-09-18 14:01:50 +00:00
|
|
|
|
|
|
|
|
|
requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
|
|
|
|
run_test "Max fragment length DTLS: disabled, larger message" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1" \
|
2017-10-18 13:42:01 +00:00
|
|
|
|
"$P_CLI debug_level=3 dtls=1 request_size=16385" \
|
2017-09-18 14:01:50 +00:00
|
|
|
|
1 \
|
|
|
|
|
-C "Maximum fragment length is 16384" \
|
|
|
|
|
-S "Maximum fragment length is 16384" \
|
|
|
|
|
-c "fragment larger than.*maximum "
|
|
|
|
|
|
2017-09-18 14:00:34 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Max fragment length: used by client" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=4096" \
|
2014-02-20 13:50:42 +00:00
|
|
|
|
0 \
|
2015-08-31 16:30:52 +00:00
|
|
|
|
-c "Maximum fragment length is 4096" \
|
|
|
|
|
-s "Maximum fragment length is 4096" \
|
2014-02-20 13:50:42 +00:00
|
|
|
|
-c "client hello, adding max_fragment_length extension" \
|
|
|
|
|
-s "found max fragment length extension" \
|
|
|
|
|
-s "server hello, max_fragment_length extension" \
|
|
|
|
|
-c "found max_fragment_length extension"
|
|
|
|
|
|
2017-09-18 14:00:34 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Max fragment length: used by server" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=4096" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
2014-02-20 13:50:42 +00:00
|
|
|
|
0 \
|
2015-08-31 16:30:52 +00:00
|
|
|
|
-c "Maximum fragment length is 16384" \
|
|
|
|
|
-s "Maximum fragment length is 4096" \
|
2014-02-20 13:50:42 +00:00
|
|
|
|
-C "client hello, adding max_fragment_length extension" \
|
|
|
|
|
-S "found max fragment length extension" \
|
|
|
|
|
-S "server hello, max_fragment_length extension" \
|
|
|
|
|
-C "found max_fragment_length extension"
|
2014-02-20 16:19:59 +00:00
|
|
|
|
|
2017-09-18 14:00:34 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2014-08-30 19:42:40 +00:00
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "Max fragment length: gnutls server" \
|
2014-08-20 18:15:53 +00:00
|
|
|
|
"$G_SRV" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=4096" \
|
2014-08-20 18:15:53 +00:00
|
|
|
|
0 \
|
2015-08-31 16:30:52 +00:00
|
|
|
|
-c "Maximum fragment length is 4096" \
|
2014-08-20 18:15:53 +00:00
|
|
|
|
-c "client hello, adding max_fragment_length extension" \
|
|
|
|
|
-c "found max_fragment_length extension"
|
|
|
|
|
|
2017-09-18 14:00:34 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2014-10-13 15:55:52 +00:00
|
|
|
|
run_test "Max fragment length: client, message just fits" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \
|
|
|
|
|
0 \
|
2015-08-31 16:30:52 +00:00
|
|
|
|
-c "Maximum fragment length is 2048" \
|
|
|
|
|
-s "Maximum fragment length is 2048" \
|
2014-10-13 15:55:52 +00:00
|
|
|
|
-c "client hello, adding max_fragment_length extension" \
|
|
|
|
|
-s "found max fragment length extension" \
|
|
|
|
|
-s "server hello, max_fragment_length extension" \
|
|
|
|
|
-c "found max_fragment_length extension" \
|
|
|
|
|
-c "2048 bytes written in 1 fragments" \
|
|
|
|
|
-s "2048 bytes read"
|
|
|
|
|
|
2017-09-18 14:00:34 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2014-10-13 15:55:52 +00:00
|
|
|
|
run_test "Max fragment length: client, larger message" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \
|
|
|
|
|
0 \
|
2015-08-31 16:30:52 +00:00
|
|
|
|
-c "Maximum fragment length is 2048" \
|
|
|
|
|
-s "Maximum fragment length is 2048" \
|
2014-10-13 15:55:52 +00:00
|
|
|
|
-c "client hello, adding max_fragment_length extension" \
|
|
|
|
|
-s "found max fragment length extension" \
|
|
|
|
|
-s "server hello, max_fragment_length extension" \
|
|
|
|
|
-c "found max_fragment_length extension" \
|
|
|
|
|
-c "2345 bytes written in 2 fragments" \
|
|
|
|
|
-s "2048 bytes read" \
|
|
|
|
|
-s "297 bytes read"
|
|
|
|
|
|
2017-09-18 14:00:34 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2015-01-21 14:37:13 +00:00
|
|
|
|
run_test "Max fragment length: DTLS client, larger message" \
|
2014-10-13 15:55:52 +00:00
|
|
|
|
"$P_SRV debug_level=3 dtls=1" \
|
|
|
|
|
"$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \
|
|
|
|
|
1 \
|
2015-08-31 16:30:52 +00:00
|
|
|
|
-c "Maximum fragment length is 2048" \
|
|
|
|
|
-s "Maximum fragment length is 2048" \
|
2014-10-13 15:55:52 +00:00
|
|
|
|
-c "client hello, adding max_fragment_length extension" \
|
|
|
|
|
-s "found max fragment length extension" \
|
|
|
|
|
-s "server hello, max_fragment_length extension" \
|
|
|
|
|
-c "found max_fragment_length extension" \
|
|
|
|
|
-c "fragment larger than.*maximum"
|
|
|
|
|
|
2014-02-20 16:19:59 +00:00
|
|
|
|
# Tests for renegotiation
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
# Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: none, for reference" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-S "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
2014-02-26 15:35:27 +00:00
|
|
|
|
-C "=> renegotiate" \
|
|
|
|
|
-S "=> renegotiate" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
-S "write hello request"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: client-initiated" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
2014-02-26 15:35:27 +00:00
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
-S "write hello request"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: server-initiated" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
2014-02-26 15:35:27 +00:00
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
-s "write hello request"
|
|
|
|
|
|
2017-10-05 11:29:42 +00:00
|
|
|
|
# Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that
|
|
|
|
|
# the server did not parse the Signature Algorithm extension. This test is valid only if an MD
|
|
|
|
|
# algorithm stronger than SHA-1 is enabled in config.h
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2017-10-05 11:29:42 +00:00
|
|
|
|
run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \
|
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \
|
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-S "write hello request" \
|
|
|
|
|
-S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated?
|
|
|
|
|
|
|
|
|
|
# Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that
|
|
|
|
|
# the server did not parse the Signature Algorithm extension. This test is valid only if an MD
|
|
|
|
|
# algorithm stronger than SHA-1 is enabled in config.h
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2017-10-05 11:29:42 +00:00
|
|
|
|
run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \
|
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \
|
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-s "write hello request" \
|
|
|
|
|
-S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated?
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: double" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
2014-02-26 15:35:27 +00:00
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
-s "write hello request"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: client-initiated, server-rejected" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
1 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-S "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
2014-02-26 15:35:27 +00:00
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-S "=> renegotiate" \
|
2014-07-04 12:32:27 +00:00
|
|
|
|
-S "write hello request" \
|
2014-08-19 10:50:30 +00:00
|
|
|
|
-c "SSL - Unexpected message at ServerHello in renegotiation" \
|
2014-07-04 12:32:27 +00:00
|
|
|
|
-c "failed"
|
2014-02-20 16:19:59 +00:00
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: server-initiated, client-rejected, default" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=0" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-S "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
2014-02-26 15:35:27 +00:00
|
|
|
|
-C "=> renegotiate" \
|
|
|
|
|
-S "=> renegotiate" \
|
2014-02-20 16:19:59 +00:00
|
|
|
|
-s "write hello request" \
|
2014-07-03 17:29:16 +00:00
|
|
|
|
-S "SSL - An unexpected message was received from our peer" \
|
|
|
|
|
-S "failed"
|
2014-02-21 08:47:37 +00:00
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: server-initiated, client-rejected, not enforced" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
renego_delay=-1 auth_mode=optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=0" \
|
2014-07-04 12:32:27 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-S "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-C "=> renegotiate" \
|
|
|
|
|
-S "=> renegotiate" \
|
|
|
|
|
-s "write hello request" \
|
|
|
|
|
-S "SSL - An unexpected message was received from our peer" \
|
|
|
|
|
-S "failed"
|
|
|
|
|
|
2014-08-15 10:07:38 +00:00
|
|
|
|
# delay 2 for 1 alert record + 1 application data record
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: server-initiated, client-rejected, delay 2" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
renego_delay=2 auth_mode=optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=0" \
|
2014-07-04 12:32:27 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-S "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-C "=> renegotiate" \
|
|
|
|
|
-S "=> renegotiate" \
|
|
|
|
|
-s "write hello request" \
|
|
|
|
|
-S "SSL - An unexpected message was received from our peer" \
|
|
|
|
|
-S "failed"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: server-initiated, client-rejected, delay 0" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
renego_delay=0 auth_mode=optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=0" \
|
2014-07-04 12:32:27 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-S "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-C "=> renegotiate" \
|
|
|
|
|
-S "=> renegotiate" \
|
|
|
|
|
-s "write hello request" \
|
2014-08-15 10:07:38 +00:00
|
|
|
|
-s "SSL - An unexpected message was received from our peer"
|
2014-07-04 12:32:27 +00:00
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: server-initiated, client-accepted, delay 0" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
renego_delay=0 auth_mode=optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1" \
|
2014-07-04 12:32:27 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-s "write hello request" \
|
|
|
|
|
-S "SSL - An unexpected message was received from our peer" \
|
|
|
|
|
-S "failed"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-11-05 13:23:03 +00:00
|
|
|
|
run_test "Renegotiation: periodic, just below period" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \
|
2014-11-05 13:23:03 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-S "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-S "record counter limit reached: renegotiate" \
|
|
|
|
|
-C "=> renegotiate" \
|
|
|
|
|
-S "=> renegotiate" \
|
|
|
|
|
-S "write hello request" \
|
|
|
|
|
-S "SSL - An unexpected message was received from our peer" \
|
|
|
|
|
-S "failed"
|
|
|
|
|
|
2015-01-14 13:41:58 +00:00
|
|
|
|
# one extra exchange to be able to complete renego
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-11-05 13:23:03 +00:00
|
|
|
|
run_test "Renegotiation: periodic, just above period" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \
|
2015-01-14 13:41:58 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=4 renegotiation=1" \
|
2014-11-05 13:23:03 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-s "record counter limit reached: renegotiate" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-s "write hello request" \
|
|
|
|
|
-S "SSL - An unexpected message was received from our peer" \
|
|
|
|
|
-S "failed"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-11-05 13:23:03 +00:00
|
|
|
|
run_test "Renegotiation: periodic, two times period" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \
|
2015-01-14 13:41:58 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=7 renegotiation=1" \
|
2014-11-05 13:23:03 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-s "record counter limit reached: renegotiate" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-s "write hello request" \
|
|
|
|
|
-S "SSL - An unexpected message was received from our peer" \
|
|
|
|
|
-S "failed"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-11-05 13:23:03 +00:00
|
|
|
|
run_test "Renegotiation: periodic, above period, disabled" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \
|
2014-11-05 13:23:03 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=4 renegotiation=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-S "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-S "record counter limit reached: renegotiate" \
|
|
|
|
|
-C "=> renegotiate" \
|
|
|
|
|
-S "=> renegotiate" \
|
|
|
|
|
-S "write hello request" \
|
|
|
|
|
-S "SSL - An unexpected message was received from our peer" \
|
|
|
|
|
-S "failed"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: nbio, client-initiated" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \
|
2014-08-15 17:04:47 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-S "write hello request"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: nbio, server-initiated" \
|
2015-03-27 16:52:25 +00:00
|
|
|
|
"$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1" \
|
2014-08-15 17:04:47 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-s "write hello request"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Renegotiation: openssl server, client-initiated" \
|
2014-08-31 16:37:01 +00:00
|
|
|
|
"$O_SRV -www" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \
|
2014-08-30 19:22:47 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
2014-11-03 19:10:36 +00:00
|
|
|
|
-C "ssl_hanshake() returned" \
|
2014-08-30 19:22:47 +00:00
|
|
|
|
-C "error" \
|
|
|
|
|
-c "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
|
2015-02-08 15:18:35 +00:00
|
|
|
|
requires_gnutls
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-11-03 19:10:36 +00:00
|
|
|
|
run_test "Renegotiation: gnutls server strict, client-initiated" \
|
|
|
|
|
"$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \
|
2014-08-30 19:22:47 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
2014-11-03 19:10:36 +00:00
|
|
|
|
-C "ssl_hanshake() returned" \
|
2014-08-30 19:22:47 +00:00
|
|
|
|
-C "error" \
|
|
|
|
|
-c "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
|
2015-02-08 15:18:35 +00:00
|
|
|
|
requires_gnutls
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-11-03 19:10:36 +00:00
|
|
|
|
run_test "Renegotiation: gnutls server unsafe, client-initiated default" \
|
|
|
|
|
"$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \
|
|
|
|
|
"$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \
|
|
|
|
|
1 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-C "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-c "mbedtls_ssl_handshake() returned" \
|
2014-11-03 19:10:36 +00:00
|
|
|
|
-c "error" \
|
|
|
|
|
-C "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
|
2015-02-08 15:18:35 +00:00
|
|
|
|
requires_gnutls
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-11-03 19:10:36 +00:00
|
|
|
|
run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \
|
|
|
|
|
"$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \
|
|
|
|
|
"$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \
|
|
|
|
|
allow_legacy=0" \
|
|
|
|
|
1 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-C "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-c "mbedtls_ssl_handshake() returned" \
|
2014-11-03 19:10:36 +00:00
|
|
|
|
-c "error" \
|
|
|
|
|
-C "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
|
2015-02-08 15:18:35 +00:00
|
|
|
|
requires_gnutls
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-11-03 19:10:36 +00:00
|
|
|
|
run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \
|
|
|
|
|
"$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \
|
|
|
|
|
"$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \
|
|
|
|
|
allow_legacy=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-C "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-C "ssl_hanshake() returned" \
|
2014-08-30 19:22:47 +00:00
|
|
|
|
-C "error" \
|
|
|
|
|
-c "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-19 15:43:50 +00:00
|
|
|
|
run_test "Renegotiation: DTLS, client-initiated" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \
|
|
|
|
|
"$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-S "write hello request"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-19 15:53:11 +00:00
|
|
|
|
run_test "Renegotiation: DTLS, server-initiated" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \
|
2014-10-02 12:17:18 +00:00
|
|
|
|
"$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \
|
|
|
|
|
read_timeout=1000 max_resend=2" \
|
2014-08-19 15:53:11 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-s "write hello request"
|
|
|
|
|
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2017-01-19 16:30:57 +00:00
|
|
|
|
run_test "Renegotiation: DTLS, renego_period overflow" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \
|
|
|
|
|
"$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
|
|
|
|
-s "record counter limit reached: renegotiate" \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
2017-10-12 14:18:45 +00:00
|
|
|
|
-s "write hello request"
|
2017-01-19 16:30:57 +00:00
|
|
|
|
|
2015-02-17 16:02:37 +00:00
|
|
|
|
requires_gnutls
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-08-31 15:13:13 +00:00
|
|
|
|
run_test "Renegotiation: DTLS, gnutls server, client-initiated" \
|
|
|
|
|
"$G_SRV -u --mtu 4096" \
|
|
|
|
|
"$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-08-31 15:13:13 +00:00
|
|
|
|
-C "error" \
|
|
|
|
|
-s "Extra-header:"
|
|
|
|
|
|
2014-11-03 19:10:36 +00:00
|
|
|
|
# Test for the "secure renegotation" extension only (no actual renegotiation)
|
|
|
|
|
|
2015-02-08 15:18:35 +00:00
|
|
|
|
requires_gnutls
|
2014-11-03 19:10:36 +00:00
|
|
|
|
run_test "Renego ext: gnutls server strict, client default" \
|
|
|
|
|
"$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-C "error" \
|
|
|
|
|
-c "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
|
2015-02-08 15:18:35 +00:00
|
|
|
|
requires_gnutls
|
2014-11-03 19:10:36 +00:00
|
|
|
|
run_test "Renego ext: gnutls server unsafe, client default" \
|
|
|
|
|
"$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "found renegotiation extension" \
|
2014-08-30 19:22:47 +00:00
|
|
|
|
-C "error" \
|
|
|
|
|
-c "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
|
2015-02-08 15:18:35 +00:00
|
|
|
|
requires_gnutls
|
2014-11-03 19:10:36 +00:00
|
|
|
|
run_test "Renego ext: gnutls server unsafe, client break legacy" \
|
|
|
|
|
"$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \
|
|
|
|
|
"$P_CLI debug_level=3 allow_legacy=-1" \
|
|
|
|
|
1 \
|
|
|
|
|
-C "found renegotiation extension" \
|
|
|
|
|
-c "error" \
|
|
|
|
|
-C "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
|
2015-02-08 15:18:35 +00:00
|
|
|
|
requires_gnutls
|
2014-11-03 19:10:36 +00:00
|
|
|
|
run_test "Renego ext: gnutls client strict, server default" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \
|
|
|
|
|
-s "server hello, secure renegotiation extension"
|
|
|
|
|
|
2015-02-08 15:18:35 +00:00
|
|
|
|
requires_gnutls
|
2014-11-03 19:10:36 +00:00
|
|
|
|
run_test "Renego ext: gnutls client unsafe, server default" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \
|
|
|
|
|
-S "server hello, secure renegotiation extension"
|
|
|
|
|
|
2015-02-08 15:18:35 +00:00
|
|
|
|
requires_gnutls
|
2014-11-03 19:10:36 +00:00
|
|
|
|
run_test "Renego ext: gnutls client unsafe, server break legacy" \
|
|
|
|
|
"$P_SRV debug_level=3 allow_legacy=-1" \
|
|
|
|
|
"$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \
|
|
|
|
|
1 \
|
|
|
|
|
-S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \
|
|
|
|
|
-S "server hello, secure renegotiation extension"
|
|
|
|
|
|
2016-02-17 10:11:21 +00:00
|
|
|
|
# Tests for silently dropping trailing extra bytes in .der certificates
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DER format: no trailing bytes" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5-der0.crt \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
"$G_CLI " \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DER format: with a trailing zero byte" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5-der1a.crt \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
"$G_CLI " \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DER format: with a trailing random byte" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5-der1b.crt \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
"$G_CLI " \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DER format: with 2 trailing random bytes" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5-der2.crt \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
"$G_CLI " \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DER format: with 4 trailing random bytes" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5-der4.crt \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
"$G_CLI " \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DER format: with 8 trailing random bytes" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5-der8.crt \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
"$G_CLI " \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DER format: with 9 trailing random bytes" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5-der9.crt \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
"$G_CLI " \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
2014-02-21 11:12:23 +00:00
|
|
|
|
# Tests for auth_mode
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Authentication: server badcert, client required" \
|
2014-02-25 13:18:30 +00:00
|
|
|
|
"$P_SRV crt_file=data_files/server5-badsign.crt \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
key_file=data_files/server5.key" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1 auth_mode=required" \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
1 \
|
|
|
|
|
-c "x509_verify_cert() returned" \
|
2015-04-20 09:56:18 +00:00
|
|
|
|
-c "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
-c "X509 - Certificate verification failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Authentication: server badcert, client optional" \
|
2014-02-25 13:18:30 +00:00
|
|
|
|
"$P_SRV crt_file=data_files/server5-badsign.crt \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
key_file=data_files/server5.key" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1 auth_mode=optional" \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "x509_verify_cert() returned" \
|
2015-04-20 09:56:18 +00:00
|
|
|
|
-c "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
-C "X509 - Certificate verification failed"
|
|
|
|
|
|
2017-05-15 15:05:15 +00:00
|
|
|
|
run_test "Authentication: server goodcert, client optional, no trusted CA" \
|
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "x509_verify_cert() returned" \
|
|
|
|
|
-c "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
|
-c "! Certificate verification flags"\
|
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "X509 - Certificate verification failed" \
|
|
|
|
|
-C "SSL - No CA Chain is set, but required to operate"
|
|
|
|
|
|
|
|
|
|
run_test "Authentication: server goodcert, client required, no trusted CA" \
|
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \
|
|
|
|
|
1 \
|
|
|
|
|
-c "x509_verify_cert() returned" \
|
|
|
|
|
-c "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
|
-c "! Certificate verification flags"\
|
|
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "SSL - No CA Chain is set, but required to operate"
|
|
|
|
|
|
|
|
|
|
# The purpose of the next two tests is to test the client's behaviour when receiving a server
|
|
|
|
|
# certificate with an unsupported elliptic curve. This should usually not happen because
|
|
|
|
|
# the client informs the server about the supported curves - it does, though, in the
|
|
|
|
|
# corner case of a static ECDH suite, because the server doesn't check the curve on that
|
|
|
|
|
# occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a
|
|
|
|
|
# different means to have the server ignoring the client's supported curve list.
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_ECP_C
|
|
|
|
|
run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \
|
|
|
|
|
"$P_SRV debug_level=1 key_file=data_files/server5.key \
|
|
|
|
|
crt_file=data_files/server5.ku-ka.crt" \
|
|
|
|
|
"$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \
|
|
|
|
|
1 \
|
|
|
|
|
-c "bad certificate (EC key curve)"\
|
|
|
|
|
-c "! Certificate verification flags"\
|
|
|
|
|
-C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_ECP_C
|
|
|
|
|
run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \
|
|
|
|
|
"$P_SRV debug_level=1 key_file=data_files/server5.key \
|
|
|
|
|
crt_file=data_files/server5.ku-ka.crt" \
|
|
|
|
|
"$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \
|
|
|
|
|
1 \
|
|
|
|
|
-c "bad certificate (EC key curve)"\
|
|
|
|
|
-c "! Certificate verification flags"\
|
|
|
|
|
-c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Authentication: server badcert, client none" \
|
2014-02-25 13:18:30 +00:00
|
|
|
|
"$P_SRV crt_file=data_files/server5-badsign.crt \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
key_file=data_files/server5.key" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1 auth_mode=none" \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "x509_verify_cert() returned" \
|
2015-04-20 09:56:18 +00:00
|
|
|
|
-C "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
-C "X509 - Certificate verification failed"
|
|
|
|
|
|
2016-10-13 16:21:01 +00:00
|
|
|
|
run_test "Authentication: client SHA256, server required" \
|
|
|
|
|
"$P_SRV auth_mode=required" \
|
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server6.crt \
|
|
|
|
|
key_file=data_files/server6.key \
|
|
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Supported Signature Algorithm found: 4," \
|
|
|
|
|
-c "Supported Signature Algorithm found: 5,"
|
|
|
|
|
|
|
|
|
|
run_test "Authentication: client SHA384, server required" \
|
|
|
|
|
"$P_SRV auth_mode=required" \
|
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server6.crt \
|
|
|
|
|
key_file=data_files/server6.key \
|
|
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Supported Signature Algorithm found: 4," \
|
|
|
|
|
-c "Supported Signature Algorithm found: 5,"
|
|
|
|
|
|
2017-05-03 14:25:07 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
|
|
|
|
run_test "Authentication: client has no cert, server required (SSLv3)" \
|
|
|
|
|
"$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \
|
|
|
|
|
"$P_CLI debug_level=3 force_version=ssl3 crt_file=none \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
1 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-c "got no certificate to send" \
|
|
|
|
|
-S "x509_verify_cert() returned" \
|
|
|
|
|
-s "client has no certificate" \
|
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-s "No client certification received from the client, but required by the authentication mode"
|
|
|
|
|
|
|
|
|
|
run_test "Authentication: client has no cert, server required (TLS)" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=required" \
|
|
|
|
|
"$P_CLI debug_level=3 crt_file=none \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
1 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-c "= write certificate$" \
|
|
|
|
|
-C "skip write certificate$" \
|
|
|
|
|
-S "x509_verify_cert() returned" \
|
|
|
|
|
-s "client has no certificate" \
|
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-s "No client certification received from the client, but required by the authentication mode"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Authentication: client badcert, server required" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 auth_mode=required" \
|
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
1 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify" \
|
|
|
|
|
-s "x509_verify_cert() returned" \
|
2015-06-22 14:50:52 +00:00
|
|
|
|
-s "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
2017-05-03 14:28:34 +00:00
|
|
|
|
-s "send alert level=2 message=48" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
-s "X509 - Certificate verification failed"
|
2017-05-03 14:28:34 +00:00
|
|
|
|
# We don't check that the client receives the alert because it might
|
|
|
|
|
# detect that its write end of the connection is closed and abort
|
|
|
|
|
# before reading the alert message.
|
2014-02-21 11:12:23 +00:00
|
|
|
|
|
2017-04-10 13:34:35 +00:00
|
|
|
|
run_test "Authentication: client cert not trusted, server required" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=required" \
|
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
1 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify" \
|
|
|
|
|
-s "x509_verify_cert() returned" \
|
|
|
|
|
-s "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-s "X509 - Certificate verification failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Authentication: client badcert, server optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional" \
|
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify" \
|
|
|
|
|
-s "x509_verify_cert() returned" \
|
2015-04-20 09:56:18 +00:00
|
|
|
|
-s "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
-S "X509 - Certificate verification failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Authentication: client badcert, server none" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 auth_mode=none" \
|
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got no certificate request" \
|
|
|
|
|
-c "skip write certificate" \
|
|
|
|
|
-c "skip write certificate verify" \
|
|
|
|
|
-s "skip parse certificate verify" \
|
|
|
|
|
-S "x509_verify_cert() returned" \
|
2015-04-20 09:56:18 +00:00
|
|
|
|
-S "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-21 11:12:23 +00:00
|
|
|
|
-S "X509 - Certificate verification failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Authentication: client no cert, server optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional" \
|
|
|
|
|
"$P_CLI debug_level=3 crt_file=none key_file=none" \
|
2014-02-27 13:58:26 +00:00
|
|
|
|
0 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate$" \
|
|
|
|
|
-C "got no certificate to send" \
|
|
|
|
|
-S "SSLv3 client has no certificate" \
|
|
|
|
|
-c "skip write certificate verify" \
|
|
|
|
|
-s "skip parse certificate verify" \
|
2015-04-20 09:56:18 +00:00
|
|
|
|
-s "! Certificate was missing" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-27 13:58:26 +00:00
|
|
|
|
-S "X509 - Certificate verification failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Authentication: openssl client no cert, server optional" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional" \
|
2014-02-27 13:58:26 +00:00
|
|
|
|
"$O_CLI" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-s "skip parse certificate verify" \
|
2015-04-20 09:56:18 +00:00
|
|
|
|
-s "! Certificate was missing" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "! mbedtls_ssl_handshake returned" \
|
2014-02-27 13:58:26 +00:00
|
|
|
|
-S "X509 - Certificate verification failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Authentication: client no cert, openssl server optional" \
|
2014-02-27 13:58:26 +00:00
|
|
|
|
"$O_SRV -verify 10" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=3 crt_file=none key_file=none" \
|
2014-02-27 13:58:26 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate$" \
|
|
|
|
|
-c "skip write certificate verify" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-C "! mbedtls_ssl_handshake returned"
|
2014-02-27 13:58:26 +00:00
|
|
|
|
|
2017-05-03 14:25:07 +00:00
|
|
|
|
run_test "Authentication: client no cert, openssl server required" \
|
|
|
|
|
"$O_SRV -Verify 10" \
|
|
|
|
|
"$P_CLI debug_level=3 crt_file=none key_file=none" \
|
|
|
|
|
1 \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate$" \
|
|
|
|
|
-c "skip write certificate verify" \
|
|
|
|
|
-c "! mbedtls_ssl_handshake returned"
|
2014-02-27 13:58:26 +00:00
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Authentication: client no cert, ssl3" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \
|
2015-01-12 10:40:14 +00:00
|
|
|
|
"$P_CLI debug_level=3 crt_file=none key_file=none min_version=ssl3" \
|
2014-02-27 13:58:26 +00:00
|
|
|
|
0 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate$" \
|
|
|
|
|
-c "skip write certificate verify" \
|
|
|
|
|
-c "got no certificate to send" \
|
|
|
|
|
-s "SSLv3 client has no certificate" \
|
|
|
|
|
-s "skip parse certificate verify" \
|
2015-04-20 09:56:18 +00:00
|
|
|
|
-s "! Certificate was missing" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-27 13:58:26 +00:00
|
|
|
|
-S "X509 - Certificate verification failed"
|
|
|
|
|
|
2017-07-06 10:16:25 +00:00
|
|
|
|
# The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its
|
|
|
|
|
# default value (8)
|
2017-07-26 12:35:11 +00:00
|
|
|
|
|
2017-07-28 14:59:35 +00:00
|
|
|
|
MAX_IM_CA='8'
|
2017-07-28 00:00:17 +00:00
|
|
|
|
MAX_IM_CA_CONFIG=$( ../scripts/config.pl get MBEDTLS_X509_MAX_INTERMEDIATE_CA)
|
|
|
|
|
|
2017-07-28 14:59:35 +00:00
|
|
|
|
if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then
|
2017-07-28 00:00:17 +00:00
|
|
|
|
printf "The ${CONFIG_H} file contains a value for the configuration of\n"
|
2017-07-28 14:59:35 +00:00
|
|
|
|
printf "MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script’s\n"
|
2017-07-28 00:00:17 +00:00
|
|
|
|
printf "test value of ${MAX_IM_CA}. \n"
|
|
|
|
|
printf "\n"
|
2017-07-28 14:59:35 +00:00
|
|
|
|
printf "The tests assume this value and if it changes, the tests in this\n"
|
|
|
|
|
printf "script should also be adjusted.\n"
|
2017-07-28 00:00:17 +00:00
|
|
|
|
printf "\n"
|
2017-07-26 12:35:11 +00:00
|
|
|
|
|
2017-07-28 00:00:17 +00:00
|
|
|
|
exit 1
|
2017-07-26 12:35:11 +00:00
|
|
|
|
fi
|
|
|
|
|
|
2017-06-26 08:45:33 +00:00
|
|
|
|
run_test "Authentication: server max_int chain, client default" \
|
|
|
|
|
"$P_SRV crt_file=data_files/dir-maxpath/c09.pem \
|
|
|
|
|
key_file=data_files/dir-maxpath/09.key" \
|
|
|
|
|
"$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \
|
|
|
|
|
0 \
|
2019-01-23 14:24:37 +00:00
|
|
|
|
-C "X509 - A fatal error occurred"
|
2017-06-26 08:45:33 +00:00
|
|
|
|
|
|
|
|
|
run_test "Authentication: server max_int+1 chain, client default" \
|
|
|
|
|
"$P_SRV crt_file=data_files/dir-maxpath/c10.pem \
|
|
|
|
|
key_file=data_files/dir-maxpath/10.key" \
|
|
|
|
|
"$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \
|
|
|
|
|
1 \
|
2019-01-23 14:24:37 +00:00
|
|
|
|
-c "X509 - A fatal error occurred"
|
2017-06-26 08:45:33 +00:00
|
|
|
|
|
|
|
|
|
run_test "Authentication: server max_int+1 chain, client optional" \
|
|
|
|
|
"$P_SRV crt_file=data_files/dir-maxpath/c10.pem \
|
|
|
|
|
key_file=data_files/dir-maxpath/10.key" \
|
|
|
|
|
"$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \
|
|
|
|
|
auth_mode=optional" \
|
|
|
|
|
1 \
|
2019-01-23 14:24:37 +00:00
|
|
|
|
-c "X509 - A fatal error occurred"
|
2017-06-26 08:45:33 +00:00
|
|
|
|
|
|
|
|
|
run_test "Authentication: server max_int+1 chain, client none" \
|
|
|
|
|
"$P_SRV crt_file=data_files/dir-maxpath/c10.pem \
|
|
|
|
|
key_file=data_files/dir-maxpath/10.key" \
|
|
|
|
|
"$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \
|
|
|
|
|
auth_mode=none" \
|
|
|
|
|
0 \
|
2019-01-23 14:24:37 +00:00
|
|
|
|
-C "X509 - A fatal error occurred"
|
2017-06-26 08:45:33 +00:00
|
|
|
|
|
|
|
|
|
run_test "Authentication: client max_int+1 chain, server default" \
|
|
|
|
|
"$P_SRV ca_file=data_files/dir-maxpath/00.crt" \
|
|
|
|
|
"$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
|
|
|
|
|
key_file=data_files/dir-maxpath/10.key" \
|
|
|
|
|
0 \
|
2019-01-23 14:24:37 +00:00
|
|
|
|
-S "X509 - A fatal error occurred"
|
2017-06-26 08:45:33 +00:00
|
|
|
|
|
|
|
|
|
run_test "Authentication: client max_int+1 chain, server optional" \
|
|
|
|
|
"$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \
|
|
|
|
|
"$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
|
|
|
|
|
key_file=data_files/dir-maxpath/10.key" \
|
|
|
|
|
1 \
|
2019-01-23 14:24:37 +00:00
|
|
|
|
-s "X509 - A fatal error occurred"
|
2017-06-26 08:45:33 +00:00
|
|
|
|
|
|
|
|
|
run_test "Authentication: client max_int+1 chain, server required" \
|
|
|
|
|
"$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \
|
|
|
|
|
"$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
|
|
|
|
|
key_file=data_files/dir-maxpath/10.key" \
|
|
|
|
|
1 \
|
2019-01-23 14:24:37 +00:00
|
|
|
|
-s "X509 - A fatal error occurred"
|
2017-06-26 08:45:33 +00:00
|
|
|
|
|
|
|
|
|
run_test "Authentication: client max_int chain, server required" \
|
|
|
|
|
"$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \
|
|
|
|
|
"$P_CLI crt_file=data_files/dir-maxpath/c09.pem \
|
|
|
|
|
key_file=data_files/dir-maxpath/09.key" \
|
|
|
|
|
0 \
|
2019-01-23 14:24:37 +00:00
|
|
|
|
-S "X509 - A fatal error occurred"
|
2017-06-26 08:45:33 +00:00
|
|
|
|
|
2017-04-10 13:34:35 +00:00
|
|
|
|
# Tests for CA list in CertificateRequest messages
|
|
|
|
|
|
|
|
|
|
run_test "Authentication: send CA list in CertificateRequest (default)" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=required" \
|
|
|
|
|
"$P_CLI crt_file=data_files/server6.crt \
|
|
|
|
|
key_file=data_files/server6.key" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "requested DN"
|
|
|
|
|
|
|
|
|
|
run_test "Authentication: do not send CA list in CertificateRequest" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \
|
|
|
|
|
"$P_CLI crt_file=data_files/server6.crt \
|
|
|
|
|
key_file=data_files/server6.key" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "requested DN"
|
|
|
|
|
|
|
|
|
|
run_test "Authentication: send CA list in CertificateRequest, client self signed" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \
|
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \
|
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
|
1 \
|
|
|
|
|
-S "requested DN" \
|
|
|
|
|
-s "x509_verify_cert() returned" \
|
|
|
|
|
-s "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
|
|
|
|
-s "X509 - Certificate verification failed"
|
|
|
|
|
|
2015-01-08 15:43:07 +00:00
|
|
|
|
# Tests for certificate selection based on SHA verson
|
|
|
|
|
|
|
|
|
|
run_test "Certificate hash: client TLS 1.2 -> SHA-2" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5.crt \
|
|
|
|
|
key_file=data_files/server5.key \
|
|
|
|
|
crt_file2=data_files/server5-sha1.crt \
|
|
|
|
|
key_file2=data_files/server5.key" \
|
|
|
|
|
"$P_CLI force_version=tls1_2" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "signed using.*ECDSA with SHA256" \
|
|
|
|
|
-C "signed using.*ECDSA with SHA1"
|
|
|
|
|
|
|
|
|
|
run_test "Certificate hash: client TLS 1.1 -> SHA-1" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5.crt \
|
|
|
|
|
key_file=data_files/server5.key \
|
|
|
|
|
crt_file2=data_files/server5-sha1.crt \
|
|
|
|
|
key_file2=data_files/server5.key" \
|
|
|
|
|
"$P_CLI force_version=tls1_1" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "signed using.*ECDSA with SHA256" \
|
|
|
|
|
-c "signed using.*ECDSA with SHA1"
|
|
|
|
|
|
|
|
|
|
run_test "Certificate hash: client TLS 1.0 -> SHA-1" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5.crt \
|
|
|
|
|
key_file=data_files/server5.key \
|
|
|
|
|
crt_file2=data_files/server5-sha1.crt \
|
|
|
|
|
key_file2=data_files/server5.key" \
|
|
|
|
|
"$P_CLI force_version=tls1" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "signed using.*ECDSA with SHA256" \
|
|
|
|
|
-c "signed using.*ECDSA with SHA1"
|
|
|
|
|
|
|
|
|
|
run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server5.crt \
|
|
|
|
|
key_file=data_files/server5.key \
|
|
|
|
|
crt_file2=data_files/server6.crt \
|
|
|
|
|
key_file2=data_files/server6.key" \
|
|
|
|
|
"$P_CLI force_version=tls1_1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "serial number.*09" \
|
|
|
|
|
-c "signed using.*ECDSA with SHA256" \
|
|
|
|
|
-C "signed using.*ECDSA with SHA1"
|
|
|
|
|
|
|
|
|
|
run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \
|
|
|
|
|
"$P_SRV crt_file=data_files/server6.crt \
|
|
|
|
|
key_file=data_files/server6.key \
|
|
|
|
|
crt_file2=data_files/server5.crt \
|
|
|
|
|
key_file2=data_files/server5.key" \
|
|
|
|
|
"$P_CLI force_version=tls1_1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "serial number.*0A" \
|
|
|
|
|
-c "signed using.*ECDSA with SHA256" \
|
|
|
|
|
-C "signed using.*ECDSA with SHA1"
|
|
|
|
|
|
2014-02-25 11:26:29 +00:00
|
|
|
|
# tests for SNI
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "SNI: no SNI callback" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
"$P_SRV debug_level=3 \
|
2014-02-25 11:26:29 +00:00
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
"$P_CLI server_name=localhost" \
|
2015-06-22 14:50:52 +00:00
|
|
|
|
0 \
|
|
|
|
|
-S "parse ServerName extension" \
|
|
|
|
|
-c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \
|
|
|
|
|
-c "subject name *: C=NL, O=PolarSSL, CN=localhost"
|
2014-02-25 11:26:29 +00:00
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "SNI: matching cert 1" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
"$P_SRV debug_level=3 \
|
2014-02-25 11:26:29 +00:00
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
2015-06-19 12:40:39 +00:00
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
"$P_CLI server_name=localhost" \
|
2015-06-22 14:50:52 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "parse ServerName extension" \
|
|
|
|
|
-c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \
|
|
|
|
|
-c "subject name *: C=NL, O=PolarSSL, CN=localhost"
|
2014-02-25 11:26:29 +00:00
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "SNI: matching cert 2" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
"$P_SRV debug_level=3 \
|
2014-02-25 11:26:29 +00:00
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
2015-06-19 12:40:39 +00:00
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
"$P_CLI server_name=polarssl.example" \
|
2015-06-22 14:50:52 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "parse ServerName extension" \
|
|
|
|
|
-c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \
|
|
|
|
|
-c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example"
|
2014-02-25 11:26:29 +00:00
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "SNI: no matching cert" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
"$P_SRV debug_level=3 \
|
2014-02-25 11:26:29 +00:00
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
2015-06-19 12:40:39 +00:00
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
"$P_CLI server_name=nonesuch.example" \
|
2015-06-22 14:50:52 +00:00
|
|
|
|
1 \
|
|
|
|
|
-s "parse ServerName extension" \
|
|
|
|
|
-s "ssl_sni_wrapper() returned" \
|
|
|
|
|
-s "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "SSL - A fatal alert message was received from our peer"
|
2014-02-25 11:26:29 +00:00
|
|
|
|
|
2015-06-22 14:04:20 +00:00
|
|
|
|
run_test "SNI: client auth no override: optional" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost" \
|
2015-06-22 14:50:52 +00:00
|
|
|
|
0 \
|
2015-06-22 14:04:20 +00:00
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify"
|
|
|
|
|
|
|
|
|
|
run_test "SNI: client auth override: none -> optional" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=none \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost" \
|
2015-06-22 14:50:52 +00:00
|
|
|
|
0 \
|
2015-06-22 14:04:20 +00:00
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify"
|
|
|
|
|
|
|
|
|
|
run_test "SNI: client auth override: optional -> none" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost" \
|
2015-06-22 14:50:52 +00:00
|
|
|
|
0 \
|
2015-06-22 14:04:20 +00:00
|
|
|
|
-s "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got no certificate request" \
|
|
|
|
|
-c "skip write certificate" \
|
|
|
|
|
-c "skip write certificate verify" \
|
|
|
|
|
-s "skip parse certificate verify"
|
|
|
|
|
|
2015-06-22 14:50:52 +00:00
|
|
|
|
run_test "SNI: CA no override" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
ca_file=data_files/test-ca.crt \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost \
|
|
|
|
|
crt_file=data_files/server6.crt key_file=data_files/server6.key" \
|
|
|
|
|
1 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify" \
|
|
|
|
|
-s "x509_verify_cert() returned" \
|
|
|
|
|
-s "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
|
-S "The certificate has been revoked (is on a CRL)"
|
|
|
|
|
|
|
|
|
|
run_test "SNI: CA override" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
ca_file=data_files/test-ca.crt \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost \
|
|
|
|
|
crt_file=data_files/server6.crt key_file=data_files/server6.key" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify" \
|
|
|
|
|
-S "x509_verify_cert() returned" \
|
|
|
|
|
-S "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
|
-S "The certificate has been revoked (is on a CRL)"
|
|
|
|
|
|
|
|
|
|
run_test "SNI: CA override with CRL" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
ca_file=data_files/test-ca.crt \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost \
|
|
|
|
|
crt_file=data_files/server6.crt key_file=data_files/server6.key" \
|
|
|
|
|
1 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify" \
|
|
|
|
|
-s "x509_verify_cert() returned" \
|
|
|
|
|
-S "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
|
-s "The certificate has been revoked (is on a CRL)"
|
|
|
|
|
|
2016-12-07 10:01:30 +00:00
|
|
|
|
# Tests for SNI and DTLS
|
|
|
|
|
|
2018-05-01 19:27:37 +00:00
|
|
|
|
run_test "SNI: DTLS, no SNI callback" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key" \
|
|
|
|
|
"$P_CLI server_name=localhost dtls=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "parse ServerName extension" \
|
|
|
|
|
-c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \
|
|
|
|
|
-c "subject name *: C=NL, O=PolarSSL, CN=localhost"
|
|
|
|
|
|
2018-05-01 19:26:47 +00:00
|
|
|
|
run_test "SNI: DTLS, matching cert 1" \
|
2016-12-07 10:01:30 +00:00
|
|
|
|
"$P_SRV debug_level=3 dtls=1 \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \
|
|
|
|
|
"$P_CLI server_name=localhost dtls=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "parse ServerName extension" \
|
|
|
|
|
-c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \
|
|
|
|
|
-c "subject name *: C=NL, O=PolarSSL, CN=localhost"
|
|
|
|
|
|
2018-05-01 19:27:37 +00:00
|
|
|
|
run_test "SNI: DTLS, matching cert 2" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \
|
|
|
|
|
"$P_CLI server_name=polarssl.example dtls=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "parse ServerName extension" \
|
|
|
|
|
-c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \
|
|
|
|
|
-c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example"
|
|
|
|
|
|
|
|
|
|
run_test "SNI: DTLS, no matching cert" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \
|
|
|
|
|
"$P_CLI server_name=nonesuch.example dtls=1" \
|
|
|
|
|
1 \
|
|
|
|
|
-s "parse ServerName extension" \
|
|
|
|
|
-s "ssl_sni_wrapper() returned" \
|
|
|
|
|
-s "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "SSL - A fatal alert message was received from our peer"
|
|
|
|
|
|
|
|
|
|
run_test "SNI: DTLS, client auth no override: optional" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional dtls=1 \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost dtls=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify"
|
|
|
|
|
|
|
|
|
|
run_test "SNI: DTLS, client auth override: none -> optional" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=none dtls=1 \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost dtls=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify"
|
|
|
|
|
|
|
|
|
|
run_test "SNI: DTLS, client auth override: optional -> none" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional dtls=1 \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost dtls=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got no certificate request" \
|
|
|
|
|
-c "skip write certificate" \
|
|
|
|
|
-c "skip write certificate verify" \
|
|
|
|
|
-s "skip parse certificate verify"
|
|
|
|
|
|
|
|
|
|
run_test "SNI: DTLS, CA no override" \
|
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional dtls=1 \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
ca_file=data_files/test-ca.crt \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost dtls=1 \
|
|
|
|
|
crt_file=data_files/server6.crt key_file=data_files/server6.key" \
|
|
|
|
|
1 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify" \
|
|
|
|
|
-s "x509_verify_cert() returned" \
|
|
|
|
|
-s "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
|
-S "The certificate has been revoked (is on a CRL)"
|
|
|
|
|
|
2018-05-01 19:26:47 +00:00
|
|
|
|
run_test "SNI: DTLS, CA override" \
|
2016-12-07 10:01:30 +00:00
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional dtls=1 \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
|
ca_file=data_files/test-ca.crt \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost dtls=1 \
|
|
|
|
|
crt_file=data_files/server6.crt key_file=data_files/server6.key" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify" \
|
|
|
|
|
-S "x509_verify_cert() returned" \
|
|
|
|
|
-S "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
|
-S "The certificate has been revoked (is on a CRL)"
|
|
|
|
|
|
2018-05-01 19:26:47 +00:00
|
|
|
|
run_test "SNI: DTLS, CA override with CRL" \
|
2016-12-07 10:01:30 +00:00
|
|
|
|
"$P_SRV debug_level=3 auth_mode=optional \
|
|
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \
|
|
|
|
|
ca_file=data_files/test-ca.crt \
|
|
|
|
|
sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \
|
|
|
|
|
"$P_CLI debug_level=3 server_name=localhost dtls=1 \
|
|
|
|
|
crt_file=data_files/server6.crt key_file=data_files/server6.key" \
|
|
|
|
|
1 \
|
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
|
-c "got a certificate request" \
|
|
|
|
|
-C "skip write certificate" \
|
|
|
|
|
-C "skip write certificate verify" \
|
|
|
|
|
-S "skip parse certificate verify" \
|
|
|
|
|
-s "x509_verify_cert() returned" \
|
|
|
|
|
-S "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
|
-s "The certificate has been revoked (is on a CRL)"
|
|
|
|
|
|
2014-02-26 13:45:12 +00:00
|
|
|
|
# Tests for non-blocking I/O: exercise a variety of handshake flows
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Non-blocking I/O: basic handshake" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
"$P_SRV nbio=2 tickets=0 auth_mode=none" \
|
|
|
|
|
"$P_CLI nbio=2 tickets=0" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Non-blocking I/O: client auth" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
"$P_SRV nbio=2 tickets=0 auth_mode=required" \
|
|
|
|
|
"$P_CLI nbio=2 tickets=0" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Non-blocking I/O: ticket" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
"$P_SRV nbio=2 tickets=1 auth_mode=none" \
|
|
|
|
|
"$P_CLI nbio=2 tickets=1" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Non-blocking I/O: ticket + client auth" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
"$P_SRV nbio=2 tickets=1 auth_mode=required" \
|
|
|
|
|
"$P_CLI nbio=2 tickets=1" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Non-blocking I/O: ticket + client auth + resume" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
"$P_SRV nbio=2 tickets=1 auth_mode=required" \
|
|
|
|
|
"$P_CLI nbio=2 tickets=1 reconnect=1" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Non-blocking I/O: ticket + resume" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
"$P_SRV nbio=2 tickets=1 auth_mode=none" \
|
|
|
|
|
"$P_CLI nbio=2 tickets=1 reconnect=1" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Non-blocking I/O: session-id resume" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
"$P_SRV nbio=2 tickets=0 auth_mode=none" \
|
|
|
|
|
"$P_CLI nbio=2 tickets=0 reconnect=1" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 13:45:12 +00:00
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
|
2014-04-07 10:42:04 +00:00
|
|
|
|
# Tests for version negotiation
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Version check: all -> 1.2" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
-s "Protocol is TLSv1.2" \
|
|
|
|
|
-c "Protocol is TLSv1.2"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Version check: cli max 1.1 -> 1.1" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI max_version=tls1_1" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
-s "Protocol is TLSv1.1" \
|
|
|
|
|
-c "Protocol is TLSv1.1"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Version check: srv max 1.1 -> 1.1" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
"$P_SRV max_version=tls1_1" \
|
|
|
|
|
"$P_CLI" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
-s "Protocol is TLSv1.1" \
|
|
|
|
|
-c "Protocol is TLSv1.1"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Version check: cli+srv max 1.1 -> 1.1" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
"$P_SRV max_version=tls1_1" \
|
|
|
|
|
"$P_CLI max_version=tls1_1" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
-s "Protocol is TLSv1.1" \
|
|
|
|
|
-c "Protocol is TLSv1.1"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Version check: cli max 1.1, srv min 1.1 -> 1.1" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
"$P_SRV min_version=tls1_1" \
|
|
|
|
|
"$P_CLI max_version=tls1_1" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
-s "Protocol is TLSv1.1" \
|
|
|
|
|
-c "Protocol is TLSv1.1"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Version check: cli min 1.1, srv max 1.1 -> 1.1" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
"$P_SRV max_version=tls1_1" \
|
|
|
|
|
"$P_CLI min_version=tls1_1" \
|
|
|
|
|
0 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
-s "Protocol is TLSv1.1" \
|
|
|
|
|
-c "Protocol is TLSv1.1"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Version check: cli min 1.2, srv max 1.1 -> fail" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
"$P_SRV max_version=tls1_1" \
|
|
|
|
|
"$P_CLI min_version=tls1_2" \
|
|
|
|
|
1 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-s "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "mbedtls_ssl_handshake returned" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
-c "SSL - Handshake protocol not within min/max boundaries"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Version check: srv min 1.2, cli max 1.1 -> fail" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
"$P_SRV min_version=tls1_2" \
|
|
|
|
|
"$P_CLI max_version=tls1_1" \
|
|
|
|
|
1 \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-s "mbedtls_ssl_handshake returned" \
|
|
|
|
|
-c "mbedtls_ssl_handshake returned" \
|
2014-02-26 15:33:03 +00:00
|
|
|
|
-s "SSL - Handshake protocol not within min/max boundaries"
|
|
|
|
|
|
2014-04-07 10:42:04 +00:00
|
|
|
|
# Tests for ALPN extension
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "ALPN: none" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
2014-04-07 10:42:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding alpn extension" \
|
|
|
|
|
-S "found alpn extension" \
|
|
|
|
|
-C "got an alert message, type: \\[2:120]" \
|
|
|
|
|
-S "server hello, adding alpn extension" \
|
|
|
|
|
-C "found alpn extension " \
|
|
|
|
|
-C "Application Layer Protocol is" \
|
|
|
|
|
-S "Application Layer Protocol is"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "ALPN: client only" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3 alpn=abc,1234" \
|
2014-04-07 10:42:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding alpn extension" \
|
|
|
|
|
-s "found alpn extension" \
|
|
|
|
|
-C "got an alert message, type: \\[2:120]" \
|
|
|
|
|
-S "server hello, adding alpn extension" \
|
|
|
|
|
-C "found alpn extension " \
|
|
|
|
|
-c "Application Layer Protocol is (none)" \
|
|
|
|
|
-S "Application Layer Protocol is"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "ALPN: server only" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 alpn=abc,1234" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
2014-04-07 10:42:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding alpn extension" \
|
|
|
|
|
-S "found alpn extension" \
|
|
|
|
|
-C "got an alert message, type: \\[2:120]" \
|
|
|
|
|
-S "server hello, adding alpn extension" \
|
|
|
|
|
-C "found alpn extension " \
|
|
|
|
|
-C "Application Layer Protocol is" \
|
|
|
|
|
-s "Application Layer Protocol is (none)"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "ALPN: both, common cli1-srv1" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 alpn=abc,1234" \
|
|
|
|
|
"$P_CLI debug_level=3 alpn=abc,1234" \
|
2014-04-07 10:42:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding alpn extension" \
|
|
|
|
|
-s "found alpn extension" \
|
|
|
|
|
-C "got an alert message, type: \\[2:120]" \
|
|
|
|
|
-s "server hello, adding alpn extension" \
|
|
|
|
|
-c "found alpn extension" \
|
|
|
|
|
-c "Application Layer Protocol is abc" \
|
|
|
|
|
-s "Application Layer Protocol is abc"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "ALPN: both, common cli2-srv1" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 alpn=abc,1234" \
|
|
|
|
|
"$P_CLI debug_level=3 alpn=1234,abc" \
|
2014-04-07 10:42:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding alpn extension" \
|
|
|
|
|
-s "found alpn extension" \
|
|
|
|
|
-C "got an alert message, type: \\[2:120]" \
|
|
|
|
|
-s "server hello, adding alpn extension" \
|
|
|
|
|
-c "found alpn extension" \
|
|
|
|
|
-c "Application Layer Protocol is abc" \
|
|
|
|
|
-s "Application Layer Protocol is abc"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "ALPN: both, common cli1-srv2" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 alpn=abc,1234" \
|
|
|
|
|
"$P_CLI debug_level=3 alpn=1234,abcde" \
|
2014-04-07 10:42:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding alpn extension" \
|
|
|
|
|
-s "found alpn extension" \
|
|
|
|
|
-C "got an alert message, type: \\[2:120]" \
|
|
|
|
|
-s "server hello, adding alpn extension" \
|
|
|
|
|
-c "found alpn extension" \
|
|
|
|
|
-c "Application Layer Protocol is 1234" \
|
|
|
|
|
-s "Application Layer Protocol is 1234"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "ALPN: both, no common" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=3 alpn=abc,123" \
|
|
|
|
|
"$P_CLI debug_level=3 alpn=1234,abcde" \
|
2014-04-07 10:42:04 +00:00
|
|
|
|
1 \
|
|
|
|
|
-c "client hello, adding alpn extension" \
|
|
|
|
|
-s "found alpn extension" \
|
|
|
|
|
-c "got an alert message, type: \\[2:120]" \
|
|
|
|
|
-S "server hello, adding alpn extension" \
|
|
|
|
|
-C "found alpn extension" \
|
|
|
|
|
-C "Application Layer Protocol is 1234" \
|
|
|
|
|
-S "Application Layer Protocol is 1234"
|
|
|
|
|
|
2014-04-07 11:24:21 +00:00
|
|
|
|
|
2014-04-09 07:50:57 +00:00
|
|
|
|
# Tests for keyUsage in leaf certificates, part 1:
|
|
|
|
|
# server-side certificate/suite selection
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
"$P_SRV key_file=data_files/server2.key \
|
|
|
|
|
crt_file=data_files/server2.ku-ds.crt" \
|
|
|
|
|
"$P_CLI" \
|
|
|
|
|
0 \
|
2014-05-22 12:42:39 +00:00
|
|
|
|
-c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-"
|
2014-04-09 07:50:57 +00:00
|
|
|
|
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
"$P_SRV key_file=data_files/server2.key \
|
|
|
|
|
crt_file=data_files/server2.ku-ke.crt" \
|
|
|
|
|
"$P_CLI" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Ciphersuite is TLS-RSA-WITH-"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage srv: RSA, keyAgreement -> fail" \
|
2014-08-30 12:20:14 +00:00
|
|
|
|
"$P_SRV key_file=data_files/server2.key \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
crt_file=data_files/server2.ku-ka.crt" \
|
2014-08-30 12:20:14 +00:00
|
|
|
|
"$P_CLI" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
1 \
|
|
|
|
|
-C "Ciphersuite is "
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
|
|
|
|
crt_file=data_files/server5.ku-ds.crt" \
|
|
|
|
|
"$P_CLI" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-"
|
|
|
|
|
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
|
|
|
|
crt_file=data_files/server5.ku-ka.crt" \
|
|
|
|
|
"$P_CLI" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Ciphersuite is TLS-ECDH-"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \
|
2014-08-30 12:20:14 +00:00
|
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
crt_file=data_files/server5.ku-ke.crt" \
|
2014-08-30 12:20:14 +00:00
|
|
|
|
"$P_CLI" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
1 \
|
|
|
|
|
-C "Ciphersuite is "
|
|
|
|
|
|
|
|
|
|
# Tests for keyUsage in leaf certificates, part 2:
|
2014-04-09 12:53:05 +00:00
|
|
|
|
# client-side checking of server cert
|
2014-04-09 07:50:57 +00:00
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
"$O_SRV -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ds_ke.crt" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
|
0 \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
-C "bad certificate (usage extensions)" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
"$O_SRV -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ds_ke.crt" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
|
0 \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
-C "bad certificate (usage extensions)" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli: KeyEncipherment, RSA: OK" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
"$O_SRV -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ke.crt" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
|
0 \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
-C "bad certificate (usage extensions)" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
"$O_SRV -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ke.crt" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
|
1 \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
-c "bad certificate (usage extensions)" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
-c "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-C "Ciphersuite is TLS-"
|
|
|
|
|
|
2015-04-20 10:01:48 +00:00
|
|
|
|
run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \
|
|
|
|
|
"$O_SRV -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ke.crt" \
|
|
|
|
|
"$P_CLI debug_level=1 auth_mode=optional \
|
|
|
|
|
force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "bad certificate (usage extensions)" \
|
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-c "Ciphersuite is TLS-" \
|
|
|
|
|
-c "! Usage does not match the keyUsage extension"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
"$O_SRV -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ds.crt" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
|
0 \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
-C "bad certificate (usage extensions)" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli: DigitalSignature, RSA: fail" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
"$O_SRV -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ds.crt" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
|
1 \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
-c "bad certificate (usage extensions)" \
|
2014-04-09 07:50:57 +00:00
|
|
|
|
-c "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-C "Ciphersuite is TLS-"
|
|
|
|
|
|
2015-04-20 10:01:48 +00:00
|
|
|
|
run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \
|
|
|
|
|
"$O_SRV -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ds.crt" \
|
|
|
|
|
"$P_CLI debug_level=1 auth_mode=optional \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "bad certificate (usage extensions)" \
|
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-c "Ciphersuite is TLS-" \
|
|
|
|
|
-c "! Usage does not match the keyUsage extension"
|
|
|
|
|
|
2014-04-09 12:53:05 +00:00
|
|
|
|
# Tests for keyUsage in leaf certificates, part 3:
|
|
|
|
|
# server-side checking of client cert
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
"$O_CLI -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ds.crt" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "bad certificate (usage extensions)" \
|
|
|
|
|
-S "Processing of the Certificate handshake message failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
"$O_CLI -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ke.crt" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "bad certificate (usage extensions)" \
|
|
|
|
|
-S "Processing of the Certificate handshake message failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=1 auth_mode=required" \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
"$O_CLI -key data_files/server2.key \
|
|
|
|
|
-cert data_files/server2.ku-ke.crt" \
|
|
|
|
|
1 \
|
|
|
|
|
-s "bad certificate (usage extensions)" \
|
|
|
|
|
-s "Processing of the Certificate handshake message failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
"$O_CLI -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.ku-ds.crt" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "bad certificate (usage extensions)" \
|
|
|
|
|
-S "Processing of the Certificate handshake message failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-09 12:53:05 +00:00
|
|
|
|
"$O_CLI -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.ku-ka.crt" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "bad certificate (usage extensions)" \
|
|
|
|
|
-S "Processing of the Certificate handshake message failed"
|
|
|
|
|
|
2014-04-11 09:06:22 +00:00
|
|
|
|
# Tests for extendedKeyUsage, part 1: server-side certificate/suite selection
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage srv: serverAuth -> OK" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
|
|
|
|
crt_file=data_files/server5.eku-srv.crt" \
|
|
|
|
|
"$P_CLI" \
|
|
|
|
|
0
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
|
|
|
|
crt_file=data_files/server5.eku-srv.crt" \
|
|
|
|
|
"$P_CLI" \
|
|
|
|
|
0
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
|
|
|
|
crt_file=data_files/server5.eku-cs_any.crt" \
|
|
|
|
|
"$P_CLI" \
|
|
|
|
|
0
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage srv: codeSign -> fail" \
|
2015-07-07 09:54:14 +00:00
|
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
crt_file=data_files/server5.eku-cli.crt" \
|
2015-07-07 09:54:14 +00:00
|
|
|
|
"$P_CLI" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
1
|
|
|
|
|
|
|
|
|
|
# Tests for extendedKeyUsage, part 2: client-side checking of server cert
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage cli: serverAuth -> OK" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$O_SRV -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.eku-srv.crt" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "bad certificate (usage extensions)" \
|
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$O_SRV -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.eku-srv_cli.crt" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "bad certificate (usage extensions)" \
|
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$O_SRV -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.eku-cs_any.crt" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "bad certificate (usage extensions)" \
|
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage cli: codeSign -> fail" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$O_SRV -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.eku-cs.crt" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_CLI debug_level=1" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
1 \
|
|
|
|
|
-c "bad certificate (usage extensions)" \
|
|
|
|
|
-c "Processing of the Certificate handshake message failed" \
|
|
|
|
|
-C "Ciphersuite is TLS-"
|
|
|
|
|
|
|
|
|
|
# Tests for extendedKeyUsage, part 3: server-side checking of client cert
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage cli-auth: clientAuth -> OK" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$O_CLI -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.eku-cli.crt" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "bad certificate (usage extensions)" \
|
|
|
|
|
-S "Processing of the Certificate handshake message failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$O_CLI -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.eku-srv_cli.crt" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "bad certificate (usage extensions)" \
|
|
|
|
|
-S "Processing of the Certificate handshake message failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$O_CLI -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.eku-cs_any.crt" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "bad certificate (usage extensions)" \
|
|
|
|
|
-S "Processing of the Certificate handshake message failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$O_CLI -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.eku-cs.crt" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "bad certificate (usage extensions)" \
|
|
|
|
|
-S "Processing of the Certificate handshake message failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \
|
2014-08-30 19:59:31 +00:00
|
|
|
|
"$P_SRV debug_level=1 auth_mode=required" \
|
2014-04-11 09:06:22 +00:00
|
|
|
|
"$O_CLI -key data_files/server5.key \
|
|
|
|
|
-cert data_files/server5.eku-cs.crt" \
|
|
|
|
|
1 \
|
|
|
|
|
-s "bad certificate (usage extensions)" \
|
|
|
|
|
-s "Processing of the Certificate handshake message failed"
|
|
|
|
|
|
2014-06-09 09:36:47 +00:00
|
|
|
|
# Tests for DHM parameters loading
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "DHM parameters: reference" \
|
2014-06-09 09:36:47 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "value of 'DHM: P ' (2048 bits)" \
|
2017-09-27 16:17:30 +00:00
|
|
|
|
-c "value of 'DHM: G ' (2 bits)"
|
2014-06-09 09:36:47 +00:00
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "DHM parameters: other parameters" \
|
2014-06-09 09:36:47 +00:00
|
|
|
|
"$P_SRV dhm_file=data_files/dhparams.pem" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "value of 'DHM: P ' (1024 bits)" \
|
|
|
|
|
-c "value of 'DHM: G ' (2 bits)"
|
|
|
|
|
|
2015-06-12 09:19:10 +00:00
|
|
|
|
# Tests for DHM client-side size checking
|
|
|
|
|
|
|
|
|
|
run_test "DHM size: server default, client default, OK" \
|
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
debug_level=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "DHM prime too short:"
|
|
|
|
|
|
|
|
|
|
run_test "DHM size: server default, client 2048, OK" \
|
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
debug_level=1 dhmlen=2048" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "DHM prime too short:"
|
|
|
|
|
|
|
|
|
|
run_test "DHM size: server 1024, client default, OK" \
|
|
|
|
|
"$P_SRV dhm_file=data_files/dhparams.pem" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
debug_level=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "DHM prime too short:"
|
|
|
|
|
|
|
|
|
|
run_test "DHM size: server 1000, client default, rejected" \
|
|
|
|
|
"$P_SRV dhm_file=data_files/dh.1000.pem" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
debug_level=1" \
|
|
|
|
|
1 \
|
|
|
|
|
-c "DHM prime too short:"
|
|
|
|
|
|
|
|
|
|
run_test "DHM size: server default, client 2049, rejected" \
|
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
|
debug_level=1 dhmlen=2049" \
|
|
|
|
|
1 \
|
|
|
|
|
-c "DHM prime too short:"
|
|
|
|
|
|
2014-06-10 13:00:46 +00:00
|
|
|
|
# Tests for PSK callback
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "PSK callback: psk, no callback" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
"$P_SRV psk=abc123 psk_identity=foo" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
|
0 \
|
2015-01-08 16:06:16 +00:00
|
|
|
|
-S "SSL - None of the common ciphersuites is usable" \
|
2014-06-10 13:28:52 +00:00
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "PSK callback: no psk, no callback" \
|
2014-06-10 13:28:52 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
|
1 \
|
2015-01-08 16:06:16 +00:00
|
|
|
|
-s "SSL - None of the common ciphersuites is usable" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "PSK callback: callback overrides other settings" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
"$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
|
1 \
|
2015-01-08 16:06:16 +00:00
|
|
|
|
-S "SSL - None of the common ciphersuites is usable" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
-s "SSL - Unknown identity received" \
|
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "PSK callback: first id matches" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
"$P_SRV psk_list=abc,dead,def,beef" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
|
psk_identity=abc psk=dead" \
|
|
|
|
|
0 \
|
2015-01-08 16:06:16 +00:00
|
|
|
|
-S "SSL - None of the common ciphersuites is usable" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "PSK callback: second id matches" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
"$P_SRV psk_list=abc,dead,def,beef" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
|
0 \
|
2015-01-08 16:06:16 +00:00
|
|
|
|
-S "SSL - None of the common ciphersuites is usable" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "PSK callback: no match" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
"$P_SRV psk_list=abc,dead,def,beef" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
|
psk_identity=ghi psk=beef" \
|
|
|
|
|
1 \
|
2015-01-08 16:06:16 +00:00
|
|
|
|
-S "SSL - None of the common ciphersuites is usable" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
-s "SSL - Unknown identity received" \
|
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "PSK callback: wrong key" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
"$P_SRV psk_list=abc,dead,def,beef" \
|
|
|
|
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
|
psk_identity=abc psk=beef" \
|
|
|
|
|
1 \
|
2015-01-08 16:06:16 +00:00
|
|
|
|
-S "SSL - None of the common ciphersuites is usable" \
|
2014-06-10 13:00:46 +00:00
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
|
-s "SSL - Verification of the message MAC failed"
|
2014-06-09 09:36:47 +00:00
|
|
|
|
|
2015-09-16 12:11:09 +00:00
|
|
|
|
# Tests for EC J-PAKE
|
|
|
|
|
|
2015-10-20 13:24:51 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE
|
2015-09-16 12:11:09 +00:00
|
|
|
|
run_test "ECJPAKE: client not configured" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "add ciphersuite: c0ff" \
|
|
|
|
|
-C "adding ecjpake_kkpp extension" \
|
2015-09-16 13:04:01 +00:00
|
|
|
|
-S "found ecjpake kkpp extension" \
|
|
|
|
|
-S "skip ecjpake kkpp extension" \
|
2015-09-16 12:11:09 +00:00
|
|
|
|
-S "ciphersuite mismatch: ecjpake not configured" \
|
2015-09-16 13:35:27 +00:00
|
|
|
|
-S "server hello, ecjpake kkpp extension" \
|
2015-09-16 14:01:00 +00:00
|
|
|
|
-C "found ecjpake_kkpp extension" \
|
2015-09-16 12:11:09 +00:00
|
|
|
|
-S "None of the common ciphersuites is usable"
|
|
|
|
|
|
2015-10-20 13:24:51 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE
|
2015-09-16 12:11:09 +00:00
|
|
|
|
run_test "ECJPAKE: server not configured" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3 ecjpake_pw=bla \
|
|
|
|
|
force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
|
|
|
|
|
1 \
|
|
|
|
|
-c "add ciphersuite: c0ff" \
|
|
|
|
|
-c "adding ecjpake_kkpp extension" \
|
2015-09-16 13:04:01 +00:00
|
|
|
|
-s "found ecjpake kkpp extension" \
|
|
|
|
|
-s "skip ecjpake kkpp extension" \
|
2015-09-16 12:11:09 +00:00
|
|
|
|
-s "ciphersuite mismatch: ecjpake not configured" \
|
2015-09-16 13:35:27 +00:00
|
|
|
|
-S "server hello, ecjpake kkpp extension" \
|
2015-09-16 14:01:00 +00:00
|
|
|
|
-C "found ecjpake_kkpp extension" \
|
2015-09-16 12:11:09 +00:00
|
|
|
|
-s "None of the common ciphersuites is usable"
|
|
|
|
|
|
2015-10-20 13:24:51 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE
|
2015-09-16 13:04:01 +00:00
|
|
|
|
run_test "ECJPAKE: working, TLS" \
|
|
|
|
|
"$P_SRV debug_level=3 ecjpake_pw=bla" \
|
|
|
|
|
"$P_CLI debug_level=3 ecjpake_pw=bla \
|
|
|
|
|
force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
|
2015-09-16 20:41:06 +00:00
|
|
|
|
0 \
|
2015-09-16 13:04:01 +00:00
|
|
|
|
-c "add ciphersuite: c0ff" \
|
|
|
|
|
-c "adding ecjpake_kkpp extension" \
|
2015-09-17 12:16:30 +00:00
|
|
|
|
-C "re-using cached ecjpake parameters" \
|
2015-09-16 13:04:01 +00:00
|
|
|
|
-s "found ecjpake kkpp extension" \
|
|
|
|
|
-S "skip ecjpake kkpp extension" \
|
|
|
|
|
-S "ciphersuite mismatch: ecjpake not configured" \
|
2015-09-16 13:35:27 +00:00
|
|
|
|
-s "server hello, ecjpake kkpp extension" \
|
2015-09-16 14:01:00 +00:00
|
|
|
|
-c "found ecjpake_kkpp extension" \
|
2015-09-16 20:52:18 +00:00
|
|
|
|
-S "None of the common ciphersuites is usable" \
|
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
server_needs_more_time 1
|
2015-10-20 13:24:51 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE
|
2015-09-16 20:52:18 +00:00
|
|
|
|
run_test "ECJPAKE: password mismatch, TLS" \
|
|
|
|
|
"$P_SRV debug_level=3 ecjpake_pw=bla" \
|
|
|
|
|
"$P_CLI debug_level=3 ecjpake_pw=bad \
|
|
|
|
|
force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
|
|
|
|
|
1 \
|
2015-09-17 12:16:30 +00:00
|
|
|
|
-C "re-using cached ecjpake parameters" \
|
2015-09-16 20:52:18 +00:00
|
|
|
|
-s "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
2015-10-20 13:24:51 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE
|
2015-09-16 20:52:18 +00:00
|
|
|
|
run_test "ECJPAKE: working, DTLS" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \
|
|
|
|
|
"$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \
|
|
|
|
|
force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
|
|
|
|
|
0 \
|
2015-09-17 12:16:30 +00:00
|
|
|
|
-c "re-using cached ecjpake parameters" \
|
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
2015-10-20 13:24:51 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE
|
2015-09-17 12:16:30 +00:00
|
|
|
|
run_test "ECJPAKE: working, DTLS, no cookie" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \
|
|
|
|
|
"$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \
|
|
|
|
|
force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "re-using cached ecjpake parameters" \
|
2015-09-16 20:52:18 +00:00
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
server_needs_more_time 1
|
2015-10-20 13:24:51 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE
|
2015-09-16 20:52:18 +00:00
|
|
|
|
run_test "ECJPAKE: password mismatch, DTLS" \
|
|
|
|
|
"$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \
|
|
|
|
|
"$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \
|
|
|
|
|
force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
|
|
|
|
|
1 \
|
2015-09-17 12:16:30 +00:00
|
|
|
|
-c "re-using cached ecjpake parameters" \
|
2015-09-16 20:52:18 +00:00
|
|
|
|
-s "SSL - Verification of the message MAC failed"
|
2015-09-16 13:04:01 +00:00
|
|
|
|
|
2015-10-20 12:47:00 +00:00
|
|
|
|
# for tests with configs/config-thread.h
|
2015-10-20 13:24:51 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE
|
2015-10-20 12:47:00 +00:00
|
|
|
|
run_test "ECJPAKE: working, DTLS, nolog" \
|
|
|
|
|
"$P_SRV dtls=1 ecjpake_pw=bla" \
|
|
|
|
|
"$P_CLI dtls=1 ecjpake_pw=bla \
|
|
|
|
|
force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
|
|
|
|
|
0
|
|
|
|
|
|
2014-06-11 12:06:01 +00:00
|
|
|
|
# Tests for ciphersuites per version
|
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2019-03-01 09:14:58 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_CAMELLIA_C
|
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Per-version suites: SSL3" \
|
2019-03-01 09:14:58 +00:00
|
|
|
|
"$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \
|
2014-06-11 12:06:01 +00:00
|
|
|
|
"$P_CLI force_version=ssl3" \
|
|
|
|
|
0 \
|
2019-03-01 09:14:58 +00:00
|
|
|
|
-c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA"
|
2014-06-11 12:06:01 +00:00
|
|
|
|
|
2019-03-01 09:14:58 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1
|
|
|
|
|
requires_config_enabled MBEDTLS_CAMELLIA_C
|
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Per-version suites: TLS 1.0" \
|
2019-03-01 09:14:58 +00:00
|
|
|
|
"$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \
|
2015-01-12 12:43:29 +00:00
|
|
|
|
"$P_CLI force_version=tls1 arc4=1" \
|
2014-06-11 12:06:01 +00:00
|
|
|
|
0 \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
-c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA"
|
2014-06-11 12:06:01 +00:00
|
|
|
|
|
2019-03-01 09:14:58 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1
|
|
|
|
|
requires_config_enabled MBEDTLS_CAMELLIA_C
|
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Per-version suites: TLS 1.1" \
|
2019-03-01 09:14:58 +00:00
|
|
|
|
"$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \
|
2014-06-11 12:06:01 +00:00
|
|
|
|
"$P_CLI force_version=tls1_1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA"
|
|
|
|
|
|
2019-03-01 09:14:58 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
|
requires_config_enabled MBEDTLS_CAMELLIA_C
|
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
2014-08-30 19:42:40 +00:00
|
|
|
|
run_test "Per-version suites: TLS 1.2" \
|
2019-03-01 09:14:58 +00:00
|
|
|
|
"$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \
|
2014-06-11 12:06:01 +00:00
|
|
|
|
"$P_CLI force_version=tls1_2" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256"
|
|
|
|
|
|
2015-07-23 10:24:03 +00:00
|
|
|
|
# Test for ClientHello without extensions
|
|
|
|
|
|
2015-08-04 14:22:30 +00:00
|
|
|
|
requires_gnutls
|
2020-01-30 11:45:14 +00:00
|
|
|
|
run_test "ClientHello without extensions" \
|
2020-01-30 10:19:45 +00:00
|
|
|
|
"$P_SRV debug_level=3" \
|
2017-05-12 11:16:40 +00:00
|
|
|
|
"$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "dumping 'client hello extensions' (0 bytes)"
|
|
|
|
|
|
2015-04-08 10:49:31 +00:00
|
|
|
|
# Tests for mbedtls_ssl_get_bytes_avail()
|
2014-06-11 16:32:36 +00:00
|
|
|
|
|
2015-04-08 10:49:31 +00:00
|
|
|
|
run_test "mbedtls_ssl_get_bytes_avail: no extra data" \
|
2014-06-11 16:32:36 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=100" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 100 bytes read$"
|
|
|
|
|
|
2015-04-08 10:49:31 +00:00
|
|
|
|
run_test "mbedtls_ssl_get_bytes_avail: extra data" \
|
2014-06-11 16:32:36 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=500" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 500 bytes read (.*+.*)"
|
2014-06-11 12:06:01 +00:00
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
# Tests for small client packets
|
2014-06-18 13:08:56 +00:00
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet SSLv3 BlockCipher" \
|
2015-01-12 10:40:14 +00:00
|
|
|
|
"$P_SRV min_version=ssl3" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=ssl3 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet SSLv3 StreamCipher" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=ssl3 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.0 BlockCipher" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=1 force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.0 BlockCipher, without EtM" \
|
2014-11-04 15:15:39 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=1 force_version=tls1 etm=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.0 StreamCipher" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1 \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2017-11-10 08:59:04 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \
|
|
|
|
|
trunc_hmac=1 etm=0" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.1 BlockCipher" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.1 BlockCipher, without EtM" \
|
2014-11-04 15:15:39 +00:00
|
|
|
|
"$P_SRV" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
2014-11-04 15:15:39 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.1 StreamCipher" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 BlockCipher" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \
|
2014-11-04 15:15:39 +00:00
|
|
|
|
"$P_SRV" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \
|
2014-11-04 15:15:39 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_SRV" \
|
2015-01-07 15:35:25 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2017-11-10 08:59:04 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 StreamCipher" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 StreamCipher, without EtM" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2017-11-10 08:59:04 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2017-11-10 08:59:04 +00:00
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 AEAD" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet TLS 1.2 AEAD shorter tag" \
|
2014-06-18 13:08:56 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=1 force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
# Tests for small client packets in DTLS
|
2017-11-10 08:59:18 +00:00
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet DTLS 1.0" \
|
2017-11-10 08:59:18 +00:00
|
|
|
|
"$P_SRV dtls=1 force_version=dtls1" \
|
|
|
|
|
"$P_CLI dtls=1 request_size=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet DTLS 1.0, without EtM" \
|
2017-11-10 08:59:18 +00:00
|
|
|
|
"$P_SRV dtls=1 force_version=dtls1 etm=0" \
|
|
|
|
|
"$P_CLI dtls=1 request_size=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet DTLS 1.0, truncated hmac" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI dtls=1 request_size=1 trunc_hmac=1 \
|
2017-11-10 08:59:18 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \
|
2017-11-10 08:59:18 +00:00
|
|
|
|
"$P_CLI dtls=1 request_size=1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\
|
2017-11-10 08:59:18 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet DTLS 1.2" \
|
2017-11-10 08:59:18 +00:00
|
|
|
|
"$P_SRV dtls=1 force_version=dtls1_2" \
|
|
|
|
|
"$P_CLI dtls=1 request_size=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet DTLS 1.2, without EtM" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV dtls=1 force_version=dtls1_2 etm=0" \
|
2017-11-10 08:59:18 +00:00
|
|
|
|
"$P_CLI dtls=1 request_size=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet DTLS 1.2, truncated hmac" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \
|
2017-11-10 08:59:18 +00:00
|
|
|
|
"$P_CLI dtls=1 request_size=1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
2017-11-10 08:59:18 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \
|
2017-11-10 08:59:18 +00:00
|
|
|
|
"$P_CLI dtls=1 request_size=1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\
|
2017-11-10 08:59:18 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
# Tests for small server packets
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
|
|
|
|
run_test "Small server packet SSLv3 BlockCipher" \
|
|
|
|
|
"$P_SRV response_size=1 min_version=ssl3" \
|
|
|
|
|
"$P_CLI force_version=ssl3 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
|
|
|
|
run_test "Small server packet SSLv3 StreamCipher" \
|
|
|
|
|
"$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=ssl3 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.0 BlockCipher" \
|
|
|
|
|
"$P_SRV response_size=1" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=1" \
|
|
|
|
|
"$P_CLI force_version=tls1 etm=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.0 StreamCipher" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \
|
|
|
|
|
trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.1 BlockCipher" \
|
|
|
|
|
"$P_SRV response_size=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.1 StreamCipher" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 BlockCipher" \
|
|
|
|
|
"$P_SRV response_size=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \
|
|
|
|
|
"$P_SRV response_size=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 StreamCipher" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 AEAD" \
|
|
|
|
|
"$P_SRV response_size=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 AEAD shorter tag" \
|
|
|
|
|
"$P_SRV response_size=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
# Tests for small server packets in DTLS
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
run_test "Small server packet DTLS 1.0" \
|
|
|
|
|
"$P_SRV dtls=1 response_size=1 force_version=dtls1" \
|
|
|
|
|
"$P_CLI dtls=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
run_test "Small server packet DTLS 1.0, without EtM" \
|
|
|
|
|
"$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \
|
|
|
|
|
"$P_CLI dtls=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet DTLS 1.0, truncated hmac" \
|
|
|
|
|
"$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI dtls=1 trunc_hmac=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \
|
|
|
|
|
"$P_CLI dtls=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
run_test "Small server packet DTLS 1.2" \
|
|
|
|
|
"$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \
|
|
|
|
|
"$P_CLI dtls=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
run_test "Small server packet DTLS 1.2, without EtM" \
|
|
|
|
|
"$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \
|
|
|
|
|
"$P_CLI dtls=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet DTLS 1.2, truncated hmac" \
|
|
|
|
|
"$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI dtls=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \
|
|
|
|
|
"$P_CLI dtls=1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
2016-05-06 12:48:23 +00:00
|
|
|
|
# A test for extensions in SSLv3
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
|
|
|
|
run_test "SSLv3 with extensions, server side" \
|
|
|
|
|
"$P_SRV min_version=ssl3 debug_level=3" \
|
|
|
|
|
"$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "dumping 'client hello extensions'" \
|
|
|
|
|
-S "server hello, total extension length:"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
# Test for large client packets
|
2014-06-18 20:05:08 +00:00
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet SSLv3 BlockCipher" \
|
2015-01-12 10:40:14 +00:00
|
|
|
|
"$P_SRV min_version=ssl3" \
|
2015-01-07 15:35:25 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2016-03-07 15:57:05 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet SSLv3 StreamCipher" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=ssl3 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.0 BlockCipher" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_SRV" \
|
2015-01-07 15:35:25 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1 recsplit=0 \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.0 BlockCipher, without EtM" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_SRV" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2015-01-07 15:35:25 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1 recsplit=0 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.0 StreamCipher" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2017-11-10 09:16:28 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.1 BlockCipher" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_1 etm=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.1 StreamCipher" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_1 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 BlockCipher" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 etm=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_SRV" \
|
2015-01-07 15:35:25 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2017-11-10 09:16:28 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV trunc_hmac=1" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 StreamCipher" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 StreamCipher, without EtM" \
|
2015-03-24 08:50:15 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2017-11-10 08:42:54 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2017-11-10 09:16:28 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
"$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
2017-11-10 09:16:28 +00:00
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 \
|
2017-11-21 17:10:12 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 AEAD" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
|
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large client packet TLS 1.2 AEAD shorter tag" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
"$P_SRV" \
|
|
|
|
|
"$P_CLI request_size=16384 force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
|
|
|
|
|
0 \
|
2017-09-18 14:04:19 +00:00
|
|
|
|
-c "16384 bytes written in 1 fragments" \
|
2014-06-18 20:05:08 +00:00
|
|
|
|
-s "Read from client: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 10:22:05 +00:00
|
|
|
|
# Tests for ECC extensions (rfc 4492)
|
|
|
|
|
|
2018-06-28 13:17:00 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
|
requires_config_enabled MBEDTLS_CIPHER_MODE_CBC
|
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
|
2018-06-28 10:22:05 +00:00
|
|
|
|
run_test "Force a non ECC ciphersuite in the client side" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
2018-06-28 13:17:00 +00:00
|
|
|
|
"$P_CLI debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \
|
2018-06-28 10:22:05 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "client hello, adding supported_elliptic_curves extension" \
|
|
|
|
|
-C "client hello, adding supported_point_formats extension" \
|
|
|
|
|
-S "found supported elliptic curves extension" \
|
|
|
|
|
-S "found supported point formats extension"
|
|
|
|
|
|
2018-06-28 13:17:00 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
|
requires_config_enabled MBEDTLS_CIPHER_MODE_CBC
|
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
|
2018-06-28 10:22:05 +00:00
|
|
|
|
run_test "Force a non ECC ciphersuite in the server side" \
|
2018-06-28 13:17:00 +00:00
|
|
|
|
"$P_SRV debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \
|
2018-06-28 10:22:05 +00:00
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "found supported_point_formats extension" \
|
|
|
|
|
-S "server hello, supported_point_formats extension"
|
|
|
|
|
|
2018-06-28 13:17:00 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
|
requires_config_enabled MBEDTLS_CIPHER_MODE_CBC
|
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-06-28 10:22:05 +00:00
|
|
|
|
run_test "Force an ECC ciphersuite in the client side" \
|
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
|
"$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "client hello, adding supported_elliptic_curves extension" \
|
|
|
|
|
-c "client hello, adding supported_point_formats extension" \
|
|
|
|
|
-s "found supported elliptic curves extension" \
|
|
|
|
|
-s "found supported point formats extension"
|
|
|
|
|
|
2018-06-28 13:17:00 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
|
requires_config_enabled MBEDTLS_CIPHER_MODE_CBC
|
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-06-28 10:22:05 +00:00
|
|
|
|
run_test "Force an ECC ciphersuite in the server side" \
|
|
|
|
|
"$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "found supported_point_formats extension" \
|
|
|
|
|
-s "server hello, supported_point_formats extension"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
# Test for large server packets
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
|
|
|
|
run_test "Large server packet SSLv3 StreamCipher" \
|
|
|
|
|
"$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=ssl3 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-08-27 12:00:13 +00:00
|
|
|
|
# Checking next 4 tests logs for 1n-1 split against BEAST too
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_SSL3
|
|
|
|
|
run_test "Large server packet SSLv3 BlockCipher" \
|
|
|
|
|
"$P_SRV response_size=16384 min_version=ssl3" \
|
|
|
|
|
"$P_CLI force_version=ssl3 recsplit=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"\
|
|
|
|
|
-c "16383 bytes read"\
|
|
|
|
|
-C "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large server packet TLS 1.0 BlockCipher" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1 recsplit=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"\
|
|
|
|
|
-c "16383 bytes read"\
|
|
|
|
|
-C "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1 etm=0 recsplit=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"\
|
|
|
|
|
-c "16383 bytes read"\
|
|
|
|
|
-C "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1 recsplit=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \
|
|
|
|
|
trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 1 bytes read"\
|
|
|
|
|
-c "16383 bytes read"\
|
|
|
|
|
-C "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \
|
|
|
|
|
trunc_hmac=1" \
|
|
|
|
|
0 \
|
2018-06-19 13:37:30 +00:00
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Large server packet TLS 1.0 StreamCipher" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
2018-06-28 08:03:10 +00:00
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Large server packet TLS 1.1 BlockCipher" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 etm=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
2018-06-28 08:03:10 +00:00
|
|
|
|
0 \
|
2018-06-19 13:37:30 +00:00
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
2018-06-28 08:03:10 +00:00
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \
|
|
|
|
|
trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Large server packet TLS 1.1 StreamCipher" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \
|
|
|
|
|
trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_1 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large server packet TLS 1.2 BlockCipher" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 etm=0 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \
|
|
|
|
|
trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384 trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large server packet TLS 1.2 StreamCipher" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
0 \
|
2018-06-19 13:37:30 +00:00
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
2018-06-28 08:03:10 +00:00
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \
|
|
|
|
|
trunc_hmac=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-19 13:37:30 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC
|
|
|
|
|
run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \
|
|
|
|
|
"$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2018-06-28 08:03:10 +00:00
|
|
|
|
run_test "Large server packet TLS 1.2 AEAD" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
|
|
run_test "Large server packet TLS 1.2 AEAD shorter tag" \
|
|
|
|
|
"$P_SRV response_size=16384" \
|
|
|
|
|
"$P_CLI force_version=tls1_2 \
|
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
2014-07-23 18:17:47 +00:00
|
|
|
|
# Tests for DTLS HelloVerifyRequest
|
|
|
|
|
|
|
|
|
|
run_test "DTLS cookie: enabled" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=2" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "cookie verification failed" \
|
|
|
|
|
-s "cookie verification passed" \
|
|
|
|
|
-S "cookie verification skipped" \
|
|
|
|
|
-c "received hello verify request" \
|
2014-10-13 17:04:37 +00:00
|
|
|
|
-s "hello verification requested" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
-S "SSL - The requested feature is not available"
|
|
|
|
|
|
|
|
|
|
run_test "DTLS cookie: disabled" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=2 cookies=0" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "cookie verification failed" \
|
|
|
|
|
-S "cookie verification passed" \
|
|
|
|
|
-s "cookie verification skipped" \
|
|
|
|
|
-C "received hello verify request" \
|
2014-10-13 17:04:37 +00:00
|
|
|
|
-S "hello verification requested" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
-S "SSL - The requested feature is not available"
|
|
|
|
|
|
2014-10-13 17:04:37 +00:00
|
|
|
|
run_test "DTLS cookie: default (failing)" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=2 cookies=-1" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \
|
|
|
|
|
1 \
|
|
|
|
|
-s "cookie verification failed" \
|
|
|
|
|
-S "cookie verification passed" \
|
|
|
|
|
-S "cookie verification skipped" \
|
|
|
|
|
-C "received hello verify request" \
|
|
|
|
|
-S "hello verification requested" \
|
|
|
|
|
-s "SSL - The requested feature is not available"
|
2014-07-23 18:17:47 +00:00
|
|
|
|
|
|
|
|
|
requires_ipv6
|
|
|
|
|
run_test "DTLS cookie: enabled, IPv6" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=2 server_addr=::1" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2 server_addr=::1" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "cookie verification failed" \
|
|
|
|
|
-s "cookie verification passed" \
|
|
|
|
|
-S "cookie verification skipped" \
|
|
|
|
|
-c "received hello verify request" \
|
2014-10-13 17:04:37 +00:00
|
|
|
|
-s "hello verification requested" \
|
2014-07-23 18:17:47 +00:00
|
|
|
|
-S "SSL - The requested feature is not available"
|
|
|
|
|
|
2014-09-29 15:47:33 +00:00
|
|
|
|
run_test "DTLS cookie: enabled, nbio" \
|
|
|
|
|
"$P_SRV dtls=1 nbio=2 debug_level=2" \
|
|
|
|
|
"$P_CLI dtls=1 nbio=2 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "cookie verification failed" \
|
|
|
|
|
-s "cookie verification passed" \
|
|
|
|
|
-S "cookie verification skipped" \
|
|
|
|
|
-c "received hello verify request" \
|
2014-10-13 17:04:37 +00:00
|
|
|
|
-s "hello verification requested" \
|
2014-09-29 15:47:33 +00:00
|
|
|
|
-S "SSL - The requested feature is not available"
|
|
|
|
|
|
2015-09-08 10:40:43 +00:00
|
|
|
|
# Tests for client reconnecting from the same port with DTLS
|
|
|
|
|
|
2015-09-09 09:37:17 +00:00
|
|
|
|
not_with_valgrind # spurious resend
|
2015-09-08 10:40:43 +00:00
|
|
|
|
run_test "DTLS client reconnect from same port: reference" \
|
2015-09-09 09:37:17 +00:00
|
|
|
|
"$P_SRV dtls=1 exchanges=2 read_timeout=1000" \
|
|
|
|
|
"$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000" \
|
2015-09-08 10:40:43 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "resend" \
|
2015-09-09 09:37:17 +00:00
|
|
|
|
-S "The operation timed out" \
|
2015-09-08 10:40:43 +00:00
|
|
|
|
-S "Client initiated reconnection from same port"
|
|
|
|
|
|
2015-09-09 09:37:17 +00:00
|
|
|
|
not_with_valgrind # spurious resend
|
2015-09-08 10:40:43 +00:00
|
|
|
|
run_test "DTLS client reconnect from same port: reconnect" \
|
2015-09-09 09:37:17 +00:00
|
|
|
|
"$P_SRV dtls=1 exchanges=2 read_timeout=1000" \
|
|
|
|
|
"$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000 reconnect_hard=1" \
|
2015-09-08 10:40:43 +00:00
|
|
|
|
0 \
|
|
|
|
|
-C "resend" \
|
2015-09-09 09:37:17 +00:00
|
|
|
|
-S "The operation timed out" \
|
2015-09-08 10:40:43 +00:00
|
|
|
|
-s "Client initiated reconnection from same port"
|
|
|
|
|
|
2016-05-13 09:33:25 +00:00
|
|
|
|
not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts)
|
|
|
|
|
run_test "DTLS client reconnect from same port: reconnect, nbio, no valgrind" \
|
2015-09-09 09:37:17 +00:00
|
|
|
|
"$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \
|
|
|
|
|
"$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000 reconnect_hard=1" \
|
2015-09-08 10:40:43 +00:00
|
|
|
|
0 \
|
2015-09-09 09:37:17 +00:00
|
|
|
|
-S "The operation timed out" \
|
2015-09-08 10:40:43 +00:00
|
|
|
|
-s "Client initiated reconnection from same port"
|
|
|
|
|
|
2016-05-13 09:33:25 +00:00
|
|
|
|
only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout
|
|
|
|
|
run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \
|
|
|
|
|
"$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \
|
|
|
|
|
"$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-S "The operation timed out" \
|
|
|
|
|
-s "Client initiated reconnection from same port"
|
|
|
|
|
|
2015-09-09 09:37:17 +00:00
|
|
|
|
run_test "DTLS client reconnect from same port: no cookies" \
|
|
|
|
|
"$P_SRV dtls=1 exchanges=2 read_timeout=1000 cookies=0" \
|
2015-09-15 10:57:46 +00:00
|
|
|
|
"$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \
|
|
|
|
|
0 \
|
2015-09-09 09:37:17 +00:00
|
|
|
|
-s "The operation timed out" \
|
|
|
|
|
-S "Client initiated reconnection from same port"
|
|
|
|
|
|
2014-09-26 08:35:50 +00:00
|
|
|
|
# Tests for various cases of client authentication with DTLS
|
|
|
|
|
# (focused on handshake flows and message parsing)
|
|
|
|
|
|
|
|
|
|
run_test "DTLS client auth: required" \
|
|
|
|
|
"$P_SRV dtls=1 auth_mode=required" \
|
|
|
|
|
"$P_CLI dtls=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "Verifying peer X.509 certificate... ok"
|
|
|
|
|
|
|
|
|
|
run_test "DTLS client auth: optional, client has no cert" \
|
|
|
|
|
"$P_SRV dtls=1 auth_mode=optional" \
|
|
|
|
|
"$P_CLI dtls=1 crt_file=none key_file=none" \
|
|
|
|
|
0 \
|
2015-04-20 09:56:18 +00:00
|
|
|
|
-s "! Certificate was missing"
|
2014-09-26 08:35:50 +00:00
|
|
|
|
|
2015-04-20 09:56:18 +00:00
|
|
|
|
run_test "DTLS client auth: none, client has no cert" \
|
2014-09-26 08:35:50 +00:00
|
|
|
|
"$P_SRV dtls=1 auth_mode=none" \
|
|
|
|
|
"$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "skip write certificate$" \
|
2015-04-20 09:56:18 +00:00
|
|
|
|
-s "! Certificate verification was skipped"
|
2014-09-26 08:35:50 +00:00
|
|
|
|
|
2015-08-04 10:08:35 +00:00
|
|
|
|
run_test "DTLS wrong PSK: badmac alert" \
|
|
|
|
|
"$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \
|
|
|
|
|
"$P_CLI dtls=1 psk=abc124" \
|
|
|
|
|
1 \
|
|
|
|
|
-s "SSL - Verification of the message MAC failed" \
|
|
|
|
|
-c "SSL - A fatal alert message was received from our peer"
|
|
|
|
|
|
2014-08-20 11:12:58 +00:00
|
|
|
|
# Tests for receiving fragmented handshake messages with DTLS
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DTLS reassembly: no fragmentation (gnutls server)" \
|
|
|
|
|
"$G_SRV -u --mtu 2048 -a" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "found fragmented DTLS handshake message" \
|
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DTLS reassembly: some fragmentation (gnutls server)" \
|
|
|
|
|
"$G_SRV -u --mtu 512" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DTLS reassembly: more fragmentation (gnutls server)" \
|
|
|
|
|
"$G_SRV -u --mtu 128" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
|
|
|
|
run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \
|
|
|
|
|
"$G_SRV -u --mtu 128" \
|
|
|
|
|
"$P_CLI dtls=1 nbio=2 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
|
-C "error"
|
|
|
|
|
|
2014-09-02 12:47:31 +00:00
|
|
|
|
requires_gnutls
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-09-02 12:47:31 +00:00
|
|
|
|
run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \
|
|
|
|
|
"$G_SRV -u --mtu 256" \
|
|
|
|
|
"$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-09-02 12:47:31 +00:00
|
|
|
|
-C "error" \
|
|
|
|
|
-s "Extra-header:"
|
|
|
|
|
|
|
|
|
|
requires_gnutls
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-09-02 12:47:31 +00:00
|
|
|
|
run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \
|
|
|
|
|
"$G_SRV -u --mtu 256" \
|
|
|
|
|
"$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
|
-c "=> renegotiate" \
|
2015-04-08 10:49:31 +00:00
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-09-02 12:47:31 +00:00
|
|
|
|
-C "error" \
|
|
|
|
|
-s "Extra-header:"
|
|
|
|
|
|
2014-08-31 16:37:01 +00:00
|
|
|
|
run_test "DTLS reassembly: no fragmentation (openssl server)" \
|
|
|
|
|
"$O_SRV -dtls1 -mtu 2048" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-C "found fragmented DTLS handshake message" \
|
|
|
|
|
-C "error"
|
|
|
|
|
|
2014-09-23 09:00:37 +00:00
|
|
|
|
run_test "DTLS reassembly: some fragmentation (openssl server)" \
|
|
|
|
|
"$O_SRV -dtls1 -mtu 768" \
|
2014-09-02 11:39:16 +00:00
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
|
-C "error"
|
|
|
|
|
|
2014-09-23 09:00:37 +00:00
|
|
|
|
run_test "DTLS reassembly: more fragmentation (openssl server)" \
|
2014-09-02 11:39:16 +00:00
|
|
|
|
"$O_SRV -dtls1 -mtu 256" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
|
|
run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \
|
|
|
|
|
"$O_SRV -dtls1 -mtu 256" \
|
|
|
|
|
"$P_CLI dtls=1 nbio=2 debug_level=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
|
-C "error"
|
2014-08-31 16:37:01 +00:00
|
|
|
|
|
2014-09-26 14:31:46 +00:00
|
|
|
|
# Tests for specific things with "unreliable" UDP connection
|
2014-09-05 15:45:19 +00:00
|
|
|
|
|
2014-09-24 13:17:31 +00:00
|
|
|
|
not_with_valgrind # spurious resend due to timeout
|
2014-09-06 10:27:02 +00:00
|
|
|
|
run_test "DTLS proxy: reference" \
|
2014-09-05 15:45:19 +00:00
|
|
|
|
-p "$P_PXY" \
|
2014-09-24 13:17:31 +00:00
|
|
|
|
"$P_SRV dtls=1 debug_level=2" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
2014-09-06 10:27:02 +00:00
|
|
|
|
0 \
|
2014-09-24 11:56:09 +00:00
|
|
|
|
-C "replayed record" \
|
|
|
|
|
-S "replayed record" \
|
|
|
|
|
-C "record from another epoch" \
|
|
|
|
|
-S "record from another epoch" \
|
|
|
|
|
-C "discarding invalid record" \
|
|
|
|
|
-S "discarding invalid record" \
|
2014-09-24 13:17:31 +00:00
|
|
|
|
-S "resend" \
|
2014-09-08 14:39:08 +00:00
|
|
|
|
-s "Extra-header:" \
|
2014-09-06 10:27:02 +00:00
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2014-09-24 13:17:31 +00:00
|
|
|
|
not_with_valgrind # spurious resend due to timeout
|
2014-09-24 11:29:58 +00:00
|
|
|
|
run_test "DTLS proxy: duplicate every packet" \
|
2014-09-06 10:27:02 +00:00
|
|
|
|
-p "$P_PXY duplicate=1" \
|
2014-09-24 13:17:31 +00:00
|
|
|
|
"$P_SRV dtls=1 debug_level=2" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
2014-09-06 10:27:02 +00:00
|
|
|
|
0 \
|
2014-09-24 11:29:58 +00:00
|
|
|
|
-c "replayed record" \
|
|
|
|
|
-s "replayed record" \
|
2017-05-26 15:07:36 +00:00
|
|
|
|
-c "record from another epoch" \
|
|
|
|
|
-s "record from another epoch" \
|
2014-09-24 13:17:31 +00:00
|
|
|
|
-S "resend" \
|
2014-09-08 14:39:08 +00:00
|
|
|
|
-s "Extra-header:" \
|
2014-09-24 12:41:11 +00:00
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
|
|
|
|
run_test "DTLS proxy: duplicate every packet, server anti-replay off" \
|
|
|
|
|
-p "$P_PXY duplicate=1" \
|
2014-09-24 13:17:31 +00:00
|
|
|
|
"$P_SRV dtls=1 debug_level=2 anti_replay=0" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
2014-09-24 12:41:11 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "replayed record" \
|
|
|
|
|
-S "replayed record" \
|
2017-05-26 15:07:36 +00:00
|
|
|
|
-c "record from another epoch" \
|
|
|
|
|
-s "record from another epoch" \
|
2014-09-24 13:17:31 +00:00
|
|
|
|
-c "resend" \
|
|
|
|
|
-s "resend" \
|
2014-09-24 12:41:11 +00:00
|
|
|
|
-s "Extra-header:" \
|
2014-09-08 14:39:08 +00:00
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2014-10-14 17:36:36 +00:00
|
|
|
|
run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \
|
2014-09-08 14:39:08 +00:00
|
|
|
|
-p "$P_PXY bad_ad=1" \
|
2014-09-24 11:56:09 +00:00
|
|
|
|
"$P_SRV dtls=1 debug_level=1" \
|
2014-10-14 17:36:36 +00:00
|
|
|
|
"$P_CLI dtls=1 debug_level=1 read_timeout=100" \
|
2014-09-23 09:00:37 +00:00
|
|
|
|
0 \
|
2014-10-14 20:34:08 +00:00
|
|
|
|
-c "discarding invalid record (mac)" \
|
|
|
|
|
-s "discarding invalid record (mac)" \
|
2014-09-23 09:00:37 +00:00
|
|
|
|
-s "Extra-header:" \
|
2014-10-14 17:36:36 +00:00
|
|
|
|
-c "HTTP/1.0 200 OK" \
|
|
|
|
|
-S "too many records with bad MAC" \
|
|
|
|
|
-S "Verification of the message MAC failed"
|
|
|
|
|
|
|
|
|
|
run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \
|
|
|
|
|
-p "$P_PXY bad_ad=1" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=1 badmac_limit=1" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=1 read_timeout=100" \
|
|
|
|
|
1 \
|
2014-10-14 20:34:08 +00:00
|
|
|
|
-C "discarding invalid record (mac)" \
|
|
|
|
|
-S "discarding invalid record (mac)" \
|
2014-10-14 17:36:36 +00:00
|
|
|
|
-S "Extra-header:" \
|
|
|
|
|
-C "HTTP/1.0 200 OK" \
|
|
|
|
|
-s "too many records with bad MAC" \
|
|
|
|
|
-s "Verification of the message MAC failed"
|
|
|
|
|
|
|
|
|
|
run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \
|
|
|
|
|
-p "$P_PXY bad_ad=1" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=1 badmac_limit=2" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=1 read_timeout=100" \
|
|
|
|
|
0 \
|
2014-10-14 20:34:08 +00:00
|
|
|
|
-c "discarding invalid record (mac)" \
|
|
|
|
|
-s "discarding invalid record (mac)" \
|
2014-10-14 17:36:36 +00:00
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK" \
|
|
|
|
|
-S "too many records with bad MAC" \
|
|
|
|
|
-S "Verification of the message MAC failed"
|
|
|
|
|
|
|
|
|
|
run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\
|
|
|
|
|
-p "$P_PXY bad_ad=1" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \
|
|
|
|
|
1 \
|
2014-10-14 20:34:08 +00:00
|
|
|
|
-c "discarding invalid record (mac)" \
|
|
|
|
|
-s "discarding invalid record (mac)" \
|
2014-10-14 17:36:36 +00:00
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK" \
|
|
|
|
|
-s "too many records with bad MAC" \
|
|
|
|
|
-s "Verification of the message MAC failed"
|
2014-09-23 09:00:37 +00:00
|
|
|
|
|
|
|
|
|
run_test "DTLS proxy: delay ChangeCipherSpec" \
|
2014-09-24 11:56:09 +00:00
|
|
|
|
-p "$P_PXY delay_ccs=1" \
|
|
|
|
|
"$P_SRV dtls=1 debug_level=1" \
|
|
|
|
|
"$P_CLI dtls=1 debug_level=1" \
|
2014-09-23 09:00:37 +00:00
|
|
|
|
0 \
|
2014-09-24 11:56:09 +00:00
|
|
|
|
-c "record from another epoch" \
|
|
|
|
|
-s "record from another epoch" \
|
2014-09-23 09:00:37 +00:00
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2014-09-26 14:31:46 +00:00
|
|
|
|
# Tests for "randomly unreliable connection": try a variety of flows and peers
|
2014-09-24 17:09:17 +00:00
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 2
|
2014-09-24 17:09:17 +00:00
|
|
|
|
run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-01 14:38:03 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \
|
|
|
|
|
psk=abc123" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \
|
2014-09-24 17:09:17 +00:00
|
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
|
2014-09-08 14:39:08 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Extra-header:" \
|
2014-09-06 10:27:02 +00:00
|
|
|
|
-c "HTTP/1.0 200 OK"
|
2014-09-05 15:45:19 +00:00
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 2
|
2014-09-24 17:09:17 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, \"short\" RSA handshake" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-01 14:38:03 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \
|
2014-09-24 17:09:17 +00:00
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2014-09-20 10:46:27 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 2
|
2014-09-24 17:09:17 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-01 14:38:03 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \
|
2014-09-20 10:46:27 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 2
|
2014-09-24 17:09:17 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, FS, client auth" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-01 14:38:03 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \
|
2014-09-20 10:46:27 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 2
|
2014-09-24 17:09:17 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, FS, ticket" \
|
2014-09-23 09:00:37 +00:00
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-01 14:38:03 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \
|
2014-09-24 17:09:17 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 2
|
2014-09-24 17:09:17 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-01 14:38:03 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \
|
2014-09-23 09:00:37 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 2
|
2014-09-29 15:52:57 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, max handshake, nbio" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-01 14:38:03 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \
|
|
|
|
|
auth_mode=required" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 nbio=2 tickets=1" \
|
2014-09-29 15:52:57 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 4
|
2014-10-02 12:50:46 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, min handshake, resumption" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \
|
|
|
|
|
psk=abc123 debug_level=3" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
debug_level=3 reconnect=1 skip_close_notify=1 read_timeout=1000 max_resend=10 \
|
2014-10-02 12:50:46 +00:00
|
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed" \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 4
|
2014-10-02 15:59:19 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \
|
|
|
|
|
psk=abc123 debug_level=3 nbio=2" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \
|
Fix possible close_notify/ClientHello confusion
The ssl-opt.sh test cases using session resumption tend to fail occasionally
on the CI due to a race condition in how ssl_server2 and ssl_client2 handle
the reconnection cycle.
The server does the following in order:
- S1 send application data
- S2 send a close_notify alert
- S3 close the client socket
- S4 wait for a "new connection" (actually a new datagram)
- S5 start a handshake
The client does the following in order:
- C1 wait for and read application data from the server
- C2 send a close_notify alert
- C3 close the server socket
- C4 reset session data and re-open a server socket
- C5 start a handshake
If the client has been able to send the close_notify (C2) and if has been
delivered to the server before if closes the client socket (S3), when the
server reaches S4, the datagram that we start the new connection will be the
ClientHello and everything will be fine.
However if S3 wins the race and happens before the close_notify is delivered,
in S4 the close_notify is what will be seen as the first datagram in a new
connection, and then in S5 this will rightfully be rejected as not being a
valid ClientHello and the server will close the connection (and go wait for
another one). The client will then fail to read from the socket and exit
non-zero and the ssl-opt.sh harness will correctly report this as a failure.
In order to avoid this race condition in test using ssl_client2 and
ssl_server2, this commits introduces a new command-line option
skip_close_notify to ssl_client2 and uses it in all ssl-opt.sh tests that use
session resumption with DTLS and ssl_server2.
This works because ssl_server2 knows how many messages it expects in each
direction and in what order, and closes the connection after that rather than
relying on close_notify (which is also why there was a race in the first
place).
Tests that use another server (in practice there are two of them, using
OpenSSL as a server) wouldn't work with skip_close_notify, as the server won't
close the connection until the client sends a close_notify, but for the same
reason they don't need it (there is no race between receiving close_notify and
closing as the former is the cause of the later).
An alternative approach would be to make ssl_server2 keep the connection open
until it receives a close_notify. Unfortunately it creates problems for tests
where we simulate a lossy network, as the close_notify could be lost (and the
client can't retransmit it). We could modify udp_proxy with an option to never
drop alert messages, but when TLS 1.3 comes that would no longer work as the
type of messages will be encrypted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-02-17 10:04:33 +00:00
|
|
|
|
debug_level=3 reconnect=1 skip_close_notify=1 read_timeout=1000 max_resend=10 \
|
2014-10-02 15:59:19 +00:00
|
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \
|
|
|
|
|
0 \
|
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
|
-c "a session has been resumed" \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 4
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-09-29 15:52:57 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \
|
2014-09-25 14:09:36 +00:00
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-01 14:38:03 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \
|
|
|
|
|
psk=abc123 renegotiation=1 debug_level=2" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \
|
|
|
|
|
renegotiate=1 debug_level=2 \
|
2014-09-25 14:09:36 +00:00
|
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 4
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-09-29 15:52:57 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-01 14:38:03 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \
|
|
|
|
|
psk=abc123 renegotiation=1 debug_level=2" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \
|
|
|
|
|
renegotiate=1 debug_level=2 \
|
2014-09-29 15:52:57 +00:00
|
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 4
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-10-09 14:13:44 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \
|
2014-10-15 10:44:41 +00:00
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-09 14:13:44 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \
|
2014-10-15 10:44:41 +00:00
|
|
|
|
psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \
|
2014-10-09 14:13:44 +00:00
|
|
|
|
debug_level=2" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \
|
2014-10-15 10:44:41 +00:00
|
|
|
|
renegotiation=1 exchanges=4 debug_level=2 \
|
2014-10-09 14:13:44 +00:00
|
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 4
|
2017-10-12 14:18:45 +00:00
|
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2014-10-09 14:13:44 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, min handshake, server-initiated renego, nbio" \
|
2014-10-15 10:44:41 +00:00
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2014-10-09 14:13:44 +00:00
|
|
|
|
"$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \
|
2014-10-15 10:44:41 +00:00
|
|
|
|
psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \
|
2014-10-09 14:13:44 +00:00
|
|
|
|
debug_level=2 nbio=2" \
|
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \
|
2014-10-15 10:44:41 +00:00
|
|
|
|
renegotiation=1 exchanges=4 debug_level=2 nbio=2 \
|
2014-10-09 14:13:44 +00:00
|
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
|
|
|
|
|
0 \
|
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 6
|
2015-08-31 10:48:22 +00:00
|
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2014-09-26 14:27:59 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, openssl server" \
|
2014-09-25 15:00:27 +00:00
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \
|
|
|
|
|
"$O_SRV -dtls1 -mtu 2048" \
|
2015-03-09 16:09:53 +00:00
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \
|
2014-09-25 15:00:27 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 8
|
2015-08-31 10:48:22 +00:00
|
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2014-09-26 14:27:59 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, openssl server, fragmentation" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \
|
|
|
|
|
"$O_SRV -dtls1 -mtu 768" \
|
2015-03-09 16:09:53 +00:00
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \
|
2014-09-26 14:27:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 8
|
2015-08-31 10:48:22 +00:00
|
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2014-09-29 15:52:57 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \
|
|
|
|
|
"$O_SRV -dtls1 -mtu 768" \
|
2015-03-09 16:09:53 +00:00
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-60000 nbio=2 tickets=0" \
|
2014-09-29 15:52:57 +00:00
|
|
|
|
0 \
|
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
2015-02-17 16:02:37 +00:00
|
|
|
|
requires_gnutls
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 6
|
2015-08-31 10:48:22 +00:00
|
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2014-09-26 14:27:59 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, gnutls server" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
|
|
|
|
"$G_SRV -u --mtu 2048 -a" \
|
2014-10-14 20:57:46 +00:00
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-60000" \
|
2014-09-26 14:27:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "Extra-header:"
|
|
|
|
|
|
2015-02-17 16:02:37 +00:00
|
|
|
|
requires_gnutls
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 8
|
2015-08-31 10:48:22 +00:00
|
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2014-09-26 14:27:59 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, gnutls server, fragmentation" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
|
|
|
|
"$G_SRV -u --mtu 512" \
|
2014-10-14 20:57:46 +00:00
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-60000" \
|
2014-09-26 14:27:59 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "Extra-header:"
|
|
|
|
|
|
2015-02-17 16:02:37 +00:00
|
|
|
|
requires_gnutls
|
2016-09-02 12:45:28 +00:00
|
|
|
|
client_needs_more_time 8
|
2015-08-31 10:48:22 +00:00
|
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2014-09-29 15:52:57 +00:00
|
|
|
|
run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \
|
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
|
|
|
|
"$G_SRV -u --mtu 512" \
|
2014-10-14 20:57:46 +00:00
|
|
|
|
"$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \
|
2014-09-29 15:52:57 +00:00
|
|
|
|
0 \
|
|
|
|
|
-s "Extra-header:" \
|
|
|
|
|
-c "Extra-header:"
|
|
|
|
|
|
2014-02-21 11:12:23 +00:00
|
|
|
|
# Final report
|
|
|
|
|
|
2014-02-21 08:47:37 +00:00
|
|
|
|
echo "------------------------------------------------------------------------"
|
|
|
|
|
|
|
|
|
|
if [ $FAILS = 0 ]; then
|
2014-12-11 10:51:28 +00:00
|
|
|
|
printf "PASSED"
|
2014-02-21 08:47:37 +00:00
|
|
|
|
else
|
2014-12-11 10:51:28 +00:00
|
|
|
|
printf "FAILED"
|
2014-02-21 08:47:37 +00:00
|
|
|
|
fi
|
2014-08-31 08:22:11 +00:00
|
|
|
|
PASSES=$(( $TESTS - $FAILS ))
|
2014-08-14 12:31:29 +00:00
|
|
|
|
echo " ($PASSES / $TESTS tests ($SKIPS skipped))"
|
2014-02-21 08:47:37 +00:00
|
|
|
|
|
|
|
|
|
exit $FAILS
|