2014-02-20 11:01:30 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-05-20 00:43:11 +02:00
|
|
|
# ssl-opt.sh
|
2014-02-20 11:01:30 +01:00
|
|
|
#
|
2020-08-07 13:07:28 +02:00
|
|
|
# Copyright The Mbed TLS Contributors
|
2020-05-26 01:54:15 +02:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
# not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
2016-05-20 00:43:11 +02:00
|
|
|
# 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 11:01:30 +01:00
|
|
|
#
|
|
|
|
|
2014-02-25 17:14:15 +01:00
|
|
|
set -u
|
|
|
|
|
2019-07-03 14:51:04 +02: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-09-16 15:17:38 +02:00
|
|
|
ORIGINAL_PWD=$PWD
|
|
|
|
if ! cd "$(dirname "$0")"; then
|
|
|
|
exit 125
|
2018-04-11 08:28:39 +02:00
|
|
|
fi
|
|
|
|
|
2019-01-23 15:24:37 +01:00
|
|
|
# default values, can be overridden by the environment
|
2014-02-27 12:25:54 +01:00
|
|
|
: ${P_SRV:=../programs/ssl/ssl_server2}
|
|
|
|
: ${P_CLI:=../programs/ssl/ssl_client2}
|
2014-09-05 17:45:19 +02:00
|
|
|
: ${P_PXY:=../programs/test/udp_proxy}
|
2021-12-06 09:52:57 +01:00
|
|
|
: ${P_QUERY:=../programs/test/query_compile_time_config}
|
2014-03-13 18:47:44 +01:00
|
|
|
: ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system
|
2014-08-20 20:15:53 +02:00
|
|
|
: ${GNUTLS_CLI:=gnutls-cli}
|
|
|
|
: ${GNUTLS_SERV:=gnutls-serv}
|
2017-05-16 17:53:03 +02:00
|
|
|
: ${PERL:=perl}
|
2014-02-20 11:01:30 +01:00
|
|
|
|
2019-09-16 15:17:38 +02:00
|
|
|
guess_config_name() {
|
2021-05-28 09:42:25 +02:00
|
|
|
if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then
|
2019-09-16 15:17:38 +02:00
|
|
|
echo "default"
|
|
|
|
else
|
|
|
|
echo "unknown"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
: ${MBEDTLS_TEST_OUTCOME_FILE=}
|
|
|
|
: ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"}
|
|
|
|
: ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"}
|
|
|
|
|
2014-09-26 16:07:29 +02:00
|
|
|
O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key"
|
2014-03-13 18:47:44 +01:00
|
|
|
O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client"
|
2014-08-20 20:15:53 +02:00
|
|
|
G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key"
|
2014-11-03 20:10:36 +01:00
|
|
|
G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt"
|
2017-05-16 17:53:03 +02:00
|
|
|
TCP_CLIENT="$PERL scripts/tcp_client.pl"
|
2014-02-25 17:14:15 +01:00
|
|
|
|
2018-08-17 12:44:54 +02:00
|
|
|
# alternative versions of OpenSSL and GnuTLS (no default path)
|
|
|
|
|
|
|
|
if [ -n "${OPENSSL_LEGACY:-}" ]; then
|
|
|
|
O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key"
|
|
|
|
O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client"
|
|
|
|
else
|
|
|
|
O_LEGACY_SRV=false
|
|
|
|
O_LEGACY_CLI=false
|
|
|
|
fi
|
|
|
|
|
2021-08-10 10:45:37 +02:00
|
|
|
if [ -n "${OPENSSL_NEXT:-}" ]; then
|
2021-11-24 02:54:50 +01:00
|
|
|
O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key"
|
2021-11-24 09:04:47 +01:00
|
|
|
O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www "
|
2021-08-10 10:45:37 +02:00
|
|
|
O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client"
|
|
|
|
else
|
|
|
|
O_NEXT_SRV=false
|
2021-11-24 09:04:47 +01:00
|
|
|
O_NEXT_SRV_NO_CERT=false
|
2021-08-10 10:45:37 +02:00
|
|
|
O_NEXT_CLI=false
|
|
|
|
fi
|
|
|
|
|
2018-08-17 16:53:21 +02:00
|
|
|
if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then
|
2018-08-17 12:44:54 +02:00
|
|
|
G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key"
|
2021-11-24 09:04:47 +01:00
|
|
|
G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV"
|
2018-08-17 12:44:54 +02:00
|
|
|
else
|
|
|
|
G_NEXT_SRV=false
|
2021-11-24 09:04:47 +01:00
|
|
|
G_NEXT_SRV_NO_CERT=false
|
2018-08-17 12:44:54 +02:00
|
|
|
fi
|
|
|
|
|
2018-08-17 16:53:21 +02:00
|
|
|
if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then
|
2018-08-17 12:44:54 +02:00
|
|
|
G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt"
|
|
|
|
else
|
|
|
|
G_NEXT_CLI=false
|
|
|
|
fi
|
|
|
|
|
2014-02-21 09:47:37 +01:00
|
|
|
TESTS=0
|
|
|
|
FAILS=0
|
2014-08-14 14:31:29 +02:00
|
|
|
SKIPS=0
|
2014-02-21 09:47:37 +01:00
|
|
|
|
2021-05-28 09:42:25 +02:00
|
|
|
CONFIG_H='../include/mbedtls/mbedtls_config.h'
|
2014-04-07 13:24:21 +02:00
|
|
|
|
2014-02-26 16:35:27 +01:00
|
|
|
MEMCHECK=0
|
2014-03-13 19:17:53 +01:00
|
|
|
FILTER='.*'
|
2014-08-14 14:31:29 +02:00
|
|
|
EXCLUDE='^$'
|
2014-02-26 16:35:27 +01:00
|
|
|
|
2016-05-10 12:18:17 +02:00
|
|
|
SHOW_TEST_NUMBER=0
|
2016-05-10 11:50:43 +02:00
|
|
|
RUN_TEST_NUMBER=''
|
|
|
|
|
2016-05-10 12:47:13 +02:00
|
|
|
PRESERVE_LOGS=0
|
|
|
|
|
2017-04-14 17:55:28 +02: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 16:35:27 +01:00
|
|
|
print_usage() {
|
|
|
|
echo "Usage: $0 [options]"
|
2014-12-11 11:51:28 +01:00
|
|
|
printf " -h|--help\tPrint this help.\n"
|
|
|
|
printf " -m|--memcheck\tCheck memory leaks and errors.\n"
|
2020-08-26 22:35:46 +02:00
|
|
|
printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n"
|
|
|
|
printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n"
|
2016-05-10 11:50:43 +02:00
|
|
|
printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n"
|
2016-05-10 12:18:17 +02:00
|
|
|
printf " -s|--show-numbers\tShow test numbers in front of test names\n"
|
2016-05-10 12:47:13 +02:00
|
|
|
printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n"
|
2019-09-16 15:17:38 +02:00
|
|
|
printf " --outcome-file\tFile where test outcomes are written\n"
|
|
|
|
printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n"
|
|
|
|
printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n"
|
2017-04-14 17:55:28 +02:00
|
|
|
printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n"
|
2019-09-16 15:17:38 +02:00
|
|
|
printf " --seed \tInteger seed value to use for this test run\n"
|
2014-02-26 16:35:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
get_options() {
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case "$1" in
|
2014-03-13 19:17:53 +01:00
|
|
|
-f|--filter)
|
|
|
|
shift; FILTER=$1
|
|
|
|
;;
|
|
|
|
-e|--exclude)
|
|
|
|
shift; EXCLUDE=$1
|
|
|
|
;;
|
2014-02-26 16:35:27 +01:00
|
|
|
-m|--memcheck)
|
|
|
|
MEMCHECK=1
|
|
|
|
;;
|
2016-05-10 11:50:43 +02:00
|
|
|
-n|--number)
|
|
|
|
shift; RUN_TEST_NUMBER=$1
|
|
|
|
;;
|
2016-05-10 12:18:17 +02:00
|
|
|
-s|--show-numbers)
|
|
|
|
SHOW_TEST_NUMBER=1
|
|
|
|
;;
|
2016-05-10 12:47:13 +02:00
|
|
|
-p|--preserve-logs)
|
|
|
|
PRESERVE_LOGS=1
|
|
|
|
;;
|
2017-04-14 17:55:28 +02:00
|
|
|
--port)
|
|
|
|
shift; SRV_PORT=$1
|
|
|
|
;;
|
|
|
|
--proxy-port)
|
|
|
|
shift; PXY_PORT=$1
|
|
|
|
;;
|
2016-10-10 16:46:20 +02:00
|
|
|
--seed)
|
|
|
|
shift; SEED="$1"
|
|
|
|
;;
|
2014-02-26 16:35:27 +01:00
|
|
|
-h|--help)
|
|
|
|
print_usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
2014-05-22 15:47:58 +02:00
|
|
|
echo "Unknown argument: '$1'"
|
2014-02-26 16:35:27 +01:00
|
|
|
print_usage
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2019-09-16 15:17:38 +02:00
|
|
|
# Make the outcome file path relative to the original directory, not
|
|
|
|
# to .../tests
|
|
|
|
case "$MBEDTLS_TEST_OUTCOME_FILE" in
|
|
|
|
[!/]*)
|
|
|
|
MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2021-05-28 09:42:25 +02:00
|
|
|
# Read boolean configuration options from mbedtls_config.h for easy and quick
|
2020-08-26 21:53:33 +02:00
|
|
|
# testing. Skip non-boolean options (with something other than spaces
|
|
|
|
# and a comment after "#define SYMBOL"). The variable contains a
|
|
|
|
# space-separated list of symbols.
|
2021-12-10 11:45:51 +01:00
|
|
|
CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )"
|
2018-08-28 11:25:41 +02:00
|
|
|
# Skip next test; use this macro to skip tests which are legitimate
|
|
|
|
# in theory and expected to be re-introduced at some point, but
|
|
|
|
# aren't expected to succeed at the moment due to problems outside
|
|
|
|
# our control (such as bugs in other TLS implementations).
|
|
|
|
skip_next_test() {
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
}
|
|
|
|
|
2021-05-28 09:42:25 +02:00
|
|
|
# skip next test if the flag is not enabled in mbedtls_config.h
|
2015-03-24 10:43:55 +01:00
|
|
|
requires_config_enabled() {
|
2020-08-26 21:53:33 +02:00
|
|
|
case $CONFIGS_ENABLED in
|
2021-12-10 13:29:02 +01:00
|
|
|
*" $1"[\ =]*) :;;
|
2020-08-26 21:53:33 +02:00
|
|
|
*) SKIP_NEXT="YES";;
|
|
|
|
esac
|
2015-03-24 10:43:55 +01:00
|
|
|
}
|
|
|
|
|
2021-05-28 09:42:25 +02:00
|
|
|
# skip next test if the flag is enabled in mbedtls_config.h
|
2017-06-08 17:51:08 +02:00
|
|
|
requires_config_disabled() {
|
2020-08-26 21:53:33 +02:00
|
|
|
case $CONFIGS_ENABLED in
|
2021-12-10 13:29:02 +01:00
|
|
|
*" $1"[\ =]*) SKIP_NEXT="YES";;
|
2020-08-26 21:53:33 +02:00
|
|
|
esac
|
2017-06-08 17:51:08 +02:00
|
|
|
}
|
|
|
|
|
2018-08-28 17:09:22 +02:00
|
|
|
get_config_value_or_default() {
|
2018-10-16 22:29:07 +02:00
|
|
|
# This function uses the query_config command line option to query the
|
|
|
|
# required Mbed TLS compile time configuration from the ssl_server2
|
|
|
|
# program. The command will always return a success value if the
|
|
|
|
# configuration is defined and the value will be printed to stdout.
|
|
|
|
#
|
|
|
|
# Note that if the configuration is not defined or is defined to nothing,
|
|
|
|
# the output of this function will be an empty string.
|
|
|
|
${P_SRV} "query_config=${1}"
|
2018-08-28 17:09:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
requires_config_value_at_least() {
|
2018-10-16 22:29:07 +02:00
|
|
|
VAL="$( get_config_value_or_default "$1" )"
|
|
|
|
if [ -z "$VAL" ]; then
|
|
|
|
# Should never happen
|
|
|
|
echo "Mbed TLS configuration $1 is not defined"
|
|
|
|
exit 1
|
|
|
|
elif [ "$VAL" -lt "$2" ]; then
|
2018-08-24 15:40:12 +02:00
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
requires_config_value_at_most() {
|
2018-08-28 17:09:22 +02:00
|
|
|
VAL=$( get_config_value_or_default "$1" )
|
2018-10-16 22:29:07 +02:00
|
|
|
if [ -z "$VAL" ]; then
|
|
|
|
# Should never happen
|
|
|
|
echo "Mbed TLS configuration $1 is not defined"
|
|
|
|
exit 1
|
|
|
|
elif [ "$VAL" -gt "$2" ]; then
|
2018-08-24 15:40:12 +02:00
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals() {
|
|
|
|
VAL=$( get_config_value_or_default "$1" )
|
|
|
|
if [ -z "$VAL" ]; then
|
|
|
|
# Should never happen
|
|
|
|
echo "Mbed TLS configuration $1 is not defined"
|
|
|
|
exit 1
|
|
|
|
elif [ "$VAL" -ne "$2" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2022-04-08 19:33:07 +02:00
|
|
|
# Require Mbed TLS to support the given protocol version.
|
|
|
|
#
|
|
|
|
# Inputs:
|
|
|
|
# * $1: protocol version in mbedtls syntax (argument to force_version=)
|
|
|
|
requires_protocol_version() {
|
|
|
|
# Support for DTLS is detected separately in detect_dtls().
|
|
|
|
case "$1" in
|
|
|
|
tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;;
|
|
|
|
tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;;
|
|
|
|
*) echo "Unknown required protocol version: $1"; exit 1;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2020-08-26 21:53:33 +02:00
|
|
|
# Space-separated list of ciphersuites supported by this build of
|
|
|
|
# Mbed TLS.
|
|
|
|
P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null |
|
2021-11-18 09:27:17 +01:00
|
|
|
grep 'TLS-\|TLS1-3' |
|
2020-08-26 21:53:33 +02:00
|
|
|
tr -s ' \n' ' ')"
|
2018-11-16 18:27:29 +01:00
|
|
|
requires_ciphersuite_enabled() {
|
2020-08-26 21:53:33 +02:00
|
|
|
case $P_CIPHERSUITES in
|
|
|
|
*" $1 "*) :;;
|
|
|
|
*) SKIP_NEXT="YES";;
|
|
|
|
esac
|
2018-11-16 18:27:29 +01:00
|
|
|
}
|
|
|
|
|
2022-04-08 19:26:26 +02:00
|
|
|
# detect_required_features CMD [RUN_TEST_OPTION...]
|
|
|
|
# If CMD (call to a TLS client or server program) requires certain features,
|
|
|
|
# arrange to only run the following test case if those features are enabled.
|
|
|
|
detect_required_features() {
|
2022-04-08 19:33:07 +02:00
|
|
|
case "$1" in
|
|
|
|
*\ force_version=*)
|
|
|
|
tmp="${1##*\ force_version=}"
|
|
|
|
tmp="${tmp%%[!-0-9A-Z_a-z]*}"
|
|
|
|
requires_protocol_version "$tmp";;
|
|
|
|
esac
|
|
|
|
|
2020-06-26 23:35:53 +02:00
|
|
|
case "$1" in
|
2022-04-08 19:26:26 +02:00
|
|
|
*\ force_ciphersuite=*)
|
|
|
|
tmp="${1##*\ force_ciphersuite=}"
|
|
|
|
tmp="${tmp%%[!-0-9A-Z_a-z]*}"
|
|
|
|
requires_ciphersuite_enabled "$tmp";;
|
2020-06-26 23:35:53 +02:00
|
|
|
esac
|
|
|
|
|
2022-04-08 19:29:27 +02:00
|
|
|
case " $1 " in
|
|
|
|
*[-_\ =]tickets=[^0]*)
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TICKET_C;;
|
2020-06-26 23:35:53 +02:00
|
|
|
esac
|
2022-04-08 19:29:27 +02:00
|
|
|
case " $1 " in
|
|
|
|
*[-_\ =]alpn=*)
|
|
|
|
requires_config_enabled MBEDTLS_SSL_ALPN;;
|
|
|
|
esac
|
|
|
|
|
2022-04-08 19:26:26 +02:00
|
|
|
unset tmp
|
2020-06-26 23:35:53 +02:00
|
|
|
}
|
|
|
|
|
2022-03-14 18:21:24 +01:00
|
|
|
requires_certificate_authentication () {
|
|
|
|
if [ "$PSK_ONLY" = "YES" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
2020-06-26 23:35:53 +02:00
|
|
|
|
2022-02-25 19:52:52 +01:00
|
|
|
adapt_cmd_for_psk () {
|
|
|
|
case "$2" in
|
|
|
|
*openssl*) s='-psk abc123 -nocert';;
|
|
|
|
*gnutls-*) s='--pskkey=abc123';;
|
|
|
|
*) s='psk=abc123';;
|
|
|
|
esac
|
|
|
|
eval $1='"$2 $s"'
|
|
|
|
unset s
|
2020-06-26 23:35:53 +02:00
|
|
|
}
|
|
|
|
|
2022-02-25 19:52:52 +01:00
|
|
|
# maybe_adapt_for_psk [RUN_TEST_OPTION...]
|
|
|
|
# If running in a PSK-only build, maybe adapt the test to use a pre-shared key.
|
|
|
|
#
|
|
|
|
# If not running in a PSK-only build, do nothing.
|
|
|
|
# If the test looks like it doesn't use a pre-shared key but can run with a
|
|
|
|
# pre-shared key, pass a pre-shared key. If the test looks like it can't run
|
|
|
|
# with a pre-shared key, skip it. If the test looks like it's already using
|
|
|
|
# a pre-shared key, do nothing.
|
|
|
|
#
|
2022-04-05 22:00:17 +02:00
|
|
|
# This code does not consider builds with ECDHE-PSK or RSA-PSK.
|
2022-02-25 19:52:52 +01:00
|
|
|
#
|
|
|
|
# Inputs:
|
|
|
|
# * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands.
|
|
|
|
# * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges).
|
|
|
|
# * "$@": options passed to run_test.
|
|
|
|
#
|
|
|
|
# Outputs:
|
|
|
|
# * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments.
|
|
|
|
# * $SKIP_NEXT: set to YES if the test can't run with PSK.
|
|
|
|
maybe_adapt_for_psk() {
|
|
|
|
if [ "$PSK_ONLY" != "YES" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
if [ "$SKIP_NEXT" = "YES" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
case "$CLI_CMD $SRV_CMD" in
|
|
|
|
*[-_\ =]psk*|*[-_\ =]PSK*)
|
|
|
|
return;;
|
|
|
|
*force_ciphersuite*)
|
|
|
|
# The test case forces a non-PSK cipher suite. In some cases, a
|
|
|
|
# PSK cipher suite could be substituted, but we're not ready for
|
|
|
|
# that yet.
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
return;;
|
|
|
|
*\ auth_mode=*|*[-_\ =]crt[_=]*)
|
|
|
|
# The test case involves certificates. PSK won't do.
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
return;;
|
|
|
|
esac
|
|
|
|
adapt_cmd_for_psk CLI_CMD "$CLI_CMD"
|
|
|
|
adapt_cmd_for_psk SRV_CMD "$SRV_CMD"
|
|
|
|
}
|
|
|
|
|
|
|
|
case " $CONFIGS_ENABLED " in
|
|
|
|
*\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";;
|
|
|
|
*\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";;
|
|
|
|
*\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";;
|
|
|
|
*\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";;
|
|
|
|
*\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";;
|
|
|
|
*) PSK_ONLY="NO";;
|
|
|
|
esac
|
|
|
|
|
2014-10-20 13:34:59 +02: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
|
|
|
|
}
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
# skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value
|
|
|
|
requires_max_content_len() {
|
|
|
|
requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1
|
|
|
|
requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1
|
|
|
|
}
|
|
|
|
|
2014-08-20 20:15:53 +02:00
|
|
|
# skip next test if GnuTLS isn't available
|
|
|
|
requires_gnutls() {
|
|
|
|
if [ -z "${GNUTLS_AVAILABLE:-}" ]; then
|
2015-06-26 15:45:30 +02:00
|
|
|
if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then
|
2014-08-20 20:15:53 +02:00
|
|
|
GNUTLS_AVAILABLE="YES"
|
|
|
|
else
|
|
|
|
GNUTLS_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$GNUTLS_AVAILABLE" = "NO" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-08-17 12:44:54 +02:00
|
|
|
# skip next test if GnuTLS-next isn't available
|
|
|
|
requires_gnutls_next() {
|
|
|
|
if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then
|
|
|
|
if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then
|
|
|
|
GNUTLS_NEXT_AVAILABLE="YES"
|
|
|
|
else
|
|
|
|
GNUTLS_NEXT_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# skip next test if OpenSSL-legacy isn't available
|
|
|
|
requires_openssl_legacy() {
|
|
|
|
if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then
|
|
|
|
if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then
|
|
|
|
OPENSSL_LEGACY_AVAILABLE="YES"
|
|
|
|
else
|
|
|
|
OPENSSL_LEGACY_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-08-10 10:45:37 +02:00
|
|
|
requires_openssl_next() {
|
|
|
|
if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then
|
|
|
|
if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then
|
|
|
|
OPENSSL_NEXT_AVAILABLE="YES"
|
|
|
|
else
|
|
|
|
OPENSSL_NEXT_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# skip next test if tls1_3 is not available
|
|
|
|
requires_openssl_tls1_3() {
|
|
|
|
requires_openssl_next
|
|
|
|
if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then
|
|
|
|
OPENSSL_TLS1_3_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then
|
|
|
|
if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null
|
|
|
|
then
|
|
|
|
OPENSSL_TLS1_3_AVAILABLE="YES"
|
|
|
|
else
|
|
|
|
OPENSSL_TLS1_3_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# skip next test if tls1_3 is not available
|
|
|
|
requires_gnutls_tls1_3() {
|
|
|
|
requires_gnutls_next
|
|
|
|
if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then
|
|
|
|
GNUTLS_TLS1_3_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then
|
|
|
|
if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null
|
|
|
|
then
|
|
|
|
GNUTLS_TLS1_3_AVAILABLE="YES"
|
|
|
|
else
|
|
|
|
GNUTLS_TLS1_3_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-09-02 11:40:08 +02:00
|
|
|
# Check %NO_TICKETS option
|
2021-08-17 04:56:08 +02:00
|
|
|
requires_gnutls_next_no_ticket() {
|
|
|
|
requires_gnutls_next
|
|
|
|
if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then
|
|
|
|
GNUTLS_NO_TICKETS_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then
|
|
|
|
if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null
|
|
|
|
then
|
|
|
|
GNUTLS_NO_TICKETS_AVAILABLE="YES"
|
|
|
|
else
|
|
|
|
GNUTLS_NO_TICKETS_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-09-02 11:40:08 +02:00
|
|
|
# Check %DISABLE_TLS13_COMPAT_MODE option
|
2021-08-17 04:56:08 +02:00
|
|
|
requires_gnutls_next_disable_tls13_compat() {
|
|
|
|
requires_gnutls_next
|
|
|
|
if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then
|
|
|
|
GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then
|
|
|
|
if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null
|
|
|
|
then
|
|
|
|
GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES"
|
|
|
|
else
|
|
|
|
GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2014-07-23 20:17:47 +02: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
|
|
|
|
}
|
|
|
|
|
2018-10-11 14:43:30 +02:00
|
|
|
# skip next test if it's i686 or uname is not available
|
|
|
|
requires_not_i686() {
|
|
|
|
if [ -z "${IS_I686:-}" ]; then
|
|
|
|
IS_I686="YES"
|
|
|
|
if which "uname" >/dev/null 2>&1; then
|
|
|
|
if [ -z "$(uname -a | grep i686)" ]; then
|
|
|
|
IS_I686="NO"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$IS_I686" = "YES" ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-04-11 08:28:39 +02:00
|
|
|
# Calculate the input & output maximum content lengths set in the config
|
2021-05-04 19:36:56 +02:00
|
|
|
MAX_CONTENT_LEN=16384
|
2021-06-22 08:16:40 +02:00
|
|
|
MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" )
|
|
|
|
MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" )
|
2018-04-11 08:28:39 +02:00
|
|
|
|
2021-06-21 20:43:33 +02:00
|
|
|
# Calculate the maximum content length that fits both
|
2018-04-11 08:28:39 +02:00
|
|
|
if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then
|
|
|
|
MAX_CONTENT_LEN="$MAX_IN_LEN"
|
|
|
|
fi
|
|
|
|
if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then
|
|
|
|
MAX_CONTENT_LEN="$MAX_OUT_LEN"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# skip the next test if the SSL output buffer is less than 16KB
|
|
|
|
requires_full_size_output_buffer() {
|
|
|
|
if [ "$MAX_OUT_LEN" -ne 16384 ]; then
|
|
|
|
SKIP_NEXT="YES"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2014-09-24 15:17:31 +02: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 11:33:25 +02: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 12:46:27 +02:00
|
|
|
# multiply the client timeout delay by the given factor for the next test
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time() {
|
2014-09-20 12:46:27 +02:00
|
|
|
CLI_DELAY_FACTOR=$1
|
|
|
|
}
|
|
|
|
|
2016-09-02 14:45:28 +02: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 09:20:14 +01:00
|
|
|
# print_name <name>
|
|
|
|
print_name() {
|
2016-05-10 12:18:17 +02:00
|
|
|
TESTS=$(( $TESTS + 1 ))
|
|
|
|
LINE=""
|
|
|
|
|
|
|
|
if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then
|
|
|
|
LINE="$TESTS "
|
|
|
|
fi
|
|
|
|
|
|
|
|
LINE="$LINE$1"
|
2020-08-26 20:05:11 +02:00
|
|
|
printf "%s " "$LINE"
|
2016-05-10 12:18:17 +02:00
|
|
|
LEN=$(( 72 - `echo "$LINE" | wc -c` ))
|
2014-12-11 11:51:28 +01:00
|
|
|
for i in `seq 1 $LEN`; do printf '.'; done
|
|
|
|
printf ' '
|
2014-02-21 09:47:37 +01:00
|
|
|
|
2014-02-21 09:20:14 +01:00
|
|
|
}
|
|
|
|
|
2019-09-16 15:17:38 +02:00
|
|
|
# record_outcome <outcome> [<failure-reason>]
|
|
|
|
# The test name must be in $NAME.
|
2022-01-07 15:47:02 +01:00
|
|
|
# Use $TEST_SUITE_NAME as the test suite name if set.
|
2019-09-16 15:17:38 +02:00
|
|
|
record_outcome() {
|
|
|
|
echo "$1"
|
|
|
|
if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then
|
|
|
|
printf '%s;%s;%s;%s;%s;%s\n' \
|
|
|
|
"$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \
|
2022-01-07 15:47:02 +01:00
|
|
|
"${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \
|
2019-09-16 15:17:38 +02:00
|
|
|
"$1" "${2-}" \
|
|
|
|
>>"$MBEDTLS_TEST_OUTCOME_FILE"
|
|
|
|
fi
|
|
|
|
}
|
2022-01-07 15:47:02 +01:00
|
|
|
unset TEST_SUITE_NAME
|
2019-09-16 15:17:38 +02:00
|
|
|
|
2021-10-20 14:17:02 +02:00
|
|
|
# True if the presence of the given pattern in a log definitely indicates
|
|
|
|
# that the test has failed. False if the presence is inconclusive.
|
|
|
|
#
|
|
|
|
# Inputs:
|
|
|
|
# * $1: pattern found in the logs
|
|
|
|
# * $TIMES_LEFT: >0 if retrying is an option
|
|
|
|
#
|
|
|
|
# Outputs:
|
|
|
|
# * $outcome: set to a retry reason if the pattern is inconclusive,
|
|
|
|
# unchanged otherwise.
|
|
|
|
# * Return value: 1 if the pattern is inconclusive,
|
|
|
|
# 0 if the failure is definitive.
|
|
|
|
log_pattern_presence_is_conclusive() {
|
|
|
|
# If we've run out of attempts, then don't retry no matter what.
|
|
|
|
if [ $TIMES_LEFT -eq 0 ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
case $1 in
|
|
|
|
"resend")
|
|
|
|
# An undesired resend may have been caused by the OS dropping or
|
|
|
|
# delaying a packet at an inopportune time.
|
|
|
|
outcome="RETRY(resend)"
|
|
|
|
return 1;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2014-02-21 09:20:14 +01:00
|
|
|
# fail <message>
|
|
|
|
fail() {
|
2019-09-16 15:17:38 +02:00
|
|
|
record_outcome "FAIL" "$1"
|
2014-02-27 15:37:24 +01:00
|
|
|
echo " ! $1"
|
2014-02-21 09:47:37 +01:00
|
|
|
|
2014-08-31 16:46:04 +02:00
|
|
|
mv $SRV_OUT o-srv-${TESTS}.log
|
|
|
|
mv $CLI_OUT o-cli-${TESTS}.log
|
2014-09-05 17:45:19 +02: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 09:47:37 +01:00
|
|
|
|
2020-06-08 11:49:05 +02:00
|
|
|
if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then
|
2014-08-31 17:42:53 +02:00
|
|
|
echo " ! server output:"
|
|
|
|
cat o-srv-${TESTS}.log
|
2014-09-05 17:45:19 +02:00
|
|
|
echo " ! ========================================================"
|
2014-08-31 17:42:53 +02:00
|
|
|
echo " ! client output:"
|
|
|
|
cat o-cli-${TESTS}.log
|
2014-09-05 17:45:19 +02:00
|
|
|
if [ -n "$PXY_CMD" ]; then
|
|
|
|
echo " ! ========================================================"
|
|
|
|
echo " ! proxy output:"
|
|
|
|
cat o-pxy-${TESTS}.log
|
|
|
|
fi
|
|
|
|
echo ""
|
2014-08-31 17:42:53 +02:00
|
|
|
fi
|
|
|
|
|
2014-08-31 10:22:11 +02:00
|
|
|
FAILS=$(( $FAILS + 1 ))
|
2014-02-21 09:20:14 +01:00
|
|
|
}
|
|
|
|
|
2014-02-25 16:42:31 +01:00
|
|
|
# is_polar <cmd_line>
|
|
|
|
is_polar() {
|
2020-08-26 21:53:33 +02:00
|
|
|
case "$1" in
|
|
|
|
*ssl_client2*) true;;
|
|
|
|
*ssl_server2*) true;;
|
|
|
|
*) false;;
|
|
|
|
esac
|
2014-02-25 16:42:31 +01:00
|
|
|
}
|
|
|
|
|
2014-09-26 16:07:29 +02:00
|
|
|
# openssl s_server doesn't have -www with DTLS
|
|
|
|
check_osrv_dtls() {
|
2020-08-26 21:53:33 +02:00
|
|
|
case "$SRV_CMD" in
|
|
|
|
*s_server*-dtls*)
|
|
|
|
NEEDS_INPUT=1
|
|
|
|
SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";;
|
|
|
|
*) NEEDS_INPUT=0;;
|
|
|
|
esac
|
2014-09-26 16:07:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# 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 16:35:27 +01: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 16:42:57 +02:00
|
|
|
# Wait for process $2 named $3 to be listening on port $1. Print error to $4.
|
2017-12-14 18:58:42 +01:00
|
|
|
if type lsof >/dev/null 2>/dev/null; then
|
2019-09-02 16:42:57 +02:00
|
|
|
wait_app_start() {
|
2021-10-20 16:59:33 +02:00
|
|
|
newline='
|
|
|
|
'
|
2017-12-14 18:58:42 +01:00
|
|
|
START_TIME=$(date +%s)
|
2014-07-23 20:17:47 +02:00
|
|
|
if [ "$DTLS" -eq 1 ]; then
|
2017-12-14 18:58:42 +01:00
|
|
|
proto=UDP
|
2014-07-23 20:17:47 +02:00
|
|
|
else
|
2017-12-14 18:58:42 +01:00
|
|
|
proto=TCP
|
2014-07-23 20:17:47 +02:00
|
|
|
fi
|
2017-12-14 18:58:42 +01:00
|
|
|
# Make a tight loop, server normally takes less than 1s to start.
|
2021-10-19 18:56:39 +02:00
|
|
|
while true; do
|
2022-04-15 22:53:18 +02:00
|
|
|
SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t)
|
2021-10-20 16:59:33 +02:00
|
|
|
# When we use a proxy, it will be listening on the same port we
|
|
|
|
# are checking for as well as the server and lsof will list both.
|
|
|
|
case ${newline}${SERVER_PIDS}${newline} in
|
2022-04-15 22:53:18 +02:00
|
|
|
*${newline}${2}${newline}*) break;;
|
2021-10-20 16:59:33 +02:00
|
|
|
esac
|
2017-12-14 18:58:42 +01:00
|
|
|
if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then
|
2019-09-02 16:42:57 +02:00
|
|
|
echo "$3 START TIMEOUT"
|
|
|
|
echo "$3 START TIMEOUT" >> $4
|
2017-12-14 18:58:42 +01: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 16:42:57 +02:00
|
|
|
echo "Warning: lsof not available, wait_app_start = sleep"
|
|
|
|
wait_app_start() {
|
2014-06-20 18:41:11 +02:00
|
|
|
sleep "$START_DELAY"
|
2017-12-14 18:58:42 +01:00
|
|
|
}
|
|
|
|
fi
|
2014-06-20 18:41:11 +02:00
|
|
|
|
2019-09-02 16:42:57 +02: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 16:44:01 +02:00
|
|
|
# Given the client or server debug output, parse the unix timestamp that is
|
2017-09-14 13:41:29 +02:00
|
|
|
# included in the first 4 bytes of the random bytes and check that it's within
|
2017-09-06 16:44:01 +02:00
|
|
|
# acceptable bounds
|
|
|
|
check_server_hello_time() {
|
|
|
|
# Extract the time from the debug (lvl 3) output of the client
|
2017-09-15 16:49:24 +02:00
|
|
|
SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")"
|
2017-09-06 16:44:01 +02: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 13:41:29 +02:00
|
|
|
# The time in ServerHello is at least 5 minutes later than now
|
2017-09-06 16:44:01 +02:00
|
|
|
return 1
|
|
|
|
else
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-11-26 16:32:40 +01:00
|
|
|
# Get handshake memory usage from server or client output and put it into the variable specified by the first argument
|
|
|
|
handshake_memory_get() {
|
|
|
|
OUTPUT_VARIABLE="$1"
|
|
|
|
OUTPUT_FILE="$2"
|
|
|
|
|
|
|
|
# Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112"
|
|
|
|
MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1)
|
|
|
|
|
|
|
|
# Check if memory usage was read
|
|
|
|
if [ -z "$MEM_USAGE" ]; then
|
|
|
|
echo "Error: Can not read the value of handshake memory usage"
|
|
|
|
return 1
|
|
|
|
else
|
|
|
|
eval "$OUTPUT_VARIABLE=$MEM_USAGE"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Get handshake memory usage from server or client output and check if this value
|
|
|
|
# is not higher than the maximum given by the first argument
|
|
|
|
handshake_memory_check() {
|
|
|
|
MAX_MEMORY="$1"
|
|
|
|
OUTPUT_FILE="$2"
|
|
|
|
|
|
|
|
# Get memory usage
|
|
|
|
if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check if memory usage is below max value
|
|
|
|
if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then
|
|
|
|
echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \
|
|
|
|
"but should be below $MAX_MEMORY bytes"
|
|
|
|
return 1
|
|
|
|
else
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2014-08-30 22:41:47 +02: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 12:46:27 +02:00
|
|
|
CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR ))
|
|
|
|
CLI_DELAY_FACTOR=1
|
|
|
|
|
2015-08-04 20:57:59 +02:00
|
|
|
( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) &
|
2014-09-20 13:15:43 +02:00
|
|
|
DOG_PID=$!
|
2014-08-30 22:41:47 +02:00
|
|
|
|
|
|
|
wait $CLI_PID
|
|
|
|
CLI_EXIT=$?
|
|
|
|
|
2014-09-20 13:15:43 +02:00
|
|
|
kill $DOG_PID >/dev/null 2>&1
|
|
|
|
wait $DOG_PID
|
2014-08-30 22:41:47 +02:00
|
|
|
|
|
|
|
echo "EXIT: $CLI_EXIT" >> $CLI_OUT
|
2016-09-02 14:45:28 +02:00
|
|
|
|
|
|
|
sleep $SRV_DELAY_SECONDS
|
|
|
|
SRV_DELAY_SECONDS=0
|
2014-08-30 22:41:47 +02:00
|
|
|
}
|
|
|
|
|
2014-07-23 20:17:47 +02:00
|
|
|
# check if the given command uses dtls and sets global variable DTLS
|
|
|
|
detect_dtls() {
|
2020-08-26 21:53:33 +02:00
|
|
|
case "$1" in
|
2021-10-12 17:02:55 +02:00
|
|
|
*dtls=1*|*-dtls*|*-u*) DTLS=1;;
|
2020-08-26 21:53:33 +02:00
|
|
|
*) DTLS=0;;
|
|
|
|
esac
|
2014-07-23 20:17:47 +02:00
|
|
|
}
|
|
|
|
|
2021-02-10 13:45:41 +01:00
|
|
|
# check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS
|
|
|
|
is_gnutls() {
|
|
|
|
case "$1" in
|
|
|
|
*gnutls-cli*)
|
|
|
|
CMD_IS_GNUTLS=1
|
|
|
|
;;
|
|
|
|
*gnutls-serv*)
|
|
|
|
CMD_IS_GNUTLS=1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
CMD_IS_GNUTLS=0
|
|
|
|
;;
|
|
|
|
esac
|
2014-07-23 20:17:47 +02:00
|
|
|
}
|
|
|
|
|
2022-03-14 17:55:04 +01:00
|
|
|
# Determine what calc_verify trace is to be expected, if any.
|
|
|
|
#
|
|
|
|
# calc_verify is only called for two things: to calculate the
|
|
|
|
# extended master secret, and to process client authentication.
|
|
|
|
#
|
|
|
|
# Warning: the current implementation assumes that extended_ms is not
|
|
|
|
# disabled on the client or on the server.
|
|
|
|
#
|
|
|
|
# Inputs:
|
2022-04-06 22:23:45 +02:00
|
|
|
# * $1: the value of the server auth_mode parameter.
|
|
|
|
# 'required' if client authentication is expected,
|
|
|
|
# 'none' or absent if not.
|
2022-03-14 17:55:04 +01:00
|
|
|
# * $CONFIGS_ENABLED
|
|
|
|
#
|
|
|
|
# Outputs:
|
|
|
|
# * $maybe_calc_verify: set to a trace expected in the debug logs
|
|
|
|
set_maybe_calc_verify() {
|
|
|
|
maybe_calc_verify=
|
|
|
|
case $CONFIGS_ENABLED in
|
|
|
|
*\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;;
|
|
|
|
*)
|
|
|
|
case ${1-} in
|
2022-04-06 22:23:45 +02:00
|
|
|
''|none) return;;
|
|
|
|
required) :;;
|
2022-03-14 17:55:04 +01:00
|
|
|
*) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
case $CONFIGS_ENABLED in
|
|
|
|
*\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";;
|
|
|
|
*) maybe_calc_verify="<= calc verify";;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2020-09-24 12:01:13 +02:00
|
|
|
# Compare file content
|
|
|
|
# Usage: find_in_both pattern file1 file2
|
|
|
|
# extract from file1 the first line matching the pattern
|
|
|
|
# check in file2 that the same line can be found
|
|
|
|
find_in_both() {
|
|
|
|
srv_pattern=$(grep -m 1 "$1" "$2");
|
|
|
|
if [ -z "$srv_pattern" ]; then
|
|
|
|
return 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
if grep "$srv_pattern" $3 >/dev/null; then :
|
2020-10-09 20:43:51 +02:00
|
|
|
return 0;
|
2020-09-24 12:01:13 +02:00
|
|
|
else
|
|
|
|
return 1;
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-08-06 05:22:24 +02:00
|
|
|
SKIP_HANDSHAKE_CHECK="NO"
|
|
|
|
skip_handshake_stage_check() {
|
|
|
|
SKIP_HANDSHAKE_CHECK="YES"
|
|
|
|
}
|
|
|
|
|
2021-10-19 16:25:10 +02:00
|
|
|
# Analyze the commands that will be used in a test.
|
|
|
|
#
|
|
|
|
# Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass
|
|
|
|
# extra arguments or go through wrappers.
|
2022-04-05 22:00:17 +02:00
|
|
|
#
|
|
|
|
# Inputs:
|
|
|
|
# * $@: supplemental options to run_test() (after the mandatory arguments).
|
|
|
|
# * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands.
|
|
|
|
# * $DTLS: 1 if DTLS, otherwise 0.
|
|
|
|
#
|
|
|
|
# Outputs:
|
|
|
|
# * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked.
|
2021-10-19 16:25:10 +02:00
|
|
|
analyze_test_commands() {
|
2020-06-08 11:40:06 +02:00
|
|
|
# if the test uses DTLS but no custom proxy, add a simple proxy
|
|
|
|
# as it provides timing info that's useful to debug failures
|
2020-06-25 09:54:46 +02:00
|
|
|
if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then
|
2020-06-08 11:40:06 +02:00
|
|
|
PXY_CMD="$P_PXY"
|
2020-07-16 10:19:32 +02:00
|
|
|
case " $SRV_CMD " in
|
|
|
|
*' server_addr=::1 '*)
|
|
|
|
PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";;
|
|
|
|
esac
|
2020-06-08 11:40:06 +02:00
|
|
|
fi
|
|
|
|
|
2021-02-10 13:45:41 +01:00
|
|
|
# update CMD_IS_GNUTLS variable
|
|
|
|
is_gnutls "$SRV_CMD"
|
|
|
|
|
|
|
|
# if the server uses gnutls but doesn't set priority, explicitly
|
|
|
|
# set the default priority
|
|
|
|
if [ "$CMD_IS_GNUTLS" -eq 1 ]; then
|
|
|
|
case "$SRV_CMD" in
|
|
|
|
*--priority*) :;;
|
|
|
|
*) SRV_CMD="$SRV_CMD --priority=NORMAL";;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
# update CMD_IS_GNUTLS variable
|
|
|
|
is_gnutls "$CLI_CMD"
|
|
|
|
|
|
|
|
# if the client uses gnutls but doesn't set priority, explicitly
|
|
|
|
# set the default priority
|
|
|
|
if [ "$CMD_IS_GNUTLS" -eq 1 ]; then
|
|
|
|
case "$CLI_CMD" in
|
|
|
|
*--priority*) :;;
|
|
|
|
*) CLI_CMD="$CLI_CMD --priority=NORMAL";;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2014-09-05 17:45:19 +02:00
|
|
|
# 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-02-26 16:35:27 +01: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
|
2021-10-19 16:25:10 +02:00
|
|
|
}
|
2014-02-26 16:35:27 +01:00
|
|
|
|
2021-10-19 16:25:10 +02:00
|
|
|
# Check for failure conditions after a test case.
|
|
|
|
#
|
|
|
|
# Inputs from run_test:
|
|
|
|
# * positional parameters: test options (see run_test documentation)
|
|
|
|
# * $CLI_EXIT: client return code
|
|
|
|
# * $CLI_EXPECT: expected client return code
|
|
|
|
# * $SRV_RET: server return code
|
|
|
|
# * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs
|
2021-10-19 17:23:25 +02:00
|
|
|
# * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed
|
2021-10-19 16:25:10 +02:00
|
|
|
#
|
|
|
|
# Outputs:
|
2021-10-19 18:00:10 +02:00
|
|
|
# * $outcome: one of PASS/RETRY*/FAIL
|
2021-10-19 16:25:10 +02:00
|
|
|
check_test_failure() {
|
2021-10-19 17:23:25 +02:00
|
|
|
outcome=FAIL
|
2014-02-25 16:42:31 +01:00
|
|
|
|
2021-10-19 17:23:25 +02:00
|
|
|
if [ $TIMES_LEFT -gt 0 ] &&
|
|
|
|
grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null
|
|
|
|
then
|
2021-10-19 18:00:10 +02:00
|
|
|
outcome="RETRY(client-timeout)"
|
2021-10-19 17:23:25 +02:00
|
|
|
return
|
|
|
|
fi
|
2015-08-04 20:57:59 +02:00
|
|
|
|
2014-02-25 16:42:31 +01:00
|
|
|
# check if the client and server went at least to the handshake stage
|
2014-05-22 15:47:58 +02:00
|
|
|
# (useful to avoid tests with only negative assertions and non-zero
|
2014-02-25 16:42:31 +01:00
|
|
|
# expected client exit to incorrectly succeed in case of catastrophic
|
|
|
|
# failure)
|
2021-08-06 05:22:24 +02:00
|
|
|
if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ]
|
|
|
|
then
|
|
|
|
if is_polar "$SRV_CMD"; then
|
|
|
|
if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :;
|
|
|
|
else
|
|
|
|
fail "server or client failed to reach handshake stage"
|
|
|
|
return
|
|
|
|
fi
|
2014-02-25 16:42:31 +01:00
|
|
|
fi
|
2021-08-06 05:22:24 +02:00
|
|
|
if is_polar "$CLI_CMD"; then
|
|
|
|
if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :;
|
|
|
|
else
|
|
|
|
fail "server or client failed to reach handshake stage"
|
|
|
|
return
|
|
|
|
fi
|
2014-02-25 16:42:31 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-08-06 05:22:24 +02:00
|
|
|
SKIP_HANDSHAKE_CHECK="NO"
|
2021-02-09 21:01:33 +01:00
|
|
|
# Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't
|
|
|
|
# exit with status 0 when interrupted by a signal, and we don't really
|
|
|
|
# care anyway), in case e.g. the server reports a memory leak.
|
|
|
|
if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then
|
2021-02-02 23:29:03 +01:00
|
|
|
fail "Server exited with status $SRV_RET"
|
2014-02-21 09:20:14 +01:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2014-02-20 11:01:30 +01:00
|
|
|
# check client exit code
|
2014-02-25 17:14:15 +01:00
|
|
|
if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \
|
|
|
|
\( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ]
|
2014-02-20 17:19:59 +01:00
|
|
|
then
|
2014-09-05 17:45:19 +02:00
|
|
|
fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)"
|
2014-02-20 11:01:30 +01:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2014-02-26 16:35:27 +01:00
|
|
|
# check other assertions
|
2014-08-21 19:38:32 +02:00
|
|
|
# lines beginning with == are added by valgrind, ignore them
|
2016-05-13 11:16:46 +02:00
|
|
|
# lines with 'Serious error when reading debug info', are valgrind issues as well
|
2014-02-20 11:01:30 +01:00
|
|
|
while [ $# -gt 0 ]
|
|
|
|
do
|
|
|
|
case $1 in
|
|
|
|
"-s")
|
2016-05-13 11:16:46 +02:00
|
|
|
if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else
|
2016-10-14 01:48:33 +02:00
|
|
|
fail "pattern '$2' MUST be present in the Server output"
|
2014-02-20 11:01:30 +01:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
"-c")
|
2016-05-13 11:16:46 +02:00
|
|
|
if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else
|
2016-10-14 01:48:33 +02:00
|
|
|
fail "pattern '$2' MUST be present in the Client output"
|
2014-02-20 11:01:30 +01:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
"-S")
|
2016-05-13 11:16:46 +02:00
|
|
|
if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then
|
2021-10-20 14:17:02 +02:00
|
|
|
if log_pattern_presence_is_conclusive "$2"; then
|
2021-10-19 18:00:10 +02:00
|
|
|
fail "pattern '$2' MUST NOT be present in the Server output"
|
|
|
|
fi
|
2014-02-20 11:01:30 +01:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
"-C")
|
2016-05-13 11:16:46 +02:00
|
|
|
if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then
|
2021-10-20 14:17:02 +02:00
|
|
|
if log_pattern_presence_is_conclusive "$2"; then
|
2021-10-19 18:00:10 +02:00
|
|
|
fail "pattern '$2' MUST NOT be present in the Client output"
|
|
|
|
fi
|
2016-10-14 01:48:33 +02:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
# The filtering in the following two options (-u and -U) do the following
|
|
|
|
# - ignore valgrind output
|
2019-01-23 15:24:37 +01:00
|
|
|
# - filter out everything but lines right after the pattern occurrences
|
2016-10-14 01:48:33 +02: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 11:01:30 +01:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
;;
|
2017-09-06 16:38:07 +02: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
|
|
|
|
;;
|
2020-09-24 12:01:13 +02:00
|
|
|
"-g")
|
|
|
|
if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then
|
|
|
|
fail "function call to '$2' failed on Server and Client output"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
;;
|
2014-02-20 11:01:30 +01:00
|
|
|
|
|
|
|
*)
|
2014-05-22 15:47:58 +02:00
|
|
|
echo "Unknown test: $1" >&2
|
2014-02-20 11:01:30 +01:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
shift 2
|
|
|
|
done
|
|
|
|
|
2014-02-26 16:35:27 +01:00
|
|
|
# check valgrind's results
|
|
|
|
if [ "$MEMCHECK" -gt 0 ]; then
|
2014-05-28 23:06:50 +02:00
|
|
|
if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then
|
2014-02-26 16:35:27 +01:00
|
|
|
fail "Server has memory errors"
|
|
|
|
return
|
|
|
|
fi
|
2014-05-28 23:06:50 +02:00
|
|
|
if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then
|
2014-02-26 16:35:27 +01:00
|
|
|
fail "Client has memory errors"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-02-20 11:01:30 +01:00
|
|
|
# if we're here, everything is ok
|
2021-10-19 17:23:25 +02:00
|
|
|
outcome=PASS
|
2021-10-19 16:25:10 +02:00
|
|
|
}
|
|
|
|
|
2021-10-19 16:35:35 +02:00
|
|
|
# Run the current test case: start the server and if applicable the proxy, run
|
|
|
|
# the client, wait for all processes to finish or time out.
|
|
|
|
#
|
|
|
|
# Inputs:
|
|
|
|
# * $NAME: test case name
|
|
|
|
# * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run
|
|
|
|
# * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs
|
|
|
|
#
|
|
|
|
# Outputs:
|
|
|
|
# * $CLI_EXIT: client return code
|
|
|
|
# * $SRV_RET: server return code
|
|
|
|
do_run_test_once() {
|
|
|
|
# run the commands
|
|
|
|
if [ -n "$PXY_CMD" ]; then
|
|
|
|
printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT
|
|
|
|
$PXY_CMD >> $PXY_OUT 2>&1 &
|
|
|
|
PXY_PID=$!
|
|
|
|
wait_proxy_start "$PXY_PORT" "$PXY_PID"
|
|
|
|
fi
|
|
|
|
|
|
|
|
check_osrv_dtls
|
|
|
|
printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT
|
|
|
|
provide_input | $SRV_CMD >> $SRV_OUT 2>&1 &
|
|
|
|
SRV_PID=$!
|
|
|
|
wait_server_start "$SRV_PORT" "$SRV_PID"
|
|
|
|
|
|
|
|
printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT
|
|
|
|
eval "$CLI_CMD" >> $CLI_OUT 2>&1 &
|
|
|
|
wait_client_done
|
|
|
|
|
|
|
|
sleep 0.05
|
|
|
|
|
|
|
|
# terminate the server (and the proxy)
|
|
|
|
kill $SRV_PID
|
|
|
|
wait $SRV_PID
|
|
|
|
SRV_RET=$?
|
|
|
|
|
|
|
|
if [ -n "$PXY_CMD" ]; then
|
|
|
|
kill $PXY_PID >/dev/null 2>&1
|
|
|
|
wait $PXY_PID
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-10-19 16:25:10 +02:00
|
|
|
# Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]]
|
|
|
|
# Options: -s pattern pattern that must be present in server output
|
|
|
|
# -c pattern pattern that must be present in client output
|
|
|
|
# -u pattern lines after pattern must be unique in client output
|
|
|
|
# -f call shell function on client output
|
|
|
|
# -S pattern pattern that must be absent in server output
|
|
|
|
# -C pattern pattern that must be absent in client output
|
|
|
|
# -U pattern lines after pattern must be unique in server output
|
|
|
|
# -F call shell function on server output
|
|
|
|
# -g call shell function on server and client output
|
|
|
|
run_test() {
|
|
|
|
NAME="$1"
|
|
|
|
shift 1
|
|
|
|
|
|
|
|
if is_excluded "$NAME"; then
|
|
|
|
SKIP_NEXT="NO"
|
|
|
|
# There was no request to run the test, so don't record its outcome.
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
print_name "$NAME"
|
|
|
|
|
|
|
|
# Do we only run numbered tests?
|
|
|
|
if [ -n "$RUN_TEST_NUMBER" ]; then
|
|
|
|
case ",$RUN_TEST_NUMBER," in
|
|
|
|
*",$TESTS,"*) :;;
|
|
|
|
*) SKIP_NEXT="YES";;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Check if test uses files
|
|
|
|
case "$SRV_CMD $CLI_CMD" in
|
|
|
|
*data_files/*)
|
|
|
|
requires_config_enabled MBEDTLS_FS_IO;;
|
|
|
|
esac
|
|
|
|
|
2022-02-25 19:46:30 +01:00
|
|
|
# Check if the test uses DTLS.
|
|
|
|
detect_dtls "$SRV_CMD"
|
|
|
|
if [ "$DTLS" -eq 1 ]; then
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
fi
|
|
|
|
|
2022-04-08 19:26:26 +02:00
|
|
|
# If the client or server requires certain features that can be detected
|
|
|
|
# from their command-line arguments, check that they're enabled.
|
|
|
|
detect_required_features "$SRV_CMD" "$@"
|
|
|
|
detect_required_features "$CLI_CMD" "$@"
|
2021-10-19 16:25:10 +02:00
|
|
|
|
2022-02-25 19:52:52 +01:00
|
|
|
# If we're in a PSK-only build and the test can be adapted to PSK, do that.
|
|
|
|
maybe_adapt_for_psk "$@"
|
2021-10-19 16:25:10 +02:00
|
|
|
|
|
|
|
# should we skip?
|
|
|
|
if [ "X$SKIP_NEXT" = "XYES" ]; then
|
|
|
|
SKIP_NEXT="NO"
|
|
|
|
record_outcome "SKIP"
|
|
|
|
SKIPS=$(( $SKIPS + 1 ))
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
analyze_test_commands "$@"
|
|
|
|
|
2022-04-01 14:52:06 +02:00
|
|
|
# One regular run and two retries
|
|
|
|
TIMES_LEFT=3
|
2021-10-19 16:25:10 +02:00
|
|
|
while [ $TIMES_LEFT -gt 0 ]; do
|
|
|
|
TIMES_LEFT=$(( $TIMES_LEFT - 1 ))
|
|
|
|
|
2021-10-19 16:35:35 +02:00
|
|
|
do_run_test_once
|
2021-10-19 16:25:10 +02:00
|
|
|
|
2021-10-19 17:23:25 +02:00
|
|
|
check_test_failure "$@"
|
|
|
|
case $outcome in
|
|
|
|
PASS) break;;
|
2021-10-19 18:00:10 +02:00
|
|
|
RETRY*) printf "$outcome ";;
|
2021-10-19 17:23:25 +02:00
|
|
|
FAIL) return;;
|
|
|
|
esac
|
2021-10-19 16:25:10 +02:00
|
|
|
done
|
|
|
|
|
2021-10-19 17:23:25 +02:00
|
|
|
# If we get this far, the test case passed.
|
2019-09-16 15:17:38 +02:00
|
|
|
record_outcome "PASS"
|
2016-05-10 12:47:13 +02:00
|
|
|
if [ "$PRESERVE_LOGS" -gt 0 ]; then
|
|
|
|
mv $SRV_OUT o-srv-${TESTS}.log
|
|
|
|
mv $CLI_OUT o-cli-${TESTS}.log
|
2018-08-20 13:21:35 +02:00
|
|
|
if [ -n "$PXY_CMD" ]; then
|
|
|
|
mv $PXY_OUT o-pxy-${TESTS}.log
|
|
|
|
fi
|
2016-05-10 12:47:13 +02:00
|
|
|
fi
|
|
|
|
|
2014-09-05 17:45:19 +02:00
|
|
|
rm -f $SRV_OUT $CLI_OUT $PXY_OUT
|
2014-02-20 11:01:30 +01:00
|
|
|
}
|
|
|
|
|
2018-11-16 18:28:40 +01:00
|
|
|
run_test_psa() {
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2022-03-14 17:55:04 +01:00
|
|
|
set_maybe_calc_verify none
|
2018-11-20 12:37:34 +01:00
|
|
|
run_test "PSA-supported ciphersuite: $1" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV debug_level=3 force_version=tls12" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_CLI debug_level=3 force_ciphersuite=$1" \
|
2018-11-16 18:28:40 +01:00
|
|
|
0 \
|
2022-03-14 17:55:04 +01:00
|
|
|
-c "$maybe_calc_verify" \
|
2019-01-30 10:10:19 +01:00
|
|
|
-c "calc PSA finished" \
|
2022-03-14 17:55:04 +01:00
|
|
|
-s "$maybe_calc_verify" \
|
2019-01-30 10:10:19 +01:00
|
|
|
-s "calc PSA finished" \
|
2018-11-16 18:28:40 +01:00
|
|
|
-s "Protocol is TLSv1.2" \
|
2019-02-18 17:47:50 +01:00
|
|
|
-c "Perform PSA-based ECDH computation."\
|
2019-01-15 11:23:59 +01:00
|
|
|
-c "Perform PSA-based computation of digest of ServerKeyExchange" \
|
2018-11-16 18:28:40 +01:00
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
2022-03-14 17:55:04 +01:00
|
|
|
unset maybe_calc_verify
|
2018-11-16 18:28:40 +01:00
|
|
|
}
|
|
|
|
|
2019-01-08 12:40:25 +01:00
|
|
|
run_test_psa_force_curve() {
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2022-03-14 17:55:04 +01:00
|
|
|
set_maybe_calc_verify none
|
2019-01-08 12:40:25 +01:00
|
|
|
run_test "PSA - ECDH with $1" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV debug_level=4 force_version=tls12 curves=$1" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_CLI debug_level=4 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \
|
2019-01-08 12:40:25 +01:00
|
|
|
0 \
|
2022-03-14 17:55:04 +01:00
|
|
|
-c "$maybe_calc_verify" \
|
2019-02-18 17:47:50 +01:00
|
|
|
-c "calc PSA finished" \
|
2022-03-14 17:55:04 +01:00
|
|
|
-s "$maybe_calc_verify" \
|
2019-02-18 17:47:50 +01:00
|
|
|
-s "calc PSA finished" \
|
2019-01-08 12:40:25 +01:00
|
|
|
-s "Protocol is TLSv1.2" \
|
2019-02-18 17:47:50 +01:00
|
|
|
-c "Perform PSA-based ECDH computation."\
|
2019-01-15 11:23:59 +01:00
|
|
|
-c "Perform PSA-based computation of digest of ServerKeyExchange" \
|
2018-11-16 18:28:40 +01:00
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
2022-03-14 17:55:04 +01:00
|
|
|
unset maybe_calc_verify
|
2018-11-16 18:28:40 +01:00
|
|
|
}
|
|
|
|
|
2019-11-26 16:32:40 +01:00
|
|
|
# Test that the server's memory usage after a handshake is reduced when a client specifies
|
|
|
|
# a maximum fragment length.
|
|
|
|
# first argument ($1) is MFL for SSL client
|
|
|
|
# second argument ($2) is memory usage for SSL client with default MFL (16k)
|
|
|
|
run_test_memory_after_hanshake_with_mfl()
|
|
|
|
{
|
|
|
|
# The test passes if the difference is around 2*(16k-MFL)
|
2020-08-26 21:52:23 +02:00
|
|
|
MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))"
|
2019-11-26 16:32:40 +01:00
|
|
|
|
|
|
|
# Leave some margin for robustness
|
|
|
|
MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))"
|
|
|
|
|
|
|
|
run_test "Handshake memory usage (MFL $1)" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV debug_level=3 auth_mode=required force_version=tls12" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_CLI debug_level=3 \
|
2019-11-26 16:32:40 +01:00
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \
|
|
|
|
0 \
|
|
|
|
-F "handshake_memory_check $MEMORY_USAGE_LIMIT"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Test that the server's memory usage after a handshake is reduced when a client specifies
|
|
|
|
# different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes
|
|
|
|
run_tests_memory_after_hanshake()
|
|
|
|
{
|
|
|
|
# all tests in this sequence requires the same configuration (see requires_config_enabled())
|
|
|
|
SKIP_THIS_TESTS="$SKIP_NEXT"
|
|
|
|
|
|
|
|
# first test with default MFU is to get reference memory usage
|
|
|
|
MEMORY_USAGE_MFL_16K=0
|
|
|
|
run_test "Handshake memory usage initial (MFL 16384 - default)" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV debug_level=3 auth_mode=required force_version=tls12" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_CLI debug_level=3 \
|
2019-11-26 16:32:40 +01:00
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \
|
|
|
|
0 \
|
|
|
|
-F "handshake_memory_get MEMORY_USAGE_MFL_16K"
|
|
|
|
|
|
|
|
SKIP_NEXT="$SKIP_THIS_TESTS"
|
|
|
|
run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K"
|
|
|
|
|
|
|
|
SKIP_NEXT="$SKIP_THIS_TESTS"
|
|
|
|
run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K"
|
|
|
|
|
|
|
|
SKIP_NEXT="$SKIP_THIS_TESTS"
|
|
|
|
run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K"
|
|
|
|
|
|
|
|
SKIP_NEXT="$SKIP_THIS_TESTS"
|
|
|
|
run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K"
|
|
|
|
}
|
|
|
|
|
2014-02-25 16:21:22 +01:00
|
|
|
cleanup() {
|
2014-09-05 17:45:19 +02:00
|
|
|
rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION
|
2020-04-16 14:35:19 +02:00
|
|
|
rm -f context_srv.txt
|
|
|
|
rm -f context_cli.txt
|
2014-09-20 13:15:43 +02: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 16:21:22 +01:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2014-02-26 18:21:02 +01:00
|
|
|
#
|
|
|
|
# MAIN
|
|
|
|
#
|
|
|
|
|
2014-03-28 10:12:38 +01:00
|
|
|
get_options "$@"
|
|
|
|
|
2020-08-26 22:35:46 +02:00
|
|
|
# Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell
|
|
|
|
# patterns rather than regular expressions, use a case statement instead
|
|
|
|
# of calling grep. To keep the optimizer simple, it is incomplete and only
|
|
|
|
# detects simple cases: plain substring, everything, nothing.
|
|
|
|
#
|
|
|
|
# As an exception, the character '.' is treated as an ordinary character
|
|
|
|
# if it is the only special character in the string. This is because it's
|
|
|
|
# rare to need "any one character", but needing a literal '.' is common
|
|
|
|
# (e.g. '-f "DTLS 1.2"').
|
|
|
|
need_grep=
|
|
|
|
case "$FILTER" in
|
|
|
|
'^$') simple_filter=;;
|
|
|
|
'.*') simple_filter='*';;
|
2020-09-29 23:48:39 +02:00
|
|
|
*[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep
|
2020-08-26 22:35:46 +02:00
|
|
|
need_grep=1;;
|
|
|
|
*) # No regexp or shell-pattern special character
|
|
|
|
simple_filter="*$FILTER*";;
|
|
|
|
esac
|
|
|
|
case "$EXCLUDE" in
|
|
|
|
'^$') simple_exclude=;;
|
|
|
|
'.*') simple_exclude='*';;
|
2020-09-29 23:48:39 +02:00
|
|
|
*[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep
|
2020-08-26 22:35:46 +02:00
|
|
|
need_grep=1;;
|
|
|
|
*) # No regexp or shell-pattern special character
|
|
|
|
simple_exclude="*$EXCLUDE*";;
|
|
|
|
esac
|
|
|
|
if [ -n "$need_grep" ]; then
|
|
|
|
is_excluded () {
|
|
|
|
! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
is_excluded () {
|
|
|
|
case "$1" in
|
|
|
|
$simple_exclude) true;;
|
|
|
|
$simple_filter) false;;
|
|
|
|
*) true;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
2014-02-27 12:25:54 +01:00
|
|
|
# sanity checks, avoid an avalanche of errors
|
2017-10-23 16:27:37 +02:00
|
|
|
P_SRV_BIN="${P_SRV%%[ ]*}"
|
|
|
|
P_CLI_BIN="${P_CLI%%[ ]*}"
|
|
|
|
P_PXY_BIN="${P_PXY%%[ ]*}"
|
2017-10-10 15:44:53 +02:00
|
|
|
if [ ! -x "$P_SRV_BIN" ]; then
|
|
|
|
echo "Command '$P_SRV_BIN' is not an executable file"
|
2014-02-27 12:25:54 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
2017-10-10 15:44:53 +02:00
|
|
|
if [ ! -x "$P_CLI_BIN" ]; then
|
|
|
|
echo "Command '$P_CLI_BIN' is not an executable file"
|
2014-02-27 12:25:54 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
2017-10-10 15:44:53 +02:00
|
|
|
if [ ! -x "$P_PXY_BIN" ]; then
|
|
|
|
echo "Command '$P_PXY_BIN' is not an executable file"
|
2014-09-05 17:45:19 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2016-05-23 12:13:17 +02: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 18:47:44 +01:00
|
|
|
if which $OPENSSL_CMD >/dev/null 2>&1; then :; else
|
|
|
|
echo "Command '$OPENSSL_CMD' not found"
|
2014-02-27 12:25:54 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-05-29 11:31:20 +02:00
|
|
|
# used by watchdog
|
|
|
|
MAIN_PID="$$"
|
|
|
|
|
2018-01-22 10:22:09 +01: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 18:41:11 +02:00
|
|
|
if [ "$MEMCHECK" -gt 0 ]; then
|
2018-01-22 10:22:09 +01:00
|
|
|
START_DELAY=6
|
|
|
|
DOG_DELAY=60
|
2014-06-20 18:41:11 +02:00
|
|
|
else
|
2018-01-22 10:22:09 +01:00
|
|
|
START_DELAY=2
|
|
|
|
DOG_DELAY=20
|
2014-06-20 18:41:11 +02:00
|
|
|
fi
|
2018-01-22 10:22:09 +01: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 12:46:27 +02:00
|
|
|
CLI_DELAY_FACTOR=1
|
2016-09-02 14:45:28 +02:00
|
|
|
SRV_DELAY_SECONDS=0
|
2014-06-20 18:41:11 +02:00
|
|
|
|
2014-07-23 20:17:47 +02:00
|
|
|
# fix commands to use this port, force IPv4 while at it
|
2015-01-21 12:44:33 +01:00
|
|
|
# +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later
|
2021-10-12 17:10:37 +02:00
|
|
|
# Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many
|
|
|
|
# machines that will resolve to ::1, and we don't want ipv6 here.
|
2014-09-05 17:45:19 +02: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 16:46:20 +02: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"}"
|
2021-04-01 14:00:11 +02:00
|
|
|
O_SRV="$O_SRV -accept $SRV_PORT"
|
2021-10-12 17:10:37 +02:00
|
|
|
O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT"
|
2014-09-05 17:45:19 +02:00
|
|
|
G_SRV="$G_SRV -p $SRV_PORT"
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
G_CLI="$G_CLI -p +SRV_PORT"
|
2014-05-28 22:59:30 +02:00
|
|
|
|
2018-08-17 12:44:54 +02:00
|
|
|
if [ -n "${OPENSSL_LEGACY:-}" ]; then
|
|
|
|
O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem"
|
2021-10-12 17:10:37 +02:00
|
|
|
O_LEGACY_CLI="$O_LEGACY_CLI -connect 127.0.0.1:+SRV_PORT"
|
2018-08-17 12:44:54 +02:00
|
|
|
fi
|
|
|
|
|
2021-08-19 12:11:43 +02:00
|
|
|
if [ -n "${OPENSSL_NEXT:-}" ]; then
|
|
|
|
O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT"
|
2021-11-24 09:04:47 +01:00
|
|
|
O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT"
|
2021-10-12 17:10:37 +02:00
|
|
|
O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT"
|
2021-08-19 12:11:43 +02:00
|
|
|
fi
|
|
|
|
|
2018-08-17 16:53:21 +02:00
|
|
|
if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then
|
2018-08-17 12:44:54 +02:00
|
|
|
G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT"
|
2021-11-24 09:04:47 +01:00
|
|
|
G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT"
|
2018-08-17 12:44:54 +02:00
|
|
|
fi
|
|
|
|
|
2018-08-17 16:53:21 +02:00
|
|
|
if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT"
|
2018-08-17 12:44:54 +02:00
|
|
|
fi
|
2014-05-28 22:59:30 +02:00
|
|
|
|
2017-05-10 10:13:59 +02: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 23:06:50 +02:00
|
|
|
# Also pick a unique name for intermediate files
|
|
|
|
SRV_OUT="srv_out.$$"
|
|
|
|
CLI_OUT="cli_out.$$"
|
2014-09-05 17:45:19 +02:00
|
|
|
PXY_OUT="pxy_out.$$"
|
2014-05-28 23:06:50 +02:00
|
|
|
SESSION="session.$$"
|
|
|
|
|
2014-08-14 14:31:29 +02:00
|
|
|
SKIP_NEXT="NO"
|
|
|
|
|
2014-02-25 16:21:22 +01:00
|
|
|
trap cleanup INT TERM HUP
|
2014-02-20 11:01:30 +01:00
|
|
|
|
2014-07-12 04:00:00 +02:00
|
|
|
# Basic test
|
|
|
|
|
2014-08-21 19:38:32 +02:00
|
|
|
# Checks that:
|
|
|
|
# - things work with all ciphersuites active (used with config-full in all.sh)
|
2021-06-02 22:14:15 +02:00
|
|
|
# - the expected parameters are selected
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:50:38 +01:00
|
|
|
requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
|
2022-04-05 22:00:32 +02:00
|
|
|
requires_config_enabled MBEDTLS_SHA512_C # "signature_algorithm ext: 6"
|
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED
|
2014-07-12 04:00:00 +02:00
|
|
|
run_test "Default" \
|
2014-08-21 19:38:32 +02:00
|
|
|
"$P_SRV debug_level=3" \
|
2014-07-12 04:00:00 +02:00
|
|
|
"$P_CLI" \
|
|
|
|
0 \
|
2014-08-21 19:38:32 +02:00
|
|
|
-s "Protocol is TLSv1.2" \
|
2018-06-14 11:11:15 +02:00
|
|
|
-s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \
|
2014-08-21 19:38:32 +02:00
|
|
|
-s "client hello v3, signature_algorithm ext: 6" \
|
2021-06-02 22:14:15 +02:00
|
|
|
-s "ECDHE curve: x25519" \
|
2014-08-21 19:38:32 +02:00
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
2014-07-12 04:00:00 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:50:38 +01:00
|
|
|
requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
|
2015-01-22 14:34:21 +01:00
|
|
|
run_test "Default, DTLS" \
|
|
|
|
"$P_SRV dtls=1" \
|
|
|
|
"$P_CLI dtls=1" \
|
|
|
|
0 \
|
|
|
|
-s "Protocol is DTLSv1.2" \
|
2018-06-14 11:11:15 +02:00
|
|
|
-s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256"
|
2015-01-22 14:34:21 +01:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-08-17 13:17:32 +02:00
|
|
|
run_test "TLS client auth: required" \
|
|
|
|
"$P_SRV auth_mode=required" \
|
|
|
|
"$P_CLI" \
|
|
|
|
0 \
|
|
|
|
-s "Verifying peer X.509 certificate... ok"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-23 14:37:02 +01:00
|
|
|
run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
|
|
|
"$P_SRV" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
|
|
|
0 \
|
|
|
|
-c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
|
|
|
-c "Key size is 256"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-23 14:37:02 +01:00
|
|
|
run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
"$P_SRV" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
-c "Key size is 128"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-08-17 13:14:06 +02:00
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
run_test "TLS: password protected client key" \
|
|
|
|
"$P_SRV auth_mode=required" \
|
|
|
|
"$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \
|
|
|
|
0
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-08-17 13:14:06 +02:00
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
run_test "TLS: password protected server key" \
|
|
|
|
"$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \
|
|
|
|
"$P_CLI" \
|
|
|
|
0
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-08-17 13:14:06 +02:00
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
run_test "TLS: password protected server key, two certificates" \
|
|
|
|
"$P_SRV \
|
|
|
|
key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \
|
|
|
|
key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \
|
|
|
|
"$P_CLI" \
|
|
|
|
0
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
|
|
|
run_test "CA callback on client" \
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
"$P_CLI ca_callback=1 debug_level=3 " \
|
|
|
|
0 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-c "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
run_test "CA callback on server" \
|
|
|
|
"$P_SRV auth_mode=required" \
|
|
|
|
"$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
0 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-c "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-s "Verifying peer X.509 certificate... ok" \
|
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
|
|
|
|
2022-03-21 10:03:46 +01:00
|
|
|
# Test using an EC opaque private key for client authentication
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-11-08 09:52:25 +01:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2022-03-21 10:03:46 +01:00
|
|
|
run_test "TLS-ECDHE-ECDSA Opaque key for client authentication" \
|
2021-10-26 12:25:27 +02:00
|
|
|
"$P_SRV auth_mode=required crt_file=data_files/server5.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
2018-11-08 09:52:25 +01:00
|
|
|
"$P_CLI key_opaque=1 crt_file=data_files/server5.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
0 \
|
|
|
|
-c "key type: Opaque" \
|
2021-10-26 12:25:27 +02:00
|
|
|
-c "Ciphersuite is TLS-ECDHE-ECDSA" \
|
2018-11-08 09:52:25 +01:00
|
|
|
-s "Verifying peer X.509 certificate... ok" \
|
2021-10-26 12:25:27 +02:00
|
|
|
-s "Ciphersuite is TLS-ECDHE-ECDSA" \
|
2018-11-08 09:52:25 +01:00
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
|
|
|
|
2022-03-21 10:03:46 +01:00
|
|
|
# Test using a RSA opaque private key for client authentication
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-10-04 11:13:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2022-03-21 10:03:46 +01:00
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
2021-10-04 11:13:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2022-03-21 10:03:46 +01:00
|
|
|
run_test "TLS-ECDHE-RSA Opaque key for client authentication" \
|
|
|
|
"$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key" \
|
|
|
|
"$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key" \
|
|
|
|
0 \
|
|
|
|
-c "key type: Opaque" \
|
|
|
|
-c "Ciphersuite is TLS-ECDHE-RSA" \
|
|
|
|
-s "Verifying peer X.509 certificate... ok" \
|
|
|
|
-s "Ciphersuite is TLS-ECDHE-RSA" \
|
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
|
|
|
|
2022-03-21 10:11:07 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
run_test "TLS-DHE-RSA Opaque key for client authentication" \
|
|
|
|
"$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key" \
|
|
|
|
"$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
|
|
|
-c "key type: Opaque" \
|
|
|
|
-c "Ciphersuite is TLS-DHE-RSA" \
|
|
|
|
-s "Verifying peer X.509 certificate... ok" \
|
|
|
|
-s "Ciphersuite is TLS-DHE-RSA" \
|
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
|
|
|
|
2022-03-21 10:03:46 +01:00
|
|
|
# Test using an EC opaque private key for server authentication
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-10-04 11:13:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2022-03-21 10:03:46 +01:00
|
|
|
run_test "TLS-ECDHE-ECDSA Opaque key for server authentication" \
|
2021-10-26 12:25:27 +02:00
|
|
|
"$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
2021-10-04 11:13:22 +02:00
|
|
|
"$P_CLI crt_file=data_files/server5.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
0 \
|
|
|
|
-c "Verifying peer X.509 certificate... ok" \
|
2021-10-26 12:25:27 +02:00
|
|
|
-c "Ciphersuite is TLS-ECDHE-ECDSA" \
|
2022-01-25 17:50:25 +01:00
|
|
|
-s "key types: Opaque, none" \
|
2021-10-26 12:25:27 +02:00
|
|
|
-s "Ciphersuite is TLS-ECDHE-ECDSA" \
|
2021-10-04 11:13:22 +02:00
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
|
|
|
|
2022-03-23 14:04:04 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
run_test "Opaque key for server authentication (ECDH-)" \
|
2022-03-25 15:13:02 +01:00
|
|
|
"$P_SRV force_version=tls12 auth_mode=required key_opaque=1\
|
|
|
|
crt_file=data_files/server5.ku-ka.crt\
|
2022-03-23 14:04:04 +01:00
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
"$P_CLI" \
|
|
|
|
0 \
|
|
|
|
-c "Verifying peer X.509 certificate... ok" \
|
|
|
|
-c "Ciphersuite is TLS-ECDH-" \
|
|
|
|
-s "key types: Opaque, none" \
|
|
|
|
-s "Ciphersuite is TLS-ECDH-" \
|
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
|
|
|
|
2022-03-21 10:03:46 +01:00
|
|
|
# Test using a RSA opaque private key for server authentication
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-10-06 11:31:49 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2022-03-21 10:03:46 +01:00
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
2021-10-06 11:31:49 +02:00
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2022-03-21 10:03:46 +01:00
|
|
|
run_test "TLS-ECDHE-RSA Opaque key for server authentication" \
|
|
|
|
"$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key" \
|
|
|
|
"$P_CLI crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key" \
|
|
|
|
0 \
|
|
|
|
-c "Verifying peer X.509 certificate... ok" \
|
|
|
|
-c "Ciphersuite is TLS-ECDHE-RSA" \
|
|
|
|
-s "key types: Opaque, none" \
|
|
|
|
-s "Ciphersuite is TLS-ECDHE-RSA" \
|
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
|
|
|
|
2022-03-21 10:11:07 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
run_test "TLS-DHE-RSA Opaque key for server authentication" \
|
|
|
|
"$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key" \
|
|
|
|
"$P_CLI crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
|
|
|
-c "Verifying peer X.509 certificate... ok" \
|
|
|
|
-c "Ciphersuite is TLS-DHE-RSA" \
|
|
|
|
-s "key types: Opaque, none" \
|
|
|
|
-s "Ciphersuite is TLS-DHE-RSA" \
|
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
|
|
|
|
2022-03-21 10:03:46 +01:00
|
|
|
# Test using an EC opaque private key for client/server authentication
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-10-06 11:31:49 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2022-03-21 10:03:46 +01:00
|
|
|
run_test "TLS-ECDHE-ECDSA Opaque key for client/server authentication" \
|
2021-10-26 12:25:27 +02:00
|
|
|
"$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
2018-11-08 09:52:25 +01:00
|
|
|
"$P_CLI key_opaque=1 crt_file=data_files/server5.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
0 \
|
|
|
|
-c "key type: Opaque" \
|
2021-10-06 11:31:49 +02:00
|
|
|
-c "Verifying peer X.509 certificate... ok" \
|
2021-10-26 12:25:27 +02:00
|
|
|
-c "Ciphersuite is TLS-ECDHE-ECDSA" \
|
2022-01-25 17:50:25 +01:00
|
|
|
-s "key types: Opaque, none" \
|
2018-11-08 09:52:25 +01:00
|
|
|
-s "Verifying peer X.509 certificate... ok" \
|
2021-10-26 12:25:27 +02:00
|
|
|
-s "Ciphersuite is TLS-ECDHE-ECDSA" \
|
2018-11-08 09:52:25 +01:00
|
|
|
-S "error" \
|
|
|
|
-C "error"
|
|
|
|
|
2022-03-21 10:03:46 +01:00
|
|
|
# Test using a RSA opaque private key for client/server authentication
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
run_test "TLS-ECDHE-RSA Opaque key for client/server authentication" \
|
|
|
|
"$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key" \
|
|
|
|
"$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key" \
|
|
|
|
0 \
|
|
|
|
-c "key type: Opaque" \
|
|
|
|
-c "Verifying peer X.509 certificate... ok" \
|
|
|
|
-c "Ciphersuite is TLS-ECDHE-RSA" \
|
|
|
|
-s "key types: Opaque, none" \
|
|
|
|
-s "Verifying peer X.509 certificate... ok" \
|
|
|
|
-s "Ciphersuite is TLS-ECDHE-RSA" \
|
|
|
|
-S "error" \
|
2022-03-21 10:11:07 +01:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
|
|
|
run_test "TLS-DHE-RSA Opaque key for client/server authentication" \
|
|
|
|
"$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key" \
|
|
|
|
"$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
|
|
|
-c "key type: Opaque" \
|
|
|
|
-c "Verifying peer X.509 certificate... ok" \
|
|
|
|
-c "Ciphersuite is TLS-DHE-RSA" \
|
|
|
|
-s "key types: Opaque, none" \
|
|
|
|
-s "Verifying peer X.509 certificate... ok" \
|
|
|
|
-s "Ciphersuite is TLS-DHE-RSA" \
|
|
|
|
-S "error" \
|
2018-11-08 09:52:25 +01:00
|
|
|
-C "error"
|
|
|
|
|
2018-11-16 18:28:40 +01:00
|
|
|
# Test ciphersuites which we expect to be fully supported by PSA Crypto
|
|
|
|
# and check that we don't fall back to Mbed TLS' internal crypto primitives.
|
|
|
|
run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM
|
|
|
|
run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8
|
|
|
|
run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM
|
|
|
|
run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8
|
|
|
|
run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
|
|
|
|
run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384
|
|
|
|
run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA
|
|
|
|
run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256
|
|
|
|
run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384
|
|
|
|
|
2019-01-08 12:40:25 +01:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED
|
|
|
|
run_test_psa_force_curve "secp521r1"
|
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED
|
|
|
|
run_test_psa_force_curve "brainpoolP512r1"
|
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED
|
|
|
|
run_test_psa_force_curve "secp384r1"
|
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED
|
|
|
|
run_test_psa_force_curve "brainpoolP384r1"
|
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
|
|
|
run_test_psa_force_curve "secp256r1"
|
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED
|
|
|
|
run_test_psa_force_curve "secp256k1"
|
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED
|
|
|
|
run_test_psa_force_curve "brainpoolP256r1"
|
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED
|
|
|
|
run_test_psa_force_curve "secp224r1"
|
2021-03-23 13:59:58 +01:00
|
|
|
## SECP224K1 is buggy via the PSA API
|
2022-03-31 15:07:01 +02:00
|
|
|
## (https://github.com/Mbed-TLS/mbedtls/issues/3541),
|
2021-03-23 13:59:58 +01:00
|
|
|
## so it is disabled in PSA even when it's enabled in Mbed TLS.
|
|
|
|
## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but
|
|
|
|
## dependencies on PSA symbols in ssl-opt.sh are not implemented yet.
|
|
|
|
#requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED
|
|
|
|
#run_test_psa_force_curve "secp224k1"
|
2019-01-08 12:40:25 +01:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED
|
|
|
|
run_test_psa_force_curve "secp192r1"
|
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED
|
|
|
|
run_test_psa_force_curve "secp192k1"
|
|
|
|
|
2017-09-06 16:44:01 +02:00
|
|
|
# Test current time in ServerHello
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-09-06 16:44:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_HAVE_TIME
|
2018-06-14 11:11:15 +02:00
|
|
|
run_test "ServerHello contains gmt_unix_time" \
|
2017-09-06 16:44:01 +02:00
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-f "check_server_hello_time" \
|
|
|
|
-F "check_server_hello_time"
|
|
|
|
|
2016-10-14 01:48:33 +02:00
|
|
|
# Test for uniqueness of IVs in AEAD ciphersuites
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-10-14 01:48:33 +02:00
|
|
|
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"
|
|
|
|
|
2019-04-04 13:03:30 +02:00
|
|
|
# Tests for certificate verification callback
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-04-04 13:03:30 +02:00
|
|
|
run_test "Configuration-specific CRT verification callback" \
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
"$P_CLI context_crt_cb=0 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-S "error" \
|
|
|
|
-c "Verify requested for " \
|
|
|
|
-c "Use configuration-specific verification callback" \
|
|
|
|
-C "Use context-specific verification callback" \
|
|
|
|
-C "error"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-04-03 14:04:33 +02:00
|
|
|
run_test "Context-specific CRT verification callback" \
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
"$P_CLI context_crt_cb=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-S "error" \
|
2019-04-04 13:03:30 +02:00
|
|
|
-c "Verify requested for " \
|
|
|
|
-c "Use context-specific verification callback" \
|
|
|
|
-C "Use configuration-specific verification callback" \
|
2019-04-03 14:04:33 +02:00
|
|
|
-C "error"
|
|
|
|
|
2017-05-09 15:59:24 +02:00
|
|
|
# Tests for SHA-1 support
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-09 15:59:24 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-09 15:59:24 +02: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
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-09 15:59:24 +02:00
|
|
|
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
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-09 15:59:24 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-09 15:59:24 +02: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
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-09 15:59:24 +02:00
|
|
|
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
|
|
|
|
|
2021-07-24 07:45:50 +02:00
|
|
|
# Dummy TLS 1.3 test
|
|
|
|
# Currently only checking that passing TLS 1.3 key exchange modes to
|
|
|
|
# ssl_client2/ssl_server2 example programs works.
|
2021-12-23 10:16:42 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: key exchange mode parameter passing: PSK only" \
|
2021-12-23 10:16:42 +01:00
|
|
|
"$P_SRV tls13_kex_modes=psk debug_level=4" \
|
|
|
|
"$P_CLI tls13_kex_modes=psk debug_level=4" \
|
2021-07-24 07:45:50 +02:00
|
|
|
0
|
2021-12-23 10:16:42 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: key exchange mode parameter passing: PSK-ephemeral only" \
|
2021-07-24 07:45:50 +02:00
|
|
|
"$P_SRV tls13_kex_modes=psk_ephemeral" \
|
|
|
|
"$P_CLI tls13_kex_modes=psk_ephemeral" \
|
|
|
|
0
|
2021-12-23 10:16:42 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: key exchange mode parameter passing: Pure-ephemeral only" \
|
2021-08-24 04:49:06 +02:00
|
|
|
"$P_SRV tls13_kex_modes=ephemeral" \
|
|
|
|
"$P_CLI tls13_kex_modes=ephemeral" \
|
2021-07-24 07:45:50 +02:00
|
|
|
0
|
2021-12-23 10:16:42 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: key exchange mode parameter passing: All ephemeral" \
|
2021-07-24 07:45:50 +02:00
|
|
|
"$P_SRV tls13_kex_modes=ephemeral_all" \
|
|
|
|
"$P_CLI tls13_kex_modes=ephemeral_all" \
|
|
|
|
0
|
2021-12-23 10:16:42 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: key exchange mode parameter passing: All PSK" \
|
2021-07-24 07:45:50 +02:00
|
|
|
"$P_SRV tls13_kex_modes=psk_all" \
|
|
|
|
"$P_CLI tls13_kex_modes=psk_all" \
|
|
|
|
0
|
2021-12-23 10:16:42 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: key exchange mode parameter passing: All" \
|
2021-07-24 07:45:50 +02:00
|
|
|
"$P_SRV tls13_kex_modes=all" \
|
|
|
|
"$P_CLI tls13_kex_modes=all" \
|
|
|
|
0
|
|
|
|
|
2018-08-14 16:43:35 +02:00
|
|
|
# Tests for datagram packing
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-14 16:43:35 +02:00
|
|
|
run_test "DTLS: multiple records in same datagram, client and server" \
|
|
|
|
"$P_SRV dtls=1 dgram_packing=1 debug_level=2" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=1 debug_level=2" \
|
|
|
|
0 \
|
|
|
|
-c "next record in same datagram" \
|
|
|
|
-s "next record in same datagram"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-14 16:43:35 +02:00
|
|
|
run_test "DTLS: multiple records in same datagram, client only" \
|
|
|
|
"$P_SRV dtls=1 dgram_packing=0 debug_level=2" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=1 debug_level=2" \
|
|
|
|
0 \
|
|
|
|
-s "next record in same datagram" \
|
|
|
|
-C "next record in same datagram"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-14 16:43:35 +02:00
|
|
|
run_test "DTLS: multiple records in same datagram, server only" \
|
|
|
|
"$P_SRV dtls=1 dgram_packing=1 debug_level=2" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 debug_level=2" \
|
|
|
|
0 \
|
|
|
|
-S "next record in same datagram" \
|
|
|
|
-c "next record in same datagram"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-14 16:43:35 +02:00
|
|
|
run_test "DTLS: multiple records in same datagram, neither client nor server" \
|
|
|
|
"$P_SRV dtls=1 dgram_packing=0 debug_level=2" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 debug_level=2" \
|
|
|
|
0 \
|
|
|
|
-S "next record in same datagram" \
|
|
|
|
-C "next record in same datagram"
|
|
|
|
|
2019-06-04 10:33:23 +02:00
|
|
|
# Tests for Context serialization
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-06-04 10:33:23 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
2019-08-30 12:32:12 +02:00
|
|
|
run_test "Context serialization, client serializes, CCM" \
|
2019-07-23 14:13:43 +02:00
|
|
|
"$P_SRV dtls=1 serialize=0 exchanges=2" \
|
2019-08-30 12:32:12 +02:00
|
|
|
"$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-S "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, client serializes, ChaChaPoly" \
|
|
|
|
"$P_SRV dtls=1 serialize=0 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-S "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, client serializes, GCM" \
|
|
|
|
"$P_SRV dtls=1 serialize=0 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
|
2019-06-04 10:33:23 +02:00
|
|
|
0 \
|
2019-06-04 14:18:19 +02:00
|
|
|
-c "Deserializing connection..." \
|
2019-06-04 10:33:23 +02:00
|
|
|
-S "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:18:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
|
|
|
run_test "Context serialization, client serializes, with CID" \
|
|
|
|
"$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-S "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-06-04 10:33:23 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
2019-08-30 12:32:12 +02:00
|
|
|
run_test "Context serialization, server serializes, CCM" \
|
|
|
|
"$P_SRV dtls=1 serialize=1 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-C "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, server serializes, ChaChaPoly" \
|
2019-07-23 14:13:43 +02:00
|
|
|
"$P_SRV dtls=1 serialize=1 exchanges=2" \
|
2019-08-30 12:32:12 +02:00
|
|
|
"$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
|
|
|
0 \
|
|
|
|
-C "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, server serializes, GCM" \
|
|
|
|
"$P_SRV dtls=1 serialize=1 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
|
2019-06-04 10:33:23 +02:00
|
|
|
0 \
|
2019-06-04 14:18:19 +02:00
|
|
|
-C "Deserializing connection..." \
|
2019-06-04 10:33:23 +02:00
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:18:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
|
|
|
run_test "Context serialization, server serializes, with CID" \
|
|
|
|
"$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-C "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-06-04 10:33:23 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
2019-08-30 12:32:12 +02:00
|
|
|
run_test "Context serialization, both serialize, CCM" \
|
|
|
|
"$P_SRV dtls=1 serialize=1 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, both serialize, ChaChaPoly" \
|
|
|
|
"$P_SRV dtls=1 serialize=1 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, both serialize, GCM" \
|
2019-07-23 14:13:43 +02:00
|
|
|
"$P_SRV dtls=1 serialize=1 exchanges=2" \
|
2019-08-30 12:32:12 +02:00
|
|
|
"$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
|
2019-06-04 10:33:23 +02:00
|
|
|
0 \
|
2019-06-04 14:18:19 +02:00
|
|
|
-c "Deserializing connection..." \
|
2019-06-04 10:33:23 +02:00
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:18:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
|
|
|
run_test "Context serialization, both serialize, with CID" \
|
|
|
|
"$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-06-06 09:44:14 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
2019-08-30 12:32:12 +02:00
|
|
|
run_test "Context serialization, re-init, client serializes, CCM" \
|
2019-07-23 14:13:43 +02:00
|
|
|
"$P_SRV dtls=1 serialize=0 exchanges=2" \
|
2019-08-30 12:32:12 +02:00
|
|
|
"$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-S "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, re-init, client serializes, ChaChaPoly" \
|
|
|
|
"$P_SRV dtls=1 serialize=0 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-S "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, re-init, client serializes, GCM" \
|
|
|
|
"$P_SRV dtls=1 serialize=0 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
|
2019-06-06 09:44:14 +02:00
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-S "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:18:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
|
|
|
run_test "Context serialization, re-init, client serializes, with CID" \
|
|
|
|
"$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-S "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-06-06 09:44:14 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
2019-08-30 12:32:12 +02:00
|
|
|
run_test "Context serialization, re-init, server serializes, CCM" \
|
|
|
|
"$P_SRV dtls=1 serialize=2 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-C "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, re-init, server serializes, ChaChaPoly" \
|
2019-07-23 14:13:43 +02:00
|
|
|
"$P_SRV dtls=1 serialize=2 exchanges=2" \
|
2019-08-30 12:32:12 +02:00
|
|
|
"$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
|
|
|
0 \
|
|
|
|
-C "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, re-init, server serializes, GCM" \
|
|
|
|
"$P_SRV dtls=1 serialize=2 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
2019-06-06 09:44:14 +02:00
|
|
|
0 \
|
|
|
|
-C "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:18:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
|
|
|
run_test "Context serialization, re-init, server serializes, with CID" \
|
|
|
|
"$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-C "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-06-06 09:44:14 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
2019-08-30 12:32:12 +02:00
|
|
|
run_test "Context serialization, re-init, both serialize, CCM" \
|
|
|
|
"$P_SRV dtls=1 serialize=2 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, re-init, both serialize, ChaChaPoly" \
|
|
|
|
"$P_SRV dtls=1 serialize=2 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:32:12 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Context serialization, re-init, both serialize, GCM" \
|
2019-07-23 14:13:43 +02:00
|
|
|
"$P_SRV dtls=1 serialize=2 exchanges=2" \
|
2019-08-30 12:32:12 +02:00
|
|
|
"$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
|
2019-06-06 09:44:14 +02:00
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-08-30 12:18:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
|
|
|
run_test "Context serialization, re-init, both serialize, with CID" \
|
|
|
|
"$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-c "Deserializing connection..." \
|
|
|
|
-s "Deserializing connection..."
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-16 14:35:19 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
|
|
|
run_test "Saving the serialized context to a file" \
|
|
|
|
"$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \
|
|
|
|
"$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \
|
|
|
|
0 \
|
|
|
|
-s "Save serialized context to a file... ok" \
|
|
|
|
-c "Save serialized context to a file... ok"
|
|
|
|
rm -f context_srv.txt
|
|
|
|
rm -f context_cli.txt
|
|
|
|
|
2019-04-09 19:08:47 +02:00
|
|
|
# Tests for DTLS Connection ID extension
|
|
|
|
|
|
|
|
# So far, the CID API isn't implemented, so we can't
|
|
|
|
# grep for output witnessing its use. This needs to be
|
|
|
|
# changed once the CID extension is implemented.
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli enabled, Srv disabled" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=0" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \
|
|
|
|
0 \
|
|
|
|
-s "Disable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-s "found CID extension" \
|
|
|
|
-s "Client sent CID extension, but CID disabled" \
|
2019-04-25 18:01:43 +02:00
|
|
|
-c "Enable use of CID extension." \
|
2019-04-26 17:00:29 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-S "server hello, adding CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-C "found CID extension" \
|
|
|
|
-S "Copy CIDs into SSL transform" \
|
2019-04-26 18:19:46 +02:00
|
|
|
-C "Copy CIDs into SSL transform" \
|
|
|
|
-c "Use of Connection ID was rejected by the server"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli disabled, Srv enabled" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=0" \
|
|
|
|
0 \
|
|
|
|
-c "Disable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-C "client hello, adding CID extension" \
|
2019-04-26 15:17:56 +02:00
|
|
|
-S "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 17:13:31 +02:00
|
|
|
-S "server hello, adding CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-C "found CID extension" \
|
|
|
|
-S "Copy CIDs into SSL transform" \
|
2019-04-26 18:19:46 +02:00
|
|
|
-C "Copy CIDs into SSL transform" \
|
2019-05-08 14:19:53 +02:00
|
|
|
-s "Use of Connection ID was not offered by client"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-05-03 18:04:23 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-c "Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
|
|
|
-c "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \
|
2019-05-08 14:31:15 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
|
|
|
-s "Enable use of CID extension." \
|
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
|
|
|
-s "Use of CID extension negotiated" \
|
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-c "Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-c "Use of Connection ID has been negotiated" \
|
|
|
|
-c "ignoring unexpected CID" \
|
|
|
|
-s "ignoring unexpected CID"
|
2019-05-08 14:31:15 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \
|
|
|
|
-p "$P_PXY mtu=800" \
|
|
|
|
"$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
|
|
|
-s "Enable use of CID extension." \
|
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
|
|
|
-s "Use of CID extension negotiated" \
|
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-c "Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
|
|
|
-c "Use of Connection ID has been negotiated"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \
|
2019-05-08 14:31:15 +02:00
|
|
|
"$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
|
|
|
-s "Enable use of CID extension." \
|
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
|
|
|
-s "Use of CID extension negotiated" \
|
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-c "Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-c "Use of Connection ID has been negotiated" \
|
|
|
|
-c "ignoring unexpected CID" \
|
|
|
|
-s "ignoring unexpected CID"
|
2019-05-08 14:31:15 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-05-03 18:04:23 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-c "Peer CID (length 4 Bytes): de ad be ef" \
|
|
|
|
-s "Peer CID (length 0 Bytes):" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
|
|
|
-c "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-05-03 18:04:23 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-s "Peer CID (length 4 Bytes): de ad be ef" \
|
|
|
|
-c "Peer CID (length 0 Bytes):" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
|
|
|
-c "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-04-26 18:19:46 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-S "Use of Connection ID has been negotiated" \
|
|
|
|
-C "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-05-03 18:04:23 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-c "Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
|
|
|
-c "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-05-03 18:04:23 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-c "Peer CID (length 4 Bytes): de ad be ef" \
|
|
|
|
-s "Peer CID (length 0 Bytes):" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
|
|
|
-c "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-05-03 18:04:23 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-s "Peer CID (length 4 Bytes): de ad be ef" \
|
|
|
|
-c "Peer CID (length 0 Bytes):" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
|
|
|
-c "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-04-26 18:19:46 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-S "Use of Connection ID has been negotiated" \
|
|
|
|
-C "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-05-03 18:04:23 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-c "Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
|
|
|
-c "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-05-03 18:04:23 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-c "Peer CID (length 4 Bytes): de ad be ef" \
|
|
|
|
-s "Peer CID (length 0 Bytes):" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
|
|
|
-c "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-05-03 18:04:23 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-s "Peer CID (length 4 Bytes): de ad be ef" \
|
|
|
|
-c "Peer CID (length 0 Bytes):" \
|
|
|
|
-s "Use of Connection ID has been negotiated" \
|
|
|
|
-c "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CBC" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-c "Enable use of CID extension." \
|
2019-04-25 18:01:43 +02:00
|
|
|
-s "Enable use of CID extension." \
|
2019-04-26 15:17:56 +02:00
|
|
|
-c "client hello, adding CID extension" \
|
|
|
|
-s "found CID extension" \
|
2019-04-26 17:00:29 +02:00
|
|
|
-s "Use of CID extension negotiated" \
|
2019-04-26 17:13:31 +02:00
|
|
|
-s "server hello, adding CID extension" \
|
|
|
|
-c "found CID extension" \
|
2019-04-26 17:23:52 +02:00
|
|
|
-c "Use of CID extension negotiated" \
|
|
|
|
-s "Copy CIDs into SSL transform" \
|
2019-04-26 18:19:46 +02:00
|
|
|
-c "Copy CIDs into SSL transform" \
|
|
|
|
-S "Use of Connection ID has been negotiated" \
|
|
|
|
-C "Use of Connection ID has been negotiated"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-04-23 12:52:44 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \
|
2019-04-25 17:05:45 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
2019-05-03 18:30:59 +02:00
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Use of Connection ID has been negotiated"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-03 18:30:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \
|
2019-05-03 18:30:59 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Use of Connection ID has been negotiated"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 17:20:46 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \
|
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Use of Connection ID has been negotiated"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-03 18:30:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate with different CID" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \
|
2019-05-08 14:31:15 +02:00
|
|
|
"$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(after renegotiation) Use of Connection ID has been negotiated" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-c "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-c "ignoring unexpected CID" \
|
|
|
|
-s "ignoring unexpected CID"
|
2019-05-08 14:31:15 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \
|
2019-05-03 18:30:59 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-C "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-S "(after renegotiation) Use of Connection ID has been negotiated"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 17:20:46 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \
|
|
|
|
"$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-C "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-S "(after renegotiation) Use of Connection ID has been negotiated"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-03 18:30:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \
|
2019-05-08 14:31:15 +02:00
|
|
|
"$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-C "(after renegotiation) Use of Connection ID has been negotiated" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-S "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-c "ignoring unexpected CID" \
|
|
|
|
-s "ignoring unexpected CID"
|
2019-05-08 14:31:15 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \
|
2019-05-03 18:30:59 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-S "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-C "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-c "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-s "(after renegotiation) Use of Connection ID has been negotiated"
|
2019-05-08 17:20:46 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 17:20:46 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \
|
|
|
|
"$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-S "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-C "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-c "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-s "(after renegotiation) Use of Connection ID has been negotiated"
|
2019-05-03 18:30:59 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-03 18:30:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \
|
2019-05-08 14:31:15 +02:00
|
|
|
"$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-S "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-C "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-c "(after renegotiation) Use of Connection ID has been negotiated" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-s "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-c "ignoring unexpected CID" \
|
|
|
|
-s "ignoring unexpected CID"
|
2019-05-08 14:31:15 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \
|
2019-05-03 18:30:59 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-C "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-S "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-s "(after renegotiation) Use of Connection ID was not offered by client"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-03 18:30:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2019-05-08 14:31:15 +02:00
|
|
|
run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \
|
2019-05-08 14:31:15 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-C "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-S "(after renegotiation) Use of Connection ID has been negotiated" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-s "(after renegotiation) Use of Connection ID was not offered by client" \
|
|
|
|
-c "ignoring unexpected CID" \
|
|
|
|
-s "ignoring unexpected CID"
|
2019-05-08 14:31:15 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \
|
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-C "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-S "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(after renegotiation) Use of Connection ID was rejected by the server"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-15 15:03:01 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
2019-05-08 14:31:15 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \
|
2019-05-03 18:30:59 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-C "(after renegotiation) Use of Connection ID has been negotiated" \
|
|
|
|
-S "(after renegotiation) Use of Connection ID has been negotiated" \
|
2019-05-24 11:11:23 +02:00
|
|
|
-c "(after renegotiation) Use of Connection ID was rejected by the server" \
|
|
|
|
-c "ignoring unexpected CID" \
|
|
|
|
-s "ignoring unexpected CID"
|
2019-04-09 19:08:47 +02:00
|
|
|
|
2021-07-09 12:21:43 +02:00
|
|
|
# This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the
|
2021-07-08 17:03:44 +02:00
|
|
|
# tests check that the buffer contents are reallocated when the message is
|
|
|
|
# larger than the buffer.
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-06-08 13:08:03 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
|
|
|
requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
|
2021-07-08 17:03:44 +02:00
|
|
|
requires_max_content_len 513
|
2020-06-08 13:08:03 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \
|
|
|
|
"$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \
|
|
|
|
"$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-s "Reallocating in_buf" \
|
|
|
|
-s "Reallocating out_buf"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-06-08 13:08:03 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID
|
|
|
|
requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
|
2021-07-08 17:03:44 +02:00
|
|
|
requires_max_content_len 1025
|
2020-06-08 13:08:03 +02:00
|
|
|
run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \
|
|
|
|
"$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \
|
|
|
|
"$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \
|
|
|
|
0 \
|
|
|
|
-c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
|
|
|
|
-s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
|
|
|
|
-s "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-c "(initial handshake) Use of Connection ID has been negotiated" \
|
|
|
|
-s "Reallocating in_buf" \
|
|
|
|
-s "Reallocating out_buf"
|
|
|
|
|
2014-10-27 13:57:03 +01:00
|
|
|
# Tests for Encrypt-then-MAC extension
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-27 13:57:03 +01:00
|
|
|
run_test "Encrypt then MAC: default" \
|
2014-10-28 13:08:59 +01:00
|
|
|
"$P_SRV debug_level=3 \
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2014-10-27 13:57:03 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-27 13:57:03 +01:00
|
|
|
run_test "Encrypt then MAC: client enabled, server disabled" \
|
2014-10-28 13:08:59 +01:00
|
|
|
"$P_SRV debug_level=3 etm=0 \
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2014-10-27 13:57:03 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-04 15:44:06 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-27 13:57:03 +01:00
|
|
|
run_test "Encrypt then MAC: client disabled, server enabled" \
|
2014-10-28 13:08:59 +01:00
|
|
|
"$P_SRV debug_level=3 etm=1 \
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2014-10-27 13:57:03 +01: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"
|
|
|
|
|
2014-10-20 18:40:56 +02:00
|
|
|
# Tests for Extended Master Secret extension
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET
|
2014-10-20 18:40:56 +02:00
|
|
|
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" \
|
2019-05-20 12:09:50 +02:00
|
|
|
-c "session hash for extended master secret" \
|
|
|
|
-s "session hash for extended master secret"
|
2014-10-20 18:40:56 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET
|
2014-10-20 18:40:56 +02:00
|
|
|
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" \
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret" \
|
|
|
|
-S "session hash for extended master secret"
|
2014-10-20 18:40:56 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET
|
2014-10-20 18:40:56 +02:00
|
|
|
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" \
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret" \
|
|
|
|
-S "session hash for extended master secret"
|
2014-10-24 15:12:31 +02:00
|
|
|
|
2018-07-10 21:08:04 +02:00
|
|
|
# Test sending and receiving empty application data records
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 21:08:04 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-03-24 10:53:39 +01:00
|
|
|
run_test "Encrypt then MAC: disabled, empty application data record" \
|
2018-07-10 21:08:04 +02:00
|
|
|
"$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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 21:08:04 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-03-24 10:53:39 +01:00
|
|
|
run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \
|
2018-07-10 21:08:04 +02:00
|
|
|
"$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"
|
|
|
|
|
2015-01-08 11:15:09 +01:00
|
|
|
# Tests for CBC 1/n-1 record splitting
|
|
|
|
|
|
|
|
run_test "CBC Record splitting: TLS 1.2, no splitting" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
2015-01-08 11:15:09 +01:00
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \
|
2022-03-17 16:45:09 +01:00
|
|
|
request_size=123" \
|
2015-01-08 11:15:09 +01:00
|
|
|
0 \
|
|
|
|
-s "Read from client: 123 bytes read" \
|
|
|
|
-S "Read from client: 1 bytes read" \
|
|
|
|
-S "122 bytes read"
|
|
|
|
|
2014-02-20 17:19:59 +01:00
|
|
|
# Tests for Session Tickets
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using tickets: basic" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 tickets=1" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
2014-02-20 11:43:46 +01:00
|
|
|
0 \
|
2014-02-20 22:50:56 +01: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" \
|
2022-02-03 23:23:24 +01:00
|
|
|
-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"
|
|
|
|
|
2022-02-15 03:26:40 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-03 23:23:24 +01:00
|
|
|
run_test "Session resume using tickets: manual rotation" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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" \
|
2014-02-20 22:50:56 +01:00
|
|
|
-c "parse new session ticket" \
|
2014-02-20 11:43:46 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using tickets: cache disabled" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 tickets=1 cache_max=0" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
2014-02-21 09:18:13 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using tickets: timeout" \
|
2014-08-30 21:59:31 +02: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 09:18:13 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-20 12:46:26 +02:00
|
|
|
run_test "Session resume using tickets: session copy" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 cache_max=0" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using tickets: openssl server" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
2014-02-25 17:14:15 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using tickets: openssl client" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 tickets=1" \
|
2014-05-28 23:06:50 +02:00
|
|
|
"( $O_CLI -sess_out $SESSION; \
|
|
|
|
$O_CLI -sess_in $SESSION; \
|
|
|
|
rm -f $SESSION )" \
|
2014-02-25 17:14:15 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: AES-128-GCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: AES-192-GCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: AES-128-CCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: AES-192-CCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: AES-256-CCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: CAMELLIA-128-CCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: CAMELLIA-192-CCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: CAMELLIA-256-CCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: ARIA-128-GCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: ARIA-192-GCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: ARIA-256-GCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: ARIA-128-CCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: ARIA-192-CCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-12 16:29:58 +01:00
|
|
|
run_test "Session resume using tickets: ARIA-256-CCM" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
|
|
|
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" \
|
2022-03-10 16:13:17 +01:00
|
|
|
-s "session successfully restored from ticket" \
|
|
|
|
-s "a session has been resumed" \
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "Session resume using tickets: CHACHA20-POLY1305" \
|
|
|
|
"$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
2022-01-12 16:29:58 +01: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"
|
|
|
|
|
2018-08-21 14:55:22 +02:00
|
|
|
# Tests for Session Tickets with DTLS
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-21 14:55:22 +02:00
|
|
|
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 11:04:33 +01:00
|
|
|
"$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \
|
2018-08-21 14:55:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-21 14:55:22 +02:00
|
|
|
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 11:04:33 +01:00
|
|
|
"$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \
|
2018-08-21 14:55:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-21 14:55:22 +02:00
|
|
|
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 11:04:33 +01:00
|
|
|
"$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_delay=2" \
|
2018-08-21 14:55:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-20 12:46:26 +02:00
|
|
|
run_test "Session resume using tickets, DTLS: session copy" \
|
|
|
|
"$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 11:04:33 +01:00
|
|
|
"$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_mode=0" \
|
2019-05-20 12:46:26 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "Session resume using tickets, DTLS: openssl server" \
|
|
|
|
"$O_SRV -dtls" \
|
|
|
|
"$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"
|
|
|
|
|
2021-10-13 13:12:47 +02:00
|
|
|
# For reasons that aren't fully understood, this test randomly fails with high
|
2021-10-13 17:13:44 +02:00
|
|
|
# probability with OpenSSL 1.0.2g on the CI, see #5012.
|
2021-10-13 13:12:47 +02:00
|
|
|
requires_openssl_next
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "Session resume using tickets, DTLS: openssl client" \
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=1" \
|
2021-10-13 13:12:47 +02:00
|
|
|
"( $O_NEXT_CLI -dtls -sess_out $SESSION; \
|
|
|
|
$O_NEXT_CLI -dtls -sess_in $SESSION; \
|
2021-05-20 14:46:20 +02:00
|
|
|
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 22:50:56 +01:00
|
|
|
# Tests for Session Resume based on session-ID and cache
|
2014-02-20 17:19:59 +01:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using cache: tickets enabled on client" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 tickets=0" \
|
|
|
|
"$P_CLI debug_level=3 tickets=1 reconnect=1" \
|
2014-02-20 11:43:46 +01:00
|
|
|
0 \
|
2014-02-20 22:50:56 +01: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 11:43:46 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using cache: tickets enabled on server" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 tickets=1" \
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1" \
|
2014-02-20 11:43:46 +01:00
|
|
|
0 \
|
2014-02-20 22:50:56 +01: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 11:43:46 +01: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 14:50:42 +01:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using cache: cache_max=0" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 tickets=0 cache_max=0" \
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1" \
|
2014-02-20 22:50:56 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using cache: cache_max=1" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 tickets=0 cache_max=1" \
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1" \
|
2014-02-20 22:50:56 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2015-05-04 10:55:47 +02:00
|
|
|
run_test "Session resume using cache: timeout > delay" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 tickets=0" \
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=0" \
|
2014-02-20 22:50:56 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using cache: timeout < delay" \
|
2014-08-30 21:59:31 +02: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 21:32:41 +01:00
|
|
|
0 \
|
|
|
|
-S "session successfully restored from cache" \
|
|
|
|
-S "session successfully restored from ticket" \
|
2014-02-20 22:50:56 +01:00
|
|
|
-S "a session has been resumed" \
|
|
|
|
-C "a session has been resumed"
|
2014-02-20 21:32:41 +01:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using cache: no timeout" \
|
2014-08-30 21:59:31 +02: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 21:32:41 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2019-05-20 12:46:26 +02:00
|
|
|
run_test "Session resume using cache: session copy" \
|
|
|
|
"$P_SRV debug_level=3 tickets=0" \
|
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \
|
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using cache: openssl client" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 tickets=0" \
|
2014-05-28 23:06:50 +02:00
|
|
|
"( $O_CLI -sess_out $SESSION; \
|
|
|
|
$O_CLI -sess_in $SESSION; \
|
|
|
|
rm -f $SESSION )" \
|
2014-02-25 17:57:59 +01: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Session resume using cache: openssl server" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 tickets=0 reconnect=1" \
|
2014-02-25 17:57:59 +01:00
|
|
|
0 \
|
|
|
|
-C "found session_ticket extension" \
|
|
|
|
-C "parse new session ticket" \
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
2018-08-21 14:55:22 +02:00
|
|
|
# Tests for Session Resume based on session-ID and cache, DTLS
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2018-08-21 14:55:22 +02:00
|
|
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1 skip_close_notify=1" \
|
2018-08-21 14:55:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2018-08-21 14:55:22 +02:00
|
|
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \
|
2018-08-21 14:55:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2018-08-21 14:55:22 +02:00
|
|
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \
|
2018-08-21 14:55:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2018-08-21 14:55:22 +02:00
|
|
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \
|
2018-08-21 14:55:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2018-08-21 14:55:22 +02:00
|
|
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=0" \
|
2018-08-21 14:55:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2018-08-21 14:55:22 +02:00
|
|
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \
|
2018-08-21 14:55:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2018-08-21 14:55:22 +02:00
|
|
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \
|
2018-08-21 14:55:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2019-05-20 12:46:26 +02:00
|
|
|
run_test "Session resume using cache, DTLS: session copy" \
|
|
|
|
"$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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_mode=0" \
|
2019-05-20 12:46:26 +02: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"
|
|
|
|
|
2021-10-13 13:12:47 +02:00
|
|
|
# For reasons that aren't fully understood, this test randomly fails with high
|
2021-10-13 17:13:44 +02:00
|
|
|
# probability with OpenSSL 1.0.2g on the CI, see #5012.
|
2021-10-13 13:12:47 +02:00
|
|
|
requires_openssl_next
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "Session resume using cache, DTLS: openssl client" \
|
|
|
|
"$P_SRV dtls=1 debug_level=3 tickets=0" \
|
2021-10-13 13:12:47 +02:00
|
|
|
"( $O_NEXT_CLI -dtls -sess_out $SESSION; \
|
|
|
|
$O_NEXT_CLI -dtls -sess_in $SESSION; \
|
2021-05-20 14:46:20 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "Session resume using cache, DTLS: openssl server" \
|
|
|
|
"$O_SRV -dtls" \
|
|
|
|
"$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \
|
|
|
|
0 \
|
|
|
|
-C "found session_ticket extension" \
|
|
|
|
-C "parse new session ticket" \
|
|
|
|
-c "a session has been resumed"
|
|
|
|
|
2014-02-20 17:19:59 +01:00
|
|
|
# Tests for Max Fragment Length extension
|
|
|
|
|
2017-09-18 16:00:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-09-18 16:01:50 +02:00
|
|
|
run_test "Max fragment length: enabled, default" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
"$P_CLI debug_level=3" \
|
2014-02-20 14:50:42 +01:00
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
|
2014-02-20 14:50:42 +01: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 16:01:50 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-09-18 16:01:50 +02:00
|
|
|
run_test "Max fragment length: enabled, default, larger message" \
|
|
|
|
"$P_SRV debug_level=3" \
|
2018-04-11 08:28:39 +02:00
|
|
|
"$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \
|
2017-09-18 16:01:50 +02:00
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
|
2017-09-18 16:01:50 +02: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" \
|
2018-04-11 08:28:39 +02:00
|
|
|
-c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \
|
|
|
|
-s "$MAX_CONTENT_LEN bytes read" \
|
2017-10-18 15:42:01 +02:00
|
|
|
-s "1 bytes read"
|
2017-09-18 16:01:50 +02:00
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-09-18 16:01:50 +02:00
|
|
|
run_test "Max fragment length, DTLS: enabled, default, larger message" \
|
|
|
|
"$P_SRV debug_level=3 dtls=1" \
|
2018-04-11 08:28:39 +02:00
|
|
|
"$P_CLI debug_level=3 dtls=1 request_size=$(( $MAX_CONTENT_LEN + 1))" \
|
2017-09-18 16:01:50 +02:00
|
|
|
1 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
|
2017-09-18 16:01:50 +02: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 "
|
|
|
|
|
2018-04-11 08:28:39 +02:00
|
|
|
# Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled
|
|
|
|
# (session fragment length will be 16384 regardless of mbedtls
|
|
|
|
# content length configuration.)
|
|
|
|
|
2017-09-18 16:01:50 +02:00
|
|
|
requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-09-18 16:01:50 +02:00
|
|
|
run_test "Max fragment length: disabled, larger message" \
|
|
|
|
"$P_SRV debug_level=3" \
|
2018-04-11 08:28:39 +02:00
|
|
|
"$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \
|
2017-09-18 16:01:50 +02:00
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-C "Maximum incoming record payload length is 16384" \
|
|
|
|
-C "Maximum outgoing record payload length is 16384" \
|
|
|
|
-S "Maximum incoming record payload length is 16384" \
|
|
|
|
-S "Maximum outgoing record payload length is 16384" \
|
2018-04-11 08:28:39 +02:00
|
|
|
-c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \
|
|
|
|
-s "$MAX_CONTENT_LEN bytes read" \
|
2017-10-18 15:42:01 +02:00
|
|
|
-s "1 bytes read"
|
2017-09-18 16:01:50 +02:00
|
|
|
|
|
|
|
requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-06-21 20:43:33 +02:00
|
|
|
run_test "Max fragment length, DTLS: disabled, larger message" \
|
2017-09-18 16:01:50 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1" \
|
2018-04-11 08:28:39 +02:00
|
|
|
"$P_CLI debug_level=3 dtls=1 request_size=$(( $MAX_CONTENT_LEN + 1))" \
|
2017-09-18 16:01:50 +02:00
|
|
|
1 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-C "Maximum incoming record payload length is 16384" \
|
|
|
|
-C "Maximum outgoing record payload length is 16384" \
|
|
|
|
-S "Maximum incoming record payload length is 16384" \
|
|
|
|
-S "Maximum outgoing record payload length is 16384" \
|
2017-09-18 16:01:50 +02:00
|
|
|
-c "fragment larger than.*maximum "
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 4096
|
2017-09-18 16:00:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Max fragment length: used by client" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=4096" \
|
2014-02-20 14:50:42 +01:00
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 4096" \
|
|
|
|
-c "Maximum outgoing record payload length is 4096" \
|
|
|
|
-s "Maximum incoming record payload length is 4096" \
|
|
|
|
-s "Maximum outgoing record payload length is 4096" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 1024
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 512, server 1024" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=1024" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=512" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 512" \
|
|
|
|
-c "Maximum outgoing record payload length is 512" \
|
|
|
|
-s "Maximum incoming record payload length is 512" \
|
|
|
|
-s "Maximum outgoing record payload length is 512" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 2048
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 512, server 2048" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=2048" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=512" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 512" \
|
|
|
|
-c "Maximum outgoing record payload length is 512" \
|
|
|
|
-s "Maximum incoming record payload length is 512" \
|
|
|
|
-s "Maximum outgoing record payload length is 512" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 4096
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 512, server 4096" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=4096" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=512" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 512" \
|
|
|
|
-c "Maximum outgoing record payload length is 512" \
|
|
|
|
-s "Maximum incoming record payload length is 512" \
|
|
|
|
-s "Maximum outgoing record payload length is 512" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 1024
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 1024, server 512" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=512" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=1024" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 1024" \
|
|
|
|
-c "Maximum outgoing record payload length is 1024" \
|
|
|
|
-s "Maximum incoming record payload length is 1024" \
|
|
|
|
-s "Maximum outgoing record payload length is 512" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 2048
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 1024, server 2048" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=2048" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=1024" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 1024" \
|
|
|
|
-c "Maximum outgoing record payload length is 1024" \
|
|
|
|
-s "Maximum incoming record payload length is 1024" \
|
|
|
|
-s "Maximum outgoing record payload length is 1024" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 4096
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 1024, server 4096" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=4096" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=1024" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 1024" \
|
|
|
|
-c "Maximum outgoing record payload length is 1024" \
|
|
|
|
-s "Maximum incoming record payload length is 1024" \
|
|
|
|
-s "Maximum outgoing record payload length is 1024" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 2048
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 2048, server 512" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=512" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=2048" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 2048" \
|
|
|
|
-c "Maximum outgoing record payload length is 2048" \
|
|
|
|
-s "Maximum incoming record payload length is 2048" \
|
|
|
|
-s "Maximum outgoing record payload length is 512" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 2048
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 2048, server 1024" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=1024" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=2048" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 2048" \
|
|
|
|
-c "Maximum outgoing record payload length is 2048" \
|
|
|
|
-s "Maximum incoming record payload length is 2048" \
|
|
|
|
-s "Maximum outgoing record payload length is 1024" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 4096
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 2048, server 4096" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=4096" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=2048" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 2048" \
|
|
|
|
-c "Maximum outgoing record payload length is 2048" \
|
|
|
|
-s "Maximum incoming record payload length is 2048" \
|
|
|
|
-s "Maximum outgoing record payload length is 2048" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 4096
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 4096, server 512" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=512" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=4096" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 4096" \
|
|
|
|
-c "Maximum outgoing record payload length is 4096" \
|
|
|
|
-s "Maximum incoming record payload length is 4096" \
|
|
|
|
-s "Maximum outgoing record payload length is 512" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 4096
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 4096, server 1024" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=1024" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=4096" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 4096" \
|
|
|
|
-c "Maximum outgoing record payload length is 4096" \
|
|
|
|
-s "Maximum incoming record payload length is 4096" \
|
|
|
|
-s "Maximum outgoing record payload length is 1024" \
|
2020-04-03 11:25:29 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 4096
|
2020-04-03 11:25:29 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 11:25:29 +02:00
|
|
|
run_test "Max fragment length: client 4096, server 2048" \
|
|
|
|
"$P_SRV debug_level=3 max_frag_len=2048" \
|
|
|
|
"$P_CLI debug_level=3 max_frag_len=4096" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 4096" \
|
|
|
|
-c "Maximum outgoing record payload length is 4096" \
|
|
|
|
-s "Maximum incoming record payload length is 4096" \
|
|
|
|
-s "Maximum outgoing record payload length is 2048" \
|
2014-02-20 14:50:42 +01: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 4096
|
2017-09-18 16:00:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Max fragment length: used by server" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 max_frag_len=4096" \
|
|
|
|
"$P_CLI debug_level=3" \
|
2014-02-20 14:50:42 +01:00
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
|
|
|
|
-s "Maximum outgoing record payload length is 4096" \
|
2014-02-20 14:50:42 +01: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 17:19:59 +01:00
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 4096
|
2017-09-18 16:00:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2014-08-30 21:42:40 +02:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Max fragment length: gnutls server" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 max_frag_len=4096" \
|
2014-08-20 20:15:53 +02:00
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 4096" \
|
|
|
|
-c "Maximum outgoing record payload length is 4096" \
|
2014-08-20 20:15:53 +02:00
|
|
|
-c "client hello, adding max_fragment_length extension" \
|
|
|
|
-c "found max_fragment_length extension"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 2048
|
2017-09-18 16:00:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-13 17:55:52 +02: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 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 2048" \
|
|
|
|
-c "Maximum outgoing record payload length is 2048" \
|
|
|
|
-s "Maximum incoming record payload length is 2048" \
|
|
|
|
-s "Maximum outgoing record payload length is 2048" \
|
2014-10-13 17:55:52 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 2048
|
2017-09-18 16:00:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-13 17:55:52 +02: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 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 2048" \
|
|
|
|
-c "Maximum outgoing record payload length is 2048" \
|
|
|
|
-s "Maximum incoming record payload length is 2048" \
|
|
|
|
-s "Maximum outgoing record payload length is 2048" \
|
2014-10-13 17:55:52 +02: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"
|
|
|
|
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 2048
|
2017-09-18 16:00:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-01-21 15:37:13 +01:00
|
|
|
run_test "Max fragment length: DTLS client, larger message" \
|
2014-10-13 17:55:52 +02:00
|
|
|
"$P_SRV debug_level=3 dtls=1" \
|
|
|
|
"$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \
|
|
|
|
1 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 2048" \
|
|
|
|
-c "Maximum outgoing record payload length is 2048" \
|
|
|
|
-s "Maximum incoming record payload length is 2048" \
|
|
|
|
-s "Maximum outgoing record payload length is 2048" \
|
2014-10-13 17:55:52 +02: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 17:19:59 +01:00
|
|
|
# Tests for renegotiation
|
|
|
|
|
2017-10-12 16:18:45 +02:00
|
|
|
# Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: none, for reference" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=2" \
|
2014-02-20 17:19:59 +01: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 16:35:27 +01:00
|
|
|
-C "=> renegotiate" \
|
|
|
|
-S "=> renegotiate" \
|
2014-02-20 17:19:59 +01:00
|
|
|
-S "write hello request"
|
|
|
|
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: client-initiated" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \
|
2014-02-20 17:19:59 +01: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 16:35:27 +01:00
|
|
|
-c "=> renegotiate" \
|
|
|
|
-s "=> renegotiate" \
|
2014-02-20 17:19:59 +01:00
|
|
|
-S "write hello request"
|
|
|
|
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: server-initiated" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1" \
|
2014-02-20 17:19:59 +01: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 16:35:27 +01:00
|
|
|
-c "=> renegotiate" \
|
|
|
|
-s "=> renegotiate" \
|
2014-02-20 17:19:59 +01:00
|
|
|
-s "write hello request"
|
|
|
|
|
2017-10-05 13:29:42 +02: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
|
2021-05-28 09:42:25 +02:00
|
|
|
# algorithm stronger than SHA-1 is enabled in mbedtls_config.h
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-10-05 13:29:42 +02: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
|
2021-05-28 09:42:25 +02:00
|
|
|
# algorithm stronger than SHA-1 is enabled in mbedtls_config.h
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-10-05 13:29:42 +02: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 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: double" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \
|
2014-02-20 17:19:59 +01: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 16:35:27 +01:00
|
|
|
-c "=> renegotiate" \
|
|
|
|
-s "=> renegotiate" \
|
2014-02-20 17:19:59 +01:00
|
|
|
-s "write hello request"
|
|
|
|
|
2020-04-03 12:40:47 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-07-02 11:10:49 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-04-03 12:40:47 +02:00
|
|
|
run_test "Renegotiation with max fragment length: client 2048, server 512" \
|
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \
|
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 max_frag_len=2048 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
2021-06-08 06:35:29 +02:00
|
|
|
-c "Maximum incoming record payload length is 2048" \
|
|
|
|
-c "Maximum outgoing record payload length is 2048" \
|
|
|
|
-s "Maximum incoming record payload length is 2048" \
|
|
|
|
-s "Maximum outgoing record payload length is 512" \
|
2020-04-03 12:40:47 +02: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 "client hello, adding renegotiation extension" \
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO" \
|
|
|
|
-s "found renegotiation extension" \
|
|
|
|
-s "server hello, secure renegotiation extension" \
|
2014-02-20 17:19:59 +01:00
|
|
|
-c "found renegotiation extension" \
|
2014-02-26 16:35:27 +01:00
|
|
|
-c "=> renegotiate" \
|
|
|
|
-s "=> renegotiate" \
|
2014-02-20 17:19:59 +01:00
|
|
|
-s "write hello request"
|
|
|
|
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: client-initiated, server-rejected" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \
|
2014-02-20 17:19:59 +01: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 16:35:27 +01:00
|
|
|
-c "=> renegotiate" \
|
|
|
|
-S "=> renegotiate" \
|
2014-07-04 14:32:27 +02:00
|
|
|
-S "write hello request" \
|
2014-08-19 12:50:30 +02:00
|
|
|
-c "SSL - Unexpected message at ServerHello in renegotiation" \
|
2014-07-04 14:32:27 +02:00
|
|
|
-c "failed"
|
2014-02-20 17:19:59 +01:00
|
|
|
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: server-initiated, client-rejected, default" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=0" \
|
2014-02-20 17:19:59 +01: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 16:35:27 +01:00
|
|
|
-C "=> renegotiate" \
|
|
|
|
-S "=> renegotiate" \
|
2014-02-20 17:19:59 +01:00
|
|
|
-s "write hello request" \
|
2014-07-03 19:29:16 +02:00
|
|
|
-S "SSL - An unexpected message was received from our peer" \
|
|
|
|
-S "failed"
|
2014-02-21 09:47:37 +01:00
|
|
|
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: server-initiated, client-rejected, not enforced" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \
|
2015-03-27 17:52:25 +01:00
|
|
|
renego_delay=-1 auth_mode=optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=0" \
|
2014-07-04 14:32:27 +02: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 12:07:38 +02:00
|
|
|
# delay 2 for 1 alert record + 1 application data record
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: server-initiated, client-rejected, delay 2" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \
|
2015-03-27 17:52:25 +01:00
|
|
|
renego_delay=2 auth_mode=optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=0" \
|
2014-07-04 14:32:27 +02: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 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: server-initiated, client-rejected, delay 0" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \
|
2015-03-27 17:52:25 +01:00
|
|
|
renego_delay=0 auth_mode=optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=0" \
|
2014-07-04 14:32:27 +02: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 12:07:38 +02:00
|
|
|
-s "SSL - An unexpected message was received from our peer"
|
2014-07-04 14:32:27 +02:00
|
|
|
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: server-initiated, client-accepted, delay 0" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \
|
2015-03-27 17:52:25 +01:00
|
|
|
renego_delay=0 auth_mode=optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=2 renegotiation=1" \
|
2014-07-04 14:32:27 +02: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 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-05 14:23:03 +01:00
|
|
|
run_test "Renegotiation: periodic, just below period" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \
|
2014-11-05 14:23:03 +01: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 14:41:58 +01:00
|
|
|
# one extra exchange to be able to complete renego
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-05 14:23:03 +01:00
|
|
|
run_test "Renegotiation: periodic, just above period" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \
|
2015-01-14 14:41:58 +01:00
|
|
|
"$P_CLI debug_level=3 exchanges=4 renegotiation=1" \
|
2014-11-05 14:23:03 +01: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 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-05 14:23:03 +01:00
|
|
|
run_test "Renegotiation: periodic, two times period" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \
|
2015-01-14 14:41:58 +01:00
|
|
|
"$P_CLI debug_level=3 exchanges=7 renegotiation=1" \
|
2014-11-05 14:23:03 +01: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 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-05 14:23:03 +01:00
|
|
|
run_test "Renegotiation: periodic, above period, disabled" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \
|
2014-11-05 14:23:03 +01: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 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: nbio, client-initiated" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \
|
2014-08-15 19:04:47 +02: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 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: nbio, server-initiated" \
|
2015-03-27 17:52:25 +01:00
|
|
|
"$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1" \
|
2014-08-15 19:04:47 +02: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 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Renegotiation: openssl server, client-initiated" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -www -tls1_2" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \
|
2014-08-30 21:22:47 +02:00
|
|
|
0 \
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
-c "=> renegotiate" \
|
2014-11-03 20:10:36 +01:00
|
|
|
-C "ssl_hanshake() returned" \
|
2014-08-30 21:22:47 +02:00
|
|
|
-C "error" \
|
|
|
|
-c "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
2015-02-08 16:18:35 +01:00
|
|
|
requires_gnutls
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-03 20:10:36 +01:00
|
|
|
run_test "Renegotiation: gnutls server strict, client-initiated" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \
|
2014-08-30 21:22:47 +02:00
|
|
|
0 \
|
|
|
|
-c "client hello, adding renegotiation extension" \
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
-c "=> renegotiate" \
|
2014-11-03 20:10:36 +01:00
|
|
|
-C "ssl_hanshake() returned" \
|
2014-08-30 21:22:47 +02:00
|
|
|
-C "error" \
|
|
|
|
-c "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
2015-02-08 16:18:35 +01:00
|
|
|
requires_gnutls
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-03 20:10:36 +01:00
|
|
|
run_test "Renegotiation: gnutls server unsafe, client-initiated default" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \
|
2014-11-03 20:10:36 +01:00
|
|
|
"$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 12:49:31 +02:00
|
|
|
-c "mbedtls_ssl_handshake() returned" \
|
2014-11-03 20:10:36 +01:00
|
|
|
-c "error" \
|
|
|
|
-C "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
2015-02-08 16:18:35 +01:00
|
|
|
requires_gnutls
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-03 20:10:36 +01:00
|
|
|
run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \
|
2014-11-03 20:10:36 +01:00
|
|
|
"$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 12:49:31 +02:00
|
|
|
-c "mbedtls_ssl_handshake() returned" \
|
2014-11-03 20:10:36 +01:00
|
|
|
-c "error" \
|
|
|
|
-C "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
2015-02-08 16:18:35 +01:00
|
|
|
requires_gnutls
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-03 20:10:36 +01:00
|
|
|
run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \
|
2014-11-03 20:10:36 +01:00
|
|
|
"$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 21:22:47 +02:00
|
|
|
-C "error" \
|
|
|
|
-c "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-19 17:43:50 +02: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 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-19 17:53:11 +02:00
|
|
|
run_test "Renegotiation: DTLS, server-initiated" \
|
|
|
|
"$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \
|
2014-10-02 14:17:18 +02:00
|
|
|
"$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \
|
|
|
|
read_timeout=1000 max_resend=2" \
|
2014-08-19 17:53:11 +02: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 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-01-19 17:30:57 +01: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 16:18:45 +02:00
|
|
|
-s "write hello request"
|
2017-01-19 17:30:57 +01:00
|
|
|
|
2015-02-17 17:02:37 +01:00
|
|
|
requires_gnutls
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-31 17:13:13 +02: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 12:49:31 +02:00
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-08-31 17:13:13 +02:00
|
|
|
-C "error" \
|
|
|
|
-s "Extra-header:"
|
|
|
|
|
2014-11-03 20:10:36 +01:00
|
|
|
# Test for the "secure renegotation" extension only (no actual renegotiation)
|
|
|
|
|
2015-02-08 16:18:35 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-03 20:10:36 +01:00
|
|
|
run_test "Renego ext: gnutls server strict, client default" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \
|
2014-11-03 20:10:36 +01:00
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "found renegotiation extension" \
|
|
|
|
-C "error" \
|
|
|
|
-c "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
2015-02-08 16:18:35 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-03 20:10:36 +01:00
|
|
|
run_test "Renego ext: gnutls server unsafe, client default" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \
|
2014-11-03 20:10:36 +01:00
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-C "found renegotiation extension" \
|
2014-08-30 21:22:47 +02:00
|
|
|
-C "error" \
|
|
|
|
-c "HTTP/1.0 200 [Oo][Kk]"
|
|
|
|
|
2015-02-08 16:18:35 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-03 20:10:36 +01:00
|
|
|
run_test "Renego ext: gnutls server unsafe, client break legacy" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \
|
2014-11-03 20:10:36 +01:00
|
|
|
"$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 16:18:35 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-03 20:10:36 +01:00
|
|
|
run_test "Renego ext: gnutls client strict, server default" \
|
|
|
|
"$P_SRV debug_level=3" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \
|
2014-11-03 20:10:36 +01:00
|
|
|
0 \
|
|
|
|
-s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \
|
|
|
|
-s "server hello, secure renegotiation extension"
|
|
|
|
|
2015-02-08 16:18:35 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-03 20:10:36 +01:00
|
|
|
run_test "Renego ext: gnutls client unsafe, server default" \
|
|
|
|
"$P_SRV debug_level=3" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \
|
2014-11-03 20:10:36 +01:00
|
|
|
0 \
|
|
|
|
-S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \
|
|
|
|
-S "server hello, secure renegotiation extension"
|
|
|
|
|
2015-02-08 16:18:35 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-11-03 20:10:36 +01:00
|
|
|
run_test "Renego ext: gnutls client unsafe, server break legacy" \
|
|
|
|
"$P_SRV debug_level=3 allow_legacy=-1" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \
|
2014-11-03 20:10:36 +01:00
|
|
|
1 \
|
|
|
|
-S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \
|
|
|
|
-S "server hello, secure renegotiation extension"
|
|
|
|
|
2016-02-17 11:11:21 +01:00
|
|
|
# Tests for silently dropping trailing extra bytes in .der certificates
|
|
|
|
|
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-02-17 11:11:21 +01:00
|
|
|
run_test "DER format: no trailing bytes" \
|
|
|
|
"$P_SRV crt_file=data_files/server5-der0.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI localhost" \
|
2016-02-17 11:11:21 +01:00
|
|
|
0 \
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-02-17 11:11:21 +01:00
|
|
|
run_test "DER format: with a trailing zero byte" \
|
|
|
|
"$P_SRV crt_file=data_files/server5-der1a.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI localhost" \
|
2016-02-17 11:11:21 +01:00
|
|
|
0 \
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-02-17 11:11:21 +01:00
|
|
|
run_test "DER format: with a trailing random byte" \
|
|
|
|
"$P_SRV crt_file=data_files/server5-der1b.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI localhost" \
|
2016-02-17 11:11:21 +01:00
|
|
|
0 \
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-02-17 11:11:21 +01:00
|
|
|
run_test "DER format: with 2 trailing random bytes" \
|
|
|
|
"$P_SRV crt_file=data_files/server5-der2.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI localhost" \
|
2016-02-17 11:11:21 +01:00
|
|
|
0 \
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-02-17 11:11:21 +01:00
|
|
|
run_test "DER format: with 4 trailing random bytes" \
|
|
|
|
"$P_SRV crt_file=data_files/server5-der4.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI localhost" \
|
2016-02-17 11:11:21 +01:00
|
|
|
0 \
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-02-17 11:11:21 +01:00
|
|
|
run_test "DER format: with 8 trailing random bytes" \
|
|
|
|
"$P_SRV crt_file=data_files/server5-der8.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI localhost" \
|
2016-02-17 11:11:21 +01:00
|
|
|
0 \
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-02-17 11:11:21 +01:00
|
|
|
run_test "DER format: with 9 trailing random bytes" \
|
|
|
|
"$P_SRV crt_file=data_files/server5-der9.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI localhost" \
|
2016-02-17 11:11:21 +01:00
|
|
|
0 \
|
|
|
|
-c "Handshake was completed" \
|
|
|
|
|
2019-04-01 14:11:54 +02:00
|
|
|
# Tests for auth_mode, there are duplicated tests using ca callback for authentication
|
|
|
|
# When updating these tests, modify the matching authentication tests accordingly
|
2014-02-21 12:12:23 +01:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Authentication: server badcert, client required" \
|
2014-02-25 14:18:30 +01:00
|
|
|
"$P_SRV crt_file=data_files/server5-badsign.crt \
|
2014-02-21 12:12:23 +01:00
|
|
|
key_file=data_files/server5.key" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1 auth_mode=required" \
|
2014-02-21 12:12:23 +01:00
|
|
|
1 \
|
|
|
|
-c "x509_verify_cert() returned" \
|
2015-04-20 11:56:18 +02:00
|
|
|
-c "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 12:49:31 +02:00
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
2014-02-21 12:12:23 +01:00
|
|
|
-c "X509 - Certificate verification failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Authentication: server badcert, client optional" \
|
2014-02-25 14:18:30 +01:00
|
|
|
"$P_SRV crt_file=data_files/server5-badsign.crt \
|
2014-02-21 12:12:23 +01:00
|
|
|
key_file=data_files/server5.key" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1 auth_mode=optional" \
|
2014-02-21 12:12:23 +01:00
|
|
|
0 \
|
|
|
|
-c "x509_verify_cert() returned" \
|
2015-04-20 11:56:18 +02:00
|
|
|
-c "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 12:49:31 +02:00
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-21 12:12:23 +01:00
|
|
|
-C "X509 - Certificate verification failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-15 17:05:15 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-15 17:05:15 +02:00
|
|
|
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
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-15 17:05:15 +02:00
|
|
|
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
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-15 17:05:15 +02:00
|
|
|
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
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Authentication: server badcert, client none" \
|
2014-02-25 14:18:30 +01:00
|
|
|
"$P_SRV crt_file=data_files/server5-badsign.crt \
|
2014-02-21 12:12:23 +01:00
|
|
|
key_file=data_files/server5.key" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1 auth_mode=none" \
|
2014-02-21 12:12:23 +01:00
|
|
|
0 \
|
|
|
|
-C "x509_verify_cert() returned" \
|
2015-04-20 11:56:18 +02:00
|
|
|
-C "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 12:49:31 +02:00
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-21 12:12:23 +01:00
|
|
|
-C "X509 - Certificate verification failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-10-13 18:21:01 +02: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,"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-10-13 18:21:01 +02:00
|
|
|
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,"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-03 16:25:07 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Authentication: client badcert, server required" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 auth_mode=required" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
|
2014-02-21 12:12:23 +01: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 16:50:52 +02:00
|
|
|
-s "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 12:49:31 +02:00
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
2017-05-03 16:28:34 +02:00
|
|
|
-s "send alert level=2 message=48" \
|
2015-04-08 12:49:31 +02:00
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
2014-02-21 12:12:23 +01:00
|
|
|
-s "X509 - Certificate verification failed"
|
2017-05-03 16:28:34 +02: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 12:12:23 +01:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-01-07 23:10:56 +01:00
|
|
|
run_test "Authentication: client cert self-signed and trusted, server required" \
|
|
|
|
"$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \
|
|
|
|
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" \
|
|
|
|
-S "! The certificate is not correctly signed" \
|
|
|
|
-S "X509 - Certificate verification failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-04-10 15:34:35 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Authentication: client badcert, server optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 auth_mode=optional" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
|
2014-02-21 12:12:23 +01: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 11:56:18 +02:00
|
|
|
-s "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "! mbedtls_ssl_handshake returned" \
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-21 12:12:23 +01:00
|
|
|
-S "X509 - Certificate verification failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Authentication: client badcert, server none" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 auth_mode=none" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
|
2014-02-21 12:12:23 +01: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 11:56:18 +02:00
|
|
|
-S "! The certificate is not correctly signed by the trusted CA" \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "! mbedtls_ssl_handshake returned" \
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-21 12:12:23 +01:00
|
|
|
-S "X509 - Certificate verification failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Authentication: client no cert, server optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 auth_mode=optional" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=none key_file=none" \
|
2014-02-27 14:58:26 +01: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" \
|
|
|
|
-c "skip write certificate verify" \
|
|
|
|
-s "skip parse certificate verify" \
|
2015-04-20 11:56:18 +02:00
|
|
|
-s "! Certificate was missing" \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "! mbedtls_ssl_handshake returned" \
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
2014-02-27 14:58:26 +01:00
|
|
|
-S "X509 - Certificate verification failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Authentication: openssl client no cert, server optional" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 auth_mode=optional" \
|
2014-02-27 14:58:26 +01:00
|
|
|
"$O_CLI" \
|
|
|
|
0 \
|
|
|
|
-S "skip write certificate request" \
|
|
|
|
-s "skip parse certificate verify" \
|
2015-04-20 11:56:18 +02:00
|
|
|
-s "! Certificate was missing" \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "! mbedtls_ssl_handshake returned" \
|
2014-02-27 14:58:26 +01:00
|
|
|
-S "X509 - Certificate verification failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Authentication: client no cert, openssl server optional" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -verify 10 -tls1_2" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=3 crt_file=none key_file=none" \
|
2014-02-27 14:58:26 +01:00
|
|
|
0 \
|
|
|
|
-C "skip parse certificate request" \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-C "skip write certificate$" \
|
|
|
|
-c "skip write certificate verify" \
|
2015-04-08 12:49:31 +02:00
|
|
|
-C "! mbedtls_ssl_handshake returned"
|
2014-02-27 14:58:26 +01:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-03 16:25:07 +02:00
|
|
|
run_test "Authentication: client no cert, openssl server required" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -Verify 10 -tls1_2" \
|
2017-05-03 16:25:07 +02:00
|
|
|
"$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 14:58:26 +01:00
|
|
|
|
2021-07-02 14:05:15 +02:00
|
|
|
# This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default
|
|
|
|
# value, defined here as MAX_IM_CA. Some test cases will be skipped if the
|
|
|
|
# library is configured with a different value.
|
2017-07-26 14:35:11 +02:00
|
|
|
|
2017-07-28 16:59:35 +02:00
|
|
|
MAX_IM_CA='8'
|
2017-07-26 14:35:11 +02:00
|
|
|
|
2021-07-02 14:05:15 +02:00
|
|
|
# The tests for the max_int tests can pass with any number higher than MAX_IM_CA
|
|
|
|
# because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1
|
|
|
|
# tests can pass with any number less than MAX_IM_CA. However, stricter preconditions
|
|
|
|
# are in place so that the semantics are consistent with the test description.
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2018-04-11 08:28:39 +02:00
|
|
|
requires_full_size_output_buffer
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-06-26 10:45:33 +02: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 15:24:37 +01:00
|
|
|
-C "X509 - A fatal error occurred"
|
2017-06-26 10:45:33 +02:00
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2018-04-11 08:28:39 +02:00
|
|
|
requires_full_size_output_buffer
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-06-26 10:45:33 +02: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 15:24:37 +01:00
|
|
|
-c "X509 - A fatal error occurred"
|
2017-06-26 10:45:33 +02:00
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2018-04-11 08:28:39 +02:00
|
|
|
requires_full_size_output_buffer
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-06-26 10:45:33 +02: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 15:24:37 +01:00
|
|
|
-c "X509 - A fatal error occurred"
|
2017-06-26 10:45:33 +02:00
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2018-04-11 08:28:39 +02:00
|
|
|
requires_full_size_output_buffer
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-06-26 10:45:33 +02: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 15:24:37 +01:00
|
|
|
-C "X509 - A fatal error occurred"
|
2017-06-26 10:45:33 +02:00
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2018-04-11 08:28:39 +02:00
|
|
|
requires_full_size_output_buffer
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-06-26 10:45:33 +02: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 15:24:37 +01:00
|
|
|
-S "X509 - A fatal error occurred"
|
2017-06-26 10:45:33 +02:00
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2018-04-11 08:28:39 +02:00
|
|
|
requires_full_size_output_buffer
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-06-26 10:45:33 +02: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 15:24:37 +01:00
|
|
|
-s "X509 - A fatal error occurred"
|
2017-06-26 10:45:33 +02:00
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2018-04-11 08:28:39 +02:00
|
|
|
requires_full_size_output_buffer
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-06-26 10:45:33 +02: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 15:24:37 +01:00
|
|
|
-s "X509 - A fatal error occurred"
|
2017-06-26 10:45:33 +02:00
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2018-04-11 08:28:39 +02:00
|
|
|
requires_full_size_output_buffer
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-06-26 10:45:33 +02: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 15:24:37 +01:00
|
|
|
-S "X509 - A fatal error occurred"
|
2017-06-26 10:45:33 +02:00
|
|
|
|
2017-04-10 15:34:35 +02:00
|
|
|
# Tests for CA list in CertificateRequest messages
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-04-10 15:34:35 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-04-10 15:34:35 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-04-10 15:34:35 +02:00
|
|
|
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"
|
|
|
|
|
2019-04-01 14:11:54 +02:00
|
|
|
# Tests for auth_mode, using CA callback, these are duplicated from the authentication tests
|
|
|
|
# When updating these tests, modify the matching authentication tests accordingly
|
2019-03-28 16:25:23 +01:00
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: server badcert, client required" \
|
|
|
|
"$P_SRV crt_file=data_files/server5-badsign.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
"$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \
|
|
|
|
1 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-c "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-c "x509_verify_cert() returned" \
|
|
|
|
-c "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
|
|
|
-c "X509 - Certificate verification failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: server badcert, client optional" \
|
|
|
|
"$P_SRV crt_file=data_files/server5-badsign.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
"$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \
|
|
|
|
0 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-c "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-c "x509_verify_cert() returned" \
|
|
|
|
-c "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
|
|
|
-C "X509 - Certificate verification failed"
|
|
|
|
|
|
|
|
# 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
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: 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 ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \
|
|
|
|
1 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-c "use CA callback for X.509 CRT verification" \
|
|
|
|
-c "bad certificate (EC key curve)" \
|
|
|
|
-c "! Certificate verification flags" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_ECP_C
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: 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 ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \
|
|
|
|
1 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-c "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-c "bad certificate (EC key curve)"\
|
|
|
|
-c "! Certificate verification flags"\
|
|
|
|
-c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: client SHA256, server required" \
|
|
|
|
"$P_SRV ca_callback=1 debug_level=3 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 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-s "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-c "Supported Signature Algorithm found: 4," \
|
|
|
|
-c "Supported Signature Algorithm found: 5,"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: client SHA384, server required" \
|
|
|
|
"$P_SRV ca_callback=1 debug_level=3 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 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-s "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-c "Supported Signature Algorithm found: 4," \
|
|
|
|
-c "Supported Signature Algorithm found: 5,"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: client badcert, server required" \
|
|
|
|
"$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
1 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-s "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01: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" \
|
|
|
|
-s "x509_verify_cert() returned" \
|
|
|
|
-s "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
-s "send alert level=2 message=48" \
|
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
|
|
|
-s "X509 - Certificate verification failed"
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: client cert not trusted, server required" \
|
|
|
|
"$P_SRV ca_callback=1 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 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-s "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01: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" \
|
|
|
|
-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"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: client badcert, server optional" \
|
|
|
|
"$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
0 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-s "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01: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" \
|
|
|
|
-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"
|
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2019-03-28 16:25:23 +01:00
|
|
|
requires_full_size_output_buffer
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: 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 ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \
|
|
|
|
0 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-c "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-C "X509 - A fatal error occurred"
|
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2019-03-28 16:25:23 +01:00
|
|
|
requires_full_size_output_buffer
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: 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 debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \
|
|
|
|
1 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-c "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-c "X509 - A fatal error occurred"
|
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2019-03-28 16:25:23 +01:00
|
|
|
requires_full_size_output_buffer
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: 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 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \
|
|
|
|
debug_level=3 auth_mode=optional" \
|
|
|
|
1 \
|
2019-04-05 15:52:17 +02:00
|
|
|
-c "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-c "X509 - A fatal error occurred"
|
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2019-03-28 16:25:23 +01:00
|
|
|
requires_full_size_output_buffer
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: client max_int+1 chain, server optional" \
|
|
|
|
"$P_SRV ca_callback=1 debug_level=3 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-04-05 15:52:17 +02:00
|
|
|
-s "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-s "X509 - A fatal error occurred"
|
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2019-03-28 16:25:23 +01:00
|
|
|
requires_full_size_output_buffer
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: client max_int+1 chain, server required" \
|
|
|
|
"$P_SRV ca_callback=1 debug_level=3 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-04-05 15:52:17 +02:00
|
|
|
-s "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-s "X509 - A fatal error occurred"
|
|
|
|
|
2021-07-02 14:10:41 +02:00
|
|
|
requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA
|
2019-03-28 16:25:23 +01:00
|
|
|
requires_full_size_output_buffer
|
|
|
|
requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-03-28 16:25:23 +01:00
|
|
|
run_test "Authentication, CA callback: client max_int chain, server required" \
|
|
|
|
"$P_SRV ca_callback=1 debug_level=3 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-04-05 15:52:17 +02:00
|
|
|
-s "use CA callback for X.509 CRT verification" \
|
2019-03-28 16:25:23 +01:00
|
|
|
-S "X509 - A fatal error occurred"
|
|
|
|
|
2015-01-08 16:43:07 +01:00
|
|
|
# Tests for certificate selection based on SHA verson
|
|
|
|
|
2020-10-09 12:10:42 +02:00
|
|
|
requires_config_disabled MBEDTLS_X509_REMOVE_INFO
|
2015-01-08 16:43:07 +01:00
|
|
|
run_test "Certificate hash: client TLS 1.2 -> SHA-2" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12 crt_file=data_files/server5.crt \
|
2015-01-08 16:43:07 +01:00
|
|
|
key_file=data_files/server5.key \
|
|
|
|
crt_file2=data_files/server5-sha1.crt \
|
|
|
|
key_file2=data_files/server5.key" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_CLI" \
|
2015-01-08 16:43:07 +01:00
|
|
|
0 \
|
|
|
|
-c "signed using.*ECDSA with SHA256" \
|
|
|
|
-C "signed using.*ECDSA with SHA1"
|
|
|
|
|
2014-02-25 12:26:29 +01:00
|
|
|
# tests for SNI
|
|
|
|
|
2020-10-09 12:10:42 +02:00
|
|
|
requires_config_disabled MBEDTLS_X509_REMOVE_INFO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "SNI: no SNI callback" \
|
2014-07-23 20:17:47 +02:00
|
|
|
"$P_SRV debug_level=3 \
|
2014-02-25 12:26:29 +01:00
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key" \
|
2014-07-23 20:17:47 +02:00
|
|
|
"$P_CLI server_name=localhost" \
|
2015-06-22 16:50:52 +02:00
|
|
|
0 \
|
|
|
|
-c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \
|
|
|
|
-c "subject name *: C=NL, O=PolarSSL, CN=localhost"
|
2014-02-25 12:26:29 +01:00
|
|
|
|
2020-10-09 12:10:42 +02:00
|
|
|
requires_config_disabled MBEDTLS_X509_REMOVE_INFO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "SNI: matching cert 1" \
|
2014-07-23 20:17:47 +02:00
|
|
|
"$P_SRV debug_level=3 \
|
2014-02-25 12:26:29 +01:00
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
2015-06-19 14:40:39 +02: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 20:17:47 +02:00
|
|
|
"$P_CLI server_name=localhost" \
|
2015-06-22 16:50:52 +02: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 12:26:29 +01:00
|
|
|
|
2020-10-09 12:10:42 +02:00
|
|
|
requires_config_disabled MBEDTLS_X509_REMOVE_INFO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "SNI: matching cert 2" \
|
2014-07-23 20:17:47 +02:00
|
|
|
"$P_SRV debug_level=3 \
|
2014-02-25 12:26:29 +01:00
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
2015-06-19 14:40:39 +02: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 20:17:47 +02:00
|
|
|
"$P_CLI server_name=polarssl.example" \
|
2015-06-22 16:50:52 +02: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 12:26:29 +01:00
|
|
|
|
2020-10-09 12:10:42 +02:00
|
|
|
requires_config_disabled MBEDTLS_X509_REMOVE_INFO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "SNI: no matching cert" \
|
2014-07-23 20:17:47 +02:00
|
|
|
"$P_SRV debug_level=3 \
|
2014-02-25 12:26:29 +01:00
|
|
|
crt_file=data_files/server5.crt key_file=data_files/server5.key \
|
2015-06-19 14:40:39 +02: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 20:17:47 +02:00
|
|
|
"$P_CLI server_name=nonesuch.example" \
|
2015-06-22 16:50:52 +02: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 12:26:29 +01:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-22 16:04:20 +02: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 16:50:52 +02:00
|
|
|
0 \
|
2015-06-22 16:04:20 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-22 16:04:20 +02:00
|
|
|
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 16:50:52 +02:00
|
|
|
0 \
|
2015-06-22 16:04:20 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-22 16:04:20 +02:00
|
|
|
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 16:50:52 +02:00
|
|
|
0 \
|
2015-06-22 16:04:20 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-22 16:50:52 +02: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)"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-22 16:50:52 +02:00
|
|
|
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)"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-22 16:50:52 +02:00
|
|
|
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 11:01:30 +01:00
|
|
|
# Tests for SNI and DTLS
|
|
|
|
|
2020-10-09 12:10:42 +02:00
|
|
|
requires_config_disabled MBEDTLS_X509_REMOVE_INFO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-05-01 21:27:37 +02: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 \
|
|
|
|
-c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \
|
|
|
|
-c "subject name *: C=NL, O=PolarSSL, CN=localhost"
|
|
|
|
|
2020-10-09 12:10:42 +02:00
|
|
|
requires_config_disabled MBEDTLS_X509_REMOVE_INFO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-05-01 21:26:47 +02:00
|
|
|
run_test "SNI: DTLS, matching cert 1" \
|
2016-12-07 11:01:30 +01: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"
|
|
|
|
|
2020-10-09 12:10:42 +02:00
|
|
|
requires_config_disabled MBEDTLS_X509_REMOVE_INFO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-05-01 21:27:37 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-05-01 21:27:37 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-05-01 21:27:37 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-05-01 21:27:37 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-05-01 21:27:37 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-05-01 21:27:37 +02:00
|
|
|
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)"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-05-01 21:26:47 +02:00
|
|
|
run_test "SNI: DTLS, CA override" \
|
2016-12-07 11:01:30 +01: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)"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-05-01 21:26:47 +02:00
|
|
|
run_test "SNI: DTLS, CA override with CRL" \
|
2016-12-07 11:01:30 +01: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 14:45:12 +01:00
|
|
|
# Tests for non-blocking I/O: exercise a variety of handshake flows
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Non-blocking I/O: basic handshake" \
|
2014-02-26 14:45:12 +01:00
|
|
|
"$P_SRV nbio=2 tickets=0 auth_mode=none" \
|
|
|
|
"$P_CLI nbio=2 tickets=0" \
|
|
|
|
0 \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 14:45:12 +01:00
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Non-blocking I/O: client auth" \
|
2014-02-26 14:45:12 +01:00
|
|
|
"$P_SRV nbio=2 tickets=0 auth_mode=required" \
|
|
|
|
"$P_CLI nbio=2 tickets=0" \
|
|
|
|
0 \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 14:45:12 +01:00
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Non-blocking I/O: ticket" \
|
2014-02-26 14:45:12 +01:00
|
|
|
"$P_SRV nbio=2 tickets=1 auth_mode=none" \
|
|
|
|
"$P_CLI nbio=2 tickets=1" \
|
|
|
|
0 \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 14:45:12 +01:00
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Non-blocking I/O: ticket + client auth" \
|
2014-02-26 14:45:12 +01:00
|
|
|
"$P_SRV nbio=2 tickets=1 auth_mode=required" \
|
|
|
|
"$P_CLI nbio=2 tickets=1" \
|
|
|
|
0 \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 14:45:12 +01:00
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Non-blocking I/O: ticket + client auth + resume" \
|
2014-02-26 14:45:12 +01:00
|
|
|
"$P_SRV nbio=2 tickets=1 auth_mode=required" \
|
|
|
|
"$P_CLI nbio=2 tickets=1 reconnect=1" \
|
|
|
|
0 \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 14:45:12 +01:00
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Non-blocking I/O: ticket + resume" \
|
2014-02-26 14:45:12 +01:00
|
|
|
"$P_SRV nbio=2 tickets=1 auth_mode=none" \
|
|
|
|
"$P_CLI nbio=2 tickets=1 reconnect=1" \
|
|
|
|
0 \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 14:45:12 +01:00
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Non-blocking I/O: session-id resume" \
|
2014-02-26 14:45:12 +01:00
|
|
|
"$P_SRV nbio=2 tickets=0 auth_mode=none" \
|
|
|
|
"$P_CLI nbio=2 tickets=0 reconnect=1" \
|
|
|
|
0 \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 14:45:12 +01:00
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2017-11-15 17:39:08 +01:00
|
|
|
# Tests for event-driven I/O: exercise a variety of handshake flows
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-11-15 17:39:08 +01:00
|
|
|
run_test "Event-driven I/O: basic handshake" \
|
|
|
|
"$P_SRV event=1 tickets=0 auth_mode=none" \
|
|
|
|
"$P_CLI event=1 tickets=0" \
|
|
|
|
0 \
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-11-15 17:39:08 +01:00
|
|
|
run_test "Event-driven I/O: client auth" \
|
|
|
|
"$P_SRV event=1 tickets=0 auth_mode=required" \
|
|
|
|
"$P_CLI event=1 tickets=0" \
|
|
|
|
0 \
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-11-15 17:39:08 +01:00
|
|
|
run_test "Event-driven I/O: ticket" \
|
|
|
|
"$P_SRV event=1 tickets=1 auth_mode=none" \
|
|
|
|
"$P_CLI event=1 tickets=1" \
|
|
|
|
0 \
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-11-15 17:39:08 +01:00
|
|
|
run_test "Event-driven I/O: ticket + client auth" \
|
|
|
|
"$P_SRV event=1 tickets=1 auth_mode=required" \
|
|
|
|
"$P_CLI event=1 tickets=1" \
|
|
|
|
0 \
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-11-15 17:39:08 +01:00
|
|
|
run_test "Event-driven I/O: ticket + client auth + resume" \
|
|
|
|
"$P_SRV event=1 tickets=1 auth_mode=required" \
|
|
|
|
"$P_CLI event=1 tickets=1 reconnect=1" \
|
|
|
|
0 \
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-11-15 17:39:08 +01:00
|
|
|
run_test "Event-driven I/O: ticket + resume" \
|
|
|
|
"$P_SRV event=1 tickets=1 auth_mode=none" \
|
|
|
|
"$P_CLI event=1 tickets=1 reconnect=1" \
|
|
|
|
0 \
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-11-15 17:39:08 +01:00
|
|
|
run_test "Event-driven I/O: session-id resume" \
|
|
|
|
"$P_SRV event=1 tickets=0 auth_mode=none" \
|
|
|
|
"$P_CLI event=1 tickets=0 reconnect=1" \
|
|
|
|
0 \
|
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-03-13 12:38:46 +01:00
|
|
|
run_test "Event-driven I/O, DTLS: basic handshake" \
|
|
|
|
"$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \
|
|
|
|
"$P_CLI dtls=1 event=1 tickets=0" \
|
|
|
|
0 \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-03-13 12:38:46 +01:00
|
|
|
run_test "Event-driven I/O, DTLS: client auth" \
|
|
|
|
"$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \
|
|
|
|
"$P_CLI dtls=1 event=1 tickets=0" \
|
|
|
|
0 \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-03-13 12:38:46 +01:00
|
|
|
run_test "Event-driven I/O, DTLS: ticket" \
|
|
|
|
"$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \
|
|
|
|
"$P_CLI dtls=1 event=1 tickets=1" \
|
|
|
|
0 \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-03-13 12:38:46 +01:00
|
|
|
run_test "Event-driven I/O, DTLS: ticket + client auth" \
|
|
|
|
"$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \
|
|
|
|
"$P_CLI dtls=1 event=1 tickets=1" \
|
|
|
|
0 \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-03-13 12:38:46 +01:00
|
|
|
run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \
|
|
|
|
"$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 event=1 tickets=1 reconnect=1 skip_close_notify=1" \
|
2018-03-13 12:38:46 +01:00
|
|
|
0 \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-03-13 12:38:46 +01:00
|
|
|
run_test "Event-driven I/O, DTLS: ticket + resume" \
|
|
|
|
"$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 event=1 tickets=1 reconnect=1 skip_close_notify=1" \
|
2018-03-13 12:38:46 +01:00
|
|
|
0 \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-03-13 12:38:46 +01:00
|
|
|
run_test "Event-driven I/O, DTLS: session-id resume" \
|
|
|
|
"$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 event=1 tickets=0 reconnect=1 skip_close_notify=1" \
|
2018-03-13 12:38:46 +01:00
|
|
|
0 \
|
|
|
|
-c "Read from server: .* bytes read"
|
2018-03-13 12:39:40 +01:00
|
|
|
|
|
|
|
# This test demonstrates the need for the mbedtls_ssl_check_pending function.
|
|
|
|
# During session resumption, the client will send its ApplicationData record
|
|
|
|
# within the same datagram as the Finished messages. In this situation, the
|
|
|
|
# server MUST NOT idle on the underlying transport after handshake completion,
|
|
|
|
# because the ApplicationData request has already been queued internally.
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-03-13 12:39:40 +01:00
|
|
|
run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \
|
2018-03-15 11:14:19 +01:00
|
|
|
-p "$P_PXY pack=50" \
|
2018-03-13 12:39:40 +01:00
|
|
|
"$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \
|
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 11:04:33 +01:00
|
|
|
"$P_CLI dtls=1 event=1 tickets=0 reconnect=1 skip_close_notify=1" \
|
2018-03-13 12:39:40 +01:00
|
|
|
0 \
|
|
|
|
-c "Read from server: .* bytes read"
|
|
|
|
|
2014-04-07 12:42:04 +02:00
|
|
|
# Tests for version negotiation
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "Version check: all -> 1.2" \
|
2014-02-26 16:33:03 +01:00
|
|
|
"$P_SRV" \
|
|
|
|
"$P_CLI" \
|
|
|
|
0 \
|
2015-04-08 12:49:31 +02:00
|
|
|
-S "mbedtls_ssl_handshake returned" \
|
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-02-26 16:33:03 +01:00
|
|
|
-s "Protocol is TLSv1.2" \
|
|
|
|
-c "Protocol is TLSv1.2"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-06-25 14:40:09 +02:00
|
|
|
run_test "Not supported version check: cli TLS 1.0" \
|
|
|
|
"$P_SRV" \
|
|
|
|
"$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \
|
|
|
|
1 \
|
|
|
|
-s "Handshake protocol not within min/max boundaries" \
|
|
|
|
-c "Error in protocol version" \
|
|
|
|
-S "Protocol is TLSv1.0" \
|
|
|
|
-C "Handshake was completed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-06-25 14:40:09 +02:00
|
|
|
run_test "Not supported version check: cli TLS 1.1" \
|
|
|
|
"$P_SRV" \
|
|
|
|
"$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \
|
|
|
|
1 \
|
|
|
|
-s "Handshake protocol not within min/max boundaries" \
|
|
|
|
-c "Error in protocol version" \
|
|
|
|
-S "Protocol is TLSv1.1" \
|
|
|
|
-C "Handshake was completed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-06-25 14:40:09 +02:00
|
|
|
run_test "Not supported version check: srv max TLS 1.0" \
|
|
|
|
"$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \
|
|
|
|
"$P_CLI" \
|
|
|
|
1 \
|
|
|
|
-s "Error in protocol version" \
|
|
|
|
-c "Handshake protocol not within min/max boundaries" \
|
|
|
|
-S "Version: TLS1.0" \
|
|
|
|
-C "Protocol is TLSv1.0"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-06-25 14:40:09 +02:00
|
|
|
run_test "Not supported version check: srv max TLS 1.1" \
|
|
|
|
"$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \
|
|
|
|
"$P_CLI" \
|
|
|
|
1 \
|
|
|
|
-s "Error in protocol version" \
|
|
|
|
-c "Handshake protocol not within min/max boundaries" \
|
|
|
|
-S "Version: TLS1.1" \
|
|
|
|
-C "Protocol is TLSv1.1"
|
|
|
|
|
2014-04-07 12:42:04 +02:00
|
|
|
# Tests for ALPN extension
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "ALPN: none" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
"$P_CLI debug_level=3" \
|
2014-04-07 12:42:04 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "ALPN: client only" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
"$P_CLI debug_level=3 alpn=abc,1234" \
|
2014-04-07 12:42:04 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "ALPN: server only" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 alpn=abc,1234" \
|
|
|
|
"$P_CLI debug_level=3" \
|
2014-04-07 12:42:04 +02: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)"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "ALPN: both, common cli1-srv1" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 alpn=abc,1234" \
|
|
|
|
"$P_CLI debug_level=3 alpn=abc,1234" \
|
2014-04-07 12:42:04 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "ALPN: both, common cli2-srv1" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 alpn=abc,1234" \
|
|
|
|
"$P_CLI debug_level=3 alpn=1234,abc" \
|
2014-04-07 12:42:04 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "ALPN: both, common cli1-srv2" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 alpn=abc,1234" \
|
|
|
|
"$P_CLI debug_level=3 alpn=1234,abcde" \
|
2014-04-07 12:42:04 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "ALPN: both, no common" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=3 alpn=abc,123" \
|
|
|
|
"$P_CLI debug_level=3 alpn=1234,abcde" \
|
2014-04-07 12:42:04 +02: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 13:24:21 +02:00
|
|
|
|
2014-04-09 09:50:57 +02:00
|
|
|
# Tests for keyUsage in leaf certificates, part 1:
|
|
|
|
# server-side certificate/suite selection
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \
|
2014-04-09 09:50:57 +02:00
|
|
|
"$P_SRV key_file=data_files/server2.key \
|
|
|
|
crt_file=data_files/server2.ku-ds.crt" \
|
|
|
|
"$P_CLI" \
|
|
|
|
0 \
|
2014-05-22 14:42:39 +02:00
|
|
|
-c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-"
|
2014-04-09 09:50:57 +02:00
|
|
|
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \
|
2014-04-09 09:50:57 +02: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-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage srv: RSA, keyAgreement -> fail" \
|
2014-08-30 14:20:14 +02:00
|
|
|
"$P_SRV key_file=data_files/server2.key \
|
2014-04-09 09:50:57 +02:00
|
|
|
crt_file=data_files/server2.ku-ka.crt" \
|
2014-08-30 14:20:14 +02:00
|
|
|
"$P_CLI" \
|
2014-04-09 09:50:57 +02:00
|
|
|
1 \
|
|
|
|
-C "Ciphersuite is "
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \
|
2014-04-09 09:50:57 +02: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-"
|
|
|
|
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \
|
2014-04-09 09:50:57 +02: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-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \
|
2014-08-30 14:20:14 +02:00
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
2014-04-09 09:50:57 +02:00
|
|
|
crt_file=data_files/server5.ku-ke.crt" \
|
2014-08-30 14:20:14 +02:00
|
|
|
"$P_CLI" \
|
2014-04-09 09:50:57 +02:00
|
|
|
1 \
|
|
|
|
-C "Ciphersuite is "
|
|
|
|
|
|
|
|
# Tests for keyUsage in leaf certificates, part 2:
|
2014-04-09 14:53:05 +02:00
|
|
|
# client-side checking of server cert
|
2014-04-09 09:50:57 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server2.key \
|
2014-04-09 09:50:57 +02:00
|
|
|
-cert data_files/server2.ku-ds_ke.crt" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 09:50:57 +02:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
2014-04-09 14:53:05 +02:00
|
|
|
-C "bad certificate (usage extensions)" \
|
2014-04-09 09:50:57 +02:00
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server2.key \
|
2014-04-09 09:50:57 +02:00
|
|
|
-cert data_files/server2.ku-ds_ke.crt" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 09:50:57 +02:00
|
|
|
force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
2014-04-09 14:53:05 +02:00
|
|
|
-C "bad certificate (usage extensions)" \
|
2014-04-09 09:50:57 +02:00
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli: KeyEncipherment, RSA: OK" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server2.key \
|
2014-04-09 09:50:57 +02:00
|
|
|
-cert data_files/server2.ku-ke.crt" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 09:50:57 +02:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
2014-04-09 14:53:05 +02:00
|
|
|
-C "bad certificate (usage extensions)" \
|
2014-04-09 09:50:57 +02:00
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server2.key \
|
2014-04-09 09:50:57 +02:00
|
|
|
-cert data_files/server2.ku-ke.crt" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 09:50:57 +02:00
|
|
|
force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
1 \
|
2014-04-09 14:53:05 +02:00
|
|
|
-c "bad certificate (usage extensions)" \
|
2014-04-09 09:50:57 +02:00
|
|
|
-c "Processing of the Certificate handshake message failed" \
|
|
|
|
-C "Ciphersuite is TLS-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-04-20 12:01:48 +02:00
|
|
|
run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server2.key \
|
2015-04-20 12:01:48 +02:00
|
|
|
-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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server2.key \
|
2014-04-09 09:50:57 +02:00
|
|
|
-cert data_files/server2.ku-ds.crt" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 09:50:57 +02:00
|
|
|
force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
2014-04-09 14:53:05 +02:00
|
|
|
-C "bad certificate (usage extensions)" \
|
2014-04-09 09:50:57 +02:00
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli: DigitalSignature, RSA: fail" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server2.key \
|
2014-04-09 09:50:57 +02:00
|
|
|
-cert data_files/server2.ku-ds.crt" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1 \
|
2014-04-09 09:50:57 +02:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
1 \
|
2014-04-09 14:53:05 +02:00
|
|
|
-c "bad certificate (usage extensions)" \
|
2014-04-09 09:50:57 +02:00
|
|
|
-c "Processing of the Certificate handshake message failed" \
|
|
|
|
-C "Ciphersuite is TLS-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-04-20 12:01:48 +02:00
|
|
|
run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server2.key \
|
2015-04-20 12:01:48 +02:00
|
|
|
-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 14:53:05 +02:00
|
|
|
# Tests for keyUsage in leaf certificates, part 3:
|
|
|
|
# server-side checking of client cert
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-09 14:53:05 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-09 14:53:05 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=1 auth_mode=required" \
|
2014-04-09 14:53:05 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-09 14:53:05 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-09 14:53:05 +02: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 11:06:22 +02:00
|
|
|
# Tests for extendedKeyUsage, part 1: server-side certificate/suite selection
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage srv: serverAuth -> OK" \
|
2014-04-11 11:06:22 +02:00
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
|
|
|
crt_file=data_files/server5.eku-srv.crt" \
|
|
|
|
"$P_CLI" \
|
|
|
|
0
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \
|
2014-04-11 11:06:22 +02:00
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
|
|
|
crt_file=data_files/server5.eku-srv.crt" \
|
|
|
|
"$P_CLI" \
|
|
|
|
0
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \
|
2014-04-11 11:06:22 +02:00
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
|
|
|
crt_file=data_files/server5.eku-cs_any.crt" \
|
|
|
|
"$P_CLI" \
|
|
|
|
0
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage srv: codeSign -> fail" \
|
2015-07-07 11:54:14 +02:00
|
|
|
"$P_SRV key_file=data_files/server5.key \
|
2014-04-11 11:06:22 +02:00
|
|
|
crt_file=data_files/server5.eku-cli.crt" \
|
2015-07-07 11:54:14 +02:00
|
|
|
"$P_CLI" \
|
2014-04-11 11:06:22 +02:00
|
|
|
1
|
|
|
|
|
|
|
|
# Tests for extendedKeyUsage, part 2: client-side checking of server cert
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage cli: serverAuth -> OK" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server5.key \
|
2014-04-11 11:06:22 +02:00
|
|
|
-cert data_files/server5.eku-srv.crt" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1" \
|
2014-04-11 11:06:22 +02:00
|
|
|
0 \
|
|
|
|
-C "bad certificate (usage extensions)" \
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server5.key \
|
2014-04-11 11:06:22 +02:00
|
|
|
-cert data_files/server5.eku-srv_cli.crt" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1" \
|
2014-04-11 11:06:22 +02:00
|
|
|
0 \
|
|
|
|
-C "bad certificate (usage extensions)" \
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server5.key \
|
2014-04-11 11:06:22 +02:00
|
|
|
-cert data_files/server5.eku-cs_any.crt" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1" \
|
2014-04-11 11:06:22 +02:00
|
|
|
0 \
|
|
|
|
-C "bad certificate (usage extensions)" \
|
|
|
|
-C "Processing of the Certificate handshake message failed" \
|
|
|
|
-c "Ciphersuite is TLS-"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage cli: codeSign -> fail" \
|
2022-03-31 18:19:56 +02:00
|
|
|
"$O_SRV -tls1_2 -key data_files/server5.key \
|
2014-04-11 11:06:22 +02:00
|
|
|
-cert data_files/server5.eku-cs.crt" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_CLI debug_level=1" \
|
2014-04-11 11:06:22 +02: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
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage cli-auth: clientAuth -> OK" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-11 11:06:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-11 11:06:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-11 11:06:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=1 auth_mode=optional" \
|
2014-04-11 11:06:22 +02: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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \
|
2014-08-30 21:59:31 +02:00
|
|
|
"$P_SRV debug_level=1 auth_mode=required" \
|
2014-04-11 11:06:22 +02: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 11:36:47 +02:00
|
|
|
# Tests for DHM parameters loading
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "DHM parameters: reference" \
|
2014-06-09 11:36:47 +02: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 18:17:30 +02:00
|
|
|
-c "value of 'DHM: G ' (2 bits)"
|
2014-06-09 11:36:47 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "DHM parameters: other parameters" \
|
2014-06-09 11:36:47 +02: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 11:19:10 +02:00
|
|
|
# Tests for DHM client-side size checking
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-12 11:19:10 +02:00
|
|
|
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:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-12 11:19:10 +02:00
|
|
|
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:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-12 11:19:10 +02:00
|
|
|
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:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-12-08 22:31:52 +01:00
|
|
|
run_test "DHM size: server 999, client 999, OK" \
|
|
|
|
"$P_SRV dhm_file=data_files/dh.999.pem" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
debug_level=1 dhmlen=999" \
|
|
|
|
0 \
|
|
|
|
-C "DHM prime too short:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-12-08 22:31:52 +01:00
|
|
|
run_test "DHM size: server 1000, client 1000, OK" \
|
|
|
|
"$P_SRV dhm_file=data_files/dh.1000.pem" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
debug_level=1 dhmlen=1000" \
|
|
|
|
0 \
|
|
|
|
-C "DHM prime too short:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-12 11:19:10 +02:00
|
|
|
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:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-12-08 22:31:52 +01:00
|
|
|
run_test "DHM size: server 1000, client 1001, 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 dhmlen=1001" \
|
|
|
|
1 \
|
|
|
|
-c "DHM prime too short:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-12-08 22:31:52 +01:00
|
|
|
run_test "DHM size: server 999, client 1000, rejected" \
|
|
|
|
"$P_SRV dhm_file=data_files/dh.999.pem" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
debug_level=1 dhmlen=1000" \
|
|
|
|
1 \
|
|
|
|
-c "DHM prime too short:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-12-08 22:31:52 +01:00
|
|
|
run_test "DHM size: server 998, client 999, rejected" \
|
|
|
|
"$P_SRV dhm_file=data_files/dh.998.pem" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
|
|
|
|
debug_level=1 dhmlen=999" \
|
|
|
|
1 \
|
|
|
|
-c "DHM prime too short:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-06-12 11:19:10 +02:00
|
|
|
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 15:00:46 +02:00
|
|
|
# Tests for PSK callback
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "PSK callback: psk, no callback" \
|
2014-06-10 15:00:46 +02: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 \
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2014-06-10 15:28:52 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2018-10-23 16:27:39 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-23 16:27:39 +02:00
|
|
|
run_test "PSK callback: opaque psk on client, no callback" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-11-15 14:06:09 +01:00
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
2018-10-23 16:27:39 +02:00
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque PSK"\
|
|
|
|
-S "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-23 16:27:39 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-23 16:27:39 +02:00
|
|
|
run_test "PSK callback: opaque psk on client, no callback, SHA-384" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
|
2018-11-15 14:06:09 +01:00
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
2018-10-23 16:27:39 +02:00
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque PSK"\
|
|
|
|
-S "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-23 16:27:39 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-23 16:27:39 +02:00
|
|
|
run_test "PSK callback: opaque psk on client, no callback, EMS" \
|
|
|
|
"$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-11-15 14:06:09 +01:00
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
2018-10-23 16:27:39 +02:00
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque PSK"\
|
|
|
|
-S "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-23 16:27:39 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-23 16:27:39 +02:00
|
|
|
run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \
|
|
|
|
"$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
|
2018-11-15 14:06:09 +01:00
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
2018-10-23 16:27:39 +02:00
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque PSK"\
|
|
|
|
-S "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2014-06-10 15:28:52 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2022-04-05 23:00:04 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque rsa-psk on client, no callback" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-S "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-S "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \
|
|
|
|
"$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-S "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \
|
|
|
|
"$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-S "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2014-06-10 15:28:52 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2022-04-14 10:22:18 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque ecdhe-psk on client, no callback" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-S "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-S "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \
|
|
|
|
"$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-S "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \
|
|
|
|
"$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-S "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2022-04-19 12:47:48 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque dhe-psk on client, no callback" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-S "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-S "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \
|
|
|
|
"$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-S "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \
|
|
|
|
"$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \
|
|
|
|
"$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123 psk_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-S "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
2022-04-14 10:22:18 +02:00
|
|
|
|
2018-10-26 14:15:08 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, static opaque on server, no callback" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque PSK"\
|
|
|
|
-s "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque PSK"\
|
|
|
|
-s "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \
|
2018-10-26 14:15:08 +02:00
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=foo psk=abc123 extended_ms=1" \
|
|
|
|
0 \
|
2019-05-20 12:09:50 +02:00
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
2018-10-26 14:15:08 +02:00
|
|
|
-C "skip PMS generation for opaque PSK"\
|
|
|
|
-s "skip PMS generation for opaque PSK"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \
|
2018-10-26 14:15:08 +02:00
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=foo psk=abc123 extended_ms=1" \
|
|
|
|
0 \
|
2019-05-20 12:09:50 +02:00
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
2018-10-26 14:15:08 +02:00
|
|
|
-C "skip PMS generation for opaque PSK"\
|
|
|
|
-s "skip PMS generation for opaque PSK"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2022-04-06 13:12:48 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-s "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-s "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \
|
|
|
|
"$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=foo psk=abc123 extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-s "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \
|
|
|
|
"$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123 extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-s "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2022-04-14 10:22:18 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \
|
|
|
|
"$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=foo psk=abc123 extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \
|
|
|
|
"$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123 extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2022-04-19 12:47:48 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \
|
|
|
|
"$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=foo psk=abc123 extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \
|
|
|
|
"$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=foo psk=abc123 extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2018-10-26 14:15:08 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque PSK"\
|
|
|
|
-s "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque PSK"\
|
|
|
|
-s "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \
|
2018-10-26 14:15:08 +02:00
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=abc psk=dead extended_ms=1" \
|
|
|
|
0 \
|
2019-05-20 12:09:50 +02:00
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
2018-10-26 14:15:08 +02:00
|
|
|
-C "skip PMS generation for opaque PSK"\
|
|
|
|
-s "skip PMS generation for opaque PSK"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \
|
2018-10-26 14:15:08 +02:00
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=abc psk=dead extended_ms=1" \
|
|
|
|
0 \
|
2019-05-20 12:09:50 +02:00
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
2018-10-26 14:15:08 +02:00
|
|
|
-C "skip PMS generation for opaque PSK"\
|
|
|
|
-s "skip PMS generation for opaque PSK"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2022-04-06 13:12:48 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-s "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-s "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \
|
|
|
|
"$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=abc psk=dead extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-s "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \
|
|
|
|
"$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=abc psk=dead extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-s "skip PMS generation for opaque RSA-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2022-04-14 10:22:18 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \
|
|
|
|
"$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=abc psk=dead extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \
|
|
|
|
"$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=abc psk=dead extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque ECDHE-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2022-04-19 12:47:48 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \
|
|
|
|
"$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \
|
|
|
|
"$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=abc psk=dead extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \
|
|
|
|
"$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \
|
|
|
|
force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
|
|
|
|
"$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
|
|
|
|
psk_identity=abc psk=dead extended_ms=1" \
|
|
|
|
0 \
|
|
|
|
-c "session hash for extended master secret"\
|
|
|
|
-s "session hash for extended master secret"\
|
|
|
|
-C "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-s "skip PMS generation for opaque DHE-PSK"\
|
|
|
|
-S "SSL - The handshake negotiation failed" \
|
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2018-10-26 14:15:08 +02:00
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV extended_ms=0 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque PSK"\
|
|
|
|
-s "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque PSK"\
|
|
|
|
-s "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
0 \
|
|
|
|
-C "skip PMS generation for opaque PSK"\
|
2019-05-20 12:09:50 +02:00
|
|
|
-C "session hash for extended master secret"\
|
|
|
|
-S "session hash for extended master secret"\
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2018-10-26 14:15:08 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-26 14:15:08 +02:00
|
|
|
run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
|
|
|
|
"$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
2018-10-26 14:15:08 +02:00
|
|
|
psk_identity=def psk=beef" \
|
|
|
|
1 \
|
|
|
|
-s "SSL - Verification of the message MAC failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "PSK callback: no psk, no callback" \
|
2014-06-10 15:28:52 +02:00
|
|
|
"$P_SRV" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
|
|
|
|
psk_identity=foo psk=abc123" \
|
|
|
|
1 \
|
2021-06-29 15:20:31 +02:00
|
|
|
-s "SSL - The handshake negotiation failed" \
|
2014-06-10 15:00:46 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "PSK callback: callback overrides other settings" \
|
2014-06-10 15:00:46 +02: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 \
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2014-06-10 15:00:46 +02:00
|
|
|
-s "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "PSK callback: first id matches" \
|
2014-06-10 15:00:46 +02: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 \
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2014-06-10 15:00:46 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "PSK callback: second id matches" \
|
2014-06-10 15:00:46 +02: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 \
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2014-06-10 15:00:46 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "PSK callback: no match" \
|
2014-06-10 15:00:46 +02: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 \
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2014-06-10 15:00:46 +02:00
|
|
|
-s "SSL - Unknown identity received" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-30 21:42:40 +02:00
|
|
|
run_test "PSK callback: wrong key" \
|
2014-06-10 15:00:46 +02: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 \
|
2021-06-29 20:05:34 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2014-06-10 15:00:46 +02:00
|
|
|
-S "SSL - Unknown identity received" \
|
|
|
|
-s "SSL - Verification of the message MAC failed"
|
2014-06-09 11:36:47 +02:00
|
|
|
|
2015-09-16 14:11:09 +02:00
|
|
|
# Tests for EC J-PAKE
|
|
|
|
|
2020-08-14 16:42:49 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-09-16 14:11:09 +02:00
|
|
|
run_test "ECJPAKE: client not configured" \
|
|
|
|
"$P_SRV debug_level=3" \
|
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
0 \
|
2020-08-14 16:41:23 +02:00
|
|
|
-C "add ciphersuite: 0xc0ff" \
|
2015-09-16 14:11:09 +02:00
|
|
|
-C "adding ecjpake_kkpp extension" \
|
2015-09-16 15:04:01 +02:00
|
|
|
-S "found ecjpake kkpp extension" \
|
|
|
|
-S "skip ecjpake kkpp extension" \
|
2015-09-16 14:11:09 +02:00
|
|
|
-S "ciphersuite mismatch: ecjpake not configured" \
|
2015-09-16 15:35:27 +02:00
|
|
|
-S "server hello, ecjpake kkpp extension" \
|
2015-09-16 16:01:00 +02:00
|
|
|
-C "found ecjpake_kkpp extension" \
|
2021-06-29 20:07:57 +02:00
|
|
|
-S "SSL - The handshake negotiation failed"
|
2015-09-16 14:11:09 +02:00
|
|
|
|
2020-08-14 16:42:49 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-09-16 14:11:09 +02: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 \
|
2022-03-08 13:34:49 +01:00
|
|
|
-c "add ciphersuite: c0ff" \
|
2015-09-16 14:11:09 +02:00
|
|
|
-c "adding ecjpake_kkpp extension" \
|
2015-09-16 15:04:01 +02:00
|
|
|
-s "found ecjpake kkpp extension" \
|
|
|
|
-s "skip ecjpake kkpp extension" \
|
2015-09-16 14:11:09 +02:00
|
|
|
-s "ciphersuite mismatch: ecjpake not configured" \
|
2015-09-16 15:35:27 +02:00
|
|
|
-S "server hello, ecjpake kkpp extension" \
|
2015-09-16 16:01:00 +02:00
|
|
|
-C "found ecjpake_kkpp extension" \
|
2021-06-29 20:07:57 +02:00
|
|
|
-s "SSL - The handshake negotiation failed"
|
2015-09-16 14:11:09 +02:00
|
|
|
|
2020-08-14 16:42:49 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-09-16 15:04:01 +02: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 22:41:06 +02:00
|
|
|
0 \
|
2022-03-08 13:34:49 +01:00
|
|
|
-c "add ciphersuite: c0ff" \
|
2015-09-16 15:04:01 +02:00
|
|
|
-c "adding ecjpake_kkpp extension" \
|
2015-09-17 14:16:30 +02:00
|
|
|
-C "re-using cached ecjpake parameters" \
|
2015-09-16 15:04:01 +02:00
|
|
|
-s "found ecjpake kkpp extension" \
|
|
|
|
-S "skip ecjpake kkpp extension" \
|
|
|
|
-S "ciphersuite mismatch: ecjpake not configured" \
|
2015-09-16 15:35:27 +02:00
|
|
|
-s "server hello, ecjpake kkpp extension" \
|
2015-09-16 16:01:00 +02:00
|
|
|
-c "found ecjpake_kkpp extension" \
|
2021-06-29 20:07:57 +02:00
|
|
|
-S "SSL - The handshake negotiation failed" \
|
2015-09-16 22:52:18 +02:00
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2016-09-02 14:45:28 +02:00
|
|
|
server_needs_more_time 1
|
2021-06-29 20:05:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-09-16 22:52:18 +02: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 14:16:30 +02:00
|
|
|
-C "re-using cached ecjpake parameters" \
|
2015-09-16 22:52:18 +02:00
|
|
|
-s "SSL - Verification of the message MAC failed"
|
|
|
|
|
2021-06-29 20:05:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-09-16 22:52:18 +02: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 14:16:30 +02:00
|
|
|
-c "re-using cached ecjpake parameters" \
|
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2021-06-29 20:05:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-09-17 14:16:30 +02: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 22:52:18 +02:00
|
|
|
-S "SSL - Verification of the message MAC failed"
|
|
|
|
|
2016-09-02 14:45:28 +02:00
|
|
|
server_needs_more_time 1
|
2021-06-29 20:05:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-09-16 22:52:18 +02: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 14:16:30 +02:00
|
|
|
-c "re-using cached ecjpake parameters" \
|
2015-09-16 22:52:18 +02:00
|
|
|
-s "SSL - Verification of the message MAC failed"
|
2015-09-16 15:04:01 +02:00
|
|
|
|
2015-10-20 14:47:00 +02:00
|
|
|
# for tests with configs/config-thread.h
|
2021-06-29 20:05:34 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-10-20 14:47:00 +02: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
|
|
|
|
|
2015-07-23 12:24:03 +02:00
|
|
|
# Test for ClientHello without extensions
|
|
|
|
|
2015-08-04 16:22:30 +02:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-01-30 12:45:14 +01:00
|
|
|
run_test "ClientHello without extensions" \
|
2020-01-30 10:58:57 +01:00
|
|
|
"$P_SRV debug_level=3" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \
|
2017-05-12 13:16:40 +02:00
|
|
|
0 \
|
|
|
|
-s "dumping 'client hello extensions' (0 bytes)"
|
|
|
|
|
2015-04-08 12:49:31 +02:00
|
|
|
# Tests for mbedtls_ssl_get_bytes_avail()
|
2014-06-11 18:32:36 +02:00
|
|
|
|
2022-04-06 23:35:56 +02:00
|
|
|
# The server first reads buffer_size-1 bytes, then reads the remainder.
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-04-08 12:49:31 +02:00
|
|
|
run_test "mbedtls_ssl_get_bytes_avail: no extra data" \
|
2022-04-06 23:35:56 +02:00
|
|
|
"$P_SRV buffer_size=100" \
|
2014-06-11 18:32:36 +02:00
|
|
|
"$P_CLI request_size=100" \
|
|
|
|
0 \
|
|
|
|
-s "Read from client: 100 bytes read$"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-04-06 23:35:56 +02:00
|
|
|
run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \
|
|
|
|
"$P_SRV buffer_size=100" \
|
|
|
|
"$P_CLI request_size=101" \
|
2014-06-11 18:32:36 +02:00
|
|
|
0 \
|
2022-04-06 23:35:56 +02:00
|
|
|
-s "Read from client: 101 bytes read (100 + 1)"
|
2014-06-11 14:06:01 +02:00
|
|
|
|
2022-04-06 23:35:56 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
|
|
|
requires_max_content_len 200
|
|
|
|
run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \
|
|
|
|
"$P_SRV buffer_size=100" \
|
|
|
|
"$P_CLI request_size=200" \
|
|
|
|
0 \
|
|
|
|
-s "Read from client: 200 bytes read (100 + 100)"
|
2014-06-18 15:08:56 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-04-06 23:35:56 +02:00
|
|
|
run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \
|
|
|
|
"$P_SRV buffer_size=100" \
|
|
|
|
"$P_CLI request_size=$MAX_CONTENT_LEN" \
|
2014-06-11 18:32:36 +02:00
|
|
|
0 \
|
2022-04-06 23:35:56 +02:00
|
|
|
-s "Read from client: $MAX_CONTENT_LEN bytes read (100 + $((MAX_CONTENT_LEN - 100)))"
|
2014-06-11 14:06:01 +02:00
|
|
|
|
2018-06-19 15:37:30 +02:00
|
|
|
# Tests for small client packets
|
2014-06-18 15:08:56 +02:00
|
|
|
|
2018-06-19 15:37:30 +02:00
|
|
|
run_test "Small client packet TLS 1.2 BlockCipher" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
|
|
|
"$P_CLI request_size=1 \
|
2014-06-18 15:08:56 +02:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
0 \
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
2018-06-19 15:37:30 +02:00
|
|
|
run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
|
|
|
"$P_CLI request_size=1 \
|
2017-11-21 18:10:12 +01:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \
|
2014-11-04 16:15:39 +01:00
|
|
|
0 \
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
2018-06-19 15:37:30 +02:00
|
|
|
run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
|
|
|
"$P_CLI request_size=1 \
|
2015-01-07 16:35:25 +01:00
|
|
|
force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
|
2014-06-18 15:08:56 +02:00
|
|
|
0 \
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
2018-06-19 15:37:30 +02:00
|
|
|
run_test "Small client packet TLS 1.2 AEAD" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
|
|
|
"$P_CLI request_size=1 \
|
2014-06-18 15:08:56 +02:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
|
|
|
|
0 \
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
2018-06-19 15:37:30 +02:00
|
|
|
run_test "Small client packet TLS 1.2 AEAD shorter tag" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
|
|
|
"$P_CLI request_size=1 \
|
2014-06-18 15:08:56 +02:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-s "Read from client: 1 bytes read"
|
|
|
|
|
2018-06-19 15:37:30 +02:00
|
|
|
# Tests for small client packets in DTLS
|
2017-11-10 09:59:18 +01:00
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
2018-06-19 15:37:30 +02:00
|
|
|
run_test "Small client packet DTLS 1.2" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV dtls=1 force_version=dtls12" \
|
2017-11-10 09:59:18 +01: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
|
2018-06-19 15:37:30 +02:00
|
|
|
run_test "Small client packet DTLS 1.2, without EtM" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV dtls=1 force_version=dtls12 etm=0" \
|
2017-11-10 09:59:18 +01: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"
|
|
|
|
|
2018-06-19 15:37:30 +02:00
|
|
|
# Tests for small server packets
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 BlockCipher" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=1 force_version=tls12" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
2018-06-19 15:37:30 +02:00
|
|
|
0 \
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=1 force_version=tls12" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \
|
2018-06-19 15:37:30 +02:00
|
|
|
0 \
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=1 force_version=tls12" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
|
2018-06-19 15:37:30 +02:00
|
|
|
0 \
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 AEAD" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=1 force_version=tls12" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
|
2018-06-19 15:37:30 +02:00
|
|
|
0 \
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
|
|
|
run_test "Small server packet TLS 1.2 AEAD shorter tag" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=1 force_version=tls12" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
|
2018-06-19 15:37:30 +02:00
|
|
|
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.2" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV dtls=1 response_size=1 force_version=dtls12" \
|
2018-06-19 15:37:30 +02:00
|
|
|
"$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" \
|
2021-12-02 09:43:35 +01:00
|
|
|
"$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \
|
2018-06-19 15:37:30 +02:00
|
|
|
"$P_CLI dtls=1 \
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
0 \
|
|
|
|
-c "Read from server: 1 bytes read"
|
|
|
|
|
2017-10-12 13:50:29 +02:00
|
|
|
# Test for large client packets
|
2014-06-18 22:05:08 +02:00
|
|
|
|
2018-04-11 08:28:39 +02:00
|
|
|
# How many fragments do we expect to write $1 bytes?
|
|
|
|
fragments_for_write() {
|
|
|
|
echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))"
|
|
|
|
}
|
|
|
|
|
2017-10-12 13:50:29 +02:00
|
|
|
run_test "Large client packet TLS 1.2 BlockCipher" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
|
|
|
"$P_CLI request_size=16384 \
|
2014-06-18 22:05:08 +02:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
0 \
|
2018-04-11 08:28:39 +02:00
|
|
|
-c "16384 bytes written in $(fragments_for_write 16384) fragments" \
|
|
|
|
-s "Read from client: $MAX_CONTENT_LEN bytes read"
|
2014-06-18 22:05:08 +02:00
|
|
|
|
2017-10-12 13:50:29 +02:00
|
|
|
run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
|
|
|
"$P_CLI request_size=16384 etm=0 \
|
2017-11-10 10:16:28 +01:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
|
|
|
0 \
|
2018-04-11 08:28:39 +02:00
|
|
|
-s "Read from client: $MAX_CONTENT_LEN bytes read"
|
2017-11-10 10:16:28 +01:00
|
|
|
|
2017-10-12 13:50:29 +02:00
|
|
|
run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
|
|
|
"$P_CLI request_size=16384 \
|
2015-01-07 16:35:25 +01:00
|
|
|
force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
|
2014-06-18 22:05:08 +02:00
|
|
|
0 \
|
2018-04-11 08:28:39 +02:00
|
|
|
-c "16384 bytes written in $(fragments_for_write 16384) fragments" \
|
|
|
|
-s "Read from client: $MAX_CONTENT_LEN bytes read"
|
2014-06-18 22:05:08 +02:00
|
|
|
|
2017-10-12 13:50:29 +02:00
|
|
|
run_test "Large client packet TLS 1.2 AEAD" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
|
|
|
"$P_CLI request_size=16384 \
|
2014-06-18 22:05:08 +02:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
|
|
|
|
0 \
|
2018-04-11 08:28:39 +02:00
|
|
|
-c "16384 bytes written in $(fragments_for_write 16384) fragments" \
|
|
|
|
-s "Read from client: $MAX_CONTENT_LEN bytes read"
|
2014-06-18 22:05:08 +02:00
|
|
|
|
2017-10-12 13:50:29 +02:00
|
|
|
run_test "Large client packet TLS 1.2 AEAD shorter tag" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV force_version=tls12" \
|
|
|
|
"$P_CLI request_size=16384 \
|
2014-06-18 22:05:08 +02:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
|
|
|
|
0 \
|
2018-04-11 08:28:39 +02:00
|
|
|
-c "16384 bytes written in $(fragments_for_write 16384) fragments" \
|
|
|
|
-s "Read from client: $MAX_CONTENT_LEN bytes read"
|
2014-06-18 22:05:08 +02:00
|
|
|
|
2021-07-08 16:56:33 +02:00
|
|
|
# The tests below fail when the server's OUT_CONTENT_LEN is less than 16384.
|
2017-10-12 13:50:29 +02:00
|
|
|
run_test "Large server packet TLS 1.2 BlockCipher" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=16384 force_version=tls12" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
2017-10-12 13:50:29 +02:00
|
|
|
0 \
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
2018-06-19 15:37:30 +02:00
|
|
|
run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=16384 force_version=tls12" \
|
|
|
|
"$P_CLI etm=0 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
|
2018-06-19 15:37:30 +02:00
|
|
|
0 \
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
2017-10-12 13:50:29 +02:00
|
|
|
run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=16384 force_version=tls12" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
|
2017-10-12 13:50:29 +02:00
|
|
|
0 \
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
2018-06-19 15:37:30 +02:00
|
|
|
run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
|
2018-06-19 15:37:30 +02:00
|
|
|
0 \
|
|
|
|
-s "16384 bytes written in 1 fragments" \
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
2017-10-12 13:50:29 +02:00
|
|
|
run_test "Large server packet TLS 1.2 AEAD" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=16384 force_version=tls12" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
|
2017-10-12 13:50:29 +02:00
|
|
|
0 \
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
|
|
|
run_test "Large server packet TLS 1.2 AEAD shorter tag" \
|
2022-03-17 16:45:09 +01:00
|
|
|
"$P_SRV response_size=16384 force_version=tls12" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
|
2017-10-12 13:50:29 +02:00
|
|
|
0 \
|
|
|
|
-c "Read from server: 16384 bytes read"
|
|
|
|
|
2017-05-16 09:26:48 +02:00
|
|
|
# Tests for restartable ECC
|
|
|
|
|
2021-06-03 11:12:40 +02:00
|
|
|
# Force the use of a curve that supports restartable ECC (secp256r1).
|
|
|
|
|
2017-05-16 09:26:48 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_RESTARTABLE
|
2021-06-03 11:12:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-16 09:26:48 +02:00
|
|
|
run_test "EC restart: TLS, default" \
|
2021-06-03 11:12:40 +02:00
|
|
|
"$P_SRV curves=secp256r1 auth_mode=required" \
|
2017-05-16 09:26:48 +02:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
2017-05-17 11:56:15 +02:00
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
2017-05-16 09:26:48 +02:00
|
|
|
debug_level=1" \
|
|
|
|
0 \
|
2018-06-13 11:22:01 +02:00
|
|
|
-C "x509_verify_cert.*4b00" \
|
|
|
|
-C "mbedtls_pk_verify.*4b00" \
|
|
|
|
-C "mbedtls_ecdh_make_public.*4b00" \
|
|
|
|
-C "mbedtls_pk_sign.*4b00"
|
2017-05-16 09:26:48 +02:00
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_ECP_RESTARTABLE
|
2021-06-03 11:12:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-16 09:26:48 +02:00
|
|
|
run_test "EC restart: TLS, max_ops=0" \
|
2021-06-03 11:12:40 +02:00
|
|
|
"$P_SRV curves=secp256r1 auth_mode=required" \
|
2017-05-16 09:26:48 +02:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
2017-05-17 11:56:15 +02:00
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
2017-05-16 09:26:48 +02:00
|
|
|
debug_level=1 ec_max_ops=0" \
|
|
|
|
0 \
|
2018-06-13 11:22:01 +02:00
|
|
|
-C "x509_verify_cert.*4b00" \
|
|
|
|
-C "mbedtls_pk_verify.*4b00" \
|
|
|
|
-C "mbedtls_ecdh_make_public.*4b00" \
|
|
|
|
-C "mbedtls_pk_sign.*4b00"
|
2017-05-16 09:26:48 +02:00
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_ECP_RESTARTABLE
|
2021-06-03 11:12:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-16 09:26:48 +02:00
|
|
|
run_test "EC restart: TLS, max_ops=65535" \
|
2021-06-03 11:12:40 +02:00
|
|
|
"$P_SRV curves=secp256r1 auth_mode=required" \
|
2017-05-16 09:26:48 +02:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
2017-05-17 11:56:15 +02:00
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
2017-05-16 09:26:48 +02:00
|
|
|
debug_level=1 ec_max_ops=65535" \
|
|
|
|
0 \
|
2018-06-13 11:22:01 +02:00
|
|
|
-C "x509_verify_cert.*4b00" \
|
|
|
|
-C "mbedtls_pk_verify.*4b00" \
|
|
|
|
-C "mbedtls_ecdh_make_public.*4b00" \
|
|
|
|
-C "mbedtls_pk_sign.*4b00"
|
2017-05-16 09:26:48 +02:00
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_ECP_RESTARTABLE
|
2021-06-03 11:12:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-16 09:26:48 +02:00
|
|
|
run_test "EC restart: TLS, max_ops=1000" \
|
2021-06-03 11:12:40 +02:00
|
|
|
"$P_SRV curves=secp256r1 auth_mode=required" \
|
2017-05-16 09:26:48 +02:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
2017-05-17 11:56:15 +02:00
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
2017-05-16 09:26:48 +02:00
|
|
|
debug_level=1 ec_max_ops=1000" \
|
|
|
|
0 \
|
2018-06-13 11:22:01 +02:00
|
|
|
-c "x509_verify_cert.*4b00" \
|
|
|
|
-c "mbedtls_pk_verify.*4b00" \
|
|
|
|
-c "mbedtls_ecdh_make_public.*4b00" \
|
|
|
|
-c "mbedtls_pk_sign.*4b00"
|
2017-05-16 09:26:48 +02:00
|
|
|
|
2017-08-15 13:47:06 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_RESTARTABLE
|
2021-06-03 11:12:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-08-15 13:47:06 +02:00
|
|
|
run_test "EC restart: TLS, max_ops=1000, badsign" \
|
2021-06-03 11:12:40 +02:00
|
|
|
"$P_SRV curves=secp256r1 auth_mode=required \
|
2017-08-15 13:47:06 +02:00
|
|
|
crt_file=data_files/server5-badsign.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
|
|
|
debug_level=1 ec_max_ops=1000" \
|
|
|
|
1 \
|
2018-06-13 11:22:01 +02:00
|
|
|
-c "x509_verify_cert.*4b00" \
|
|
|
|
-C "mbedtls_pk_verify.*4b00" \
|
|
|
|
-C "mbedtls_ecdh_make_public.*4b00" \
|
|
|
|
-C "mbedtls_pk_sign.*4b00" \
|
2017-08-15 13:47:06 +02:00
|
|
|
-c "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
-c "! mbedtls_ssl_handshake returned" \
|
|
|
|
-c "X509 - Certificate verification failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_ECP_RESTARTABLE
|
2021-06-03 11:12:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-08-15 13:47:06 +02:00
|
|
|
run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \
|
2021-06-03 11:12:40 +02:00
|
|
|
"$P_SRV curves=secp256r1 auth_mode=required \
|
2017-08-15 13:47:06 +02:00
|
|
|
crt_file=data_files/server5-badsign.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
|
|
|
debug_level=1 ec_max_ops=1000 auth_mode=optional" \
|
|
|
|
0 \
|
2018-06-13 11:22:01 +02:00
|
|
|
-c "x509_verify_cert.*4b00" \
|
|
|
|
-c "mbedtls_pk_verify.*4b00" \
|
|
|
|
-c "mbedtls_ecdh_make_public.*4b00" \
|
|
|
|
-c "mbedtls_pk_sign.*4b00" \
|
2017-08-15 13:47:06 +02:00
|
|
|
-c "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
|
|
|
-C "X509 - Certificate verification failed"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_ECP_RESTARTABLE
|
2021-06-03 11:12:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-08-15 13:47:06 +02:00
|
|
|
run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \
|
2021-06-03 11:12:40 +02:00
|
|
|
"$P_SRV curves=secp256r1 auth_mode=required \
|
2017-08-15 13:47:06 +02:00
|
|
|
crt_file=data_files/server5-badsign.crt \
|
|
|
|
key_file=data_files/server5.key" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
|
|
|
debug_level=1 ec_max_ops=1000 auth_mode=none" \
|
|
|
|
0 \
|
2018-06-13 11:22:01 +02:00
|
|
|
-C "x509_verify_cert.*4b00" \
|
|
|
|
-c "mbedtls_pk_verify.*4b00" \
|
|
|
|
-c "mbedtls_ecdh_make_public.*4b00" \
|
|
|
|
-c "mbedtls_pk_sign.*4b00" \
|
2017-08-15 13:47:06 +02:00
|
|
|
-C "! The certificate is not correctly signed by the trusted CA" \
|
|
|
|
-C "! mbedtls_ssl_handshake returned" \
|
|
|
|
-C "X509 - Certificate verification failed"
|
|
|
|
|
2017-05-16 09:26:48 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_RESTARTABLE
|
2021-06-03 11:12:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-16 09:26:48 +02:00
|
|
|
run_test "EC restart: DTLS, max_ops=1000" \
|
2021-06-03 11:12:40 +02:00
|
|
|
"$P_SRV curves=secp256r1 auth_mode=required dtls=1" \
|
2017-05-16 09:26:48 +02:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
2017-05-17 11:56:15 +02:00
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
2017-05-16 09:26:48 +02:00
|
|
|
dtls=1 debug_level=1 ec_max_ops=1000" \
|
|
|
|
0 \
|
2018-06-13 11:22:01 +02:00
|
|
|
-c "x509_verify_cert.*4b00" \
|
|
|
|
-c "mbedtls_pk_verify.*4b00" \
|
|
|
|
-c "mbedtls_ecdh_make_public.*4b00" \
|
|
|
|
-c "mbedtls_pk_sign.*4b00"
|
2017-05-16 09:26:48 +02:00
|
|
|
|
2017-05-18 12:49:27 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_RESTARTABLE
|
2021-06-03 11:12:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-18 12:49:27 +02:00
|
|
|
run_test "EC restart: TLS, max_ops=1000 no client auth" \
|
2021-06-03 11:12:40 +02:00
|
|
|
"$P_SRV curves=secp256r1" \
|
2017-05-18 12:49:27 +02:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
|
|
|
debug_level=1 ec_max_ops=1000" \
|
|
|
|
0 \
|
2018-06-13 11:22:01 +02:00
|
|
|
-c "x509_verify_cert.*4b00" \
|
|
|
|
-c "mbedtls_pk_verify.*4b00" \
|
|
|
|
-c "mbedtls_ecdh_make_public.*4b00" \
|
|
|
|
-C "mbedtls_pk_sign.*4b00"
|
2017-05-18 12:49:27 +02:00
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_ECP_RESTARTABLE
|
2021-06-03 11:12:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-05-18 12:49:27 +02:00
|
|
|
run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \
|
2021-06-03 11:12:40 +02:00
|
|
|
"$P_SRV curves=secp256r1 psk=abc123" \
|
2017-05-18 12:49:27 +02:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \
|
|
|
|
psk=abc123 debug_level=1 ec_max_ops=1000" \
|
|
|
|
0 \
|
2018-06-13 11:22:01 +02:00
|
|
|
-C "x509_verify_cert.*4b00" \
|
|
|
|
-C "mbedtls_pk_verify.*4b00" \
|
|
|
|
-C "mbedtls_ecdh_make_public.*4b00" \
|
|
|
|
-C "mbedtls_pk_sign.*4b00"
|
2017-05-18 12:49:27 +02:00
|
|
|
|
2018-01-05 21:22:12 +01:00
|
|
|
# Tests of asynchronous private key support in SSL
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-12 13:47:48 +01:00
|
|
|
run_test "SSL async private: sign, delay=0" \
|
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=0 async_private_delay2=0" \
|
2018-01-05 21:22:12 +01:00
|
|
|
"$P_CLI" \
|
|
|
|
0 \
|
|
|
|
-s "Async sign callback: using key slot " \
|
2018-01-12 13:47:48 +01:00
|
|
|
-s "Async resume (slot [0-9]): sign done, status=0"
|
2018-01-05 21:22:12 +01:00
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-12 13:47:48 +01:00
|
|
|
run_test "SSL async private: sign, delay=1" \
|
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_delay2=1" \
|
2018-01-05 21:22:12 +01:00
|
|
|
"$P_CLI" \
|
|
|
|
0 \
|
|
|
|
-s "Async sign callback: using key slot " \
|
|
|
|
-s "Async resume (slot [0-9]): call 0 more times." \
|
2018-01-12 13:47:48 +01:00
|
|
|
-s "Async resume (slot [0-9]): sign done, status=0"
|
|
|
|
|
2018-04-26 15:06:56 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-04-26 15:06:56 +02:00
|
|
|
run_test "SSL async private: sign, delay=2" \
|
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=2 async_private_delay2=2" \
|
|
|
|
"$P_CLI" \
|
|
|
|
0 \
|
|
|
|
-s "Async sign callback: using key slot " \
|
|
|
|
-U "Async sign callback: using key slot " \
|
|
|
|
-s "Async resume (slot [0-9]): call 1 more times." \
|
|
|
|
-s "Async resume (slot [0-9]): call 0 more times." \
|
|
|
|
-s "Async resume (slot [0-9]): sign done, status=0"
|
|
|
|
|
2018-04-30 10:30:49 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2020-10-09 12:10:42 +02:00
|
|
|
requires_config_disabled MBEDTLS_X509_REMOVE_INFO
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-04-30 10:30:49 +02:00
|
|
|
run_test "SSL async private: sign, SNI" \
|
|
|
|
"$P_SRV debug_level=3 \
|
|
|
|
async_operations=s async_private_delay1=0 async_private_delay2=0 \
|
|
|
|
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" \
|
|
|
|
0 \
|
|
|
|
-s "Async sign callback: using key slot " \
|
|
|
|
-s "Async resume (slot [0-9]): sign done, status=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"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-12 13:47:48 +01:00
|
|
|
run_test "SSL async private: decrypt, delay=0" \
|
|
|
|
"$P_SRV \
|
|
|
|
async_operations=d async_private_delay1=0 async_private_delay2=0" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
|
|
|
-s "Async decrypt callback: using key slot " \
|
|
|
|
-s "Async resume (slot [0-9]): decrypt done, status=0"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-12 13:47:48 +01:00
|
|
|
run_test "SSL async private: decrypt, delay=1" \
|
|
|
|
"$P_SRV \
|
|
|
|
async_operations=d async_private_delay1=1 async_private_delay2=1" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
|
|
|
-s "Async decrypt callback: using key slot " \
|
|
|
|
-s "Async resume (slot [0-9]): call 0 more times." \
|
|
|
|
-s "Async resume (slot [0-9]): decrypt done, status=0"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-12 13:47:48 +01:00
|
|
|
run_test "SSL async private: decrypt RSA-PSK, delay=0" \
|
|
|
|
"$P_SRV psk=abc123 \
|
|
|
|
async_operations=d async_private_delay1=0 async_private_delay2=0" \
|
|
|
|
"$P_CLI psk=abc123 \
|
|
|
|
force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-s "Async decrypt callback: using key slot " \
|
|
|
|
-s "Async resume (slot [0-9]): decrypt done, status=0"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-12 13:47:48 +01:00
|
|
|
run_test "SSL async private: decrypt RSA-PSK, delay=1" \
|
|
|
|
"$P_SRV psk=abc123 \
|
|
|
|
async_operations=d async_private_delay1=1 async_private_delay2=1" \
|
|
|
|
"$P_CLI psk=abc123 \
|
|
|
|
force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-s "Async decrypt callback: using key slot " \
|
|
|
|
-s "Async resume (slot [0-9]): call 0 more times." \
|
|
|
|
-s "Async resume (slot [0-9]): decrypt done, status=0"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-12 13:47:48 +01:00
|
|
|
run_test "SSL async private: sign callback not present" \
|
|
|
|
"$P_SRV \
|
|
|
|
async_operations=d async_private_delay1=1 async_private_delay2=1" \
|
|
|
|
"$P_CLI; [ \$? -eq 1 ] &&
|
|
|
|
$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
|
|
|
-S "Async sign callback" \
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
-s "The own private key or pre-shared key is not set, but needed" \
|
|
|
|
-s "Async resume (slot [0-9]): decrypt done, status=0" \
|
|
|
|
-s "Successful connection"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-12 13:47:48 +01:00
|
|
|
run_test "SSL async private: decrypt callback not present" \
|
|
|
|
"$P_SRV debug_level=1 \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_delay2=1" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA;
|
|
|
|
[ \$? -eq 1 ] && $P_CLI" \
|
|
|
|
0 \
|
|
|
|
-S "Async decrypt callback" \
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
-s "got no RSA private key" \
|
|
|
|
-s "Async resume (slot [0-9]): sign done, status=0" \
|
|
|
|
-s "Successful connection"
|
2018-01-05 21:22:12 +01:00
|
|
|
|
|
|
|
# key1: ECDSA, key2: RSA; use key1 from slot 0
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-05 21:22:12 +01:00
|
|
|
run_test "SSL async private: slot 0 used with key1" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 \
|
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
|
|
|
key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \
|
2018-01-05 21:22:12 +01:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-s "Async sign callback: using key slot 0," \
|
|
|
|
-s "Async resume (slot 0): call 0 more times." \
|
2018-01-12 13:47:48 +01:00
|
|
|
-s "Async resume (slot 0): sign done, status=0"
|
2018-01-05 21:22:12 +01:00
|
|
|
|
|
|
|
# key1: ECDSA, key2: RSA; use key2 from slot 0
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-05 21:22:12 +01:00
|
|
|
run_test "SSL async private: slot 0 used with key2" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay2=1 \
|
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
|
|
|
key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \
|
2018-01-05 21:22:12 +01:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-s "Async sign callback: using key slot 0," \
|
|
|
|
-s "Async resume (slot 0): call 0 more times." \
|
2018-01-12 13:47:48 +01:00
|
|
|
-s "Async resume (slot 0): sign done, status=0"
|
2018-01-05 21:22:12 +01:00
|
|
|
|
|
|
|
# key1: ECDSA, key2: RSA; use key2 from slot 1
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-04-26 00:19:16 +02:00
|
|
|
run_test "SSL async private: slot 1 used with key2" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
2018-04-25 23:35:42 +02:00
|
|
|
async_operations=s async_private_delay1=1 async_private_delay2=1 \
|
2018-01-12 13:47:48 +01:00
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
|
|
|
key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \
|
2018-01-05 21:22:12 +01:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-s "Async sign callback: using key slot 1," \
|
|
|
|
-s "Async resume (slot 1): call 0 more times." \
|
2018-01-12 13:47:48 +01:00
|
|
|
-s "Async resume (slot 1): sign done, status=0"
|
2018-01-05 21:22:12 +01:00
|
|
|
|
|
|
|
# key1: ECDSA, key2: RSA; use key2 directly
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-05 21:22:12 +01:00
|
|
|
run_test "SSL async private: fall back to transparent key" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 \
|
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
|
|
|
key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \
|
2018-01-05 21:22:12 +01:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-s "Async sign callback: no key matches this certificate."
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-12 15:06:40 +02:00
|
|
|
run_test "SSL async private: sign, error in start" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_delay2=1 \
|
|
|
|
async_private_error=1" \
|
2018-01-05 21:22:12 +01:00
|
|
|
"$P_CLI" \
|
|
|
|
1 \
|
|
|
|
-s "Async sign callback: injected error" \
|
|
|
|
-S "Async resume" \
|
2018-04-27 11:50:14 +02:00
|
|
|
-S "Async cancel" \
|
2018-01-05 21:22:12 +01:00
|
|
|
-s "! mbedtls_ssl_handshake returned"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-12 15:06:40 +02:00
|
|
|
run_test "SSL async private: sign, cancel after start" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_delay2=1 \
|
|
|
|
async_private_error=2" \
|
2018-01-05 21:22:12 +01:00
|
|
|
"$P_CLI" \
|
|
|
|
1 \
|
|
|
|
-s "Async sign callback: using key slot " \
|
|
|
|
-S "Async resume" \
|
|
|
|
-s "Async cancel"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-12 15:06:40 +02:00
|
|
|
run_test "SSL async private: sign, error in resume" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_delay2=1 \
|
|
|
|
async_private_error=3" \
|
2018-01-05 21:22:12 +01:00
|
|
|
"$P_CLI" \
|
|
|
|
1 \
|
|
|
|
-s "Async sign callback: using key slot " \
|
2018-01-12 13:47:48 +01:00
|
|
|
-s "Async resume callback: sign done but injected error" \
|
2018-04-27 11:50:14 +02:00
|
|
|
-S "Async cancel" \
|
2018-01-05 21:22:12 +01:00
|
|
|
-s "! mbedtls_ssl_handshake returned"
|
|
|
|
|
2018-06-12 15:06:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-12 15:06:40 +02:00
|
|
|
run_test "SSL async private: decrypt, error in start" \
|
|
|
|
"$P_SRV \
|
|
|
|
async_operations=d async_private_delay1=1 async_private_delay2=1 \
|
|
|
|
async_private_error=1" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
1 \
|
|
|
|
-s "Async decrypt callback: injected error" \
|
|
|
|
-S "Async resume" \
|
|
|
|
-S "Async cancel" \
|
|
|
|
-s "! mbedtls_ssl_handshake returned"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-12 15:06:40 +02:00
|
|
|
run_test "SSL async private: decrypt, cancel after start" \
|
|
|
|
"$P_SRV \
|
|
|
|
async_operations=d async_private_delay1=1 async_private_delay2=1 \
|
|
|
|
async_private_error=2" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
1 \
|
|
|
|
-s "Async decrypt callback: using key slot " \
|
|
|
|
-S "Async resume" \
|
|
|
|
-s "Async cancel"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-12 15:06:40 +02:00
|
|
|
run_test "SSL async private: decrypt, error in resume" \
|
|
|
|
"$P_SRV \
|
|
|
|
async_operations=d async_private_delay1=1 async_private_delay2=1 \
|
|
|
|
async_private_error=3" \
|
|
|
|
"$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
1 \
|
|
|
|
-s "Async decrypt callback: using key slot " \
|
|
|
|
-s "Async resume callback: decrypt done but injected error" \
|
|
|
|
-S "Async cancel" \
|
|
|
|
-s "! mbedtls_ssl_handshake returned"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-08 11:28:05 +01:00
|
|
|
run_test "SSL async private: cancel after start then operate correctly" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_delay2=1 \
|
|
|
|
async_private_error=-2" \
|
2018-01-08 11:28:05 +01:00
|
|
|
"$P_CLI; [ \$? -eq 1 ] && $P_CLI" \
|
|
|
|
0 \
|
|
|
|
-s "Async cancel" \
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
-s "Async resume" \
|
|
|
|
-s "Successful connection"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-08 11:28:05 +01:00
|
|
|
run_test "SSL async private: error in resume then operate correctly" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_delay2=1 \
|
|
|
|
async_private_error=-3" \
|
2018-01-08 11:28:05 +01:00
|
|
|
"$P_CLI; [ \$? -eq 1 ] && $P_CLI" \
|
|
|
|
0 \
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
-s "Async resume" \
|
|
|
|
-s "Successful connection"
|
|
|
|
|
|
|
|
# key1: ECDSA, key2: RSA; use key1 through async, then key2 directly
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-01-08 11:28:05 +01:00
|
|
|
run_test "SSL async private: cancel after start then fall back to transparent key" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_error=-2 \
|
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
|
|
|
key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \
|
2018-01-08 11:28:05 +01:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256;
|
|
|
|
[ \$? -eq 1 ] &&
|
|
|
|
$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
2018-04-30 10:02:45 +02:00
|
|
|
-s "Async sign callback: using key slot 0" \
|
2018-01-08 11:28:05 +01:00
|
|
|
-S "Async resume" \
|
|
|
|
-s "Async cancel" \
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
-s "Async sign callback: no key matches this certificate." \
|
|
|
|
-s "Successful connection"
|
|
|
|
|
|
|
|
# key1: ECDSA, key2: RSA; use key1 through async, then key2 directly
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-12 15:06:40 +02:00
|
|
|
run_test "SSL async private: sign, error in resume then fall back to transparent key" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_error=-3 \
|
|
|
|
key_file=data_files/server5.key crt_file=data_files/server5.crt \
|
|
|
|
key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \
|
2018-01-08 11:28:05 +01:00
|
|
|
"$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256;
|
|
|
|
[ \$? -eq 1 ] &&
|
|
|
|
$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \
|
|
|
|
0 \
|
|
|
|
-s "Async resume" \
|
|
|
|
-s "! mbedtls_ssl_handshake returned" \
|
|
|
|
-s "Async sign callback: no key matches this certificate." \
|
|
|
|
-s "Successful connection"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2018-01-05 21:22:12 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-09-16 15:19:20 +02:00
|
|
|
run_test "SSL async private: renegotiation: client-initiated, sign" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_delay2=1 \
|
2018-01-05 21:22:12 +01:00
|
|
|
exchanges=2 renegotiation=1" \
|
|
|
|
"$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \
|
|
|
|
0 \
|
|
|
|
-s "Async sign callback: using key slot " \
|
2018-01-12 13:47:48 +01:00
|
|
|
-s "Async resume (slot [0-9]): sign done, status=0"
|
2018-01-05 21:22:12 +01:00
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2018-01-05 21:22:12 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-09-16 15:19:20 +02:00
|
|
|
run_test "SSL async private: renegotiation: server-initiated, sign" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=s async_private_delay1=1 async_private_delay2=1 \
|
2018-01-05 21:22:12 +01:00
|
|
|
exchanges=2 renegotiation=1 renegotiate=1" \
|
|
|
|
"$P_CLI exchanges=2 renegotiation=1" \
|
|
|
|
0 \
|
|
|
|
-s "Async sign callback: using key slot " \
|
2018-01-12 13:47:48 +01:00
|
|
|
-s "Async resume (slot [0-9]): sign done, status=0"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2018-01-12 13:47:48 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-09-16 15:19:20 +02:00
|
|
|
run_test "SSL async private: renegotiation: client-initiated, decrypt" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=d async_private_delay1=1 async_private_delay2=1 \
|
|
|
|
exchanges=2 renegotiation=1" \
|
|
|
|
"$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
|
|
|
-s "Async decrypt callback: using key slot " \
|
|
|
|
-s "Async resume (slot [0-9]): decrypt done, status=0"
|
|
|
|
|
2018-04-24 13:09:22 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE
|
2018-01-12 13:47:48 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-09-16 15:19:20 +02:00
|
|
|
run_test "SSL async private: renegotiation: server-initiated, decrypt" \
|
2018-01-12 13:47:48 +01:00
|
|
|
"$P_SRV \
|
|
|
|
async_operations=d async_private_delay1=1 async_private_delay2=1 \
|
|
|
|
exchanges=2 renegotiation=1 renegotiate=1" \
|
|
|
|
"$P_CLI exchanges=2 renegotiation=1 \
|
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
|
|
|
0 \
|
|
|
|
-s "Async decrypt callback: using key slot " \
|
|
|
|
-s "Async resume (slot [0-9]): decrypt done, status=0"
|
2018-01-05 21:22:12 +01:00
|
|
|
|
2018-06-28 12:22:05 +02:00
|
|
|
# Tests for ECC extensions (rfc 4492)
|
|
|
|
|
2018-06-28 15:17:00 +02: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
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-28 12:22:05 +02:00
|
|
|
run_test "Force a non ECC ciphersuite in the client side" \
|
|
|
|
"$P_SRV debug_level=3" \
|
2018-06-28 15:17:00 +02:00
|
|
|
"$P_CLI debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \
|
2018-06-28 12:22:05 +02:00
|
|
|
0 \
|
2021-12-21 10:09:00 +01:00
|
|
|
-C "client hello, adding supported_groups extension" \
|
2018-06-28 12:22:05 +02:00
|
|
|
-C "client hello, adding supported_point_formats extension" \
|
|
|
|
-S "found supported elliptic curves extension" \
|
|
|
|
-S "found supported point formats extension"
|
|
|
|
|
2018-06-28 15:17:00 +02: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
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-28 12:22:05 +02:00
|
|
|
run_test "Force a non ECC ciphersuite in the server side" \
|
2018-06-28 15:17:00 +02:00
|
|
|
"$P_SRV debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \
|
2018-06-28 12:22:05 +02:00
|
|
|
"$P_CLI debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-C "found supported_point_formats extension" \
|
|
|
|
-S "server hello, supported_point_formats extension"
|
|
|
|
|
2018-06-28 15:17:00 +02: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
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-28 12:22:05 +02: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 \
|
2021-12-21 10:09:00 +01:00
|
|
|
-c "client hello, adding supported_groups extension" \
|
2018-06-28 12:22:05 +02:00
|
|
|
-c "client hello, adding supported_point_formats extension" \
|
|
|
|
-s "found supported elliptic curves extension" \
|
|
|
|
-s "found supported point formats extension"
|
|
|
|
|
2018-06-28 15:17:00 +02: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
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-06-28 12:22:05 +02: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"
|
|
|
|
|
2014-07-23 20:17:47 +02:00
|
|
|
# Tests for DTLS HelloVerifyRequest
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-07-23 20:17:47 +02:00
|
|
|
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 19:04:37 +02:00
|
|
|
-s "hello verification requested" \
|
2014-07-23 20:17:47 +02:00
|
|
|
-S "SSL - The requested feature is not available"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-07-23 20:17:47 +02:00
|
|
|
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 19:04:37 +02:00
|
|
|
-S "hello verification requested" \
|
2014-07-23 20:17:47 +02:00
|
|
|
-S "SSL - The requested feature is not available"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-13 19:04:37 +02: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 20:17:47 +02:00
|
|
|
|
|
|
|
requires_ipv6
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-07-23 20:17:47 +02:00
|
|
|
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 19:04:37 +02:00
|
|
|
-s "hello verification requested" \
|
2014-07-23 20:17:47 +02:00
|
|
|
-S "SSL - The requested feature is not available"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-29 17:47:33 +02: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 19:04:37 +02:00
|
|
|
-s "hello verification requested" \
|
2014-09-29 17:47:33 +02:00
|
|
|
-S "SSL - The requested feature is not available"
|
|
|
|
|
2015-09-08 12:40:43 +02:00
|
|
|
# Tests for client reconnecting from the same port with DTLS
|
|
|
|
|
2015-09-09 11:37:17 +02:00
|
|
|
not_with_valgrind # spurious resend
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-09-08 12:40:43 +02:00
|
|
|
run_test "DTLS client reconnect from same port: reference" \
|
Adjust timeout of tests with "no resend" assertions
There are currently 4 tests in ssl-opt.sh with either -C "resend" or -S
"resend", that is, asserting that no retransmission will occur. They sometimes
fail on loaded CI machines as one side doesn't send a message fast enough,
causing the other side to retransmit, causing the test to fail.
(For the "reconnect" test there was an other issue causing random failures,
fixed in a previous commit, but even after that fix the test would still
sometimes randomly fail, even if much more rarely.)
While it's a hard problem to fix in a general and perfect way, in practice the
probability of failures can be drastically reduced by making the timeout
values much larger.
For some tests, where retransmissions are actually expected, this would have
the negative effect of increasing the average running time of the test, as
each side would wait for longer before it starts retransmission, so we have a
trade-off between average running time and probability of spurious failures.
But for tests where retransmission is not expected, there is no such trade-off
as the expected running time of the test (assuming the code is correct most of
the time) is not impacted by the timeout value. So the only negative effect of
increasing the timeout value is on the worst-case running time on the test,
which is much less important, as test should only fail quite rarely.
This commit addresses the easy case of tests that don't expect retransmission
by increasing the value of their timeout range to 10s-20s. This value
corresponds to the value used for tests that assert `-S "autoreduction"` which
are in the same case and where the current value seems acceptable so far.
It also represents an increase, compared to the values before this commit, of
a factor 20 for the "reconnect" tests which were frequently observed to fail
in the CI, and of a factor 10 for the first two "DTLS proxy" tests, which were
observed to fail much less frequently, so hopefully the new values are enough
to reduce the probability of spurious failures to an acceptable level.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2019-09-09 11:14:37 +02:00
|
|
|
"$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \
|
|
|
|
"$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000" \
|
2015-09-08 12:40:43 +02:00
|
|
|
0 \
|
|
|
|
-C "resend" \
|
2015-09-09 11:37:17 +02:00
|
|
|
-S "The operation timed out" \
|
2015-09-08 12:40:43 +02:00
|
|
|
-S "Client initiated reconnection from same port"
|
|
|
|
|
2015-09-09 11:37:17 +02:00
|
|
|
not_with_valgrind # spurious resend
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-09-08 12:40:43 +02:00
|
|
|
run_test "DTLS client reconnect from same port: reconnect" \
|
Adjust timeout of tests with "no resend" assertions
There are currently 4 tests in ssl-opt.sh with either -C "resend" or -S
"resend", that is, asserting that no retransmission will occur. They sometimes
fail on loaded CI machines as one side doesn't send a message fast enough,
causing the other side to retransmit, causing the test to fail.
(For the "reconnect" test there was an other issue causing random failures,
fixed in a previous commit, but even after that fix the test would still
sometimes randomly fail, even if much more rarely.)
While it's a hard problem to fix in a general and perfect way, in practice the
probability of failures can be drastically reduced by making the timeout
values much larger.
For some tests, where retransmissions are actually expected, this would have
the negative effect of increasing the average running time of the test, as
each side would wait for longer before it starts retransmission, so we have a
trade-off between average running time and probability of spurious failures.
But for tests where retransmission is not expected, there is no such trade-off
as the expected running time of the test (assuming the code is correct most of
the time) is not impacted by the timeout value. So the only negative effect of
increasing the timeout value is on the worst-case running time on the test,
which is much less important, as test should only fail quite rarely.
This commit addresses the easy case of tests that don't expect retransmission
by increasing the value of their timeout range to 10s-20s. This value
corresponds to the value used for tests that assert `-S "autoreduction"` which
are in the same case and where the current value seems acceptable so far.
It also represents an increase, compared to the values before this commit, of
a factor 20 for the "reconnect" tests which were frequently observed to fail
in the CI, and of a factor 10 for the first two "DTLS proxy" tests, which were
observed to fail much less frequently, so hopefully the new values are enough
to reduce the probability of spurious failures to an acceptable level.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2019-09-09 11:14:37 +02:00
|
|
|
"$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \
|
|
|
|
"$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000 reconnect_hard=1" \
|
2015-09-08 12:40:43 +02:00
|
|
|
0 \
|
|
|
|
-C "resend" \
|
2015-09-09 11:37:17 +02:00
|
|
|
-S "The operation timed out" \
|
2015-09-08 12:40:43 +02:00
|
|
|
-s "Client initiated reconnection from same port"
|
|
|
|
|
2016-05-13 11:33:25 +02:00
|
|
|
not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts)
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-05-13 11:33:25 +02:00
|
|
|
run_test "DTLS client reconnect from same port: reconnect, nbio, no valgrind" \
|
2015-09-09 11:37:17 +02: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 12:40:43 +02:00
|
|
|
0 \
|
2015-09-09 11:37:17 +02:00
|
|
|
-S "The operation timed out" \
|
2015-09-08 12:40:43 +02:00
|
|
|
-s "Client initiated reconnection from same port"
|
|
|
|
|
2016-05-13 11:33:25 +02:00
|
|
|
only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2016-05-13 11:33:25 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-09-09 11:37:17 +02: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 12:57:46 +02:00
|
|
|
"$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \
|
|
|
|
0 \
|
2015-09-09 11:37:17 +02:00
|
|
|
-s "The operation timed out" \
|
|
|
|
-S "Client initiated reconnection from same port"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2020-03-13 11:11:02 +01:00
|
|
|
run_test "DTLS client reconnect from same port: attacker-injected" \
|
|
|
|
-p "$P_PXY inject_clihlo=1" \
|
|
|
|
"$P_SRV dtls=1 exchanges=2 debug_level=1" \
|
|
|
|
"$P_CLI dtls=1 exchanges=2" \
|
|
|
|
0 \
|
|
|
|
-s "possible client reconnect from the same port" \
|
|
|
|
-S "Client initiated reconnection from same port"
|
|
|
|
|
2014-09-26 10:35:50 +02:00
|
|
|
# Tests for various cases of client authentication with DTLS
|
|
|
|
# (focused on handshake flows and message parsing)
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-26 10:35:50 +02:00
|
|
|
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"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-26 10:35:50 +02:00
|
|
|
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 11:56:18 +02:00
|
|
|
-s "! Certificate was missing"
|
2014-09-26 10:35:50 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-04-20 11:56:18 +02:00
|
|
|
run_test "DTLS client auth: none, client has no cert" \
|
2014-09-26 10:35:50 +02: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 11:56:18 +02:00
|
|
|
-s "! Certificate verification was skipped"
|
2014-09-26 10:35:50 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2015-08-04 12:08:35 +02: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 13:12:58 +02:00
|
|
|
# Tests for receiving fragmented handshake messages with DTLS
|
|
|
|
|
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-20 13:12:58 +02:00
|
|
|
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
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-20 13:12:58 +02:00
|
|
|
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
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-20 13:12:58 +02:00
|
|
|
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
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-08-20 13:12:58 +02:00
|
|
|
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 14:47:31 +02:00
|
|
|
requires_gnutls
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-02 14:47:31 +02: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 12:49:31 +02:00
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-09-02 14:47:31 +02:00
|
|
|
-C "error" \
|
|
|
|
-s "Extra-header:"
|
|
|
|
|
|
|
|
requires_gnutls
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-02 14:47:31 +02: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 12:49:31 +02:00
|
|
|
-C "mbedtls_ssl_handshake returned" \
|
2014-09-02 14:47:31 +02:00
|
|
|
-C "error" \
|
|
|
|
-s "Extra-header:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS reassembly: no fragmentation (openssl server)" \
|
|
|
|
"$O_SRV -dtls -mtu 2048" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
0 \
|
|
|
|
-C "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS reassembly: some fragmentation (openssl server)" \
|
|
|
|
"$O_SRV -dtls -mtu 768" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
0 \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS reassembly: more fragmentation (openssl server)" \
|
|
|
|
"$O_SRV -dtls -mtu 256" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2" \
|
|
|
|
0 \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \
|
|
|
|
"$O_SRV -dtls -mtu 256" \
|
|
|
|
"$P_CLI dtls=1 nbio=2 debug_level=2" \
|
|
|
|
0 \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2017-09-19 13:00:47 +02:00
|
|
|
# Tests for sending fragmented handshake messages with DTLS
|
|
|
|
#
|
|
|
|
# Use client auth when we need the client to send large messages,
|
|
|
|
# and use large cert chains on both sides too (the long chains we have all use
|
|
|
|
# both RSA and ECDSA, but ideally we should have long chains with either).
|
|
|
|
# Sizes reached (UDP payload):
|
|
|
|
# - 2037B for server certificate
|
|
|
|
# - 1542B for client certificate
|
|
|
|
# - 1013B for newsessionticket
|
|
|
|
# - all others below 512B
|
|
|
|
# All those tests assume MAX_CONTENT_LEN is at least 2048
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 4096
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-09-19 13:00:47 +02:00
|
|
|
run_test "DTLS fragmenting: none (for reference)" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-08-13 17:45:46 +02:00
|
|
|
max_frag_len=4096" \
|
2017-09-19 13:00:47 +02:00
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-08-13 17:45:46 +02:00
|
|
|
max_frag_len=4096" \
|
2017-09-19 13:00:47 +02:00
|
|
|
0 \
|
|
|
|
-S "found fragmented DTLS handshake message" \
|
|
|
|
-C "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-12 13:28:53 +02:00
|
|
|
run_test "DTLS fragmenting: server only (max_frag_len)" \
|
2017-09-19 13:00:47 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2017-09-19 13:00:47 +02:00
|
|
|
max_frag_len=1024" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2017-09-19 13:00:47 +02:00
|
|
|
max_frag_len=2048" \
|
|
|
|
0 \
|
|
|
|
-S "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-08-24 13:11:35 +02:00
|
|
|
# With the MFL extension, the server has no way of forcing
|
|
|
|
# the client to not exceed a certain MTU; hence, the following
|
|
|
|
# test can't be replicated with an MTU proxy such as the one
|
|
|
|
# `client-initiated, server only (max_frag_len)` below.
|
2017-09-19 13:00:47 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 4096
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-12 13:28:53 +02:00
|
|
|
run_test "DTLS fragmenting: server only (more) (max_frag_len)" \
|
2017-09-19 13:00:47 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2017-09-19 13:00:47 +02:00
|
|
|
max_frag_len=512" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-08-24 13:11:35 +02:00
|
|
|
max_frag_len=4096" \
|
2017-09-19 13:00:47 +02:00
|
|
|
0 \
|
|
|
|
-S "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-12 13:28:53 +02:00
|
|
|
run_test "DTLS fragmenting: client-initiated, server only (max_frag_len)" \
|
2017-09-19 13:00:47 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=none \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2017-09-19 13:00:47 +02:00
|
|
|
max_frag_len=2048" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
|
|
|
max_frag_len=1024" \
|
|
|
|
0 \
|
2017-09-19 13:00:47 +02:00
|
|
|
-S "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-08-24 12:48:01 +02:00
|
|
|
# While not required by the standard defining the MFL extension
|
|
|
|
# (according to which it only applies to records, not to datagrams),
|
|
|
|
# Mbed TLS will never send datagrams larger than MFL + { Max record expansion },
|
|
|
|
# as otherwise there wouldn't be any means to communicate MTU restrictions
|
|
|
|
# to the peer.
|
|
|
|
# The next test checks that no datagrams significantly larger than the
|
|
|
|
# negotiated MFL are sent.
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-24 12:48:01 +02:00
|
|
|
run_test "DTLS fragmenting: client-initiated, server only (max_frag_len), proxy MTU" \
|
2018-10-09 09:09:41 +02:00
|
|
|
-p "$P_PXY mtu=1110" \
|
2018-08-24 12:48:01 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=none \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-08-24 12:48:01 +02:00
|
|
|
max_frag_len=2048" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
|
|
|
max_frag_len=1024" \
|
2018-08-24 12:48:01 +02:00
|
|
|
0 \
|
|
|
|
-S "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2017-09-19 13:00:47 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-12 13:28:53 +02:00
|
|
|
run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \
|
2017-09-19 13:00:47 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2017-09-19 13:00:47 +02:00
|
|
|
max_frag_len=2048" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
|
|
|
max_frag_len=1024" \
|
2017-09-19 13:00:47 +02:00
|
|
|
0 \
|
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-08-24 12:48:01 +02:00
|
|
|
# While not required by the standard defining the MFL extension
|
|
|
|
# (according to which it only applies to records, not to datagrams),
|
|
|
|
# Mbed TLS will never send datagrams larger than MFL + { Max record expansion },
|
|
|
|
# as otherwise there wouldn't be any means to communicate MTU restrictions
|
|
|
|
# to the peer.
|
|
|
|
# The next test checks that no datagrams significantly larger than the
|
|
|
|
# negotiated MFL are sent.
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-24 12:48:01 +02:00
|
|
|
run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \
|
2018-10-09 09:09:41 +02:00
|
|
|
-p "$P_PXY mtu=1110" \
|
2018-08-24 12:48:01 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-08-24 12:48:01 +02:00
|
|
|
max_frag_len=2048" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
2017-09-19 13:00:47 +02:00
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
|
|
|
max_frag_len=1024" \
|
2017-09-19 13:00:47 +02:00
|
|
|
0 \
|
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-08-12 13:28:53 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 4096
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-12 13:28:53 +02:00
|
|
|
run_test "DTLS fragmenting: none (for reference) (MTU)" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-08-13 17:45:46 +02:00
|
|
|
mtu=4096" \
|
2018-08-12 13:28:53 +02:00
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-08-13 17:45:46 +02:00
|
|
|
mtu=4096" \
|
2018-08-12 13:28:53 +02:00
|
|
|
0 \
|
|
|
|
-S "found fragmented DTLS handshake message" \
|
|
|
|
-C "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 4096
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-12 13:28:53 +02:00
|
|
|
run_test "DTLS fragmenting: client (MTU)" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 21:42:44 +02:00
|
|
|
hs_timeout=3500-60000 \
|
2018-08-13 17:45:46 +02:00
|
|
|
mtu=4096" \
|
2018-08-12 13:28:53 +02:00
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 21:42:44 +02:00
|
|
|
hs_timeout=3500-60000 \
|
2018-10-05 13:53:40 +02:00
|
|
|
mtu=1024" \
|
2018-08-12 13:28:53 +02:00
|
|
|
0 \
|
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-C "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-12 13:28:53 +02:00
|
|
|
run_test "DTLS fragmenting: server (MTU)" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-08-12 13:28:53 +02:00
|
|
|
mtu=512" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-08-12 13:28:53 +02:00
|
|
|
mtu=2048" \
|
|
|
|
0 \
|
|
|
|
-S "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-11 12:49:41 +02:00
|
|
|
run_test "DTLS fragmenting: both (MTU=1024)" \
|
2018-10-05 13:53:40 +02:00
|
|
|
-p "$P_PXY mtu=1024" \
|
2018-08-12 13:28:53 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-10-11 14:55:37 +02:00
|
|
|
mtu=1024" \
|
2018-08-12 13:28:53 +02:00
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=2500-60000 \
|
|
|
|
mtu=1024" \
|
2018-08-12 13:28:53 +02:00
|
|
|
0 \
|
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-11 13:34:08 +02:00
|
|
|
# Forcing ciphersuite for this test to fit the MTU of 512 with full config.
|
2018-10-11 12:49:41 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-10-11 12:49:41 +02:00
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_GCM_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-11 12:49:41 +02:00
|
|
|
run_test "DTLS fragmenting: both (MTU=512)" \
|
2018-08-20 11:52:24 +02:00
|
|
|
-p "$P_PXY mtu=512" \
|
2018-08-12 13:28:53 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
hs_timeout=2500-60000 \
|
2018-08-12 13:28:53 +02:00
|
|
|
mtu=512" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
|
|
|
hs_timeout=2500-60000 \
|
2018-08-12 13:28:53 +02:00
|
|
|
mtu=512" \
|
|
|
|
0 \
|
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-11 12:49:41 +02:00
|
|
|
# Test for automatic MTU reduction on repeated resend.
|
2018-10-11 13:34:08 +02:00
|
|
|
# Forcing ciphersuite for this test to fit the MTU of 508 with full config.
|
2018-10-11 12:49:41 +02:00
|
|
|
# The ratio of max/min timeout should ideally equal 4 to accept two
|
|
|
|
# retransmissions, but in some cases (like both the server and client using
|
|
|
|
# fragmentation and auto-reduction) an extra retransmission might occur,
|
|
|
|
# hence the ratio of 8.
|
2018-08-29 18:01:40 +02:00
|
|
|
not_with_valgrind
|
2018-08-20 09:34:02 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-10-11 12:49:41 +02:00
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_GCM_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-09-20 18:03:11 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \
|
2018-08-20 09:34:02 +02:00
|
|
|
-p "$P_PXY mtu=508" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
2018-10-11 12:49:41 +02:00
|
|
|
key_file=data_files/server7.key \
|
|
|
|
hs_timeout=400-3200" \
|
2018-08-20 09:34:02 +02:00
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
|
|
|
hs_timeout=400-3200" \
|
2018-08-20 09:34:02 +02:00
|
|
|
0 \
|
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-11 13:34:08 +02:00
|
|
|
# Forcing ciphersuite for this test to fit the MTU of 508 with full config.
|
2018-08-29 18:04:18 +02:00
|
|
|
only_with_valgrind
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-10-11 12:49:41 +02:00
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_GCM_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-09-20 18:03:11 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \
|
2018-08-29 18:04:18 +02:00
|
|
|
-p "$P_PXY mtu=508" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
2018-10-11 12:49:41 +02:00
|
|
|
key_file=data_files/server7.key \
|
2018-08-29 18:04:18 +02:00
|
|
|
hs_timeout=250-10000" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
2018-08-29 18:04:18 +02:00
|
|
|
hs_timeout=250-10000" \
|
|
|
|
0 \
|
|
|
|
-s "found fragmented DTLS handshake message" \
|
2018-08-20 09:34:02 +02:00
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-08-13 12:37:51 +02:00
|
|
|
# the proxy shouldn't drop or mess up anything, so we shouldn't need to resend
|
2018-08-22 09:56:22 +02:00
|
|
|
# OTOH the client might resend if the server is to slow to reset after sending
|
|
|
|
# a HelloVerifyRequest, so only check for no retransmission server-side
|
2018-10-09 14:52:14 +02:00
|
|
|
not_with_valgrind # spurious autoreduction due to timeout
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-11 12:49:41 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \
|
2018-10-05 13:53:40 +02:00
|
|
|
-p "$P_PXY mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
|
|
|
mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
|
|
|
mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
0 \
|
2018-10-09 14:52:14 +02:00
|
|
|
-S "autoreduction" \
|
2018-08-13 12:37:51 +02:00
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-11 13:34:08 +02:00
|
|
|
# Forcing ciphersuite for this test to fit the MTU of 512 with full config.
|
2018-10-11 12:49:41 +02:00
|
|
|
# the proxy shouldn't drop or mess up anything, so we shouldn't need to resend
|
|
|
|
# OTOH the client might resend if the server is to slow to reset after sending
|
|
|
|
# a HelloVerifyRequest, so only check for no retransmission server-side
|
2018-10-09 14:52:14 +02:00
|
|
|
not_with_valgrind # spurious autoreduction due to timeout
|
2018-08-22 10:02:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-10-11 12:49:41 +02:00
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_GCM_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-11 12:49:41 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \
|
2018-08-13 12:37:51 +02:00
|
|
|
-p "$P_PXY mtu=512" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
hs_timeout=10000-60000 \
|
2018-08-13 12:37:51 +02:00
|
|
|
mtu=512" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
|
|
|
hs_timeout=10000-60000 \
|
2018-08-13 12:37:51 +02:00
|
|
|
mtu=512" \
|
|
|
|
0 \
|
2018-10-11 12:49:41 +02:00
|
|
|
-S "autoreduction" \
|
2018-08-13 12:37:51 +02:00
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-11 12:49:41 +02:00
|
|
|
not_with_valgrind # spurious autoreduction due to timeout
|
2018-08-22 10:02:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-11 12:49:41 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \
|
2018-10-05 13:53:40 +02:00
|
|
|
-p "$P_PXY mtu=1024" \
|
2018-08-22 10:02:59 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
hs_timeout=10000-60000 \
|
|
|
|
mtu=1024 nbio=2" \
|
2018-08-22 10:02:59 +02:00
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
hs_timeout=10000-60000 \
|
|
|
|
mtu=1024 nbio=2" \
|
|
|
|
0 \
|
|
|
|
-S "autoreduction" \
|
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-11 13:34:08 +02:00
|
|
|
# Forcing ciphersuite for this test to fit the MTU of 512 with full config.
|
2018-10-11 12:49:41 +02:00
|
|
|
not_with_valgrind # spurious autoreduction due to timeout
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-10-11 12:49:41 +02:00
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_GCM_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-10-11 12:49:41 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \
|
2018-08-22 10:02:59 +02:00
|
|
|
-p "$P_PXY mtu=512" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
hs_timeout=10000-60000 \
|
2018-08-22 10:02:59 +02:00
|
|
|
mtu=512 nbio=2" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
|
|
|
hs_timeout=10000-60000 \
|
2018-08-22 10:02:59 +02:00
|
|
|
mtu=512 nbio=2" \
|
|
|
|
0 \
|
2018-10-09 14:52:14 +02:00
|
|
|
-S "autoreduction" \
|
2018-08-22 10:02:59 +02:00
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-11 13:34:08 +02:00
|
|
|
# Forcing ciphersuite for this test to fit the MTU of 1450 with full config.
|
2018-08-28 11:25:51 +02:00
|
|
|
# This ensures things still work after session_reset().
|
|
|
|
# It also exercises the "resumed handshake" flow.
|
2018-08-16 10:50:39 +02:00
|
|
|
# Since we don't support reading fragmented ClientHello yet,
|
|
|
|
# up the MTU to 1450 (larger than ClientHello with session ticket,
|
|
|
|
# but still smaller than client's Certificate to ensure fragmentation).
|
2018-10-09 14:52:14 +02:00
|
|
|
# An autoreduction on the client-side might happen if the server is
|
|
|
|
# slow to reset, therefore omitting '-C "autoreduction"' below.
|
2018-08-21 12:17:54 +02:00
|
|
|
# reco_delay avoids races where the client reconnects before the server has
|
2018-10-09 14:52:14 +02:00
|
|
|
# resumed listening, which would result in a spurious autoreduction.
|
|
|
|
not_with_valgrind # spurious autoreduction due to timeout
|
2018-08-16 10:50:39 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-10-11 12:49:41 +02:00
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_GCM_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-16 10:50:39 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU, resumed handshake" \
|
|
|
|
-p "$P_PXY mtu=1450" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
2018-08-16 10:50:39 +02:00
|
|
|
mtu=1450" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
2018-10-11 12:49:41 +02:00
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
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 11:04:33 +01:00
|
|
|
mtu=1450 reconnect=1 skip_close_notify=1 reco_delay=1" \
|
2018-08-16 10:50:39 +02:00
|
|
|
0 \
|
2018-10-09 14:52:14 +02:00
|
|
|
-S "autoreduction" \
|
2018-08-16 10:50:39 +02:00
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-09 14:52:14 +02:00
|
|
|
# An autoreduction on the client-side might happen if the server is
|
|
|
|
# slow to reset, therefore omitting '-C "autoreduction"' below.
|
|
|
|
not_with_valgrind # spurious autoreduction due to timeout
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
requires_config_enabled MBEDTLS_CHACHAPOLY_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-13 12:37:51 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \
|
|
|
|
-p "$P_PXY mtu=512" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
|
|
|
exchanges=2 renegotiation=1 \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
2018-08-13 12:37:51 +02:00
|
|
|
mtu=512" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
|
|
|
exchanges=2 renegotiation=1 renegotiate=1 \
|
2018-10-11 12:49:41 +02:00
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
2018-08-13 12:37:51 +02:00
|
|
|
mtu=512" \
|
|
|
|
0 \
|
2018-10-09 14:52:14 +02:00
|
|
|
-S "autoreduction" \
|
2018-08-13 12:37:51 +02:00
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-09 14:52:14 +02:00
|
|
|
# An autoreduction on the client-side might happen if the server is
|
|
|
|
# slow to reset, therefore omitting '-C "autoreduction"' below.
|
|
|
|
not_with_valgrind # spurious autoreduction due to timeout
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_GCM_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-13 12:37:51 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \
|
|
|
|
-p "$P_PXY mtu=512" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
|
|
|
exchanges=2 renegotiation=1 \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
2018-08-13 12:37:51 +02:00
|
|
|
mtu=512" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
|
|
|
exchanges=2 renegotiation=1 renegotiate=1 \
|
2018-10-11 12:49:41 +02:00
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
2018-08-13 12:37:51 +02:00
|
|
|
mtu=512" \
|
|
|
|
0 \
|
2018-10-09 14:52:14 +02:00
|
|
|
-S "autoreduction" \
|
2018-08-13 12:37:51 +02:00
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-09 14:52:14 +02:00
|
|
|
# An autoreduction on the client-side might happen if the server is
|
|
|
|
# slow to reset, therefore omitting '-C "autoreduction"' below.
|
|
|
|
not_with_valgrind # spurious autoreduction due to timeout
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_CCM_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-13 12:37:51 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \
|
2018-10-05 13:53:40 +02:00
|
|
|
-p "$P_PXY mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
|
|
|
exchanges=2 renegotiation=1 \
|
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
|
|
|
mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
|
|
|
exchanges=2 renegotiation=1 renegotiate=1 \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
|
|
|
mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
0 \
|
2018-10-09 14:52:14 +02:00
|
|
|
-S "autoreduction" \
|
2018-08-13 12:37:51 +02:00
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-09 14:52:14 +02:00
|
|
|
# An autoreduction on the client-side might happen if the server is
|
|
|
|
# slow to reset, therefore omitting '-C "autoreduction"' below.
|
|
|
|
not_with_valgrind # spurious autoreduction due to timeout
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_CIPHER_MODE_CBC
|
|
|
|
requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-13 12:37:51 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \
|
2018-10-05 13:53:40 +02:00
|
|
|
-p "$P_PXY mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
|
|
|
exchanges=2 renegotiation=1 \
|
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
|
|
|
mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
|
|
|
exchanges=2 renegotiation=1 renegotiate=1 \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
|
|
|
mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
0 \
|
2018-10-09 14:52:14 +02:00
|
|
|
-S "autoreduction" \
|
2018-08-13 12:37:51 +02:00
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-09 14:52:14 +02:00
|
|
|
# An autoreduction on the client-side might happen if the server is
|
|
|
|
# slow to reset, therefore omitting '-C "autoreduction"' below.
|
|
|
|
not_with_valgrind # spurious autoreduction due to timeout
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SHA256_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-08-13 12:37:51 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_CIPHER_MODE_CBC
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-13 12:37:51 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \
|
2018-10-05 13:53:40 +02:00
|
|
|
-p "$P_PXY mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
|
|
|
exchanges=2 renegotiation=1 \
|
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
|
|
|
mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
|
|
|
exchanges=2 renegotiation=1 renegotiate=1 \
|
2018-10-05 13:53:40 +02:00
|
|
|
hs_timeout=10000-60000 \
|
|
|
|
mtu=1024" \
|
2018-08-13 12:37:51 +02:00
|
|
|
0 \
|
2018-10-09 14:52:14 +02:00
|
|
|
-S "autoreduction" \
|
2018-08-13 12:37:51 +02:00
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-10-11 13:34:08 +02:00
|
|
|
# Forcing ciphersuite for this test to fit the MTU of 512 with full config.
|
2018-08-16 11:09:03 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-10-11 12:49:41 +02:00
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_GCM_C
|
2018-08-16 11:09:03 +02:00
|
|
|
client_needs_more_time 2
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-16 11:09:03 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU + 3d" \
|
|
|
|
-p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \
|
2018-08-14 14:46:33 +02:00
|
|
|
"$P_SRV dgram_packing=0 dtls=1 debug_level=2 auth_mode=required \
|
2018-08-16 11:09:03 +02:00
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2018-08-20 10:49:28 +02:00
|
|
|
hs_timeout=250-10000 mtu=512" \
|
2018-08-14 14:46:33 +02:00
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 \
|
2018-08-16 11:09:03 +02:00
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
2018-08-20 10:49:28 +02:00
|
|
|
hs_timeout=250-10000 mtu=512" \
|
2018-08-16 11:09:03 +02:00
|
|
|
0 \
|
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
2018-08-22 10:02:59 +02:00
|
|
|
-C "error"
|
|
|
|
|
2018-10-11 13:34:08 +02:00
|
|
|
# Forcing ciphersuite for this test to fit the MTU of 512 with full config.
|
2018-08-22 10:02:59 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-13 20:34:55 +02:00
|
|
|
requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
2018-10-11 12:49:41 +02:00
|
|
|
requires_config_enabled MBEDTLS_AES_C
|
|
|
|
requires_config_enabled MBEDTLS_GCM_C
|
2018-08-22 10:02:59 +02:00
|
|
|
client_needs_more_time 2
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-22 10:02:59 +02:00
|
|
|
run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \
|
|
|
|
-p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 auth_mode=required \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
|
|
|
hs_timeout=250-10000 mtu=512 nbio=2" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2018-10-11 12:49:41 +02:00
|
|
|
force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
|
2018-08-22 10:02:59 +02:00
|
|
|
hs_timeout=250-10000 mtu=512 nbio=2" \
|
|
|
|
0 \
|
|
|
|
-s "found fragmented DTLS handshake message" \
|
|
|
|
-c "found fragmented DTLS handshake message" \
|
2018-08-16 11:09:03 +02:00
|
|
|
-C "error"
|
|
|
|
|
2018-08-17 12:44:54 +02:00
|
|
|
# interop tests for DTLS fragmentating with reliable connection
|
|
|
|
#
|
2018-08-17 10:51:26 +02:00
|
|
|
# here and below we just want to test that the we fragment in a way that
|
|
|
|
# pleases other implementations, so we don't need the peer to fragment
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2018-08-21 09:40:07 +02:00
|
|
|
requires_gnutls
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2018-08-17 10:51:26 +02:00
|
|
|
run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \
|
|
|
|
"$G_SRV -u" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2021-12-02 09:43:35 +01:00
|
|
|
mtu=512 force_version=dtls12" \
|
2018-08-17 10:51:26 +02:00
|
|
|
0 \
|
|
|
|
-c "fragmenting handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-08-28 11:20:22 +02:00
|
|
|
# We use --insecure for the GnuTLS client because it expects
|
|
|
|
# the hostname / IP it connects to to be the name used in the
|
|
|
|
# certificate obtained from the server. Here, however, it
|
|
|
|
# connects to 127.0.0.1 while our test certificates use 'localhost'
|
|
|
|
# as the server name in the certificate. This will make the
|
|
|
|
# certifiate validation fail, but passing --insecure makes
|
|
|
|
# GnuTLS continue the connection nonetheless.
|
2018-08-17 10:51:26 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2018-08-21 09:40:07 +02:00
|
|
|
requires_gnutls
|
2018-10-11 14:43:30 +02:00
|
|
|
requires_not_i686
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2018-08-17 10:51:26 +02:00
|
|
|
run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 \
|
2018-08-17 10:51:26 +02:00
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2021-12-02 09:43:35 +01:00
|
|
|
mtu=512 force_version=dtls12" \
|
Force IPv4 for gnutls-cli DTLS tests
Depending on the settings of the local machine, gnutls-cli will either try
IPv4 or IPv6 when trying to connect to localhost. With TLS, whatever it tries
first, it will notice if any failure happens and try the other protocol if
necessary. With DTLS it can't do that. Unfortunately for now there isn't
really any good way to specify an address and hostname independently, though
that might come soon: https://gitlab.com/gnutls/gnutls/issues/344
A work around is to specify an address directly and then use --insecure to
ignore certificate hostname mismatch; that is OK for tests that are completely
unrelated to certificate verification (such as the recent fragmenting tests)
but unacceptable for others.
For that reason, don't specify a default hostname for gnutls-cli, but instead
let each test choose between `--insecure 127.0.0.1` and `localhost` (or
`--insecure '::1'` if desired).
Alternatives include:
- having test certificates with 127.0.0.1 as the hostname, but having an IP as
the CN is unusual, and we would need to change our test certs;
- have our server open two sockets under the hood and listen on both IPv4 and
IPv6 (that's what gnutls-serv does, and IMO it's a good thing) but that
obviously requires development and testing (esp. for windows compatibility)
- wait for a newer version of GnuTLS to be released, install it on the CI and
developer machines, and use that in all tests - quite satisfying but can't
be done now (and puts stronger requirements on test environment).
2018-08-23 19:07:15 +02:00
|
|
|
"$G_CLI -u --insecure 127.0.0.1" \
|
2018-08-17 10:51:26 +02:00
|
|
|
0 \
|
|
|
|
-s "fragmenting handshake message"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2018-08-17 10:51:26 +02:00
|
|
|
run_test "DTLS fragmenting: openssl server, DTLS 1.2" \
|
|
|
|
"$O_SRV -dtls1_2 -verify 10" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2021-12-02 09:43:35 +01:00
|
|
|
mtu=512 force_version=dtls12" \
|
2018-08-17 10:51:26 +02:00
|
|
|
0 \
|
|
|
|
-c "fragmenting handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2018-08-17 10:51:26 +02:00
|
|
|
run_test "DTLS fragmenting: openssl client, DTLS 1.2" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2021-12-02 09:43:35 +01:00
|
|
|
mtu=512 force_version=dtls12" \
|
2018-08-17 10:51:26 +02:00
|
|
|
"$O_CLI -dtls1_2" \
|
|
|
|
0 \
|
|
|
|
-s "fragmenting handshake message"
|
|
|
|
|
2018-08-17 12:44:54 +02:00
|
|
|
# interop tests for DTLS fragmentating with unreliable connection
|
|
|
|
#
|
|
|
|
# again we just want to test that the we fragment in a way that
|
|
|
|
# pleases other implementations, so we don't need the peer to fragment
|
|
|
|
requires_gnutls_next
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
2018-08-20 10:49:28 +02:00
|
|
|
client_needs_more_time 4
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2018-08-17 12:44:54 +02:00
|
|
|
run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \
|
|
|
|
-p "$P_PXY drop=8 delay=8 duplicate=8" \
|
|
|
|
"$G_NEXT_SRV -u" \
|
2018-08-14 14:46:33 +02:00
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 \
|
2018-08-17 12:44:54 +02:00
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2021-12-02 09:43:35 +01:00
|
|
|
hs_timeout=250-60000 mtu=512 force_version=dtls12" \
|
2018-08-17 12:44:54 +02:00
|
|
|
0 \
|
|
|
|
-c "fragmenting handshake message" \
|
|
|
|
-C "error"
|
|
|
|
|
2019-02-18 15:29:56 +01:00
|
|
|
requires_gnutls_next
|
2018-08-28 11:25:41 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
client_needs_more_time 4
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2018-08-28 11:25:41 +02:00
|
|
|
run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \
|
|
|
|
-p "$P_PXY drop=8 delay=8 duplicate=8" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2021-12-02 09:43:35 +01:00
|
|
|
hs_timeout=250-60000 mtu=512 force_version=dtls12" \
|
2019-02-18 15:29:56 +01:00
|
|
|
"$G_NEXT_CLI -u --insecure 127.0.0.1" \
|
2018-08-28 11:25:41 +02:00
|
|
|
0 \
|
|
|
|
-s "fragmenting handshake message"
|
|
|
|
|
2018-09-03 10:41:49 +02:00
|
|
|
## Interop test with OpenSSL might trigger a bug in recent versions (including
|
|
|
|
## all versions installed on the CI machines), reported here:
|
2018-08-17 12:44:54 +02:00
|
|
|
## Bug report: https://github.com/openssl/openssl/issues/6902
|
2018-09-03 10:41:49 +02:00
|
|
|
## They should be re-enabled once a fixed version of OpenSSL is available
|
|
|
|
## (this should happen in some 1.1.1_ release according to the ticket).
|
2018-08-28 11:25:41 +02:00
|
|
|
skip_next_test
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
client_needs_more_time 4
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2018-08-28 11:25:41 +02:00
|
|
|
run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \
|
|
|
|
-p "$P_PXY drop=8 delay=8 duplicate=8" \
|
|
|
|
"$O_SRV -dtls1_2 -verify 10" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server8_int-ca2.crt \
|
|
|
|
key_file=data_files/server8.key \
|
2021-12-02 09:43:35 +01:00
|
|
|
hs_timeout=250-60000 mtu=512 force_version=dtls12" \
|
2018-08-28 11:25:41 +02:00
|
|
|
0 \
|
|
|
|
-c "fragmenting handshake message" \
|
|
|
|
-C "error"
|
2018-08-17 12:44:54 +02:00
|
|
|
|
2018-09-03 10:41:49 +02:00
|
|
|
skip_next_test
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_ECDSA_C
|
|
|
|
client_needs_more_time 4
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 2048
|
2018-09-03 10:41:49 +02:00
|
|
|
run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \
|
|
|
|
-p "$P_PXY drop=8 delay=8 duplicate=8" \
|
|
|
|
"$P_SRV dtls=1 debug_level=2 \
|
|
|
|
crt_file=data_files/server7_int-ca.crt \
|
|
|
|
key_file=data_files/server7.key \
|
2021-12-02 09:43:35 +01:00
|
|
|
hs_timeout=250-60000 mtu=512 force_version=dtls12" \
|
2018-09-03 10:41:49 +02:00
|
|
|
"$O_CLI -dtls1_2" \
|
|
|
|
0 \
|
|
|
|
-s "fragmenting handshake message"
|
2018-08-17 12:44:54 +02:00
|
|
|
|
2018-07-05 17:25:39 +02:00
|
|
|
# Tests for DTLS-SRTP (RFC 5764)
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-05 17:25:39 +02:00
|
|
|
run_test "DTLS-SRTP all profiles supported" \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile" \
|
|
|
|
-c "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2020-09-24 12:01:13 +02:00
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-C "error"
|
|
|
|
|
2020-09-24 12:01:13 +02:00
|
|
|
|
2018-07-05 17:25:39 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-05 17:25:39 +02:00
|
|
|
run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 debug_level=3" \
|
2020-09-22 12:25:52 +02:00
|
|
|
"$P_CLI dtls=1 use_srtp=1 srtp_force_profile=5 debug_level=3" \
|
2018-07-05 17:25:39 +02:00
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \
|
|
|
|
-s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \
|
2018-07-05 17:25:39 +02:00
|
|
|
-s "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2020-09-24 12:01:13 +02:00
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \
|
2020-09-22 12:25:52 +02:00
|
|
|
"$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \
|
2018-07-05 17:25:39 +02:00
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \
|
2018-07-05 17:25:39 +02:00
|
|
|
-s "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2020-09-24 12:01:13 +02:00
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-05 17:25:39 +02:00
|
|
|
run_test "DTLS-SRTP server and Client support only one matching profile." \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
|
|
|
|
-s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
|
2018-07-05 17:25:39 +02:00
|
|
|
-s "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2020-09-24 12:01:13 +02:00
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-05 17:25:39 +02:00
|
|
|
run_test "DTLS-SRTP server and Client support only one different profile." \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \
|
2020-09-22 12:25:52 +02:00
|
|
|
"$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \
|
2018-07-05 17:25:39 +02:00
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \
|
2018-07-05 17:25:39 +02:00
|
|
|
-S "selected srtp profile" \
|
|
|
|
-S "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-S "DTLS-SRTP key material is"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-C "found use_srtp extension" \
|
|
|
|
-C "found srtp profile" \
|
|
|
|
-C "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-C "DTLS-SRTP key material is"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-05 17:25:39 +02:00
|
|
|
run_test "DTLS-SRTP server doesn't support use_srtp extension." \
|
|
|
|
"$P_SRV dtls=1 debug_level=3" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-S "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-S "DTLS-SRTP key material is"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-C "found use_srtp extension" \
|
|
|
|
-C "found srtp profile" \
|
|
|
|
-C "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-C "DTLS-SRTP key material is"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-05 17:25:39 +02:00
|
|
|
run_test "DTLS-SRTP all profiles supported. mki used" \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
|
|
|
-s "dumping 'using mki' (8 bytes)" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile" \
|
|
|
|
-c "selected srtp profile" \
|
|
|
|
-c "dumping 'sending mki' (8 bytes)" \
|
|
|
|
-c "dumping 'received mki' (8 bytes)" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2020-09-24 12:01:13 +02:00
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
2020-10-26 22:45:58 +01:00
|
|
|
-g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-05 17:25:39 +02:00
|
|
|
run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2020-10-28 17:05:47 +01:00
|
|
|
-s "DTLS-SRTP no mki value negotiated"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-S "dumping 'using mki' (8 bytes)" \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile" \
|
|
|
|
-c "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2020-10-28 17:05:47 +01:00
|
|
|
-c "DTLS-SRTP no mki value negotiated"\
|
2020-09-24 12:01:13 +02:00
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
2018-07-05 17:25:39 +02:00
|
|
|
-c "dumping 'sending mki' (8 bytes)" \
|
|
|
|
-C "dumping 'received mki' (8 bytes)" \
|
|
|
|
-C "error"
|
|
|
|
|
2021-05-20 14:46:20 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP all profiles supported. openssl client." \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
|
|
|
-s "DTLS-SRTP key material is"\
|
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
|
|
|
-c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
|
|
|
-s "DTLS-SRTP key material is"\
|
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
|
|
|
-c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
|
|
|
-s "DTLS-SRTP key material is"\
|
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
|
|
|
-c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \
|
|
|
|
"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
|
|
|
-s "DTLS-SRTP key material is"\
|
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
|
|
|
-c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \
|
|
|
|
"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
|
|
|
-s "DTLS-SRTP key material is"\
|
|
|
|
-g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
|
|
|
|
-c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \
|
|
|
|
"$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \
|
|
|
|
"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-S "selected srtp profile" \
|
|
|
|
-S "server hello, adding use_srtp extension" \
|
|
|
|
-S "DTLS-SRTP key material is"\
|
|
|
|
-C "SRTP Extension negotiated, profile"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \
|
|
|
|
"$P_SRV dtls=1 debug_level=3" \
|
|
|
|
"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-S "server hello, adding use_srtp extension" \
|
|
|
|
-S "DTLS-SRTP key material is"\
|
|
|
|
-C "SRTP Extension negotiated, profile"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP all profiles supported. openssl server" \
|
|
|
|
"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile" \
|
|
|
|
-c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \
|
|
|
|
-c "DTLS-SRTP key material is"\
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \
|
|
|
|
"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile" \
|
|
|
|
-c "selected srtp profile" \
|
|
|
|
-c "DTLS-SRTP key material is"\
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \
|
|
|
|
"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
|
|
|
|
-c "selected srtp profile" \
|
|
|
|
-c "DTLS-SRTP key material is"\
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \
|
|
|
|
"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
|
|
|
|
-c "selected srtp profile" \
|
|
|
|
-c "DTLS-SRTP key material is"\
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \
|
|
|
|
"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
|
|
|
|
-c "selected srtp profile" \
|
|
|
|
-c "DTLS-SRTP key material is"\
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \
|
|
|
|
"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-C "found use_srtp extension" \
|
|
|
|
-C "found srtp profile" \
|
|
|
|
-C "selected srtp profile" \
|
|
|
|
-C "DTLS-SRTP key material is"\
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \
|
|
|
|
"$O_SRV -dtls" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-C "found use_srtp extension" \
|
|
|
|
-C "found srtp profile" \
|
|
|
|
-C "selected srtp profile" \
|
|
|
|
-C "DTLS-SRTP key material is"\
|
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2021-05-20 14:46:20 +02:00
|
|
|
run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \
|
|
|
|
"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile" \
|
|
|
|
-c "selected srtp profile" \
|
|
|
|
-c "DTLS-SRTP key material is"\
|
|
|
|
-c "DTLS-SRTP no mki value negotiated"\
|
|
|
|
-c "dumping 'sending mki' (8 bytes)" \
|
|
|
|
-C "dumping 'received mki' (8 bytes)" \
|
|
|
|
-C "error"
|
|
|
|
|
2018-07-10 09:32:10 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP all profiles supported. gnutls client." \
|
2019-01-15 17:54:03 +01:00
|
|
|
"$P_SRV dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
"$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \
|
2018-07-10 09:32:10 +02:00
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls client." \
|
2019-01-15 17:54:03 +01:00
|
|
|
"$P_SRV dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
"$G_CLI -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \
|
2018-07-10 09:32:10 +02:00
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-c "SRTP profile: SRTP_NULL_HMAC_SHA1_80"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls client." \
|
2019-01-15 17:54:03 +01:00
|
|
|
"$P_SRV dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
"$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \
|
2018-07-10 09:32:10 +02:00
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
|
|
|
|
-s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
|
2018-07-10 09:32:10 +02:00
|
|
|
-s "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls client." \
|
2020-09-22 12:25:52 +02:00
|
|
|
"$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \
|
2019-01-15 17:54:03 +01:00
|
|
|
"$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \
|
2018-07-10 09:32:10 +02:00
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \
|
2018-07-10 09:32:10 +02:00
|
|
|
-s "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-c "SRTP profile: SRTP_NULL_SHA1_32"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server and Client support only one matching profile. gnutls client." \
|
2019-01-15 17:54:03 +01:00
|
|
|
"$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \
|
|
|
|
"$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \
|
2018-07-10 09:32:10 +02:00
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-s "selected srtp profile" \
|
|
|
|
-s "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-s "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server and Client support only one different profile. gnutls client." \
|
2019-01-15 17:54:03 +01:00
|
|
|
"$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \
|
|
|
|
"$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \
|
2018-07-10 09:32:10 +02:00
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-s "found srtp profile" \
|
|
|
|
-S "selected srtp profile" \
|
|
|
|
-S "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-S "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-C "SRTP profile:"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls client" \
|
2019-01-15 17:54:03 +01:00
|
|
|
"$P_SRV dtls=1 debug_level=3" \
|
|
|
|
"$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \
|
2018-07-10 09:32:10 +02:00
|
|
|
0 \
|
|
|
|
-s "found use_srtp extension" \
|
|
|
|
-S "server hello, adding use_srtp extension" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-S "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-C "SRTP profile:"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP all profiles supported. gnutls server" \
|
|
|
|
"$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \
|
|
|
|
"$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \
|
|
|
|
"$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
|
2018-07-10 09:32:10 +02:00
|
|
|
-c "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \
|
|
|
|
"$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \
|
2020-09-21 23:44:45 +02:00
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
2018-07-10 09:32:10 +02:00
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \
|
2018-07-10 09:32:10 +02:00
|
|
|
-c "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \
|
|
|
|
"$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
2020-09-22 12:25:52 +02:00
|
|
|
-c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
|
2018-07-10 09:32:10 +02:00
|
|
|
-c "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \
|
|
|
|
"$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \
|
2020-09-22 12:25:52 +02:00
|
|
|
"$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \
|
2018-07-10 09:32:10 +02:00
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-C "found use_srtp extension" \
|
|
|
|
-C "found srtp profile" \
|
|
|
|
-C "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-C "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \
|
|
|
|
"$G_SRV -u" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-C "found use_srtp extension" \
|
|
|
|
-C "found srtp profile" \
|
|
|
|
-C "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-C "DTLS-SRTP key material is"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-C "error"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_DTLS_SRTP
|
2019-01-15 17:54:03 +01:00
|
|
|
requires_gnutls
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-07-10 09:32:10 +02:00
|
|
|
run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \
|
|
|
|
"$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \
|
|
|
|
"$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \
|
|
|
|
0 \
|
|
|
|
-c "client hello, adding use_srtp extension" \
|
|
|
|
-c "found use_srtp extension" \
|
|
|
|
-c "found srtp profile" \
|
|
|
|
-c "selected srtp profile" \
|
2020-09-21 23:44:45 +02:00
|
|
|
-c "DTLS-SRTP key material is"\
|
2020-10-26 22:45:58 +01:00
|
|
|
-c "DTLS-SRTP mki value:"\
|
2018-07-10 09:32:10 +02:00
|
|
|
-c "dumping 'sending mki' (8 bytes)" \
|
|
|
|
-c "dumping 'received mki' (8 bytes)" \
|
|
|
|
-C "error"
|
|
|
|
|
2014-09-26 16:31:46 +02:00
|
|
|
# Tests for specific things with "unreliable" UDP connection
|
2014-09-05 17:45:19 +02:00
|
|
|
|
2014-09-24 15:17:31 +02:00
|
|
|
not_with_valgrind # spurious resend due to timeout
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-06 12:27:02 +02:00
|
|
|
run_test "DTLS proxy: reference" \
|
2014-09-05 17:45:19 +02:00
|
|
|
-p "$P_PXY" \
|
Adjust timeout of tests with "no resend" assertions
There are currently 4 tests in ssl-opt.sh with either -C "resend" or -S
"resend", that is, asserting that no retransmission will occur. They sometimes
fail on loaded CI machines as one side doesn't send a message fast enough,
causing the other side to retransmit, causing the test to fail.
(For the "reconnect" test there was an other issue causing random failures,
fixed in a previous commit, but even after that fix the test would still
sometimes randomly fail, even if much more rarely.)
While it's a hard problem to fix in a general and perfect way, in practice the
probability of failures can be drastically reduced by making the timeout
values much larger.
For some tests, where retransmissions are actually expected, this would have
the negative effect of increasing the average running time of the test, as
each side would wait for longer before it starts retransmission, so we have a
trade-off between average running time and probability of spurious failures.
But for tests where retransmission is not expected, there is no such trade-off
as the expected running time of the test (assuming the code is correct most of
the time) is not impacted by the timeout value. So the only negative effect of
increasing the timeout value is on the worst-case running time on the test,
which is much less important, as test should only fail quite rarely.
This commit addresses the easy case of tests that don't expect retransmission
by increasing the value of their timeout range to 10s-20s. This value
corresponds to the value used for tests that assert `-S "autoreduction"` which
are in the same case and where the current value seems acceptable so far.
It also represents an increase, compared to the values before this commit, of
a factor 20 for the "reconnect" tests which were frequently observed to fail
in the CI, and of a factor 10 for the first two "DTLS proxy" tests, which were
observed to fail much less frequently, so hopefully the new values are enough
to reduce the probability of spurious failures to an acceptable level.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2019-09-09 11:14:37 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \
|
|
|
|
"$P_CLI dtls=1 debug_level=2 hs_timeout=10000-20000" \
|
2014-09-06 12:27:02 +02:00
|
|
|
0 \
|
2014-09-24 13:56:09 +02:00
|
|
|
-C "replayed record" \
|
|
|
|
-S "replayed record" \
|
Don't disallow 'record from another epoch' log msg in proxy ref test
It happens regularly in test runs that the server example application
shuts down a connection, goes into waiting mode for a new connection,
and then receives the encrypted ClosureAlert from the client. The only
reason why this does currently not trigger the 'record from another epoch'
message is that we handle ClientHello parsing outside of the main record
stack because we want to be able to detect SSLv2 ClientHellos. However,
this is likely to go away, and once it happens, we'll see the log message.
Further, when record checking is used, every record, including the mentioned
closure alert, is passed to the record checking API before being passed to
the rest of the stack, which leads to the log message being printed.
In summary, grepping for 'record from another epoch' is a fragile way
of checking whether a reordered message has arrived. A more reliable
way is to grep for 'Buffer record from epoch' which is printed when
a record from a future epoch is actually buffered, and 'ssl_buffer_message'
which is the function buffering a future handshake message.
2019-07-19 16:43:09 +02:00
|
|
|
-C "Buffer record from epoch" \
|
|
|
|
-S "Buffer record from epoch" \
|
|
|
|
-C "ssl_buffer_message" \
|
|
|
|
-S "ssl_buffer_message" \
|
2014-09-24 13:56:09 +02:00
|
|
|
-C "discarding invalid record" \
|
|
|
|
-S "discarding invalid record" \
|
2014-09-24 15:17:31 +02:00
|
|
|
-S "resend" \
|
2014-09-08 16:39:08 +02:00
|
|
|
-s "Extra-header:" \
|
2014-09-06 12:27:02 +02:00
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2014-09-24 15:17:31 +02:00
|
|
|
not_with_valgrind # spurious resend due to timeout
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-24 13:29:58 +02:00
|
|
|
run_test "DTLS proxy: duplicate every packet" \
|
2014-09-06 12:27:02 +02:00
|
|
|
-p "$P_PXY duplicate=1" \
|
Adjust timeout of tests with "no resend" assertions
There are currently 4 tests in ssl-opt.sh with either -C "resend" or -S
"resend", that is, asserting that no retransmission will occur. They sometimes
fail on loaded CI machines as one side doesn't send a message fast enough,
causing the other side to retransmit, causing the test to fail.
(For the "reconnect" test there was an other issue causing random failures,
fixed in a previous commit, but even after that fix the test would still
sometimes randomly fail, even if much more rarely.)
While it's a hard problem to fix in a general and perfect way, in practice the
probability of failures can be drastically reduced by making the timeout
values much larger.
For some tests, where retransmissions are actually expected, this would have
the negative effect of increasing the average running time of the test, as
each side would wait for longer before it starts retransmission, so we have a
trade-off between average running time and probability of spurious failures.
But for tests where retransmission is not expected, there is no such trade-off
as the expected running time of the test (assuming the code is correct most of
the time) is not impacted by the timeout value. So the only negative effect of
increasing the timeout value is on the worst-case running time on the test,
which is much less important, as test should only fail quite rarely.
This commit addresses the easy case of tests that don't expect retransmission
by increasing the value of their timeout range to 10s-20s. This value
corresponds to the value used for tests that assert `-S "autoreduction"` which
are in the same case and where the current value seems acceptable so far.
It also represents an increase, compared to the values before this commit, of
a factor 20 for the "reconnect" tests which were frequently observed to fail
in the CI, and of a factor 10 for the first two "DTLS proxy" tests, which were
observed to fail much less frequently, so hopefully the new values are enough
to reduce the probability of spurious failures to an acceptable level.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2019-09-09 11:14:37 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \
|
2014-09-06 12:27:02 +02:00
|
|
|
0 \
|
2014-09-24 13:29:58 +02:00
|
|
|
-c "replayed record" \
|
|
|
|
-s "replayed record" \
|
2017-05-26 17:07:36 +02:00
|
|
|
-c "record from another epoch" \
|
|
|
|
-s "record from another epoch" \
|
2014-09-24 15:17:31 +02:00
|
|
|
-S "resend" \
|
2014-09-08 16:39:08 +02:00
|
|
|
-s "Extra-header:" \
|
2014-09-24 14:41:11 +02:00
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-24 14:41:11 +02:00
|
|
|
run_test "DTLS proxy: duplicate every packet, server anti-replay off" \
|
|
|
|
-p "$P_PXY duplicate=1" \
|
2018-08-14 14:46:33 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 debug_level=2" \
|
2014-09-24 14:41:11 +02:00
|
|
|
0 \
|
|
|
|
-c "replayed record" \
|
|
|
|
-S "replayed record" \
|
2017-05-26 17:07:36 +02:00
|
|
|
-c "record from another epoch" \
|
|
|
|
-s "record from another epoch" \
|
2014-09-24 15:17:31 +02:00
|
|
|
-c "resend" \
|
|
|
|
-s "resend" \
|
2014-09-24 14:41:11 +02:00
|
|
|
-s "Extra-header:" \
|
2014-09-08 16:39:08 +02:00
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-11-15 17:39:20 +01:00
|
|
|
run_test "DTLS proxy: multiple records in same datagram" \
|
2018-03-15 11:14:19 +01:00
|
|
|
-p "$P_PXY pack=50" \
|
2018-08-14 14:46:33 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 debug_level=2" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 debug_level=2" \
|
2017-11-15 17:39:20 +01:00
|
|
|
0 \
|
|
|
|
-c "next record in same datagram" \
|
|
|
|
-s "next record in same datagram"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2017-11-15 17:39:20 +01:00
|
|
|
run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \
|
2018-03-15 11:14:19 +01:00
|
|
|
-p "$P_PXY pack=50 duplicate=1" \
|
2018-08-14 14:46:33 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 debug_level=2" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 debug_level=2" \
|
2017-11-15 17:39:20 +01:00
|
|
|
0 \
|
|
|
|
-c "next record in same datagram" \
|
|
|
|
-s "next record in same datagram"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-14 19:36:36 +02:00
|
|
|
run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \
|
2014-09-08 16:39:08 +02:00
|
|
|
-p "$P_PXY bad_ad=1" \
|
2018-08-14 14:46:33 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 debug_level=1" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \
|
2014-09-23 11:00:37 +02:00
|
|
|
0 \
|
2014-10-14 22:34:08 +02:00
|
|
|
-c "discarding invalid record (mac)" \
|
|
|
|
-s "discarding invalid record (mac)" \
|
2014-09-23 11:00:37 +02:00
|
|
|
-s "Extra-header:" \
|
2014-10-14 19:36:36 +02:00
|
|
|
-c "HTTP/1.0 200 OK" \
|
|
|
|
-S "too many records with bad MAC" \
|
|
|
|
-S "Verification of the message MAC failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-14 19:36:36 +02:00
|
|
|
run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \
|
|
|
|
-p "$P_PXY bad_ad=1" \
|
2018-08-14 14:46:33 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \
|
2014-10-14 19:36:36 +02:00
|
|
|
1 \
|
2014-10-14 22:34:08 +02:00
|
|
|
-C "discarding invalid record (mac)" \
|
|
|
|
-S "discarding invalid record (mac)" \
|
2014-10-14 19:36:36 +02:00
|
|
|
-S "Extra-header:" \
|
|
|
|
-C "HTTP/1.0 200 OK" \
|
|
|
|
-s "too many records with bad MAC" \
|
|
|
|
-s "Verification of the message MAC failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-14 19:36:36 +02:00
|
|
|
run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \
|
|
|
|
-p "$P_PXY bad_ad=1" \
|
2018-08-14 14:46:33 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \
|
2014-10-14 19:36:36 +02:00
|
|
|
0 \
|
2014-10-14 22:34:08 +02:00
|
|
|
-c "discarding invalid record (mac)" \
|
|
|
|
-s "discarding invalid record (mac)" \
|
2014-10-14 19:36:36 +02:00
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "HTTP/1.0 200 OK" \
|
|
|
|
-S "too many records with bad MAC" \
|
|
|
|
-S "Verification of the message MAC failed"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-14 19:36:36 +02:00
|
|
|
run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\
|
|
|
|
-p "$P_PXY bad_ad=1" \
|
2018-08-14 14:46:33 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100 exchanges=2" \
|
2014-10-14 19:36:36 +02:00
|
|
|
1 \
|
2014-10-14 22:34:08 +02:00
|
|
|
-c "discarding invalid record (mac)" \
|
|
|
|
-s "discarding invalid record (mac)" \
|
2014-10-14 19:36:36 +02: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 11:00:37 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-23 11:00:37 +02:00
|
|
|
run_test "DTLS proxy: delay ChangeCipherSpec" \
|
2014-09-24 13:56:09 +02:00
|
|
|
-p "$P_PXY delay_ccs=1" \
|
2018-08-14 14:41:21 +02:00
|
|
|
"$P_SRV dtls=1 debug_level=1 dgram_packing=0" \
|
|
|
|
"$P_CLI dtls=1 debug_level=1 dgram_packing=0" \
|
2014-09-23 11:00:37 +02:00
|
|
|
0 \
|
2014-09-24 13:56:09 +02:00
|
|
|
-c "record from another epoch" \
|
|
|
|
-s "record from another epoch" \
|
2014-09-23 11:00:37 +02:00
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2018-08-16 14:15:19 +02:00
|
|
|
# Tests for reordering support with DTLS
|
|
|
|
|
2022-03-14 18:21:24 +01:00
|
|
|
requires_certificate_authentication
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-17 14:42:15 +02:00
|
|
|
run_test "DTLS reordering: Buffer out-of-order handshake message on client" \
|
|
|
|
-p "$P_PXY delay_srv=ServerHello" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
2018-08-16 16:28:59 +02:00
|
|
|
0 \
|
|
|
|
-c "Buffering HS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-c "Next handshake message has been buffered - load"\
|
|
|
|
-S "Buffering HS message" \
|
|
|
|
-S "Next handshake message has been buffered - load"\
|
2018-08-28 18:17:13 +02:00
|
|
|
-C "Injecting buffered CCS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-C "Remember CCS message" \
|
2018-08-28 18:17:13 +02:00
|
|
|
-S "Injecting buffered CCS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-S "Remember CCS message"
|
2018-08-28 17:02:33 +02:00
|
|
|
|
2022-03-14 18:21:24 +01:00
|
|
|
requires_certificate_authentication
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-28 17:02:33 +02:00
|
|
|
run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \
|
|
|
|
-p "$P_PXY delay_srv=ServerHello" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
2018-08-28 17:02:33 +02:00
|
|
|
0 \
|
|
|
|
-c "Buffering HS message" \
|
|
|
|
-c "found fragmented DTLS handshake message"\
|
|
|
|
-c "Next handshake message 1 not or only partially bufffered" \
|
|
|
|
-c "Next handshake message has been buffered - load"\
|
|
|
|
-S "Buffering HS message" \
|
|
|
|
-S "Next handshake message has been buffered - load"\
|
2018-08-28 18:17:13 +02:00
|
|
|
-C "Injecting buffered CCS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-C "Remember CCS message" \
|
2018-08-28 18:17:13 +02:00
|
|
|
-S "Injecting buffered CCS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-S "Remember CCS message"
|
|
|
|
|
2018-08-24 15:41:07 +02:00
|
|
|
# The client buffers the ServerKeyExchange before receiving the fragmented
|
|
|
|
# Certificate message; at the time of writing, together these are aroudn 1200b
|
|
|
|
# in size, so that the bound below ensures that the certificate can be reassembled
|
|
|
|
# while keeping the ServerKeyExchange.
|
2022-03-14 18:21:24 +01:00
|
|
|
requires_certificate_authentication
|
2018-08-24 15:41:07 +02:00
|
|
|
requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-24 15:41:07 +02:00
|
|
|
run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next" \
|
2018-08-21 17:50:43 +02:00
|
|
|
-p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
2018-08-21 17:50:43 +02:00
|
|
|
0 \
|
|
|
|
-c "Buffering HS message" \
|
|
|
|
-c "Next handshake message has been buffered - load"\
|
2018-08-24 15:41:07 +02:00
|
|
|
-C "attempt to make space by freeing buffered messages" \
|
|
|
|
-S "Buffering HS message" \
|
|
|
|
-S "Next handshake message has been buffered - load"\
|
2018-08-28 18:17:13 +02:00
|
|
|
-C "Injecting buffered CCS message" \
|
2018-08-24 15:41:07 +02:00
|
|
|
-C "Remember CCS message" \
|
2018-08-28 18:17:13 +02:00
|
|
|
-S "Injecting buffered CCS message" \
|
2018-08-24 15:41:07 +02:00
|
|
|
-S "Remember CCS message"
|
|
|
|
|
|
|
|
# The size constraints ensure that the delayed certificate message can't
|
|
|
|
# be reassembled while keeping the ServerKeyExchange message, but it can
|
|
|
|
# when dropping it first.
|
2022-03-14 18:21:24 +01:00
|
|
|
requires_certificate_authentication
|
2018-08-24 15:41:07 +02:00
|
|
|
requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900
|
|
|
|
requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-24 15:41:07 +02:00
|
|
|
run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \
|
|
|
|
-p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
2018-08-24 15:41:07 +02:00
|
|
|
0 \
|
|
|
|
-c "Buffering HS message" \
|
|
|
|
-c "attempt to make space by freeing buffered future messages" \
|
|
|
|
-c "Enough space available after freeing buffered HS messages" \
|
2018-08-21 17:50:43 +02:00
|
|
|
-S "Buffering HS message" \
|
|
|
|
-S "Next handshake message has been buffered - load"\
|
2018-08-28 18:17:13 +02:00
|
|
|
-C "Injecting buffered CCS message" \
|
2018-08-21 17:50:43 +02:00
|
|
|
-C "Remember CCS message" \
|
2018-08-28 18:17:13 +02:00
|
|
|
-S "Injecting buffered CCS message" \
|
2018-08-21 17:50:43 +02:00
|
|
|
-S "Remember CCS message"
|
|
|
|
|
2022-03-14 18:21:24 +01:00
|
|
|
requires_certificate_authentication
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-17 14:42:15 +02:00
|
|
|
run_test "DTLS reordering: Buffer out-of-order handshake message on server" \
|
|
|
|
-p "$P_PXY delay_cli=Certificate" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
2018-08-17 14:42:15 +02:00
|
|
|
0 \
|
|
|
|
-C "Buffering HS message" \
|
|
|
|
-C "Next handshake message has been buffered - load"\
|
|
|
|
-s "Buffering HS message" \
|
|
|
|
-s "Next handshake message has been buffered - load" \
|
2018-08-28 18:17:13 +02:00
|
|
|
-C "Injecting buffered CCS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-C "Remember CCS message" \
|
2018-08-28 18:17:13 +02:00
|
|
|
-S "Injecting buffered CCS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-S "Remember CCS message"
|
|
|
|
|
2022-03-14 18:21:24 +01:00
|
|
|
requires_certificate_authentication
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-17 14:42:15 +02:00
|
|
|
run_test "DTLS reordering: Buffer out-of-order CCS message on client"\
|
|
|
|
-p "$P_PXY delay_srv=NewSessionTicket" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
2018-08-17 14:42:15 +02:00
|
|
|
0 \
|
|
|
|
-C "Buffering HS message" \
|
|
|
|
-C "Next handshake message has been buffered - load"\
|
|
|
|
-S "Buffering HS message" \
|
|
|
|
-S "Next handshake message has been buffered - load" \
|
2018-08-28 18:17:13 +02:00
|
|
|
-c "Injecting buffered CCS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-c "Remember CCS message" \
|
2018-08-28 18:17:13 +02:00
|
|
|
-S "Injecting buffered CCS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-S "Remember CCS message"
|
2018-08-16 16:28:59 +02:00
|
|
|
|
2022-03-14 18:21:24 +01:00
|
|
|
requires_certificate_authentication
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-17 14:42:15 +02:00
|
|
|
run_test "DTLS reordering: Buffer out-of-order CCS message on server"\
|
|
|
|
-p "$P_PXY delay_cli=ClientKeyExchange" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
2018-08-16 16:29:06 +02:00
|
|
|
0 \
|
2018-08-17 14:42:15 +02:00
|
|
|
-C "Buffering HS message" \
|
|
|
|
-C "Next handshake message has been buffered - load"\
|
|
|
|
-S "Buffering HS message" \
|
|
|
|
-S "Next handshake message has been buffered - load" \
|
2018-08-28 18:17:13 +02:00
|
|
|
-C "Injecting buffered CCS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-C "Remember CCS message" \
|
2018-08-28 18:17:13 +02:00
|
|
|
-s "Injecting buffered CCS message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-s "Remember CCS message"
|
2018-08-16 16:29:06 +02:00
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-24 15:41:07 +02:00
|
|
|
run_test "DTLS reordering: Buffer encrypted Finished message" \
|
2018-08-17 14:42:15 +02:00
|
|
|
-p "$P_PXY delay_ccs=1" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 \
|
|
|
|
hs_timeout=2500-60000" \
|
2018-08-16 14:15:19 +02:00
|
|
|
0 \
|
2018-08-17 14:42:15 +02:00
|
|
|
-s "Buffer record from epoch 1" \
|
|
|
|
-s "Found buffered record from current epoch - load" \
|
|
|
|
-c "Buffer record from epoch 1" \
|
|
|
|
-c "Found buffered record from current epoch - load"
|
2018-08-16 14:15:19 +02:00
|
|
|
|
2018-08-24 15:41:07 +02:00
|
|
|
# In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec
|
|
|
|
# from the server are delayed, so that the encrypted Finished message
|
|
|
|
# is received and buffered. When the fragmented NewSessionTicket comes
|
|
|
|
# in afterwards, the encrypted Finished message must be freed in order
|
|
|
|
# to make space for the NewSessionTicket to be reassembled.
|
|
|
|
# This works only in very particular circumstances:
|
|
|
|
# - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering
|
|
|
|
# of the NewSessionTicket, but small enough to also allow buffering of
|
|
|
|
# the encrypted Finished message.
|
|
|
|
# - The MTU setting on the server must be so small that the NewSessionTicket
|
|
|
|
# needs to be fragmented.
|
|
|
|
# - All messages sent by the server must be small enough to be either sent
|
|
|
|
# without fragmentation or be reassembled within the bounds of
|
|
|
|
# MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based
|
|
|
|
# handshake, omitting CRTs.
|
2019-05-28 10:21:30 +02:00
|
|
|
requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190
|
|
|
|
requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2018-08-24 15:41:07 +02:00
|
|
|
run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \
|
|
|
|
-p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \
|
2019-05-28 10:21:30 +02:00
|
|
|
"$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \
|
2018-08-24 15:41:07 +02:00
|
|
|
"$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \
|
|
|
|
0 \
|
|
|
|
-s "Buffer record from epoch 1" \
|
|
|
|
-s "Found buffered record from current epoch - load" \
|
|
|
|
-c "Buffer record from epoch 1" \
|
|
|
|
-C "Found buffered record from current epoch - load" \
|
|
|
|
-c "Enough space available after freeing future epoch record"
|
|
|
|
|
2014-09-26 16:31:46 +02:00
|
|
|
# Tests for "randomly unreliable connection": try a variety of flows and peers
|
2014-09-24 19:09:17 +02:00
|
|
|
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 2
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-24 19:09:17 +02:00
|
|
|
run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
|
2014-10-01 16:38:03 +02:00
|
|
|
psk=abc123" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
|
2014-09-24 19:09:17 +02:00
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
|
2014-09-08 16:39:08 +02:00
|
|
|
0 \
|
|
|
|
-s "Extra-header:" \
|
2014-09-06 12:27:02 +02:00
|
|
|
-c "HTTP/1.0 200 OK"
|
2014-09-05 17:45:19 +02:00
|
|
|
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 2
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-24 19:09:17 +02:00
|
|
|
run_test "DTLS proxy: 3d, \"short\" RSA handshake" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \
|
2014-09-24 19:09:17 +02:00
|
|
|
force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
|
2014-09-20 12:46:27 +02:00
|
|
|
0 \
|
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 2
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-24 19:09:17 +02:00
|
|
|
run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \
|
2014-09-20 12:46:27 +02:00
|
|
|
0 \
|
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 2
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-24 19:09:17 +02:00
|
|
|
run_test "DTLS proxy: 3d, FS, client auth" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \
|
2014-09-20 12:46:27 +02:00
|
|
|
0 \
|
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 2
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-24 19:09:17 +02:00
|
|
|
run_test "DTLS proxy: 3d, FS, ticket" \
|
2014-09-23 11:00:37 +02:00
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \
|
2014-09-24 19:09:17 +02:00
|
|
|
0 \
|
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 2
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-24 19:09:17 +02:00
|
|
|
run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \
|
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \
|
2014-09-23 11:00:37 +02:00
|
|
|
0 \
|
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 2
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-29 17:52:57 +02:00
|
|
|
run_test "DTLS proxy: 3d, max handshake, nbio" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \
|
2014-10-01 16:38:03 +02:00
|
|
|
auth_mode=required" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1" \
|
2014-09-29 17:52:57 +02:00
|
|
|
0 \
|
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 4
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2014-10-02 14:50:46 +02:00
|
|
|
run_test "DTLS proxy: 3d, min handshake, resumption" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
|
2014-10-02 14:50:46 +02:00
|
|
|
psk=abc123 debug_level=3" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-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 11:04:33 +01:00
|
|
|
debug_level=3 reconnect=1 skip_close_notify=1 read_timeout=1000 max_resend=10 \
|
2014-10-02 14:50:46 +02: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 14:45:28 +02:00
|
|
|
client_needs_more_time 4
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2022-02-25 19:51:52 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CACHE_C
|
2014-10-02 17:59:19 +02:00
|
|
|
run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
|
2014-10-02 17:59:19 +02:00
|
|
|
psk=abc123 debug_level=3 nbio=2" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-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 11:04:33 +01:00
|
|
|
debug_level=3 reconnect=1 skip_close_notify=1 read_timeout=1000 max_resend=10 \
|
2014-10-02 17:59:19 +02: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 14:45:28 +02:00
|
|
|
client_needs_more_time 4
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-29 17:52:57 +02:00
|
|
|
run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \
|
2014-09-25 16:09:36 +02:00
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
|
2014-10-01 16:38:03 +02:00
|
|
|
psk=abc123 renegotiation=1 debug_level=2" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
|
2014-10-01 16:38:03 +02:00
|
|
|
renegotiate=1 debug_level=2 \
|
2014-09-25 16:09:36 +02: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 14:45:28 +02:00
|
|
|
client_needs_more_time 4
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-29 17:52:57 +02:00
|
|
|
run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
|
2014-10-01 16:38:03 +02:00
|
|
|
psk=abc123 renegotiation=1 debug_level=2" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
|
2014-10-01 16:38:03 +02:00
|
|
|
renegotiate=1 debug_level=2 \
|
2014-09-29 17:52:57 +02: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 14:45:28 +02:00
|
|
|
client_needs_more_time 4
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-09 16:13:44 +02:00
|
|
|
run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \
|
2014-10-15 12:44:41 +02:00
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
|
2014-10-15 12:44:41 +02:00
|
|
|
psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \
|
2014-10-09 16:13:44 +02:00
|
|
|
debug_level=2" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
|
2014-10-15 12:44:41 +02:00
|
|
|
renegotiation=1 exchanges=4 debug_level=2 \
|
2014-10-09 16:13:44 +02: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 14:45:28 +02:00
|
|
|
client_needs_more_time 4
|
2017-10-12 16:18:45 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_RENEGOTIATION
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-10-09 16:13:44 +02:00
|
|
|
run_test "DTLS proxy: 3d, min handshake, server-initiated renego, nbio" \
|
2014-10-15 12:44:41 +02:00
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
|
2014-10-15 12:44:41 +02:00
|
|
|
psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \
|
2014-10-09 16:13:44 +02:00
|
|
|
debug_level=2 nbio=2" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
|
2014-10-15 12:44:41 +02:00
|
|
|
renegotiation=1 exchanges=4 debug_level=2 nbio=2 \
|
2014-10-09 16:13:44 +02:00
|
|
|
force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
|
|
|
|
0 \
|
|
|
|
-c "=> renegotiate" \
|
|
|
|
-s "=> renegotiate" \
|
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2018-09-03 10:50:21 +02:00
|
|
|
## Interop tests with OpenSSL might trigger a bug in recent versions (including
|
|
|
|
## all versions installed on the CI machines), reported here:
|
|
|
|
## Bug report: https://github.com/openssl/openssl/issues/6902
|
|
|
|
## They should be re-enabled once a fixed version of OpenSSL is available
|
|
|
|
## (this should happen in some 1.1.1_ release according to the ticket).
|
|
|
|
skip_next_test
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 6
|
2015-08-31 12:48:22 +02:00
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-26 16:27:59 +02:00
|
|
|
run_test "DTLS proxy: 3d, openssl server" \
|
2014-09-25 17:00:27 +02:00
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \
|
|
|
|
"$O_SRV -dtls1 -mtu 2048" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \
|
2014-09-25 17:00:27 +02:00
|
|
|
0 \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2018-09-03 10:50:21 +02:00
|
|
|
skip_next_test # see above
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 8
|
2015-08-31 12:48:22 +02:00
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-26 16:27:59 +02: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" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \
|
2014-09-26 16:27:59 +02:00
|
|
|
0 \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2018-09-03 10:50:21 +02:00
|
|
|
skip_next_test # see above
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 8
|
2015-08-31 12:48:22 +02:00
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-29 17:52:57 +02: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" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2 tickets=0" \
|
2014-09-29 17:52:57 +02:00
|
|
|
0 \
|
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2015-02-17 17:02:37 +01:00
|
|
|
requires_gnutls
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 6
|
2015-08-31 12:48:22 +02:00
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-26 16:27:59 +02:00
|
|
|
run_test "DTLS proxy: 3d, gnutls server" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
|
|
|
"$G_SRV -u --mtu 2048 -a" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \
|
2014-09-26 16:27:59 +02:00
|
|
|
0 \
|
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "Extra-header:"
|
|
|
|
|
2019-02-18 15:29:56 +01:00
|
|
|
requires_gnutls_next
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 8
|
2015-08-31 12:48:22 +02:00
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-26 16:27:59 +02:00
|
|
|
run_test "DTLS proxy: 3d, gnutls server, fragmentation" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2019-02-18 15:29:56 +01:00
|
|
|
"$G_NEXT_SRV -u --mtu 512" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \
|
2014-09-26 16:27:59 +02:00
|
|
|
0 \
|
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "Extra-header:"
|
|
|
|
|
2019-02-18 15:29:56 +01:00
|
|
|
requires_gnutls_next
|
2016-09-02 14:45:28 +02:00
|
|
|
client_needs_more_time 8
|
2015-08-31 12:48:22 +02:00
|
|
|
not_with_valgrind # risk of non-mbedtls peer timing out
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2014-09-29 17:52:57 +02:00
|
|
|
run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \
|
|
|
|
-p "$P_PXY drop=5 delay=5 duplicate=5" \
|
2019-02-18 15:29:56 +01:00
|
|
|
"$G_NEXT_SRV -u --mtu 512" \
|
2018-10-05 21:42:44 +02:00
|
|
|
"$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2" \
|
2014-09-29 17:52:57 +02:00
|
|
|
0 \
|
|
|
|
-s "Extra-header:" \
|
|
|
|
-c "Extra-header:"
|
|
|
|
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-05-14 19:38:49 +02:00
|
|
|
run_test "export keys functionality" \
|
|
|
|
"$P_SRV eap_tls=1 debug_level=3" \
|
|
|
|
"$P_CLI eap_tls=1 debug_level=3" \
|
|
|
|
0 \
|
2019-06-04 12:05:36 +02:00
|
|
|
-c "EAP-TLS key material is:"\
|
|
|
|
-s "EAP-TLS key material is:"\
|
|
|
|
-c "EAP-TLS IV is:" \
|
|
|
|
-s "EAP-TLS IV is:"
|
2019-05-14 19:38:49 +02:00
|
|
|
|
2021-08-10 10:45:37 +02:00
|
|
|
# openssl feature tests: check if tls1.3 exists.
|
|
|
|
requires_openssl_tls1_3
|
2021-12-03 03:04:08 +01:00
|
|
|
run_test "TLS 1.3: Test openssl tls1_3 feature" \
|
2021-08-10 10:45:37 +02:00
|
|
|
"$O_NEXT_SRV -tls1_3 -msg" \
|
|
|
|
"$O_NEXT_CLI -tls1_3 -msg" \
|
|
|
|
0 \
|
|
|
|
-c "TLS 1.3" \
|
|
|
|
-s "TLS 1.3"
|
|
|
|
|
2021-09-02 11:40:08 +02:00
|
|
|
# gnutls feature tests: check if TLS 1.3 is supported as well as the NO_TICKETS and DISABLE_TLS13_COMPAT_MODE options.
|
2021-08-10 10:45:37 +02:00
|
|
|
requires_gnutls_tls1_3
|
2021-08-17 04:56:08 +02:00
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_gnutls_next_disable_tls13_compat
|
2021-12-03 03:04:08 +01:00
|
|
|
run_test "TLS 1.3: Test gnutls tls1_3 feature" \
|
2021-10-28 11:39:28 +02:00
|
|
|
"$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert " \
|
2021-08-17 04:56:08 +02:00
|
|
|
"$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \
|
2021-08-10 10:45:37 +02:00
|
|
|
0 \
|
|
|
|
-s "Version: TLS1.3" \
|
|
|
|
-c "Version: TLS1.3"
|
|
|
|
|
2021-08-06 05:22:24 +02:00
|
|
|
# TLS1.3 test cases
|
2021-08-19 12:11:43 +02:00
|
|
|
requires_openssl_tls1_3
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-12-09 10:39:19 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-12-03 03:04:08 +01:00
|
|
|
run_test "TLS 1.3: minimal feature sets - openssl" \
|
2021-12-09 10:39:19 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3" \
|
2021-12-02 07:36:27 +01:00
|
|
|
0 \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_HELLO_REQUEST" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_HELLO" \
|
|
|
|
-c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_FINISHED" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \
|
|
|
|
-c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \
|
|
|
|
-c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \
|
2021-11-12 09:53:56 +01:00
|
|
|
-c "<= ssl_tls13_process_server_hello" \
|
2021-10-13 16:01:04 +02:00
|
|
|
-c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "ECDH curve: x25519" \
|
2021-11-12 09:53:56 +01:00
|
|
|
-c "=> ssl_tls13_process_server_hello" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "<= parse encrypted extensions" \
|
2021-10-30 07:26:15 +02:00
|
|
|
-c "Certificate verification flags clear" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "=> parse certificate verify" \
|
|
|
|
-c "<= parse certificate verify" \
|
2021-11-10 07:17:40 +01:00
|
|
|
-c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \
|
2021-11-15 07:01:04 +01:00
|
|
|
-c "<= parse finished message" \
|
2022-01-13 01:10:24 +01:00
|
|
|
-c "Protocol is TLSv1.3" \
|
2021-11-15 07:01:04 +01:00
|
|
|
-c "HTTP/1.0 200 ok"
|
2021-08-19 12:11:43 +02:00
|
|
|
|
2021-09-22 15:16:27 +02:00
|
|
|
requires_gnutls_tls1_3
|
2021-10-28 11:39:28 +02:00
|
|
|
requires_gnutls_next_no_ticket
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-12-09 10:39:19 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-12-03 03:04:08 +01:00
|
|
|
run_test "TLS 1.3: minimal feature sets - gnutls" \
|
2021-12-09 10:39:19 +01:00
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3" \
|
2021-12-02 07:36:27 +01:00
|
|
|
0 \
|
2022-03-08 11:37:55 +01:00
|
|
|
-s "SERVER HELLO was queued" \
|
|
|
|
-c "client state: MBEDTLS_SSL_HELLO_REQUEST" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_HELLO" \
|
|
|
|
-c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_FINISHED" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \
|
|
|
|
-c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \
|
|
|
|
-c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \
|
2021-11-12 09:53:56 +01:00
|
|
|
-c "<= ssl_tls13_process_server_hello" \
|
2021-10-13 16:01:04 +02:00
|
|
|
-c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "ECDH curve: x25519" \
|
2021-11-12 09:53:56 +01:00
|
|
|
-c "=> ssl_tls13_process_server_hello" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "<= parse encrypted extensions" \
|
2021-10-30 07:26:15 +02:00
|
|
|
-c "Certificate verification flags clear" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "=> parse certificate verify" \
|
|
|
|
-c "<= parse certificate verify" \
|
2021-11-10 07:17:40 +01:00
|
|
|
-c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \
|
2021-11-15 07:01:04 +01:00
|
|
|
-c "<= parse finished message" \
|
2022-02-12 00:44:48 +01:00
|
|
|
-c "Protocol is TLSv1.3" \
|
2021-11-15 07:01:04 +01:00
|
|
|
-c "HTTP/1.0 200 OK"
|
2021-11-10 07:17:40 +01:00
|
|
|
|
2022-01-21 16:34:27 +01:00
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_ALPN
|
|
|
|
run_test "TLS 1.3: alpn - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -alpn h2" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3 alpn=h2" \
|
2022-01-21 16:34:27 +01:00
|
|
|
0 \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_HELLO_REQUEST" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_HELLO" \
|
|
|
|
-c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_FINISHED" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \
|
|
|
|
-c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \
|
|
|
|
-c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \
|
2022-01-21 16:34:27 +01:00
|
|
|
-c "<= ssl_tls13_process_server_hello" \
|
|
|
|
-c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "ECDH curve: x25519" \
|
2022-01-21 16:34:27 +01:00
|
|
|
-c "=> ssl_tls13_process_server_hello" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "<= parse encrypted extensions" \
|
2022-01-21 16:34:27 +01:00
|
|
|
-c "Certificate verification flags clear" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "=> parse certificate verify" \
|
|
|
|
-c "<= parse certificate verify" \
|
2022-01-21 16:34:27 +01:00
|
|
|
-c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \
|
|
|
|
-c "<= parse finished message" \
|
2022-03-18 14:04:12 +01:00
|
|
|
-c "Protocol is TLSv1.3" \
|
2022-01-21 16:34:27 +01:00
|
|
|
-c "HTTP/1.0 200 ok" \
|
|
|
|
-c "Application Layer Protocol is h2"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_ALPN
|
|
|
|
run_test "TLS 1.3: alpn - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert --alpn=h2" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3 alpn=h2" \
|
2022-01-21 16:34:27 +01:00
|
|
|
0 \
|
2022-03-08 11:37:55 +01:00
|
|
|
-s "SERVER HELLO was queued" \
|
|
|
|
-c "client state: MBEDTLS_SSL_HELLO_REQUEST" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_HELLO" \
|
|
|
|
-c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
|
|
|
|
-c "client state: MBEDTLS_SSL_SERVER_FINISHED" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \
|
|
|
|
-c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \
|
|
|
|
-c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \
|
2022-01-21 16:34:27 +01:00
|
|
|
-c "<= ssl_tls13_process_server_hello" \
|
|
|
|
-c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "ECDH curve: x25519" \
|
2022-01-21 16:34:27 +01:00
|
|
|
-c "=> ssl_tls13_process_server_hello" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "<= parse encrypted extensions" \
|
2022-01-21 16:34:27 +01:00
|
|
|
-c "Certificate verification flags clear" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "=> parse certificate verify" \
|
|
|
|
-c "<= parse certificate verify" \
|
2022-01-21 16:34:27 +01:00
|
|
|
-c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \
|
|
|
|
-c "<= parse finished message" \
|
2022-03-18 14:04:12 +01:00
|
|
|
-c "Protocol is TLSv1.3" \
|
2022-01-21 16:34:27 +01:00
|
|
|
-c "HTTP/1.0 200 OK" \
|
|
|
|
-c "Application Layer Protocol is h2"
|
|
|
|
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-11-22 10:28:01 +01:00
|
|
|
skip_handshake_stage_check
|
|
|
|
requires_gnutls_tls1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.0" \
|
2021-11-22 10:28:01 +01:00
|
|
|
"$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4" \
|
2021-11-22 10:28:01 +01:00
|
|
|
1 \
|
|
|
|
-s "Client's version: 3.3" \
|
|
|
|
-S "Version: TLS1.0" \
|
|
|
|
-C "Protocol is TLSv1.0"
|
|
|
|
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-11-22 10:28:01 +01:00
|
|
|
skip_handshake_stage_check
|
|
|
|
requires_gnutls_tls1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.1" \
|
2021-11-22 10:28:01 +01:00
|
|
|
"$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4" \
|
2021-11-22 10:28:01 +01:00
|
|
|
1 \
|
|
|
|
-s "Client's version: 3.3" \
|
|
|
|
-S "Version: TLS1.1" \
|
|
|
|
-C "Protocol is TLSv1.1"
|
|
|
|
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-11-22 10:28:01 +01:00
|
|
|
skip_handshake_stage_check
|
|
|
|
requires_gnutls_tls1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.2" \
|
2021-11-22 10:28:01 +01:00
|
|
|
"$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI force_version=tls13 debug_level=4" \
|
2021-11-22 10:28:01 +01:00
|
|
|
1 \
|
|
|
|
-s "Client's version: 3.3" \
|
|
|
|
-c "is a fatal alert message (msg 40)" \
|
|
|
|
-S "Version: TLS1.2" \
|
|
|
|
-C "Protocol is TLSv1.2"
|
|
|
|
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-11-22 10:28:01 +01:00
|
|
|
skip_handshake_stage_check
|
|
|
|
requires_openssl_next
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: Not supported version check:openssl: srv max TLS 1.0" \
|
2021-11-22 10:28:01 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4" \
|
2021-11-22 10:28:01 +01:00
|
|
|
1 \
|
|
|
|
-s "fatal protocol_version" \
|
|
|
|
-c "is a fatal alert message (msg 70)" \
|
|
|
|
-S "Version: TLS1.0" \
|
|
|
|
-C "Protocol : TLSv1.0"
|
|
|
|
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-11-22 10:28:01 +01:00
|
|
|
skip_handshake_stage_check
|
|
|
|
requires_openssl_next
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: Not supported version check:openssl: srv max TLS 1.1" \
|
2021-11-22 10:28:01 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_1" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4" \
|
2021-11-22 10:28:01 +01:00
|
|
|
1 \
|
|
|
|
-s "fatal protocol_version" \
|
|
|
|
-c "is a fatal alert message (msg 70)" \
|
|
|
|
-S "Version: TLS1.1" \
|
|
|
|
-C "Protocol : TLSv1.1"
|
|
|
|
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-11-22 10:28:01 +01:00
|
|
|
skip_handshake_stage_check
|
|
|
|
requires_openssl_next
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: Not supported version check:openssl: srv max TLS 1.2" \
|
2021-11-22 10:28:01 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_2" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI force_version=tls13 debug_level=4" \
|
2021-11-22 10:28:01 +01:00
|
|
|
1 \
|
|
|
|
-s "fatal protocol_version" \
|
|
|
|
-c "is a fatal alert message (msg 70)" \
|
|
|
|
-S "Version: TLS1.2" \
|
|
|
|
-C "Protocol : TLSv1.2"
|
|
|
|
|
2022-02-18 08:23:23 +01:00
|
|
|
requires_openssl_tls1_3
|
2022-01-30 12:53:28 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-18 08:23:23 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, no client certificate - openssl" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -verify 10" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4 crt_file=none key_file=none" \
|
2022-01-30 12:53:28 +01:00
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
2022-02-18 08:23:23 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-s "TLS 1.3" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "HTTP/1.0 200 ok" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
2022-01-30 12:53:28 +01:00
|
|
|
|
2022-02-18 08:23:23 +01:00
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
2022-01-30 12:53:28 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-18 08:23:23 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --verify-client-cert" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3 crt_file=none key_file=none" \
|
2022-01-30 12:53:28 +01:00
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
2022-02-18 08:23:23 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\
|
|
|
|
-s "Version: TLS1.3" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "HTTP/1.0 200 OK" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
2022-01-30 12:53:28 +01:00
|
|
|
|
2022-01-26 04:12:34 +01:00
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-22 03:14:24 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \
|
2022-01-26 04:12:34 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key" \
|
2022-01-29 03:44:44 +01:00
|
|
|
0 \
|
2022-01-26 04:12:34 +01:00
|
|
|
-c "got a certificate request" \
|
2022-01-28 07:26:30 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
2022-01-26 04:12:34 +01:00
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-22 03:14:24 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \
|
2022-01-26 04:12:34 +01:00
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/cli2.crt \
|
2022-01-29 03:33:13 +01:00
|
|
|
key_file=data_files/cli2.key" \
|
2022-01-29 03:44:44 +01:00
|
|
|
0 \
|
2022-01-26 04:12:34 +01:00
|
|
|
-c "got a certificate request" \
|
2022-01-28 07:26:30 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
2022-01-28 07:26:30 +01:00
|
|
|
|
2022-02-16 07:52:39 +01:00
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-18 08:23:23 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \
|
2022-02-16 07:52:39 +01:00
|
|
|
key_file=data_files/ecdsa_secp256r1.key" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
2022-02-16 07:52:39 +01:00
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-18 08:23:23 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \
|
2022-02-16 07:52:39 +01:00
|
|
|
key_file=data_files/ecdsa_secp256r1.key" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
2022-02-16 07:52:39 +01:00
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-18 08:23:23 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \
|
2022-02-16 07:52:39 +01:00
|
|
|
key_file=data_files/ecdsa_secp384r1.key" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
2022-02-16 07:52:39 +01:00
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-18 08:23:23 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \
|
2022-02-16 07:52:39 +01:00
|
|
|
key_file=data_files/ecdsa_secp384r1.key" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
2022-02-16 07:52:39 +01:00
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-18 08:23:23 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \
|
2022-02-16 07:52:39 +01:00
|
|
|
key_file=data_files/ecdsa_secp521r1.key" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
2022-02-16 07:52:39 +01:00
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-18 08:23:23 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \
|
2022-02-16 07:52:39 +01:00
|
|
|
key_file=data_files/ecdsa_secp521r1.key" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
2022-02-16 07:52:39 +01:00
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-17 13:55:34 +01:00
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-18 08:23:23 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \
|
2022-02-23 03:38:25 +01:00
|
|
|
key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \
|
2022-02-23 03:40:19 +01:00
|
|
|
0 \
|
2022-02-16 07:52:39 +01:00
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
2022-02-23 03:40:19 +01:00
|
|
|
-c "Protocol is TLSv1.3"
|
2022-02-16 07:52:39 +01:00
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-02-17 13:55:34 +01:00
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-18 08:23:23 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \
|
2022-02-23 03:38:25 +01:00
|
|
|
key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \
|
2022-02-23 03:40:19 +01:00
|
|
|
0 \
|
2022-02-16 07:52:39 +01:00
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
2022-02-18 08:35:11 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
2022-02-23 03:40:19 +01:00
|
|
|
-c "Protocol is TLSv1.3"
|
2022-02-16 07:52:39 +01:00
|
|
|
|
2022-02-18 14:07:18 +01:00
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2022-02-22 09:42:29 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
|
|
|
"$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \
|
|
|
|
key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
|
|
|
"$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
|
|
|
"$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \
|
|
|
|
key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
|
|
|
"$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2022-02-18 14:07:18 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2022-02-22 10:38:34 +01:00
|
|
|
run_test "TLS 1.3: Client authentication, client alg not in server list - openssl" \
|
2022-02-22 03:14:24 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10
|
2022-02-18 14:07:18 +01:00
|
|
|
-sigalgs ecdsa_secp256r1_sha256" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \
|
2022-02-23 03:38:25 +01:00
|
|
|
key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \
|
2022-02-18 14:07:18 +01:00
|
|
|
1 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
2022-02-23 03:38:25 +01:00
|
|
|
-c "signature algorithm not in received or offered list." \
|
|
|
|
-C "unkown pk type"
|
2022-02-18 14:07:18 +01:00
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
2022-02-22 03:14:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \
|
2022-02-23 03:38:25 +01:00
|
|
|
key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \
|
2022-02-18 14:07:18 +01:00
|
|
|
1 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
2022-02-23 03:38:25 +01:00
|
|
|
-c "signature algorithm not in received or offered list." \
|
|
|
|
-C "unkown pk type"
|
2022-02-18 14:07:18 +01:00
|
|
|
|
2022-04-15 10:09:11 +02:00
|
|
|
# Test using an opaque private key for client authentication
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \
|
|
|
|
"$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/cli2.crt \
|
|
|
|
key_file=data_files/cli2.key key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
|
|
|
"$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \
|
|
|
|
key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \
|
|
|
|
key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
|
|
|
"$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \
|
|
|
|
key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \
|
|
|
|
key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
|
|
|
"$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \
|
|
|
|
key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \
|
|
|
|
key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
|
|
|
"$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \
|
|
|
|
key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
|
|
|
"$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \
|
|
|
|
key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
|
|
|
"$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
|
|
|
|
"$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \
|
|
|
|
key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
|
|
|
|
"$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \
|
|
|
|
key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \
|
|
|
|
0 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "Protocol is TLSv1.3"
|
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \
|
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10
|
|
|
|
-sigalgs ecdsa_secp256r1_sha256" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \
|
|
|
|
key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \
|
|
|
|
1 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "signature algorithm not in received or offered list." \
|
|
|
|
-C "unkown pk type"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_config_enabled MBEDTLS_RSA_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO
|
|
|
|
run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \
|
|
|
|
"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \
|
|
|
|
"$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \
|
|
|
|
key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \
|
|
|
|
1 \
|
|
|
|
-c "got a certificate request" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
|
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
|
|
|
|
-c "signature algorithm not in received or offered list." \
|
|
|
|
-C "unkown pk type"
|
|
|
|
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-12-09 10:39:19 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-11-22 14:15:41 +01:00
|
|
|
requires_openssl_tls1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \
|
2022-01-26 07:31:39 +01:00
|
|
|
"$O_NEXT_SRV -ciphersuites TLS_AES_128_GCM_SHA256 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4" \
|
2022-01-26 07:31:39 +01:00
|
|
|
0 \
|
|
|
|
-c "received HelloRetryRequest message" \
|
2022-01-27 04:48:27 +01:00
|
|
|
-c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_HELLO" \
|
2022-03-18 14:04:12 +01:00
|
|
|
-c "Protocol is TLSv1.3" \
|
2022-01-26 07:31:39 +01:00
|
|
|
-c "HTTP/1.0 200 ok"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
requires_openssl_tls1_3
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_256_GCM_SHA384 - openssl" \
|
2021-12-09 10:39:19 +01:00
|
|
|
"$O_NEXT_SRV -ciphersuites TLS_AES_256_GCM_SHA384 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4" \
|
2022-01-18 07:36:23 +01:00
|
|
|
0 \
|
2021-11-22 14:15:41 +01:00
|
|
|
-c "received HelloRetryRequest message" \
|
2022-01-27 04:48:27 +01:00
|
|
|
-c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_HELLO" \
|
2022-03-18 14:04:12 +01:00
|
|
|
-c "Protocol is TLSv1.3" \
|
2022-01-18 07:36:23 +01:00
|
|
|
-c "HTTP/1.0 200 ok"
|
2021-11-22 14:15:41 +01:00
|
|
|
|
2022-04-13 19:08:38 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-11-22 14:15:41 +01:00
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
2021-12-09 10:39:19 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \
|
2022-01-26 07:31:39 +01:00
|
|
|
"$G_NEXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-128-GCM:+SHA256:+AEAD:+SIGN-ECDSA-SECP256R1-SHA256:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4" \
|
2022-01-26 07:31:39 +01:00
|
|
|
0 \
|
|
|
|
-c "received HelloRetryRequest message" \
|
2022-01-27 04:48:27 +01:00
|
|
|
-c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_HELLO" \
|
2022-03-18 14:04:12 +01:00
|
|
|
-c "Protocol is TLSv1.3" \
|
2022-01-26 07:31:39 +01:00
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
2022-04-13 19:08:38 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2022-01-26 07:31:39 +01:00
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-04-05 16:01:03 +02:00
|
|
|
run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_256_GCM_SHA384 - gnutls" \
|
2022-01-20 12:14:50 +01:00
|
|
|
"$G_NEXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-256-GCM:+SHA384:+AEAD:+SIGN-ECDSA-SECP256R1-SHA256:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=4" \
|
2022-01-20 12:14:50 +01:00
|
|
|
0 \
|
2021-11-22 14:15:41 +01:00
|
|
|
-c "received HelloRetryRequest message" \
|
2022-01-27 04:48:27 +01:00
|
|
|
-c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \
|
2022-03-08 11:37:55 +01:00
|
|
|
-c "client state: MBEDTLS_SSL_CLIENT_HELLO" \
|
2022-03-18 14:04:12 +01:00
|
|
|
-c "Protocol is TLSv1.3" \
|
2022-01-20 12:14:50 +01:00
|
|
|
-c "HTTP/1.0 200 OK"
|
2021-12-09 10:39:19 +01:00
|
|
|
|
2022-02-17 08:51:12 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
2022-04-22 04:34:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_SRV_C
|
2022-02-17 08:51:12 +01:00
|
|
|
requires_openssl_tls1_3
|
2022-04-20 11:43:51 +02:00
|
|
|
run_test "TLS 1.3: Server side check - openssl" \
|
2022-04-07 13:31:38 +02:00
|
|
|
"$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \
|
2022-04-14 14:55:12 +02:00
|
|
|
"$O_NEXT_CLI -msg -debug -tls1_3" \
|
2022-02-17 08:51:12 +01:00
|
|
|
1 \
|
2022-04-14 12:36:14 +02:00
|
|
|
-s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
|
|
|
|
-s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
|
|
|
|
-s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
|
|
|
|
-s "SSL - The requested feature is not available" \
|
2022-02-17 08:51:12 +01:00
|
|
|
-s "=> parse client hello" \
|
|
|
|
-s "<= parse client hello"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
2022-04-22 04:34:40 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_SRV_C
|
2022-04-20 11:43:51 +02:00
|
|
|
run_test "TLS 1.3: Server side check - gnutls" \
|
2022-04-07 13:31:38 +02:00
|
|
|
"$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \
|
2022-04-19 08:36:17 +02:00
|
|
|
"$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \
|
2022-02-17 08:51:12 +01:00
|
|
|
1 \
|
2022-04-14 12:36:14 +02:00
|
|
|
-s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
|
|
|
|
-s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
|
|
|
|
-s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
|
|
|
|
-s "SSL - The requested feature is not available" \
|
2022-04-14 14:55:12 +02:00
|
|
|
-s "=> parse client hello" \
|
|
|
|
-s "<= parse client hello"
|
|
|
|
|
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_SRV_C
|
2022-04-22 16:27:33 +02:00
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2022-04-14 14:55:12 +02:00
|
|
|
run_test "TLS 1.3: Server side check - mbedtls" \
|
|
|
|
"$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \
|
|
|
|
"$P_CLI debug_level=4 force_version=tls13" \
|
|
|
|
1 \
|
|
|
|
-s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
|
|
|
|
-s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
|
|
|
|
-s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
|
|
|
|
-c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
|
|
|
|
-s "SSL - The requested feature is not available" \
|
2022-02-17 08:51:12 +01:00
|
|
|
-s "=> parse client hello" \
|
|
|
|
-s "<= parse client hello"
|
|
|
|
|
2022-01-07 15:46:12 +01:00
|
|
|
for i in opt-testcases/*.sh
|
2021-11-29 09:50:13 +01:00
|
|
|
do
|
2022-01-07 15:47:02 +01:00
|
|
|
TEST_SUITE_NAME=${i##*/}
|
|
|
|
TEST_SUITE_NAME=${TEST_SUITE_NAME%.*}
|
|
|
|
. "$i"
|
2021-11-29 09:50:13 +01:00
|
|
|
done
|
2022-01-07 15:47:02 +01:00
|
|
|
unset TEST_SUITE_NAME
|
2021-11-24 09:04:47 +01:00
|
|
|
|
2021-12-09 10:39:19 +01:00
|
|
|
requires_openssl_tls1_3
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-12-09 10:39:19 +01:00
|
|
|
requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-11-30 09:32:47 +01:00
|
|
|
run_test "TLS 1.3 m->O both peers do not support middlebox compatibility" \
|
2021-12-09 10:39:19 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3" \
|
2021-12-09 10:39:19 +01:00
|
|
|
0 \
|
2022-03-18 14:04:12 +01:00
|
|
|
-c "Protocol is TLSv1.3" \
|
2021-12-09 10:39:19 +01:00
|
|
|
-c "HTTP/1.0 200 ok"
|
|
|
|
|
|
|
|
requires_openssl_tls1_3
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-12-09 10:39:19 +01:00
|
|
|
requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
2021-11-30 09:16:24 +01:00
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
2021-11-30 09:32:47 +01:00
|
|
|
run_test "TLS 1.3 m->O server with middlebox compat support, not client" \
|
2021-12-09 10:39:19 +01:00
|
|
|
"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3" \
|
2021-12-09 10:39:19 +01:00
|
|
|
1 \
|
|
|
|
-c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode"
|
|
|
|
|
2021-11-30 09:32:47 +01:00
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
|
|
|
requires_gnutls_next_disable_tls13_compat
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-11-30 09:32:47 +01:00
|
|
|
requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \
|
|
|
|
"$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3" \
|
2021-11-30 09:32:47 +01:00
|
|
|
0 \
|
2022-03-18 14:04:12 +01:00
|
|
|
-c "Protocol is TLSv1.3" \
|
2021-11-30 09:32:47 +01:00
|
|
|
-c "HTTP/1.0 200 OK"
|
|
|
|
|
|
|
|
requires_gnutls_tls1_3
|
|
|
|
requires_gnutls_next_no_ticket
|
2021-12-08 16:57:54 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3
|
2021-11-30 09:32:47 +01:00
|
|
|
requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
|
|
|
requires_config_enabled MBEDTLS_DEBUG_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_CLI_C
|
|
|
|
run_test "TLS 1.3 m->G server with middlebox compat support, not client" \
|
|
|
|
"$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \
|
2022-03-18 14:04:12 +01:00
|
|
|
"$P_CLI debug_level=3" \
|
2021-11-30 09:32:47 +01:00
|
|
|
1 \
|
|
|
|
-c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode"
|
|
|
|
|
2019-11-26 16:32:40 +01:00
|
|
|
# Test heap memory usage after handshake
|
2021-12-23 11:02:22 +01:00
|
|
|
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
|
2019-11-26 16:32:40 +01:00
|
|
|
requires_config_enabled MBEDTLS_MEMORY_DEBUG
|
|
|
|
requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C
|
|
|
|
requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
2021-07-08 16:56:33 +02:00
|
|
|
requires_max_content_len 16384
|
2019-11-26 16:32:40 +01:00
|
|
|
run_tests_memory_after_hanshake
|
|
|
|
|
2014-02-21 12:12:23 +01:00
|
|
|
# Final report
|
|
|
|
|
2014-02-21 09:47:37 +01:00
|
|
|
echo "------------------------------------------------------------------------"
|
|
|
|
|
|
|
|
if [ $FAILS = 0 ]; then
|
2014-12-11 11:51:28 +01:00
|
|
|
printf "PASSED"
|
2014-02-21 09:47:37 +01:00
|
|
|
else
|
2014-12-11 11:51:28 +01:00
|
|
|
printf "FAILED"
|
2014-02-21 09:47:37 +01:00
|
|
|
fi
|
2014-08-31 10:22:11 +02:00
|
|
|
PASSES=$(( $TESTS - $FAILS ))
|
2014-08-14 14:31:29 +02:00
|
|
|
echo " ($PASSES / $TESTS tests ($SKIPS skipped))"
|
2014-02-21 09:47:37 +01:00
|
|
|
|
|
|
|
exit $FAILS
|