Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Dave Rodgman | 7ff7965 | 2023-11-03 12:04:52 +0000 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 7 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 8 | # Purpose |
| 9 | # |
| 10 | # Executes tests to prove various TLS/SSL options and extensions. |
| 11 | # |
| 12 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 13 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 14 | # (session resumption from cache or ticket, renego, etc). |
| 15 | # |
| 16 | # The tests assume a build with default options, with exceptions expressed |
| 17 | # with a dependency. The tests focus on functionality and do not consider |
| 18 | # performance. |
| 19 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 20 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 21 | set -u |
| 22 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 23 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 24 | # where it may output seemingly unlimited length error logs. |
| 25 | ulimit -f 20971520 |
| 26 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 27 | ORIGINAL_PWD=$PWD |
| 28 | if ! cd "$(dirname "$0")"; then |
| 29 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 30 | fi |
| 31 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 32 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 33 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 34 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 35 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | bbfa1d8 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 36 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | 89d4027 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 37 | : ${OPENSSL:=openssl} |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 38 | : ${GNUTLS_CLI:=gnutls-cli} |
| 39 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 40 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 41 | |
Manuel Pégourié-Gonnard | 89d4027 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 42 | # The OPENSSL variable used to be OPENSSL_CMD for historical reasons. |
| 43 | # To help the migration, error out if the old variable is set, |
| 44 | # but only if it has a different value than the new one. |
| 45 | if [ "${OPENSSL_CMD+set}" = set ]; then |
| 46 | # the variable is set, we can now check its value |
| 47 | if [ "$OPENSSL_CMD" != "$OPENSSL" ]; then |
| 48 | echo "Please use OPENSSL instead of OPENSSL_CMD." >&2 |
| 49 | exit 125 |
| 50 | fi |
| 51 | fi |
| 52 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 53 | guess_config_name() { |
| 54 | if git diff --quiet ../include/mbedtls/config.h 2>/dev/null; then |
| 55 | echo "default" |
| 56 | else |
| 57 | echo "unknown" |
| 58 | fi |
| 59 | } |
| 60 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 61 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 62 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 63 | |
Manuel Pégourié-Gonnard | 89d4027 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 64 | O_SRV="$OPENSSL s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 65 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 66 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 67 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 68 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 69 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 70 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 71 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 72 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 73 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 74 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 75 | else |
| 76 | O_NEXT_SRV=false |
| 77 | O_NEXT_CLI=false |
| 78 | fi |
| 79 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 80 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 81 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 82 | else |
| 83 | G_NEXT_SRV=false |
| 84 | fi |
| 85 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 86 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 87 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 88 | else |
| 89 | G_NEXT_CLI=false |
| 90 | fi |
| 91 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 92 | TESTS=0 |
| 93 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 94 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 95 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 96 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 97 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 98 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 99 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 100 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 101 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 102 | SHOW_TEST_NUMBER=0 |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 103 | LIST_TESTS=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 104 | RUN_TEST_NUMBER='' |
| 105 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 106 | PRESERVE_LOGS=0 |
| 107 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 108 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 109 | # port which is this plus 10000. Each port number may be independently |
| 110 | # overridden by a command line option. |
| 111 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 112 | PXY_PORT=$((SRV_PORT + 10000)) |
| 113 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 114 | print_usage() { |
| 115 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 116 | printf " -h|--help\tPrint this help.\n" |
| 117 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 118 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 119 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 120 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 121 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 122 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 123 | printf " --list-test-cases\tList all potential test cases (No Execution)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 124 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 125 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 126 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 127 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 128 | printf " --seed \tInteger seed value to use for this test run\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | get_options() { |
| 132 | while [ $# -gt 0 ]; do |
| 133 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 134 | -f|--filter) |
| 135 | shift; FILTER=$1 |
| 136 | ;; |
| 137 | -e|--exclude) |
| 138 | shift; EXCLUDE=$1 |
| 139 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 140 | -m|--memcheck) |
| 141 | MEMCHECK=1 |
| 142 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 143 | -n|--number) |
| 144 | shift; RUN_TEST_NUMBER=$1 |
| 145 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 146 | -s|--show-numbers) |
| 147 | SHOW_TEST_NUMBER=1 |
| 148 | ;; |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 149 | -l|--list-test-cases) |
| 150 | LIST_TESTS=1 |
| 151 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 152 | -p|--preserve-logs) |
| 153 | PRESERVE_LOGS=1 |
| 154 | ;; |
Yanray Wang | 5659981 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 155 | --outcome-file) |
| 156 | shift; MBEDTLS_TEST_OUTCOME_FILE=$1 |
| 157 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 158 | --port) |
| 159 | shift; SRV_PORT=$1 |
| 160 | ;; |
| 161 | --proxy-port) |
| 162 | shift; PXY_PORT=$1 |
| 163 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 164 | --seed) |
| 165 | shift; SEED="$1" |
| 166 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 167 | -h|--help) |
| 168 | print_usage |
| 169 | exit 0 |
| 170 | ;; |
| 171 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 172 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 173 | print_usage |
| 174 | exit 1 |
| 175 | ;; |
| 176 | esac |
| 177 | shift |
| 178 | done |
| 179 | } |
| 180 | |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 181 | get_options "$@" |
| 182 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 183 | # Read boolean configuration options from config.h for easy and quick |
| 184 | # testing. Skip non-boolean options (with something other than spaces |
| 185 | # and a comment after "#define SYMBOL"). The variable contains a |
| 186 | # space-separated list of symbols. |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 187 | if [ "$LIST_TESTS" -eq 0 ];then |
| 188 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
| 189 | else |
| 190 | P_QUERY=":" |
| 191 | CONFIGS_ENABLED="" |
| 192 | fi |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 193 | # Skip next test; use this macro to skip tests which are legitimate |
| 194 | # in theory and expected to be re-introduced at some point, but |
| 195 | # aren't expected to succeed at the moment due to problems outside |
| 196 | # our control (such as bugs in other TLS implementations). |
| 197 | skip_next_test() { |
| 198 | SKIP_NEXT="YES" |
| 199 | } |
| 200 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 201 | # skip next test if the flag is not enabled in config.h |
| 202 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 203 | case $CONFIGS_ENABLED in |
Jerry Yu | 969c01a | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 204 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 205 | *) SKIP_NEXT="YES";; |
| 206 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 207 | } |
| 208 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 209 | # skip next test if the flag is enabled in config.h |
| 210 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 211 | case $CONFIGS_ENABLED in |
Jerry Yu | 969c01a | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 212 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 213 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 214 | } |
| 215 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 216 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 217 | # This function uses the query_config command line option to query the |
| 218 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 219 | # program. The command will always return a success value if the |
| 220 | # configuration is defined and the value will be printed to stdout. |
| 221 | # |
| 222 | # Note that if the configuration is not defined or is defined to nothing, |
| 223 | # the output of this function will be an empty string. |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 224 | if [ "$LIST_TESTS" -eq 0 ];then |
| 225 | ${P_SRV} "query_config=${1}" |
| 226 | else |
| 227 | echo "1" |
| 228 | fi |
| 229 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 233 | VAL="$( get_config_value_or_default "$1" )" |
| 234 | if [ -z "$VAL" ]; then |
| 235 | # Should never happen |
| 236 | echo "Mbed TLS configuration $1 is not defined" |
| 237 | exit 1 |
| 238 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 239 | SKIP_NEXT="YES" |
| 240 | fi |
| 241 | } |
| 242 | |
| 243 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 244 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 245 | if [ -z "$VAL" ]; then |
| 246 | # Should never happen |
| 247 | echo "Mbed TLS configuration $1 is not defined" |
| 248 | exit 1 |
| 249 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 250 | SKIP_NEXT="YES" |
| 251 | fi |
| 252 | } |
| 253 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 254 | requires_config_value_equals() { |
| 255 | VAL=$( get_config_value_or_default "$1" ) |
| 256 | if [ -z "$VAL" ]; then |
| 257 | # Should never happen |
| 258 | echo "Mbed TLS configuration $1 is not defined" |
| 259 | exit 1 |
| 260 | elif [ "$VAL" -ne "$2" ]; then |
| 261 | SKIP_NEXT="YES" |
| 262 | fi |
| 263 | } |
| 264 | |
Gilles Peskine | 4b137d1 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 265 | # Require Mbed TLS to support the given protocol version. |
| 266 | # |
| 267 | # Inputs: |
| 268 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 269 | requires_protocol_version() { |
| 270 | # Support for DTLS is detected separately in detect_dtls(). |
| 271 | case "$1" in |
| 272 | ssl3) requires_config_enabled MBEDTLS_SSL_PROTO_SSL3;; |
| 273 | tls1) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1;; |
| 274 | tls1_1|dtls1) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1;; |
| 275 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 276 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 277 | esac |
| 278 | } |
| 279 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 280 | # Space-separated list of ciphersuites supported by this build of |
| 281 | # Mbed TLS. |
Ronald Cron | 46a660a | 2023-11-23 17:20:19 +0100 | [diff] [blame^] | 282 | P_CIPHERSUITES=" $($P_CLI help_ciphersuites 2>/dev/null | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 283 | grep TLS- | |
| 284 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 285 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 286 | case $P_CIPHERSUITES in |
| 287 | *" $1 "*) :;; |
| 288 | *) SKIP_NEXT="YES";; |
| 289 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 290 | } |
| 291 | |
Gilles Peskine | 511fdf4 | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 292 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 293 | # If CMD (call to a TLS client or server program) requires certain features, |
| 294 | # arrange to only run the following test case if those features are enabled. |
| 295 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 296 | case "$1" in |
Gilles Peskine | 4b137d1 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 297 | *\ force_version=*) |
| 298 | tmp="${1##*\ force_version=}" |
| 299 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 300 | requires_protocol_version "$tmp";; |
| 301 | esac |
| 302 | |
| 303 | case "$1" in |
Gilles Peskine | 511fdf4 | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 304 | *\ force_ciphersuite=*) |
| 305 | tmp="${1##*\ force_ciphersuite=}" |
| 306 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 307 | case "$*" in |
| 308 | *"-s SSL - The server has no ciphersuites in common"*) |
| 309 | # This test case expects a ciphersuite mismatch, so it |
| 310 | # doesn't actually require the ciphersuite to be enabled. |
| 311 | :;; |
| 312 | *) requires_ciphersuite_enabled "$tmp";; |
| 313 | esac;; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 314 | esac |
| 315 | |
Gilles Peskine | 3c985f6 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 316 | case " $1 " in |
| 317 | *[-_\ =]tickets=[^0]*) |
| 318 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 319 | esac |
| 320 | case " $1 " in |
| 321 | *[-_\ =]alpn=*) |
| 322 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 323 | esac |
| 324 | |
Gilles Peskine | bba3b4c | 2022-04-09 00:08:47 +0200 | [diff] [blame] | 325 | case " $1 " in |
Gilles Peskine | 6e257b0 | 2022-04-13 14:19:57 +0200 | [diff] [blame] | 326 | *\ badmac_limit=*) |
| 327 | requires_config_enabled MBEDTLS_SSL_DTLS_BADMAC_LIMIT;; |
| 328 | esac |
| 329 | |
| 330 | case " $1 " in |
Gilles Peskine | bba3b4c | 2022-04-09 00:08:47 +0200 | [diff] [blame] | 331 | *\ fallback=1\ *|*\ -fallback_scsv\ *) |
| 332 | requires_config_enabled MBEDTLS_SSL_FALLBACK_SCSV;; |
| 333 | esac |
| 334 | |
Gilles Peskine | 511fdf4 | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 335 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 336 | } |
| 337 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 338 | requires_certificate_authentication () { |
| 339 | if [ "$PSK_ONLY" = "YES" ]; then |
| 340 | SKIP_NEXT="YES" |
| 341 | fi |
| 342 | } |
| 343 | |
Gilles Peskine | 89d892f | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 344 | adapt_cmd_for_psk () { |
| 345 | case "$2" in |
| 346 | *openssl*) s='-psk abc123 -nocert';; |
| 347 | *gnutls-*) s='--pskkey=abc123';; |
| 348 | *) s='psk=abc123';; |
| 349 | esac |
| 350 | eval $1='"$2 $s"' |
| 351 | unset s |
| 352 | } |
| 353 | |
| 354 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 355 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 356 | # |
| 357 | # If not running in a PSK-only build, do nothing. |
| 358 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 359 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 360 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 361 | # a pre-shared key, do nothing. |
| 362 | # |
Gilles Peskine | d5b1a30 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 363 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 89d892f | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 364 | # |
| 365 | # Inputs: |
| 366 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 367 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 368 | # * "$@": options passed to run_test. |
| 369 | # |
| 370 | # Outputs: |
| 371 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 372 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 373 | maybe_adapt_for_psk() { |
| 374 | if [ "$PSK_ONLY" != "YES" ]; then |
| 375 | return |
| 376 | fi |
| 377 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 378 | return |
| 379 | fi |
| 380 | case "$CLI_CMD $SRV_CMD" in |
| 381 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 382 | return;; |
| 383 | *force_ciphersuite*) |
| 384 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 385 | # PSK cipher suite could be substituted, but we're not ready for |
| 386 | # that yet. |
| 387 | SKIP_NEXT="YES" |
| 388 | return;; |
| 389 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 390 | # The test case involves certificates. PSK won't do. |
| 391 | SKIP_NEXT="YES" |
| 392 | return;; |
| 393 | esac |
| 394 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 395 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 396 | } |
| 397 | |
| 398 | case " $CONFIGS_ENABLED " in |
| 399 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 400 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 401 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 402 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 403 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 404 | *) PSK_ONLY="NO";; |
| 405 | esac |
| 406 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 407 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 408 | requires_openssl_with_fallback_scsv() { |
| 409 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | 89d4027 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 410 | if $OPENSSL s_client -help 2>&1 | grep fallback_scsv >/dev/null |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 411 | then |
| 412 | OPENSSL_HAS_FBSCSV="YES" |
| 413 | else |
| 414 | OPENSSL_HAS_FBSCSV="NO" |
| 415 | fi |
| 416 | fi |
| 417 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 418 | SKIP_NEXT="YES" |
| 419 | fi |
| 420 | } |
| 421 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 422 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 423 | requires_max_content_len() { |
| 424 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 425 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 426 | } |
| 427 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 428 | # skip next test if GnuTLS isn't available |
| 429 | requires_gnutls() { |
| 430 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 431 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 432 | GNUTLS_AVAILABLE="YES" |
| 433 | else |
| 434 | GNUTLS_AVAILABLE="NO" |
| 435 | fi |
| 436 | fi |
| 437 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 438 | SKIP_NEXT="YES" |
| 439 | fi |
| 440 | } |
| 441 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 442 | # skip next test if GnuTLS-next isn't available |
| 443 | requires_gnutls_next() { |
| 444 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 445 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 446 | GNUTLS_NEXT_AVAILABLE="YES" |
| 447 | else |
| 448 | GNUTLS_NEXT_AVAILABLE="NO" |
| 449 | fi |
| 450 | fi |
| 451 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 452 | SKIP_NEXT="YES" |
| 453 | fi |
| 454 | } |
| 455 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 456 | requires_openssl_next() { |
| 457 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 458 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 459 | OPENSSL_NEXT_AVAILABLE="YES" |
| 460 | else |
| 461 | OPENSSL_NEXT_AVAILABLE="NO" |
| 462 | fi |
| 463 | fi |
| 464 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 465 | SKIP_NEXT="YES" |
| 466 | fi |
| 467 | } |
| 468 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 469 | # skip next test if IPv6 isn't available on this host |
| 470 | requires_ipv6() { |
| 471 | if [ -z "${HAS_IPV6:-}" ]; then |
| 472 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 473 | SRV_PID=$! |
| 474 | sleep 1 |
| 475 | kill $SRV_PID >/dev/null 2>&1 |
| 476 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 477 | HAS_IPV6="NO" |
| 478 | else |
| 479 | HAS_IPV6="YES" |
| 480 | fi |
| 481 | rm -r $SRV_OUT |
| 482 | fi |
| 483 | |
| 484 | if [ "$HAS_IPV6" = "NO" ]; then |
| 485 | SKIP_NEXT="YES" |
| 486 | fi |
| 487 | } |
| 488 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 489 | # skip next test if it's i686 or uname is not available |
| 490 | requires_not_i686() { |
| 491 | if [ -z "${IS_I686:-}" ]; then |
| 492 | IS_I686="YES" |
| 493 | if which "uname" >/dev/null 2>&1; then |
| 494 | if [ -z "$(uname -a | grep i686)" ]; then |
| 495 | IS_I686="NO" |
| 496 | fi |
| 497 | fi |
| 498 | fi |
| 499 | if [ "$IS_I686" = "YES" ]; then |
| 500 | SKIP_NEXT="YES" |
| 501 | fi |
| 502 | } |
| 503 | |
Yuto Takano | ab9e4333 | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 504 | MAX_CONTENT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_MAX_CONTENT_LEN" ) |
| 505 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 506 | MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" ) |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 507 | if [ "$LIST_TESTS" -eq 0 ];then |
| 508 | # Calculate the input & output maximum content lengths set in the config |
| 509 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 510 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 511 | fi |
| 512 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 513 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 514 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 515 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 516 | # skip the next test if the SSL output buffer is less than 16KB |
| 517 | requires_full_size_output_buffer() { |
| 518 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 519 | SKIP_NEXT="YES" |
| 520 | fi |
| 521 | } |
| 522 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 523 | # skip the next test if valgrind is in use |
| 524 | not_with_valgrind() { |
| 525 | if [ "$MEMCHECK" -gt 0 ]; then |
| 526 | SKIP_NEXT="YES" |
| 527 | fi |
| 528 | } |
| 529 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 530 | # skip the next test if valgrind is NOT in use |
| 531 | only_with_valgrind() { |
| 532 | if [ "$MEMCHECK" -eq 0 ]; then |
| 533 | SKIP_NEXT="YES" |
| 534 | fi |
| 535 | } |
| 536 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 537 | # multiply the client timeout delay by the given factor for the next test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 538 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 539 | CLI_DELAY_FACTOR=$1 |
| 540 | } |
| 541 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 542 | # wait for the given seconds after the client finished in the next test |
| 543 | server_needs_more_time() { |
| 544 | SRV_DELAY_SECONDS=$1 |
| 545 | } |
| 546 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 547 | # print_name <name> |
| 548 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 549 | TESTS=$(( $TESTS + 1 )) |
| 550 | LINE="" |
| 551 | |
| 552 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 553 | LINE="$TESTS " |
| 554 | fi |
| 555 | |
| 556 | LINE="$LINE$1" |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 557 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 558 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 559 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 560 | for i in `seq 1 $LEN`; do printf '.'; done |
| 561 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 562 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 563 | } |
| 564 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 565 | # record_outcome <outcome> [<failure-reason>] |
| 566 | # The test name must be in $NAME. |
| 567 | record_outcome() { |
| 568 | echo "$1" |
| 569 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 570 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 571 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 572 | "ssl-opt" "$NAME" \ |
| 573 | "$1" "${2-}" \ |
| 574 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 575 | fi |
| 576 | } |
| 577 | |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 578 | # True if the presence of the given pattern in a log definitely indicates |
| 579 | # that the test has failed. False if the presence is inconclusive. |
| 580 | # |
| 581 | # Inputs: |
| 582 | # * $1: pattern found in the logs |
| 583 | # * $TIMES_LEFT: >0 if retrying is an option |
| 584 | # |
| 585 | # Outputs: |
| 586 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 587 | # unchanged otherwise. |
| 588 | # * Return value: 1 if the pattern is inconclusive, |
| 589 | # 0 if the failure is definitive. |
| 590 | log_pattern_presence_is_conclusive() { |
| 591 | # If we've run out of attempts, then don't retry no matter what. |
| 592 | if [ $TIMES_LEFT -eq 0 ]; then |
| 593 | return 0 |
| 594 | fi |
| 595 | case $1 in |
| 596 | "resend") |
| 597 | # An undesired resend may have been caused by the OS dropping or |
| 598 | # delaying a packet at an inopportune time. |
| 599 | outcome="RETRY(resend)" |
| 600 | return 1;; |
| 601 | esac |
| 602 | } |
| 603 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 604 | # fail <message> |
| 605 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 606 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 607 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 608 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 609 | mv $SRV_OUT o-srv-${TESTS}.log |
| 610 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 611 | if [ -n "$PXY_CMD" ]; then |
| 612 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 613 | fi |
| 614 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 615 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 616 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 617 | echo " ! server output:" |
| 618 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 619 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 620 | echo " ! client output:" |
| 621 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 622 | if [ -n "$PXY_CMD" ]; then |
| 623 | echo " ! ========================================================" |
| 624 | echo " ! proxy output:" |
| 625 | cat o-pxy-${TESTS}.log |
| 626 | fi |
| 627 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 628 | fi |
| 629 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 630 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 631 | } |
| 632 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 633 | # is_polar <cmd_line> |
| 634 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 635 | case "$1" in |
| 636 | *ssl_client2*) true;; |
| 637 | *ssl_server2*) true;; |
| 638 | *) false;; |
| 639 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 640 | } |
| 641 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 642 | # openssl s_server doesn't have -www with DTLS |
| 643 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 644 | case "$SRV_CMD" in |
| 645 | *s_server*-dtls*) |
| 646 | NEEDS_INPUT=1 |
| 647 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 648 | *) NEEDS_INPUT=0;; |
| 649 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 650 | } |
| 651 | |
| 652 | # provide input to commands that need it |
| 653 | provide_input() { |
| 654 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 655 | return |
| 656 | fi |
| 657 | |
| 658 | while true; do |
| 659 | echo "HTTP/1.0 200 OK" |
| 660 | sleep 1 |
| 661 | done |
| 662 | } |
| 663 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 664 | # has_mem_err <log_file_name> |
| 665 | has_mem_err() { |
| 666 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 667 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 668 | then |
| 669 | return 1 # false: does not have errors |
| 670 | else |
| 671 | return 0 # true: has errors |
| 672 | fi |
| 673 | } |
| 674 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 675 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 676 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 677 | wait_app_start() { |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 678 | newline=' |
| 679 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 680 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 681 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 682 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 683 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 684 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 685 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 686 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 6cd97ce | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 687 | while true; do |
Gilles Peskine | 36019d5 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 688 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 689 | # When we use a proxy, it will be listening on the same port we |
| 690 | # are checking for as well as the server and lsof will list both. |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 691 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 36019d5 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 692 | *${newline}${2}${newline}*) break;; |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 693 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 694 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 695 | echo "$3 START TIMEOUT" |
| 696 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 697 | break |
| 698 | fi |
| 699 | # Linux and *BSD support decimal arguments to sleep. On other |
| 700 | # OSes this may be a tight loop. |
| 701 | sleep 0.1 2>/dev/null || true |
| 702 | done |
| 703 | } |
| 704 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 705 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 706 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 707 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 708 | } |
| 709 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 710 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 711 | # Wait for server process $2 to be listening on port $1. |
| 712 | wait_server_start() { |
| 713 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 714 | } |
| 715 | |
| 716 | # Wait for proxy process $2 to be listening on port $1. |
| 717 | wait_proxy_start() { |
| 718 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 719 | } |
| 720 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 721 | # Given the client or server debug output, parse the unix timestamp that is |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 722 | # included in the first 4 bytes of the random bytes and check that it's within |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 723 | # acceptable bounds |
| 724 | check_server_hello_time() { |
| 725 | # Extract the time from the debug (lvl 3) output of the client |
Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 726 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 727 | # Get the Unix timestamp for now |
| 728 | CUR_TIME=$(date +'%s') |
| 729 | THRESHOLD_IN_SECS=300 |
| 730 | |
| 731 | # Check if the ServerHello time was printed |
| 732 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 733 | return 1 |
| 734 | fi |
| 735 | |
| 736 | # Check the time in ServerHello is within acceptable bounds |
| 737 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 738 | # The time in ServerHello is at least 5 minutes before now |
| 739 | return 1 |
| 740 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 741 | # The time in ServerHello is at least 5 minutes later than now |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 742 | return 1 |
| 743 | else |
| 744 | return 0 |
| 745 | fi |
| 746 | } |
| 747 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 748 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 749 | handshake_memory_get() { |
| 750 | OUTPUT_VARIABLE="$1" |
| 751 | OUTPUT_FILE="$2" |
| 752 | |
| 753 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 754 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 755 | |
| 756 | # Check if memory usage was read |
| 757 | if [ -z "$MEM_USAGE" ]; then |
| 758 | echo "Error: Can not read the value of handshake memory usage" |
| 759 | return 1 |
| 760 | else |
| 761 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 762 | return 0 |
| 763 | fi |
| 764 | } |
| 765 | |
| 766 | # Get handshake memory usage from server or client output and check if this value |
| 767 | # is not higher than the maximum given by the first argument |
| 768 | handshake_memory_check() { |
| 769 | MAX_MEMORY="$1" |
| 770 | OUTPUT_FILE="$2" |
| 771 | |
| 772 | # Get memory usage |
| 773 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 774 | return 1 |
| 775 | fi |
| 776 | |
| 777 | # Check if memory usage is below max value |
| 778 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 779 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 780 | "but should be below $MAX_MEMORY bytes" |
| 781 | return 1 |
| 782 | else |
| 783 | return 0 |
| 784 | fi |
| 785 | } |
| 786 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 787 | # wait for client to terminate and set CLI_EXIT |
| 788 | # must be called right after starting the client |
| 789 | wait_client_done() { |
| 790 | CLI_PID=$! |
| 791 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 792 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 793 | CLI_DELAY_FACTOR=1 |
| 794 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 795 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 796 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 797 | |
| 798 | wait $CLI_PID |
| 799 | CLI_EXIT=$? |
| 800 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 801 | kill $DOG_PID >/dev/null 2>&1 |
| 802 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 803 | |
| 804 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 805 | |
| 806 | sleep $SRV_DELAY_SECONDS |
| 807 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 808 | } |
| 809 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 810 | # check if the given command uses dtls and sets global variable DTLS |
| 811 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 812 | case "$1" in |
Paul Elliott | 405fccc | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 813 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 814 | *) DTLS=0;; |
| 815 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 816 | } |
| 817 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 818 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 819 | is_gnutls() { |
| 820 | case "$1" in |
| 821 | *gnutls-cli*) |
| 822 | CMD_IS_GNUTLS=1 |
| 823 | ;; |
| 824 | *gnutls-serv*) |
| 825 | CMD_IS_GNUTLS=1 |
| 826 | ;; |
| 827 | *) |
| 828 | CMD_IS_GNUTLS=0 |
| 829 | ;; |
| 830 | esac |
| 831 | } |
| 832 | |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 833 | # Determine what calc_verify trace is to be expected, if any. |
| 834 | # |
| 835 | # calc_verify is only called for two things: to calculate the |
| 836 | # extended master secret, and to process client authentication. |
| 837 | # |
| 838 | # Warning: the current implementation assumes that extended_ms is not |
| 839 | # disabled on the client or on the server. |
| 840 | # |
| 841 | # Inputs: |
Gilles Peskine | f2e1f47 | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 842 | # * $1: the value of the server auth_mode parameter. |
| 843 | # 'required' if client authentication is expected, |
| 844 | # 'none' or absent if not. |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 845 | # * $CONFIGS_ENABLED |
| 846 | # |
| 847 | # Outputs: |
| 848 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 849 | set_maybe_calc_verify() { |
| 850 | maybe_calc_verify= |
| 851 | case $CONFIGS_ENABLED in |
| 852 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 853 | *) |
| 854 | case ${1-} in |
Gilles Peskine | f2e1f47 | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 855 | ''|none) return;; |
| 856 | required) :;; |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 857 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 858 | esac |
| 859 | esac |
| 860 | case $CONFIGS_ENABLED in |
| 861 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 862 | *) maybe_calc_verify="<= calc verify";; |
| 863 | esac |
| 864 | } |
| 865 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 866 | # Compare file content |
| 867 | # Usage: find_in_both pattern file1 file2 |
| 868 | # extract from file1 the first line matching the pattern |
| 869 | # check in file2 that the same line can be found |
| 870 | find_in_both() { |
| 871 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 872 | if [ -z "$srv_pattern" ]; then |
| 873 | return 1; |
| 874 | fi |
| 875 | |
| 876 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 877 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 878 | else |
| 879 | return 1; |
| 880 | fi |
| 881 | } |
| 882 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 883 | # Analyze the commands that will be used in a test. |
| 884 | # |
| 885 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 886 | # extra arguments or go through wrappers. |
Gilles Peskine | d5b1a30 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 887 | # |
| 888 | # Inputs: |
| 889 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 890 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 891 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 892 | # |
| 893 | # Outputs: |
| 894 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 895 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 896 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 897 | # as it provides timing info that's useful to debug failures |
Manuel Pégourié-Gonnard | 70fce98 | 2020-06-25 09:54:46 +0200 | [diff] [blame] | 898 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 899 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 900 | case " $SRV_CMD " in |
| 901 | *' server_addr=::1 '*) |
| 902 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 903 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 904 | fi |
| 905 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 906 | # update CMD_IS_GNUTLS variable |
| 907 | is_gnutls "$SRV_CMD" |
| 908 | |
| 909 | # if the server uses gnutls but doesn't set priority, explicitly |
| 910 | # set the default priority |
| 911 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 912 | case "$SRV_CMD" in |
| 913 | *--priority*) :;; |
| 914 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 915 | esac |
| 916 | fi |
| 917 | |
| 918 | # update CMD_IS_GNUTLS variable |
| 919 | is_gnutls "$CLI_CMD" |
| 920 | |
| 921 | # if the client uses gnutls but doesn't set priority, explicitly |
| 922 | # set the default priority |
| 923 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 924 | case "$CLI_CMD" in |
| 925 | *--priority*) :;; |
| 926 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 927 | esac |
| 928 | fi |
| 929 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 930 | # fix client port |
| 931 | if [ -n "$PXY_CMD" ]; then |
| 932 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 933 | else |
| 934 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 935 | fi |
| 936 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 937 | # prepend valgrind to our commands if active |
| 938 | if [ "$MEMCHECK" -gt 0 ]; then |
| 939 | if is_polar "$SRV_CMD"; then |
| 940 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 941 | fi |
| 942 | if is_polar "$CLI_CMD"; then |
| 943 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 944 | fi |
| 945 | fi |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 946 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 947 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 948 | # Check for failure conditions after a test case. |
| 949 | # |
| 950 | # Inputs from run_test: |
| 951 | # * positional parameters: test options (see run_test documentation) |
| 952 | # * $CLI_EXIT: client return code |
| 953 | # * $CLI_EXPECT: expected client return code |
| 954 | # * $SRV_RET: server return code |
| 955 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 956 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 957 | # |
| 958 | # Outputs: |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 959 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 960 | check_test_failure() { |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 961 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 962 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 963 | if [ $TIMES_LEFT -gt 0 ] && |
| 964 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 965 | then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 966 | outcome="RETRY(client-timeout)" |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 967 | return |
| 968 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 969 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 970 | # check if the client and server went at least to the handshake stage |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 971 | # (useful to avoid tests with only negative assertions and non-zero |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 972 | # expected client exit to incorrectly succeed in case of catastrophic |
| 973 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 974 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 975 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 976 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 977 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 978 | return |
| 979 | fi |
| 980 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 981 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 982 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 983 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 984 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 985 | return |
| 986 | fi |
| 987 | fi |
| 988 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 989 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 990 | # exit with status 0 when interrupted by a signal, and we don't really |
| 991 | # care anyway), in case e.g. the server reports a memory leak. |
| 992 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 993 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 994 | return |
| 995 | fi |
| 996 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 997 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 998 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 999 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1000 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1001 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1002 | return |
| 1003 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1004 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1005 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1006 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1007 | # lines with 'Serious error when reading debug info', are valgrind issues as well |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1008 | while [ $# -gt 0 ] |
| 1009 | do |
| 1010 | case $1 in |
| 1011 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1012 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1013 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1014 | return |
| 1015 | fi |
| 1016 | ;; |
| 1017 | |
| 1018 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1019 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1020 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1021 | return |
| 1022 | fi |
| 1023 | ;; |
| 1024 | |
| 1025 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1026 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1027 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1028 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1029 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1030 | return |
| 1031 | fi |
| 1032 | ;; |
| 1033 | |
| 1034 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1035 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1036 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1037 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1038 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1039 | return |
| 1040 | fi |
| 1041 | ;; |
| 1042 | |
| 1043 | # The filtering in the following two options (-u and -U) do the following |
| 1044 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1045 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1046 | # - keep one of each non-unique line |
| 1047 | # - count how many lines remain |
| 1048 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1049 | # if there were no duplicates. |
| 1050 | "-U") |
| 1051 | 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 |
| 1052 | fail "lines following pattern '$2' must be unique in Server output" |
| 1053 | return |
| 1054 | fi |
| 1055 | ;; |
| 1056 | |
| 1057 | "-u") |
| 1058 | 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 |
| 1059 | fail "lines following pattern '$2' must be unique in Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1060 | return |
| 1061 | fi |
| 1062 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1063 | "-F") |
| 1064 | if ! $2 "$SRV_OUT"; then |
| 1065 | fail "function call to '$2' failed on Server output" |
| 1066 | return |
| 1067 | fi |
| 1068 | ;; |
| 1069 | "-f") |
| 1070 | if ! $2 "$CLI_OUT"; then |
| 1071 | fail "function call to '$2' failed on Client output" |
| 1072 | return |
| 1073 | fi |
| 1074 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1075 | "-g") |
| 1076 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1077 | fail "function call to '$2' failed on Server and Client output" |
| 1078 | return |
| 1079 | fi |
| 1080 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1081 | |
| 1082 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1083 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1084 | exit 1 |
| 1085 | esac |
| 1086 | shift 2 |
| 1087 | done |
| 1088 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1089 | # check valgrind's results |
| 1090 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1091 | if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1092 | fail "Server has memory errors" |
| 1093 | return |
| 1094 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1095 | if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1096 | fail "Client has memory errors" |
| 1097 | return |
| 1098 | fi |
| 1099 | fi |
| 1100 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1101 | # if we're here, everything is ok |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1102 | outcome=PASS |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1103 | } |
| 1104 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1105 | # Run the current test case: start the server and if applicable the proxy, run |
| 1106 | # the client, wait for all processes to finish or time out. |
| 1107 | # |
| 1108 | # Inputs: |
| 1109 | # * $NAME: test case name |
| 1110 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1111 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1112 | # |
| 1113 | # Outputs: |
| 1114 | # * $CLI_EXIT: client return code |
| 1115 | # * $SRV_RET: server return code |
| 1116 | do_run_test_once() { |
| 1117 | # run the commands |
| 1118 | if [ -n "$PXY_CMD" ]; then |
| 1119 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1120 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1121 | PXY_PID=$! |
| 1122 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1123 | fi |
| 1124 | |
| 1125 | check_osrv_dtls |
| 1126 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1127 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1128 | SRV_PID=$! |
| 1129 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1130 | |
| 1131 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | d27cdcc | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1132 | # The client must be a subprocess of the script in order for killing it to |
| 1133 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1134 | # not at the end of the line: the latter approach will spawn eval as a |
| 1135 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1136 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1137 | wait_client_done |
| 1138 | |
| 1139 | sleep 0.05 |
| 1140 | |
| 1141 | # terminate the server (and the proxy) |
| 1142 | kill $SRV_PID |
| 1143 | wait $SRV_PID |
| 1144 | SRV_RET=$? |
| 1145 | |
| 1146 | if [ -n "$PXY_CMD" ]; then |
| 1147 | kill $PXY_PID >/dev/null 2>&1 |
| 1148 | wait $PXY_PID |
| 1149 | fi |
| 1150 | } |
| 1151 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1152 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1153 | # Options: -s pattern pattern that must be present in server output |
| 1154 | # -c pattern pattern that must be present in client output |
| 1155 | # -u pattern lines after pattern must be unique in client output |
| 1156 | # -f call shell function on client output |
| 1157 | # -S pattern pattern that must be absent in server output |
| 1158 | # -C pattern pattern that must be absent in client output |
| 1159 | # -U pattern lines after pattern must be unique in server output |
| 1160 | # -F call shell function on server output |
| 1161 | # -g call shell function on server and client output |
| 1162 | run_test() { |
| 1163 | NAME="$1" |
| 1164 | shift 1 |
| 1165 | |
| 1166 | if is_excluded "$NAME"; then |
| 1167 | SKIP_NEXT="NO" |
| 1168 | # There was no request to run the test, so don't record its outcome. |
| 1169 | return |
| 1170 | fi |
| 1171 | |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 1172 | if [ "$LIST_TESTS" -gt 0 ]; then |
| 1173 | printf "%s\n" "$NAME" |
| 1174 | return |
| 1175 | fi |
| 1176 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1177 | print_name "$NAME" |
| 1178 | |
| 1179 | # Do we only run numbered tests? |
| 1180 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1181 | case ",$RUN_TEST_NUMBER," in |
| 1182 | *",$TESTS,"*) :;; |
| 1183 | *) SKIP_NEXT="YES";; |
| 1184 | esac |
| 1185 | fi |
| 1186 | |
| 1187 | # does this test use a proxy? |
| 1188 | if [ "X$1" = "X-p" ]; then |
| 1189 | PXY_CMD="$2" |
| 1190 | shift 2 |
| 1191 | else |
| 1192 | PXY_CMD="" |
| 1193 | fi |
| 1194 | |
| 1195 | # get commands and client output |
| 1196 | SRV_CMD="$1" |
| 1197 | CLI_CMD="$2" |
| 1198 | CLI_EXPECT="$3" |
| 1199 | shift 3 |
| 1200 | |
| 1201 | # Check if test uses files |
| 1202 | case "$SRV_CMD $CLI_CMD" in |
| 1203 | *data_files/*) |
| 1204 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1205 | esac |
| 1206 | |
Gilles Peskine | e5f4958 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1207 | # Check if the test uses DTLS. |
| 1208 | detect_dtls "$SRV_CMD" |
| 1209 | if [ "$DTLS" -eq 1 ]; then |
| 1210 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1211 | fi |
| 1212 | |
Gilles Peskine | 511fdf4 | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1213 | # If the client or server requires certain features that can be detected |
| 1214 | # from their command-line arguments, check that they're enabled. |
| 1215 | detect_required_features "$SRV_CMD" "$@" |
| 1216 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1217 | |
Gilles Peskine | 89d892f | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1218 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1219 | maybe_adapt_for_psk "$@" |
| 1220 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1221 | # should we skip? |
| 1222 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1223 | SKIP_NEXT="NO" |
| 1224 | record_outcome "SKIP" |
| 1225 | SKIPS=$(( $SKIPS + 1 )) |
| 1226 | return |
| 1227 | fi |
| 1228 | |
| 1229 | analyze_test_commands "$@" |
| 1230 | |
Andrzej Kurek | 363553b | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1231 | # One regular run and two retries |
| 1232 | TIMES_LEFT=3 |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1233 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1234 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1235 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1236 | do_run_test_once |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1237 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1238 | check_test_failure "$@" |
| 1239 | case $outcome in |
| 1240 | PASS) break;; |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1241 | RETRY*) printf "$outcome ";; |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1242 | FAIL) return;; |
| 1243 | esac |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1244 | done |
| 1245 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1246 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1247 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1248 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1249 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1250 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1251 | if [ -n "$PXY_CMD" ]; then |
| 1252 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1253 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1254 | fi |
| 1255 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1256 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1257 | } |
| 1258 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1259 | run_test_psa() { |
| 1260 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1261 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1262 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1263 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1264 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1265 | 0 \ |
| 1266 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1267 | -c "Successfully setup PSA-based encryption cipher context" \ |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1268 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1269 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1270 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1271 | -s "Successfully setup PSA-based encryption cipher context" \ |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1272 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1273 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1274 | -C "Failed to setup PSA-based cipher context"\ |
| 1275 | -S "Failed to setup PSA-based cipher context"\ |
| 1276 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1277 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1278 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1279 | -S "error" \ |
| 1280 | -C "error" |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1281 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1282 | } |
| 1283 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1284 | run_test_psa_force_curve() { |
| 1285 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1286 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1287 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1288 | "$P_SRV debug_level=4 force_version=tls12" \ |
| 1289 | "$P_CLI debug_level=4 force_version=tls12 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1290 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1291 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1292 | -c "Successfully setup PSA-based encryption cipher context" \ |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1293 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1294 | -c "calc PSA finished" \ |
| 1295 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1296 | -s "Successfully setup PSA-based encryption cipher context" \ |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1297 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1298 | -s "calc PSA finished" \ |
| 1299 | -C "Failed to setup PSA-based cipher context"\ |
| 1300 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1301 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1302 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1303 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1304 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1305 | -C "error" |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1306 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1307 | } |
| 1308 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1309 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1310 | # a maximum fragment length. |
| 1311 | # first argument ($1) is MFL for SSL client |
| 1312 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1313 | run_test_memory_after_hanshake_with_mfl() |
| 1314 | { |
| 1315 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1316 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1317 | |
| 1318 | # Leave some margin for robustness |
| 1319 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1320 | |
| 1321 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1322 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1323 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1324 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1325 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1326 | 0 \ |
| 1327 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1328 | } |
| 1329 | |
| 1330 | |
| 1331 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1332 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1333 | run_tests_memory_after_hanshake() |
| 1334 | { |
| 1335 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1336 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1337 | |
| 1338 | # first test with default MFU is to get reference memory usage |
| 1339 | MEMORY_USAGE_MFL_16K=0 |
| 1340 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1341 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1342 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1343 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1344 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1345 | 0 \ |
| 1346 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1347 | |
| 1348 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1349 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1350 | |
| 1351 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1352 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1353 | |
| 1354 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1355 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1356 | |
| 1357 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1358 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1359 | } |
| 1360 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1361 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1362 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1363 | rm -f context_srv.txt |
| 1364 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1365 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1366 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1367 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1368 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1369 | exit 1 |
| 1370 | } |
| 1371 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1372 | # |
| 1373 | # MAIN |
| 1374 | # |
| 1375 | |
Yanray Wang | 5659981 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1376 | # Make the outcome file path relative to the original directory, not |
| 1377 | # to .../tests |
| 1378 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1379 | [!/]*) |
| 1380 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1381 | ;; |
| 1382 | esac |
| 1383 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1384 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1385 | # patterns rather than regular expressions, use a case statement instead |
| 1386 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1387 | # detects simple cases: plain substring, everything, nothing. |
| 1388 | # |
| 1389 | # As an exception, the character '.' is treated as an ordinary character |
| 1390 | # if it is the only special character in the string. This is because it's |
| 1391 | # rare to need "any one character", but needing a literal '.' is common |
| 1392 | # (e.g. '-f "DTLS 1.2"'). |
| 1393 | need_grep= |
| 1394 | case "$FILTER" in |
| 1395 | '^$') simple_filter=;; |
| 1396 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1397 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1398 | need_grep=1;; |
| 1399 | *) # No regexp or shell-pattern special character |
| 1400 | simple_filter="*$FILTER*";; |
| 1401 | esac |
| 1402 | case "$EXCLUDE" in |
| 1403 | '^$') simple_exclude=;; |
| 1404 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1405 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1406 | need_grep=1;; |
| 1407 | *) # No regexp or shell-pattern special character |
| 1408 | simple_exclude="*$EXCLUDE*";; |
| 1409 | esac |
| 1410 | if [ -n "$need_grep" ]; then |
| 1411 | is_excluded () { |
| 1412 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1413 | } |
| 1414 | else |
| 1415 | is_excluded () { |
| 1416 | case "$1" in |
| 1417 | $simple_exclude) true;; |
| 1418 | $simple_filter) false;; |
| 1419 | *) true;; |
| 1420 | esac |
| 1421 | } |
| 1422 | fi |
| 1423 | |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 1424 | if [ "$LIST_TESTS" -eq 0 ];then |
| 1425 | |
| 1426 | # sanity checks, avoid an avalanche of errors |
| 1427 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1428 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1429 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 1430 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1431 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1432 | exit 1 |
| 1433 | fi |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 1434 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1435 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 1436 | exit 1 |
| 1437 | fi |
| 1438 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1439 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 1440 | exit 1 |
| 1441 | fi |
| 1442 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1443 | if which valgrind >/dev/null 2>&1; then :; else |
| 1444 | echo "Memcheck not possible. Valgrind not found" |
| 1445 | exit 1 |
| 1446 | fi |
| 1447 | fi |
| 1448 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 1449 | echo "Command '$OPENSSL' not found" |
| 1450 | exit 1 |
| 1451 | fi |
| 1452 | |
| 1453 | # used by watchdog |
| 1454 | MAIN_PID="$$" |
| 1455 | |
| 1456 | # We use somewhat arbitrary delays for tests: |
| 1457 | # - how long do we wait for the server to start (when lsof not available)? |
| 1458 | # - how long do we allow for the client to finish? |
| 1459 | # (not to check performance, just to avoid waiting indefinitely) |
| 1460 | # Things are slower with valgrind, so give extra time here. |
| 1461 | # |
| 1462 | # Note: without lsof, there is a trade-off between the running time of this |
| 1463 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1464 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1465 | # the script, only the case where a client or server gets stuck. |
| 1466 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1467 | START_DELAY=6 |
| 1468 | DOG_DELAY=60 |
| 1469 | else |
| 1470 | START_DELAY=2 |
| 1471 | DOG_DELAY=20 |
| 1472 | fi |
| 1473 | |
| 1474 | # some particular tests need more time: |
| 1475 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1476 | # - for the server, we sleep for a number of seconds after the client exits |
| 1477 | # see client_need_more_time() and server_needs_more_time() |
| 1478 | CLI_DELAY_FACTOR=1 |
| 1479 | SRV_DELAY_SECONDS=0 |
| 1480 | |
| 1481 | # fix commands to use this port, force IPv4 while at it |
| 1482 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 1483 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1484 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 1485 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1486 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 1487 | 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"}" |
| 1488 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 1489 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 1490 | G_SRV="$G_SRV -p $SRV_PORT" |
| 1491 | G_CLI="$G_CLI -p +SRV_PORT" |
| 1492 | |
| 1493 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 1494 | # low-security ones. This covers not just cipher suites but also protocol |
| 1495 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 1496 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 1497 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 1498 | # a way to discover it from -help, so check the openssl version. |
| 1499 | case $($OPENSSL version) in |
| 1500 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 1501 | *) |
| 1502 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 1503 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 1504 | ;; |
| 1505 | esac |
| 1506 | |
| 1507 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1508 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 1509 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 1510 | fi |
| 1511 | |
| 1512 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 1513 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1514 | fi |
| 1515 | |
| 1516 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 1517 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 1518 | fi |
| 1519 | |
| 1520 | # Allow SHA-1, because many of our test certificates use it |
| 1521 | P_SRV="$P_SRV allow_sha1=1" |
| 1522 | P_CLI="$P_CLI allow_sha1=1" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1523 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1524 | # Also pick a unique name for intermediate files |
| 1525 | SRV_OUT="srv_out.$$" |
| 1526 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1527 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1528 | SESSION="session.$$" |
| 1529 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1530 | SKIP_NEXT="NO" |
| 1531 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1532 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1533 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1534 | # Basic test |
| 1535 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1536 | # Checks that: |
| 1537 | # - things work with all ciphersuites active (used with config-full in all.sh) |
Gilles Peskine | de4cb35 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1538 | # - the expected parameters are selected |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | dff48c1 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1540 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Gilles Peskine | de4cb35 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1541 | requires_config_enabled MBEDTLS_SHA512_C # "signature_algorithm ext: 6" |
| 1542 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1543 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1544 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1545 | "$P_CLI" \ |
| 1546 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1547 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1548 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1549 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1550 | -s "ECDHE curve: secp521r1" \ |
| 1551 | -S "error" \ |
| 1552 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1553 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | dff48c1 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1555 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1556 | run_test "Default, DTLS" \ |
| 1557 | "$P_SRV dtls=1" \ |
| 1558 | "$P_CLI dtls=1" \ |
| 1559 | 0 \ |
| 1560 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1561 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1562 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1563 | run_test "TLS client auth: required" \ |
| 1564 | "$P_SRV auth_mode=required" \ |
| 1565 | "$P_CLI" \ |
| 1566 | 0 \ |
| 1567 | -s "Verifying peer X.509 certificate... ok" |
| 1568 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1569 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1570 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1571 | requires_config_enabled MBEDTLS_SHA256_C |
| 1572 | run_test "TLS: password protected client key" \ |
| 1573 | "$P_SRV auth_mode=required" \ |
| 1574 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1575 | 0 |
| 1576 | |
| 1577 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1578 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1579 | requires_config_enabled MBEDTLS_SHA256_C |
| 1580 | run_test "TLS: password protected server key" \ |
| 1581 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1582 | "$P_CLI" \ |
| 1583 | 0 |
| 1584 | |
| 1585 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1586 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1587 | requires_config_enabled MBEDTLS_RSA_C |
| 1588 | requires_config_enabled MBEDTLS_SHA256_C |
| 1589 | run_test "TLS: password protected server key, two certificates" \ |
| 1590 | "$P_SRV \ |
| 1591 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1592 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1593 | "$P_CLI" \ |
| 1594 | 0 |
| 1595 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1596 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1597 | run_test "Default (compression enabled)" \ |
| 1598 | "$P_SRV debug_level=3" \ |
| 1599 | "$P_CLI debug_level=3" \ |
| 1600 | 0 \ |
| 1601 | -s "Allocating compression buffer" \ |
| 1602 | -c "Allocating compression buffer" \ |
| 1603 | -s "Record expansion is unknown (compression)" \ |
| 1604 | -c "Record expansion is unknown (compression)" \ |
| 1605 | -S "error" \ |
| 1606 | -C "error" |
| 1607 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1608 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1609 | run_test "CA callback on client" \ |
| 1610 | "$P_SRV debug_level=3" \ |
| 1611 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1612 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1613 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1614 | -S "error" \ |
| 1615 | -C "error" |
| 1616 | |
| 1617 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1618 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1619 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1620 | requires_config_enabled MBEDTLS_SHA256_C |
| 1621 | run_test "CA callback on server" \ |
| 1622 | "$P_SRV auth_mode=required" \ |
| 1623 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1624 | key_file=data_files/server5.key" \ |
| 1625 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1626 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1627 | -s "Verifying peer X.509 certificate... ok" \ |
| 1628 | -S "error" \ |
| 1629 | -C "error" |
| 1630 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1631 | # Test using an opaque private key for client authentication |
| 1632 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1633 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1634 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1635 | requires_config_enabled MBEDTLS_SHA256_C |
| 1636 | run_test "Opaque key for client authentication" \ |
Przemyslaw Stekiel | b3de3fd | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1637 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1638 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1639 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1640 | key_file=data_files/server5.key" \ |
| 1641 | 0 \ |
| 1642 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | b3de3fd | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1643 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1644 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | b3de3fd | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1645 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1646 | -S "error" \ |
| 1647 | -C "error" |
| 1648 | |
Przemyslaw Stekiel | ab09c9e | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1649 | # Test using an opaque private key for server authentication |
| 1650 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1651 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1652 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1653 | requires_config_enabled MBEDTLS_SHA256_C |
| 1654 | run_test "Opaque key for server authentication" \ |
Przemyslaw Stekiel | b3de3fd | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1655 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1656 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | ab09c9e | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1657 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1658 | key_file=data_files/server5.key" \ |
| 1659 | 0 \ |
| 1660 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | b3de3fd | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1661 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1662 | -s "key types: Opaque - invalid PK" \ |
| 1663 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | ab09c9e | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1664 | -S "error" \ |
| 1665 | -C "error" |
| 1666 | |
Przemyslaw Stekiel | 5b6c4c9 | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1667 | # Test using an opaque private key for client/server authentication |
| 1668 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1669 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1670 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1671 | requires_config_enabled MBEDTLS_SHA256_C |
| 1672 | run_test "Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | b3de3fd | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1673 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1674 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 5b6c4c9 | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1675 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1676 | key_file=data_files/server5.key" \ |
| 1677 | 0 \ |
| 1678 | -c "key type: Opaque" \ |
| 1679 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | b3de3fd | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1680 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1681 | -s "key types: Opaque - invalid PK" \ |
Przemyslaw Stekiel | 5b6c4c9 | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1682 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | b3de3fd | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1683 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 5b6c4c9 | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1684 | -S "error" \ |
| 1685 | -C "error" |
| 1686 | |
Manuel Pégourié-Gonnard | 938be42 | 2022-06-14 10:43:36 +0200 | [diff] [blame] | 1687 | # Opaque keys not supported for static ECDH |
| 1688 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1689 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1690 | run_test "Opaque key: server: ECDH-ECDSA not supported" \ |
| 1691 | "$P_SRV debug_level=1 key_opaque=1 |
| 1692 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 1693 | "$P_CLI force_ciphersuite=TLS-ECDH-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 1694 | 1 \ |
| 1695 | -s "server key not ECDH capable" \ |
| 1696 | -s "ssl_get_ecdh_params_from_cert() returned" \ |
| 1697 | -s "error" \ |
| 1698 | -c "error" |
| 1699 | |
| 1700 | # Opaque keys not supported for static ECDH |
| 1701 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1702 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1703 | run_test "Opaque key: server: ECDH-RSA not supported" \ |
| 1704 | "$P_SRV debug_level=1 key_opaque=1 |
| 1705 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 1706 | "$P_CLI force_ciphersuite=TLS-ECDH-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1707 | 1 \ |
| 1708 | -s "server key not ECDH capable" \ |
| 1709 | -s "ssl_get_ecdh_params_from_cert() returned" \ |
| 1710 | -s "error" \ |
| 1711 | -c "error" |
| 1712 | |
Manuel Pégourié-Gonnard | a49a00c | 2022-06-14 10:45:19 +0200 | [diff] [blame] | 1713 | # Opaque PSKs not supported for mixed PSK |
| 1714 | |
| 1715 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1716 | run_test "Opaque psk: client: ECDHE-PSK not supported" \ |
| 1717 | "$P_SRV debug_level=1 psk=abc123 psk_identity=foo" \ |
| 1718 | "$P_CLI debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 \ |
| 1719 | force_version=tls12 \ |
| 1720 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 1721 | 1 \ |
| 1722 | -c "opaque PSK not supported with ECDHE-PSK" \ |
| 1723 | -s "error" \ |
| 1724 | -c "error" |
| 1725 | |
| 1726 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1727 | run_test "Opaque psk: client: DHE-PSK not supported" \ |
| 1728 | "$P_SRV debug_level=1 psk=abc123 psk_identity=foo" \ |
| 1729 | "$P_CLI debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 \ |
| 1730 | force_version=tls12 \ |
| 1731 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 1732 | 1 \ |
| 1733 | -c "opaque PSK not supported with DHE-PSK" \ |
| 1734 | -s "error" \ |
| 1735 | -c "error" |
| 1736 | |
| 1737 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1738 | run_test "Opaque psk: client: RSA-PSK not supported" \ |
| 1739 | "$P_SRV debug_level=1 psk=abc123 psk_identity=foo" \ |
| 1740 | "$P_CLI debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 \ |
| 1741 | force_version=tls12 \ |
| 1742 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 1743 | 1 \ |
| 1744 | -c "opaque PSK not supported with RSA-PSK" \ |
| 1745 | -s "error" \ |
| 1746 | -c "error" |
| 1747 | |
Manuel Pégourié-Gonnard | d80d8a4 | 2022-06-14 10:53:15 +0200 | [diff] [blame] | 1748 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1749 | run_test "Opaque psk: server: ECDHE-PSK not supported" \ |
| 1750 | "$P_SRV debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 \ |
| 1751 | force_version=tls12 \ |
| 1752 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 1753 | "$P_CLI debug_level=1 psk=abc123 psk_identity=foo" \ |
| 1754 | 1 \ |
| 1755 | -s "opaque PSK not supported with ECDHE-PSK" \ |
| 1756 | -s "error" \ |
| 1757 | -c "error" |
| 1758 | |
| 1759 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1760 | run_test "Opaque psk: server: DHE-PSK not supported" \ |
| 1761 | "$P_SRV debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 \ |
| 1762 | force_version=tls12 \ |
| 1763 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 1764 | "$P_CLI debug_level=1 psk=abc123 psk_identity=foo" \ |
| 1765 | 1 \ |
| 1766 | -s "opaque PSK not supported with DHE-PSK" \ |
| 1767 | -s "error" \ |
| 1768 | -c "error" |
| 1769 | |
| 1770 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1771 | run_test "Opaque psk: server: RSA-PSK not supported" \ |
| 1772 | "$P_SRV debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 \ |
| 1773 | force_version=tls12 \ |
| 1774 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 1775 | "$P_CLI debug_level=1 psk=abc123 psk_identity=foo" \ |
| 1776 | 1 \ |
| 1777 | -s "opaque PSK not supported with RSA-PSK" \ |
| 1778 | -s "error" \ |
| 1779 | -c "error" |
| 1780 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1781 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1782 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1783 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1784 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1785 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1786 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1787 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1788 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1789 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1790 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1791 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1792 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1793 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1794 | run_test_psa_force_curve "secp521r1" |
| 1795 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1796 | run_test_psa_force_curve "brainpoolP512r1" |
| 1797 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1798 | run_test_psa_force_curve "secp384r1" |
| 1799 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1800 | run_test_psa_force_curve "brainpoolP384r1" |
| 1801 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1802 | run_test_psa_force_curve "secp256r1" |
| 1803 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1804 | run_test_psa_force_curve "secp256k1" |
| 1805 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1806 | run_test_psa_force_curve "brainpoolP256r1" |
| 1807 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1808 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1809 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 52af769 | 2022-03-31 14:27:24 +0100 | [diff] [blame] | 1810 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1811 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1812 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1813 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1814 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1815 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1816 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1817 | run_test_psa_force_curve "secp192r1" |
| 1818 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1819 | run_test_psa_force_curve "secp192k1" |
| 1820 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1821 | # Test current time in ServerHello |
| 1822 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1823 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1824 | "$P_SRV debug_level=3" \ |
| 1825 | "$P_CLI debug_level=3" \ |
| 1826 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1827 | -f "check_server_hello_time" \ |
| 1828 | -F "check_server_hello_time" |
| 1829 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1830 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1831 | run_test "Unique IV in GCM" \ |
| 1832 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1833 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1834 | 0 \ |
| 1835 | -u "IV used" \ |
| 1836 | -U "IV used" |
| 1837 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1838 | # Tests for certificate verification callback |
| 1839 | run_test "Configuration-specific CRT verification callback" \ |
| 1840 | "$P_SRV debug_level=3" \ |
| 1841 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1842 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1843 | -S "error" \ |
| 1844 | -c "Verify requested for " \ |
| 1845 | -c "Use configuration-specific verification callback" \ |
| 1846 | -C "Use context-specific verification callback" \ |
| 1847 | -C "error" |
| 1848 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1849 | run_test "Context-specific CRT verification callback" \ |
| 1850 | "$P_SRV debug_level=3" \ |
| 1851 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1852 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1853 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1854 | -c "Verify requested for " \ |
| 1855 | -c "Use context-specific verification callback" \ |
| 1856 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1857 | -C "error" |
| 1858 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1859 | # Tests for rc4 option |
| 1860 | |
Gilles Peskine | 719a652 | 2022-04-15 20:03:33 +0200 | [diff] [blame] | 1861 | # Manual dependencies on the ciphersuite support are necessary |
| 1862 | # because the automatic requirements from force_ciphersuite=... detection |
| 1863 | # make an exception for these test cases since they expect a handshake |
| 1864 | # failure. |
| 1865 | requires_config_enabled MBEDTLS_ARC4_C |
| 1866 | requires_config_enabled MBEDTLS_SHA1_C |
| 1867 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1868 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1869 | run_test "RC4: server disabled, client enabled" \ |
| 1870 | "$P_SRV" \ |
| 1871 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1872 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1873 | -s "SSL - The server has no ciphersuites in common" |
| 1874 | |
Gilles Peskine | 719a652 | 2022-04-15 20:03:33 +0200 | [diff] [blame] | 1875 | requires_config_enabled MBEDTLS_ARC4_C |
| 1876 | requires_config_enabled MBEDTLS_SHA1_C |
| 1877 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1878 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1879 | run_test "RC4: server half, client enabled" \ |
| 1880 | "$P_SRV arc4=1" \ |
| 1881 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1882 | 1 \ |
| 1883 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1884 | |
Gilles Peskine | 719a652 | 2022-04-15 20:03:33 +0200 | [diff] [blame] | 1885 | requires_config_enabled MBEDTLS_ARC4_C |
| 1886 | requires_config_enabled MBEDTLS_SHA1_C |
| 1887 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
| 1888 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1889 | run_test "RC4: server enabled, client disabled" \ |
| 1890 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1891 | "$P_CLI" \ |
| 1892 | 1 \ |
| 1893 | -s "SSL - The server has no ciphersuites in common" |
| 1894 | |
Gilles Peskine | 719a652 | 2022-04-15 20:03:33 +0200 | [diff] [blame] | 1895 | # Run even if the ciphersuite is disabled by default, but only if the |
| 1896 | # requisite cryptographic mechanisms are present. |
| 1897 | # Having "force_ciphersuite=..." in the client or server arguments would |
| 1898 | # prevent that due to the automatic detection, so hide behind some |
| 1899 | # shell expansion to fool the automatic detection. |
| 1900 | with_rc4_ciphersuite() { |
| 1901 | exec "$@" force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA |
| 1902 | } |
| 1903 | requires_config_enabled MBEDTLS_ARC4_C |
| 1904 | requires_config_enabled MBEDTLS_SHA1_C |
| 1905 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1906 | run_test "RC4: both enabled" \ |
Gilles Peskine | 719a652 | 2022-04-15 20:03:33 +0200 | [diff] [blame] | 1907 | "with_rc4_ciphersuite $P_SRV" \ |
| 1908 | "with_rc4_ciphersuite $P_CLI" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1909 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1910 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1911 | -S "SSL - The server has no ciphersuites in common" |
| 1912 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1913 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1914 | |
| 1915 | requires_gnutls |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1916 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1917 | "$G_SRV"\ |
| 1918 | "$P_CLI force_version=tls1_1" \ |
| 1919 | 0 |
| 1920 | |
| 1921 | requires_gnutls |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1922 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1923 | "$G_SRV"\ |
| 1924 | "$P_CLI force_version=tls1" \ |
| 1925 | 0 |
| 1926 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1927 | # Tests for SHA-1 support |
| 1928 | |
| 1929 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1930 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1931 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1932 | 1 \ |
| 1933 | -c "The certificate is signed with an unacceptable hash" |
| 1934 | |
| 1935 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1936 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1937 | "$P_CLI allow_sha1=1" \ |
| 1938 | 0 |
| 1939 | |
| 1940 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1941 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1942 | "$P_CLI allow_sha1=0" \ |
| 1943 | 0 |
| 1944 | |
| 1945 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1946 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1947 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1948 | 1 \ |
| 1949 | -s "The certificate is signed with an unacceptable hash" |
| 1950 | |
| 1951 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1952 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1953 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1954 | 0 |
| 1955 | |
| 1956 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1957 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1958 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1959 | 0 |
| 1960 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1961 | # Tests for datagram packing |
| 1962 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1963 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1964 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1965 | 0 \ |
| 1966 | -c "next record in same datagram" \ |
| 1967 | -s "next record in same datagram" |
| 1968 | |
| 1969 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1970 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1971 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1972 | 0 \ |
| 1973 | -s "next record in same datagram" \ |
| 1974 | -C "next record in same datagram" |
| 1975 | |
| 1976 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1977 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1978 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1979 | 0 \ |
| 1980 | -S "next record in same datagram" \ |
| 1981 | -c "next record in same datagram" |
| 1982 | |
| 1983 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1984 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1985 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1986 | 0 \ |
| 1987 | -S "next record in same datagram" \ |
| 1988 | -C "next record in same datagram" |
| 1989 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1990 | # Tests for Truncated HMAC extension |
| 1991 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1992 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1993 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1994 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1995 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1996 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1997 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1998 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1999 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 2000 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2001 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 2002 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2003 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 2004 | -s "dumping 'expected mac' (20 bytes)" \ |
| 2005 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 2006 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 2007 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 2008 | run_test "Truncated HMAC: client enabled, server default" \ |
| 2009 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 2010 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 2011 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 2012 | -s "dumping 'expected mac' (20 bytes)" \ |
| 2013 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 2014 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 2015 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 2016 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 2017 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 2018 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 2019 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 2020 | -s "dumping 'expected mac' (20 bytes)" \ |
| 2021 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 2022 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 2023 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 2024 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 2025 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 2026 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 2027 | 0 \ |
| 2028 | -s "dumping 'expected mac' (20 bytes)" \ |
| 2029 | -S "dumping 'expected mac' (10 bytes)" |
| 2030 | |
| 2031 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 2032 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 2033 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 2034 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 2035 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 2036 | -S "dumping 'expected mac' (20 bytes)" \ |
| 2037 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2038 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 2039 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 2040 | "$P_SRV dtls=1 debug_level=4" \ |
| 2041 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2042 | 0 \ |
| 2043 | -s "dumping 'expected mac' (20 bytes)" \ |
| 2044 | -S "dumping 'expected mac' (10 bytes)" |
| 2045 | |
| 2046 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 2047 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 2048 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 2049 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 2050 | 0 \ |
| 2051 | -s "dumping 'expected mac' (20 bytes)" \ |
| 2052 | -S "dumping 'expected mac' (10 bytes)" |
| 2053 | |
| 2054 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 2055 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 2056 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 2057 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 2058 | 0 \ |
| 2059 | -s "dumping 'expected mac' (20 bytes)" \ |
| 2060 | -S "dumping 'expected mac' (10 bytes)" |
| 2061 | |
| 2062 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 2063 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 2064 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 2065 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 2066 | 0 \ |
| 2067 | -s "dumping 'expected mac' (20 bytes)" \ |
| 2068 | -S "dumping 'expected mac' (10 bytes)" |
| 2069 | |
| 2070 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 2071 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 2072 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 2073 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 2074 | 0 \ |
| 2075 | -s "dumping 'expected mac' (20 bytes)" \ |
| 2076 | -S "dumping 'expected mac' (10 bytes)" |
| 2077 | |
| 2078 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 2079 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 2080 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 2081 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2082 | 0 \ |
| 2083 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2084 | -s "dumping 'expected mac' (10 bytes)" |
| 2085 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2086 | # Tests for Context serialization |
| 2087 | |
| 2088 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2089 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2090 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2091 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2092 | 0 \ |
| 2093 | -c "Deserializing connection..." \ |
| 2094 | -S "Deserializing connection..." |
| 2095 | |
| 2096 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2097 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2098 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2099 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2100 | 0 \ |
| 2101 | -c "Deserializing connection..." \ |
| 2102 | -S "Deserializing connection..." |
| 2103 | |
| 2104 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2105 | run_test "Context serialization, client serializes, GCM" \ |
| 2106 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2107 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2108 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2109 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2110 | -S "Deserializing connection..." |
| 2111 | |
| 2112 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2113 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2114 | run_test "Context serialization, client serializes, with CID" \ |
| 2115 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2116 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2117 | 0 \ |
| 2118 | -c "Deserializing connection..." \ |
| 2119 | -S "Deserializing connection..." |
| 2120 | |
| 2121 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2122 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2123 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2124 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2125 | 0 \ |
| 2126 | -C "Deserializing connection..." \ |
| 2127 | -s "Deserializing connection..." |
| 2128 | |
| 2129 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2130 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2131 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2132 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2133 | 0 \ |
| 2134 | -C "Deserializing connection..." \ |
| 2135 | -s "Deserializing connection..." |
| 2136 | |
| 2137 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2138 | run_test "Context serialization, server serializes, GCM" \ |
| 2139 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2140 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2141 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2142 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2143 | -s "Deserializing connection..." |
| 2144 | |
| 2145 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2146 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2147 | run_test "Context serialization, server serializes, with CID" \ |
| 2148 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2149 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2150 | 0 \ |
| 2151 | -C "Deserializing connection..." \ |
| 2152 | -s "Deserializing connection..." |
| 2153 | |
| 2154 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2155 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2156 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2157 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2158 | 0 \ |
| 2159 | -c "Deserializing connection..." \ |
| 2160 | -s "Deserializing connection..." |
| 2161 | |
| 2162 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2163 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2164 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2165 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2166 | 0 \ |
| 2167 | -c "Deserializing connection..." \ |
| 2168 | -s "Deserializing connection..." |
| 2169 | |
| 2170 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2171 | run_test "Context serialization, both serialize, GCM" \ |
| 2172 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2173 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2174 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2175 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2176 | -s "Deserializing connection..." |
| 2177 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2178 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2179 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2180 | run_test "Context serialization, both serialize, with CID" \ |
| 2181 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2182 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2183 | 0 \ |
| 2184 | -c "Deserializing connection..." \ |
| 2185 | -s "Deserializing connection..." |
| 2186 | |
| 2187 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2188 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2189 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2190 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2191 | 0 \ |
| 2192 | -c "Deserializing connection..." \ |
| 2193 | -S "Deserializing connection..." |
| 2194 | |
| 2195 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2196 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2197 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2198 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2199 | 0 \ |
| 2200 | -c "Deserializing connection..." \ |
| 2201 | -S "Deserializing connection..." |
| 2202 | |
| 2203 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2204 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2205 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2206 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2207 | 0 \ |
| 2208 | -c "Deserializing connection..." \ |
| 2209 | -S "Deserializing connection..." |
| 2210 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2211 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2212 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2213 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2214 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2215 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2216 | 0 \ |
| 2217 | -c "Deserializing connection..." \ |
| 2218 | -S "Deserializing connection..." |
| 2219 | |
| 2220 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2221 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2222 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2223 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2224 | 0 \ |
| 2225 | -C "Deserializing connection..." \ |
| 2226 | -s "Deserializing connection..." |
| 2227 | |
| 2228 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2229 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2230 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2231 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2232 | 0 \ |
| 2233 | -C "Deserializing connection..." \ |
| 2234 | -s "Deserializing connection..." |
| 2235 | |
| 2236 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2237 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2238 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2239 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2240 | 0 \ |
| 2241 | -C "Deserializing connection..." \ |
| 2242 | -s "Deserializing connection..." |
| 2243 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2244 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2245 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2246 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2247 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2248 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2249 | 0 \ |
| 2250 | -C "Deserializing connection..." \ |
| 2251 | -s "Deserializing connection..." |
| 2252 | |
| 2253 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2254 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2255 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2256 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2257 | 0 \ |
| 2258 | -c "Deserializing connection..." \ |
| 2259 | -s "Deserializing connection..." |
| 2260 | |
| 2261 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2262 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2263 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2264 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2265 | 0 \ |
| 2266 | -c "Deserializing connection..." \ |
| 2267 | -s "Deserializing connection..." |
| 2268 | |
| 2269 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2270 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2271 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2272 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2273 | 0 \ |
| 2274 | -c "Deserializing connection..." \ |
| 2275 | -s "Deserializing connection..." |
| 2276 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2277 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2278 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2279 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2280 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2281 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2282 | 0 \ |
| 2283 | -c "Deserializing connection..." \ |
| 2284 | -s "Deserializing connection..." |
| 2285 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2286 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2287 | run_test "Saving the serialized context to a file" \ |
| 2288 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2289 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2290 | 0 \ |
| 2291 | -s "Save serialized context to a file... ok" \ |
| 2292 | -c "Save serialized context to a file... ok" |
| 2293 | rm -f context_srv.txt |
| 2294 | rm -f context_cli.txt |
| 2295 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2296 | # Tests for DTLS Connection ID extension |
| 2297 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2298 | # So far, the CID API isn't implemented, so we can't |
| 2299 | # grep for output witnessing its use. This needs to be |
| 2300 | # changed once the CID extension is implemented. |
| 2301 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2302 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2303 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2304 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2305 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2306 | 0 \ |
| 2307 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2308 | -s "found CID extension" \ |
| 2309 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2310 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2311 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2312 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2313 | -C "found CID extension" \ |
| 2314 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2315 | -C "Copy CIDs into SSL transform" \ |
| 2316 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2317 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2318 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2319 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2320 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2321 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2322 | 0 \ |
| 2323 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2324 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2325 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2326 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2327 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2328 | -C "found CID extension" \ |
| 2329 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2330 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2331 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2332 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2333 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2334 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2335 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2336 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2337 | 0 \ |
| 2338 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2339 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2340 | -c "client hello, adding CID extension" \ |
| 2341 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2342 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2343 | -s "server hello, adding CID extension" \ |
| 2344 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2345 | -c "Use of CID extension negotiated" \ |
| 2346 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2347 | -c "Copy CIDs into SSL transform" \ |
| 2348 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2349 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2350 | -s "Use of Connection ID has been negotiated" \ |
| 2351 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2352 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2353 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2354 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2355 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2356 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2357 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2358 | 0 \ |
| 2359 | -c "Enable use of CID extension." \ |
| 2360 | -s "Enable use of CID extension." \ |
| 2361 | -c "client hello, adding CID extension" \ |
| 2362 | -s "found CID extension" \ |
| 2363 | -s "Use of CID extension negotiated" \ |
| 2364 | -s "server hello, adding CID extension" \ |
| 2365 | -c "found CID extension" \ |
| 2366 | -c "Use of CID extension negotiated" \ |
| 2367 | -s "Copy CIDs into SSL transform" \ |
| 2368 | -c "Copy CIDs into SSL transform" \ |
| 2369 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2370 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2371 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2372 | -c "Use of Connection ID has been negotiated" \ |
| 2373 | -c "ignoring unexpected CID" \ |
| 2374 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2375 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2376 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2377 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2378 | -p "$P_PXY mtu=800" \ |
| 2379 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2380 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2381 | 0 \ |
| 2382 | -c "Enable use of CID extension." \ |
| 2383 | -s "Enable use of CID extension." \ |
| 2384 | -c "client hello, adding CID extension" \ |
| 2385 | -s "found CID extension" \ |
| 2386 | -s "Use of CID extension negotiated" \ |
| 2387 | -s "server hello, adding CID extension" \ |
| 2388 | -c "found CID extension" \ |
| 2389 | -c "Use of CID extension negotiated" \ |
| 2390 | -s "Copy CIDs into SSL transform" \ |
| 2391 | -c "Copy CIDs into SSL transform" \ |
| 2392 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2393 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2394 | -s "Use of Connection ID has been negotiated" \ |
| 2395 | -c "Use of Connection ID has been negotiated" |
| 2396 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2397 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2398 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2399 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2400 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2401 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2402 | 0 \ |
| 2403 | -c "Enable use of CID extension." \ |
| 2404 | -s "Enable use of CID extension." \ |
| 2405 | -c "client hello, adding CID extension" \ |
| 2406 | -s "found CID extension" \ |
| 2407 | -s "Use of CID extension negotiated" \ |
| 2408 | -s "server hello, adding CID extension" \ |
| 2409 | -c "found CID extension" \ |
| 2410 | -c "Use of CID extension negotiated" \ |
| 2411 | -s "Copy CIDs into SSL transform" \ |
| 2412 | -c "Copy CIDs into SSL transform" \ |
| 2413 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2414 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2415 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2416 | -c "Use of Connection ID has been negotiated" \ |
| 2417 | -c "ignoring unexpected CID" \ |
| 2418 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2419 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2420 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2421 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2422 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2423 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2424 | 0 \ |
| 2425 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2426 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2427 | -c "client hello, adding CID extension" \ |
| 2428 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2429 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2430 | -s "server hello, adding CID extension" \ |
| 2431 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2432 | -c "Use of CID extension negotiated" \ |
| 2433 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2434 | -c "Copy CIDs into SSL transform" \ |
| 2435 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2436 | -s "Peer CID (length 0 Bytes):" \ |
| 2437 | -s "Use of Connection ID has been negotiated" \ |
| 2438 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2439 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2440 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2441 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2442 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2443 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2444 | 0 \ |
| 2445 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2446 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2447 | -c "client hello, adding CID extension" \ |
| 2448 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2449 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2450 | -s "server hello, adding CID extension" \ |
| 2451 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2452 | -c "Use of CID extension negotiated" \ |
| 2453 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2454 | -c "Copy CIDs into SSL transform" \ |
| 2455 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2456 | -c "Peer CID (length 0 Bytes):" \ |
| 2457 | -s "Use of Connection ID has been negotiated" \ |
| 2458 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2459 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2460 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2461 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2462 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2463 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2464 | 0 \ |
| 2465 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2466 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2467 | -c "client hello, adding CID extension" \ |
| 2468 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2469 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2470 | -s "server hello, adding CID extension" \ |
| 2471 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2472 | -c "Use of CID extension negotiated" \ |
| 2473 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2474 | -c "Copy CIDs into SSL transform" \ |
| 2475 | -S "Use of Connection ID has been negotiated" \ |
| 2476 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2477 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2478 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2479 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2480 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2481 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2482 | 0 \ |
| 2483 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2484 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2485 | -c "client hello, adding CID extension" \ |
| 2486 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2487 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2488 | -s "server hello, adding CID extension" \ |
| 2489 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2490 | -c "Use of CID extension negotiated" \ |
| 2491 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2492 | -c "Copy CIDs into SSL transform" \ |
| 2493 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2494 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2495 | -s "Use of Connection ID has been negotiated" \ |
| 2496 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2497 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2498 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2499 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2500 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2501 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2502 | 0 \ |
| 2503 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2504 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2505 | -c "client hello, adding CID extension" \ |
| 2506 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2507 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2508 | -s "server hello, adding CID extension" \ |
| 2509 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2510 | -c "Use of CID extension negotiated" \ |
| 2511 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2512 | -c "Copy CIDs into SSL transform" \ |
| 2513 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2514 | -s "Peer CID (length 0 Bytes):" \ |
| 2515 | -s "Use of Connection ID has been negotiated" \ |
| 2516 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2517 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2518 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2519 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2520 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2521 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2522 | 0 \ |
| 2523 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2524 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2525 | -c "client hello, adding CID extension" \ |
| 2526 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2527 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2528 | -s "server hello, adding CID extension" \ |
| 2529 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2530 | -c "Use of CID extension negotiated" \ |
| 2531 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2532 | -c "Copy CIDs into SSL transform" \ |
| 2533 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2534 | -c "Peer CID (length 0 Bytes):" \ |
| 2535 | -s "Use of Connection ID has been negotiated" \ |
| 2536 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2537 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2539 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2540 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2541 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2542 | 0 \ |
| 2543 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2544 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2545 | -c "client hello, adding CID extension" \ |
| 2546 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2547 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2548 | -s "server hello, adding CID extension" \ |
| 2549 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2550 | -c "Use of CID extension negotiated" \ |
| 2551 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2552 | -c "Copy CIDs into SSL transform" \ |
| 2553 | -S "Use of Connection ID has been negotiated" \ |
| 2554 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2555 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2556 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2557 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2558 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2559 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2560 | 0 \ |
| 2561 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2562 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2563 | -c "client hello, adding CID extension" \ |
| 2564 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2565 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2566 | -s "server hello, adding CID extension" \ |
| 2567 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2568 | -c "Use of CID extension negotiated" \ |
| 2569 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2570 | -c "Copy CIDs into SSL transform" \ |
| 2571 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2572 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2573 | -s "Use of Connection ID has been negotiated" \ |
| 2574 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2575 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2576 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2577 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2578 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2579 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2580 | 0 \ |
| 2581 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2582 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2583 | -c "client hello, adding CID extension" \ |
| 2584 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2585 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2586 | -s "server hello, adding CID extension" \ |
| 2587 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2588 | -c "Use of CID extension negotiated" \ |
| 2589 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2590 | -c "Copy CIDs into SSL transform" \ |
| 2591 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2592 | -s "Peer CID (length 0 Bytes):" \ |
| 2593 | -s "Use of Connection ID has been negotiated" \ |
| 2594 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2595 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2596 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2597 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2598 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2599 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2600 | 0 \ |
| 2601 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2602 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2603 | -c "client hello, adding CID extension" \ |
| 2604 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2605 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2606 | -s "server hello, adding CID extension" \ |
| 2607 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2608 | -c "Use of CID extension negotiated" \ |
| 2609 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2610 | -c "Copy CIDs into SSL transform" \ |
| 2611 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2612 | -c "Peer CID (length 0 Bytes):" \ |
| 2613 | -s "Use of Connection ID has been negotiated" \ |
| 2614 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2615 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2616 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2617 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2618 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2619 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2620 | 0 \ |
| 2621 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2622 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2623 | -c "client hello, adding CID extension" \ |
| 2624 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2625 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2626 | -s "server hello, adding CID extension" \ |
| 2627 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2628 | -c "Use of CID extension negotiated" \ |
| 2629 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2630 | -c "Copy CIDs into SSL transform" \ |
| 2631 | -S "Use of Connection ID has been negotiated" \ |
| 2632 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2633 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2634 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2635 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2636 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2637 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2638 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2639 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2640 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2641 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2642 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2643 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2644 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2645 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2646 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2647 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2648 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2649 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2650 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2651 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2652 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2653 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2654 | 0 \ |
| 2655 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2656 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2657 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2658 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2659 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2660 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2661 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2662 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2663 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2664 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2665 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2666 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2667 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2668 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2669 | 0 \ |
| 2670 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2671 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2672 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2673 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2674 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2675 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2676 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2677 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2678 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2679 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2680 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2681 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2682 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2683 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2684 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2685 | 0 \ |
| 2686 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2687 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2688 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2689 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2690 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2691 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2692 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2693 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2694 | -c "ignoring unexpected CID" \ |
| 2695 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2696 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2697 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2698 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2699 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2700 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2701 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2702 | 0 \ |
| 2703 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2704 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2705 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2706 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2707 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2708 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2709 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2710 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2711 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2712 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2713 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2714 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2715 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2716 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2717 | 0 \ |
| 2718 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2719 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2720 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2721 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2722 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2723 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2724 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2725 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2726 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2727 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2728 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2729 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2730 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2731 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2732 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2733 | 0 \ |
| 2734 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2735 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2736 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2737 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2738 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2739 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2740 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2741 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2742 | -c "ignoring unexpected CID" \ |
| 2743 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2744 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2745 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2746 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2747 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2748 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2749 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2750 | 0 \ |
| 2751 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2752 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2753 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2754 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2755 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2756 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2757 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2758 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2759 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2760 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2761 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2762 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2763 | 0 \ |
| 2764 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2765 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2766 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2767 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2768 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2769 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2770 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2771 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2772 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2773 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2774 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2775 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2776 | "$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" \ |
| 2777 | 0 \ |
| 2778 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2779 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2780 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2781 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2782 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2783 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2784 | -c "ignoring unexpected CID" \ |
| 2785 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2786 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2787 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2788 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2789 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2790 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2791 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2792 | 0 \ |
| 2793 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2794 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2795 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2796 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2797 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2798 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2799 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2800 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2801 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2802 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2804 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2805 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2806 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2807 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2808 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2809 | 0 \ |
| 2810 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2811 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2812 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2813 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2814 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2815 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2816 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2817 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2818 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2819 | -c "ignoring unexpected CID" \ |
| 2820 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2821 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2822 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2823 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2824 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2825 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2826 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2827 | 0 \ |
| 2828 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2829 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2830 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2831 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2832 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2833 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2834 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2835 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2836 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2837 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2838 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2839 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2840 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2841 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2842 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2843 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2844 | 0 \ |
| 2845 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2846 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2847 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2848 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2849 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2850 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2851 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2852 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2853 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2854 | -c "ignoring unexpected CID" \ |
| 2855 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2856 | |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2857 | # This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the |
| 2858 | # tests check that the buffer contents are reallocated when the message is |
| 2859 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2860 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2861 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2862 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2863 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2864 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2865 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2866 | 0 \ |
| 2867 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2868 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2869 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2870 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2871 | -s "Reallocating in_buf" \ |
| 2872 | -s "Reallocating out_buf" |
| 2873 | |
| 2874 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2875 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2876 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2877 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2878 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2879 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2880 | 0 \ |
| 2881 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2882 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2883 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2884 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2885 | -s "Reallocating in_buf" \ |
| 2886 | -s "Reallocating out_buf" |
| 2887 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2888 | # Tests for Encrypt-then-MAC extension |
| 2889 | |
| 2890 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2891 | "$P_SRV debug_level=3 \ |
| 2892 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2893 | "$P_CLI debug_level=3" \ |
| 2894 | 0 \ |
| 2895 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2896 | -s "found encrypt then mac extension" \ |
| 2897 | -s "server hello, adding encrypt then mac extension" \ |
| 2898 | -c "found encrypt_then_mac extension" \ |
| 2899 | -c "using encrypt then mac" \ |
| 2900 | -s "using encrypt then mac" |
| 2901 | |
| 2902 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2903 | "$P_SRV debug_level=3 etm=0 \ |
| 2904 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2905 | "$P_CLI debug_level=3 etm=1" \ |
| 2906 | 0 \ |
| 2907 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2908 | -s "found encrypt then mac extension" \ |
| 2909 | -S "server hello, adding encrypt then mac extension" \ |
| 2910 | -C "found encrypt_then_mac extension" \ |
| 2911 | -C "using encrypt then mac" \ |
| 2912 | -S "using encrypt then mac" |
| 2913 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2914 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2915 | "$P_SRV debug_level=3 etm=1 \ |
| 2916 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2917 | "$P_CLI debug_level=3 etm=1" \ |
| 2918 | 0 \ |
| 2919 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2920 | -s "found encrypt then mac extension" \ |
| 2921 | -S "server hello, adding encrypt then mac extension" \ |
| 2922 | -C "found encrypt_then_mac extension" \ |
| 2923 | -C "using encrypt then mac" \ |
| 2924 | -S "using encrypt then mac" |
| 2925 | |
| 2926 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2927 | "$P_SRV debug_level=3 etm=1 \ |
| 2928 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2929 | "$P_CLI debug_level=3 etm=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2930 | 0 \ |
| 2931 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2932 | -s "found encrypt then mac extension" \ |
| 2933 | -S "server hello, adding encrypt then mac extension" \ |
| 2934 | -C "found encrypt_then_mac extension" \ |
| 2935 | -C "using encrypt then mac" \ |
| 2936 | -S "using encrypt then mac" |
| 2937 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2938 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2939 | "$P_SRV debug_level=3 etm=1 \ |
| 2940 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2941 | "$P_CLI debug_level=3 etm=0" \ |
| 2942 | 0 \ |
| 2943 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2944 | -S "found encrypt then mac extension" \ |
| 2945 | -S "server hello, adding encrypt then mac extension" \ |
| 2946 | -C "found encrypt_then_mac extension" \ |
| 2947 | -C "using encrypt then mac" \ |
| 2948 | -S "using encrypt then mac" |
| 2949 | |
| 2950 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2951 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2952 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2953 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2954 | 0 \ |
| 2955 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2956 | -S "found encrypt then mac extension" \ |
| 2957 | -S "server hello, adding encrypt then mac extension" \ |
| 2958 | -C "found encrypt_then_mac extension" \ |
| 2959 | -C "using encrypt then mac" \ |
| 2960 | -S "using encrypt then mac" |
| 2961 | |
| 2962 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2963 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2964 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2965 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2966 | 0 \ |
| 2967 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2968 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2969 | -S "server hello, adding encrypt then mac extension" \ |
| 2970 | -C "found encrypt_then_mac extension" \ |
| 2971 | -C "using encrypt then mac" \ |
| 2972 | -S "using encrypt then mac" |
| 2973 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2974 | # Tests for Extended Master Secret extension |
| 2975 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2976 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2977 | run_test "Extended Master Secret: default" \ |
| 2978 | "$P_SRV debug_level=3" \ |
| 2979 | "$P_CLI debug_level=3" \ |
| 2980 | 0 \ |
| 2981 | -c "client hello, adding extended_master_secret extension" \ |
| 2982 | -s "found extended master secret extension" \ |
| 2983 | -s "server hello, adding extended master secret extension" \ |
| 2984 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2985 | -c "session hash for extended master secret" \ |
| 2986 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2987 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2988 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2989 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2990 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2991 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2992 | 0 \ |
| 2993 | -c "client hello, adding extended_master_secret extension" \ |
| 2994 | -s "found extended master secret extension" \ |
| 2995 | -S "server hello, adding extended master secret extension" \ |
| 2996 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2997 | -C "session hash for extended master secret" \ |
| 2998 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2999 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3000 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3001 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3002 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3003 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3004 | 0 \ |
| 3005 | -C "client hello, adding extended_master_secret extension" \ |
| 3006 | -S "found extended master secret extension" \ |
| 3007 | -S "server hello, adding extended master secret extension" \ |
| 3008 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3009 | -C "session hash for extended master secret" \ |
| 3010 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3011 | |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 3012 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 3013 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 3014 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 3015 | 0 \ |
| 3016 | -C "client hello, adding extended_master_secret extension" \ |
| 3017 | -S "found extended master secret extension" \ |
| 3018 | -S "server hello, adding extended master secret extension" \ |
| 3019 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3020 | -C "session hash for extended master secret" \ |
| 3021 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 3022 | |
| 3023 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 3024 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 3025 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 3026 | 0 \ |
| 3027 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 3028 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 3029 | -S "server hello, adding extended master secret extension" \ |
| 3030 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3031 | -C "session hash for extended master secret" \ |
| 3032 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 3033 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 3034 | # Tests for FALLBACK_SCSV |
| 3035 | |
| 3036 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 3037 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 3038 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 3039 | 0 \ |
| 3040 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 3041 | -S "received FALLBACK_SCSV" \ |
| 3042 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 3043 | -C "is a fatal alert message (msg 86)" |
| 3044 | |
| 3045 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 3046 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 3047 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 3048 | 0 \ |
| 3049 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 3050 | -S "received FALLBACK_SCSV" \ |
| 3051 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 3052 | -C "is a fatal alert message (msg 86)" |
| 3053 | |
| 3054 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 3055 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 3056 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 3057 | 1 \ |
| 3058 | -c "adding FALLBACK_SCSV" \ |
| 3059 | -s "received FALLBACK_SCSV" \ |
| 3060 | -s "inapropriate fallback" \ |
| 3061 | -c "is a fatal alert message (msg 86)" |
| 3062 | |
| 3063 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 3064 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 3065 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 3066 | 0 \ |
| 3067 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 3068 | -s "received FALLBACK_SCSV" \ |
| 3069 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 3070 | -C "is a fatal alert message (msg 86)" |
| 3071 | |
| 3072 | requires_openssl_with_fallback_scsv |
| 3073 | run_test "Fallback SCSV: default, openssl server" \ |
| 3074 | "$O_SRV" \ |
| 3075 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 3076 | 0 \ |
| 3077 | -C "adding FALLBACK_SCSV" \ |
| 3078 | -C "is a fatal alert message (msg 86)" |
| 3079 | |
| 3080 | requires_openssl_with_fallback_scsv |
| 3081 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 3082 | "$O_SRV" \ |
| 3083 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 3084 | 1 \ |
| 3085 | -c "adding FALLBACK_SCSV" \ |
| 3086 | -c "is a fatal alert message (msg 86)" |
| 3087 | |
Gilles Peskine | add21ad | 2022-04-15 15:14:58 +0200 | [diff] [blame] | 3088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 3089 | requires_openssl_with_fallback_scsv |
| 3090 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 3091 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 3092 | "$O_CLI -tls1_1" \ |
| 3093 | 0 \ |
| 3094 | -S "received FALLBACK_SCSV" \ |
| 3095 | -S "inapropriate fallback" |
| 3096 | |
Gilles Peskine | add21ad | 2022-04-15 15:14:58 +0200 | [diff] [blame] | 3097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 3098 | requires_openssl_with_fallback_scsv |
| 3099 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 3100 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 3101 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 3102 | 1 \ |
| 3103 | -s "received FALLBACK_SCSV" \ |
| 3104 | -s "inapropriate fallback" |
| 3105 | |
| 3106 | requires_openssl_with_fallback_scsv |
| 3107 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 3108 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 3109 | "$O_CLI -fallback_scsv" \ |
| 3110 | 0 \ |
| 3111 | -s "received FALLBACK_SCSV" \ |
| 3112 | -S "inapropriate fallback" |
| 3113 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3114 | # Test sending and receiving empty application data records |
| 3115 | |
| 3116 | run_test "Encrypt then MAC: empty application data record" \ |
| 3117 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3118 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3119 | 0 \ |
| 3120 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3121 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3122 | -c "0 bytes written in 1 fragments" |
| 3123 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3124 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3125 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3126 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3127 | 0 \ |
| 3128 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3129 | -c "0 bytes written in 1 fragments" |
| 3130 | |
| 3131 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3132 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3133 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3134 | 0 \ |
| 3135 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3136 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3137 | -c "0 bytes written in 1 fragments" |
| 3138 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3139 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3140 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3141 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3142 | 0 \ |
| 3143 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3144 | -c "0 bytes written in 1 fragments" |
| 3145 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 3146 | ## ClientHello generated with |
| 3147 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 3148 | ## then manually twiddling the ciphersuite list. |
| 3149 | ## The ClientHello content is spelled out below as a hex string as |
| 3150 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 3151 | ## The expected response is an inappropriate_fallback alert. |
Gilles Peskine | bba3b4c | 2022-04-09 00:08:47 +0200 | [diff] [blame] | 3152 | requires_config_enabled MBEDTLS_SSL_FALLBACK_SCSV |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 3153 | run_test "Fallback SCSV: beginning of list" \ |
| 3154 | "$P_SRV debug_level=2" \ |
| 3155 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 3156 | 0 \ |
| 3157 | -s "received FALLBACK_SCSV" \ |
| 3158 | -s "inapropriate fallback" |
| 3159 | |
Gilles Peskine | bba3b4c | 2022-04-09 00:08:47 +0200 | [diff] [blame] | 3160 | requires_config_enabled MBEDTLS_SSL_FALLBACK_SCSV |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 3161 | run_test "Fallback SCSV: end of list" \ |
| 3162 | "$P_SRV debug_level=2" \ |
| 3163 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 3164 | 0 \ |
| 3165 | -s "received FALLBACK_SCSV" \ |
| 3166 | -s "inapropriate fallback" |
| 3167 | |
| 3168 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
Gilles Peskine | bba3b4c | 2022-04-09 00:08:47 +0200 | [diff] [blame] | 3169 | requires_config_enabled MBEDTLS_SSL_FALLBACK_SCSV |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 3170 | run_test "Fallback SCSV: not in list" \ |
| 3171 | "$P_SRV debug_level=2" \ |
| 3172 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 3173 | 0 \ |
| 3174 | -S "received FALLBACK_SCSV" \ |
| 3175 | -S "inapropriate fallback" |
| 3176 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3177 | # Tests for CBC 1/n-1 record splitting |
| 3178 | |
| 3179 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 3180 | "$P_SRV" \ |
| 3181 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 3182 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3183 | 0 \ |
| 3184 | -s "Read from client: 123 bytes read" \ |
| 3185 | -S "Read from client: 1 bytes read" \ |
| 3186 | -S "122 bytes read" |
| 3187 | |
| 3188 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 3189 | "$P_SRV" \ |
| 3190 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 3191 | request_size=123 force_version=tls1_1" \ |
| 3192 | 0 \ |
| 3193 | -s "Read from client: 123 bytes read" \ |
| 3194 | -S "Read from client: 1 bytes read" \ |
| 3195 | -S "122 bytes read" |
| 3196 | |
| 3197 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 3198 | "$P_SRV" \ |
| 3199 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 3200 | request_size=123 force_version=tls1" \ |
| 3201 | 0 \ |
| 3202 | -S "Read from client: 123 bytes read" \ |
| 3203 | -s "Read from client: 1 bytes read" \ |
| 3204 | -s "122 bytes read" |
| 3205 | |
| 3206 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 3207 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3208 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 3209 | request_size=123 force_version=ssl3" \ |
| 3210 | 0 \ |
| 3211 | -S "Read from client: 123 bytes read" \ |
| 3212 | -s "Read from client: 1 bytes read" \ |
| 3213 | -s "122 bytes read" |
| 3214 | |
| 3215 | run_test "CBC Record splitting: TLS 1.0 RC4, no splitting" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3216 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3217 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 3218 | request_size=123 force_version=tls1" \ |
| 3219 | 0 \ |
| 3220 | -s "Read from client: 123 bytes read" \ |
| 3221 | -S "Read from client: 1 bytes read" \ |
| 3222 | -S "122 bytes read" |
| 3223 | |
| 3224 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 3225 | "$P_SRV" \ |
| 3226 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 3227 | request_size=123 force_version=tls1 recsplit=0" \ |
| 3228 | 0 \ |
| 3229 | -s "Read from client: 123 bytes read" \ |
| 3230 | -S "Read from client: 1 bytes read" \ |
| 3231 | -S "122 bytes read" |
| 3232 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 3233 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 3234 | "$P_SRV nbio=2" \ |
| 3235 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 3236 | request_size=123 force_version=tls1" \ |
| 3237 | 0 \ |
| 3238 | -S "Read from client: 123 bytes read" \ |
| 3239 | -s "Read from client: 1 bytes read" \ |
| 3240 | -s "122 bytes read" |
| 3241 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3242 | # Tests for Session Tickets |
| 3243 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3244 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3245 | "$P_SRV debug_level=3 tickets=1" \ |
| 3246 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3247 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3248 | -c "client hello, adding session ticket extension" \ |
| 3249 | -s "found session ticket extension" \ |
| 3250 | -s "server hello, adding session ticket extension" \ |
| 3251 | -c "found session_ticket extension" \ |
| 3252 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3253 | -S "session successfully restored from cache" \ |
| 3254 | -s "session successfully restored from ticket" \ |
| 3255 | -s "a session has been resumed" \ |
| 3256 | -c "a session has been resumed" |
| 3257 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3258 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3259 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3260 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3261 | 0 \ |
| 3262 | -c "client hello, adding session ticket extension" \ |
| 3263 | -s "found session ticket extension" \ |
| 3264 | -s "server hello, adding session ticket extension" \ |
| 3265 | -c "found session_ticket extension" \ |
| 3266 | -c "parse new session ticket" \ |
| 3267 | -S "session successfully restored from cache" \ |
| 3268 | -s "session successfully restored from ticket" \ |
| 3269 | -s "a session has been resumed" \ |
| 3270 | -c "a session has been resumed" |
| 3271 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3272 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3273 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3274 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_delay=2" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3275 | 0 \ |
| 3276 | -c "client hello, adding session ticket extension" \ |
| 3277 | -s "found session ticket extension" \ |
| 3278 | -s "server hello, adding session ticket extension" \ |
| 3279 | -c "found session_ticket extension" \ |
| 3280 | -c "parse new session ticket" \ |
| 3281 | -S "session successfully restored from cache" \ |
| 3282 | -S "session successfully restored from ticket" \ |
| 3283 | -S "a session has been resumed" \ |
| 3284 | -C "a session has been resumed" |
| 3285 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3286 | run_test "Session resume using tickets: session copy" \ |
| 3287 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3288 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3289 | 0 \ |
| 3290 | -c "client hello, adding session ticket extension" \ |
| 3291 | -s "found session ticket extension" \ |
| 3292 | -s "server hello, adding session ticket extension" \ |
| 3293 | -c "found session_ticket extension" \ |
| 3294 | -c "parse new session ticket" \ |
| 3295 | -S "session successfully restored from cache" \ |
| 3296 | -s "session successfully restored from ticket" \ |
| 3297 | -s "a session has been resumed" \ |
| 3298 | -c "a session has been resumed" |
| 3299 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3300 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3301 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3302 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3303 | 0 \ |
| 3304 | -c "client hello, adding session ticket extension" \ |
| 3305 | -c "found session_ticket extension" \ |
| 3306 | -c "parse new session ticket" \ |
| 3307 | -c "a session has been resumed" |
| 3308 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3309 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3310 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3311 | "( $O_CLI -sess_out $SESSION; \ |
| 3312 | $O_CLI -sess_in $SESSION; \ |
| 3313 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3314 | 0 \ |
| 3315 | -s "found session ticket extension" \ |
| 3316 | -s "server hello, adding session ticket extension" \ |
| 3317 | -S "session successfully restored from cache" \ |
| 3318 | -s "session successfully restored from ticket" \ |
| 3319 | -s "a session has been resumed" |
| 3320 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3321 | # Tests for Session Tickets with DTLS |
| 3322 | |
| 3323 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3324 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3325 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3326 | 0 \ |
| 3327 | -c "client hello, adding session ticket extension" \ |
| 3328 | -s "found session ticket extension" \ |
| 3329 | -s "server hello, adding session ticket extension" \ |
| 3330 | -c "found session_ticket extension" \ |
| 3331 | -c "parse new session ticket" \ |
| 3332 | -S "session successfully restored from cache" \ |
| 3333 | -s "session successfully restored from ticket" \ |
| 3334 | -s "a session has been resumed" \ |
| 3335 | -c "a session has been resumed" |
| 3336 | |
| 3337 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3338 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3339 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3340 | 0 \ |
| 3341 | -c "client hello, adding session ticket extension" \ |
| 3342 | -s "found session ticket extension" \ |
| 3343 | -s "server hello, adding session ticket extension" \ |
| 3344 | -c "found session_ticket extension" \ |
| 3345 | -c "parse new session ticket" \ |
| 3346 | -S "session successfully restored from cache" \ |
| 3347 | -s "session successfully restored from ticket" \ |
| 3348 | -s "a session has been resumed" \ |
| 3349 | -c "a session has been resumed" |
| 3350 | |
| 3351 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3352 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3353 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_delay=2" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3354 | 0 \ |
| 3355 | -c "client hello, adding session ticket extension" \ |
| 3356 | -s "found session ticket extension" \ |
| 3357 | -s "server hello, adding session ticket extension" \ |
| 3358 | -c "found session_ticket extension" \ |
| 3359 | -c "parse new session ticket" \ |
| 3360 | -S "session successfully restored from cache" \ |
| 3361 | -S "session successfully restored from ticket" \ |
| 3362 | -S "a session has been resumed" \ |
| 3363 | -C "a session has been resumed" |
| 3364 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3365 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3366 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3367 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3368 | 0 \ |
| 3369 | -c "client hello, adding session ticket extension" \ |
| 3370 | -s "found session ticket extension" \ |
| 3371 | -s "server hello, adding session ticket extension" \ |
| 3372 | -c "found session_ticket extension" \ |
| 3373 | -c "parse new session ticket" \ |
| 3374 | -S "session successfully restored from cache" \ |
| 3375 | -s "session successfully restored from ticket" \ |
| 3376 | -s "a session has been resumed" \ |
| 3377 | -c "a session has been resumed" |
| 3378 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3379 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3380 | "$O_SRV -dtls1" \ |
| 3381 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3382 | 0 \ |
| 3383 | -c "client hello, adding session ticket extension" \ |
| 3384 | -c "found session_ticket extension" \ |
| 3385 | -c "parse new session ticket" \ |
| 3386 | -c "a session has been resumed" |
| 3387 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3388 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 7ca2f39 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 3389 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3390 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3391 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3392 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3393 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3394 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3395 | rm -f $SESSION )" \ |
| 3396 | 0 \ |
| 3397 | -s "found session ticket extension" \ |
| 3398 | -s "server hello, adding session ticket extension" \ |
| 3399 | -S "session successfully restored from cache" \ |
| 3400 | -s "session successfully restored from ticket" \ |
| 3401 | -s "a session has been resumed" |
| 3402 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3403 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3404 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3405 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3406 | "$P_SRV debug_level=3 tickets=0" \ |
| 3407 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3408 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3409 | -c "client hello, adding session ticket extension" \ |
| 3410 | -s "found session ticket extension" \ |
| 3411 | -S "server hello, adding session ticket extension" \ |
| 3412 | -C "found session_ticket extension" \ |
| 3413 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3414 | -s "session successfully restored from cache" \ |
| 3415 | -S "session successfully restored from ticket" \ |
| 3416 | -s "a session has been resumed" \ |
| 3417 | -c "a session has been resumed" |
| 3418 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3419 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3420 | "$P_SRV debug_level=3 tickets=1" \ |
| 3421 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3422 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3423 | -C "client hello, adding session ticket extension" \ |
| 3424 | -S "found session ticket extension" \ |
| 3425 | -S "server hello, adding session ticket extension" \ |
| 3426 | -C "found session_ticket extension" \ |
| 3427 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3428 | -s "session successfully restored from cache" \ |
| 3429 | -S "session successfully restored from ticket" \ |
| 3430 | -s "a session has been resumed" \ |
| 3431 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3432 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3433 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3434 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3435 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3436 | 0 \ |
| 3437 | -S "session successfully restored from cache" \ |
| 3438 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3439 | -S "a session has been resumed" \ |
| 3440 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3441 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3442 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3443 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3444 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3445 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3446 | 0 \ |
| 3447 | -s "session successfully restored from cache" \ |
| 3448 | -S "session successfully restored from ticket" \ |
| 3449 | -s "a session has been resumed" \ |
| 3450 | -c "a session has been resumed" |
| 3451 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3453 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3454 | "$P_SRV debug_level=3 tickets=0" \ |
| 3455 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3456 | 0 \ |
| 3457 | -s "session successfully restored from cache" \ |
| 3458 | -S "session successfully restored from ticket" \ |
| 3459 | -s "a session has been resumed" \ |
| 3460 | -c "a session has been resumed" |
| 3461 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3462 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3463 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3464 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3465 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3466 | 0 \ |
| 3467 | -S "session successfully restored from cache" \ |
| 3468 | -S "session successfully restored from ticket" \ |
| 3469 | -S "a session has been resumed" \ |
| 3470 | -C "a session has been resumed" |
| 3471 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3472 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3473 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3474 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3475 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3476 | 0 \ |
| 3477 | -s "session successfully restored from cache" \ |
| 3478 | -S "session successfully restored from ticket" \ |
| 3479 | -s "a session has been resumed" \ |
| 3480 | -c "a session has been resumed" |
| 3481 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3482 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3483 | run_test "Session resume using cache: session copy" \ |
| 3484 | "$P_SRV debug_level=3 tickets=0" \ |
| 3485 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3486 | 0 \ |
| 3487 | -s "session successfully restored from cache" \ |
| 3488 | -S "session successfully restored from ticket" \ |
| 3489 | -s "a session has been resumed" \ |
| 3490 | -c "a session has been resumed" |
| 3491 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3492 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3493 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3494 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3495 | "( $O_CLI -sess_out $SESSION; \ |
| 3496 | $O_CLI -sess_in $SESSION; \ |
| 3497 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3498 | 0 \ |
| 3499 | -s "found session ticket extension" \ |
| 3500 | -S "server hello, adding session ticket extension" \ |
| 3501 | -s "session successfully restored from cache" \ |
| 3502 | -S "session successfully restored from ticket" \ |
| 3503 | -s "a session has been resumed" |
| 3504 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3505 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3506 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3507 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3508 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3509 | 0 \ |
| 3510 | -C "found session_ticket extension" \ |
| 3511 | -C "parse new session ticket" \ |
| 3512 | -c "a session has been resumed" |
| 3513 | |
Andrzej Kurek | c87d97b | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 3514 | # Tests for Session resume and extensions |
| 3515 | |
| 3516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3517 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3518 | run_test "Session resume and connection ID" \ |
| 3519 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 3520 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 3521 | 0 \ |
| 3522 | -c "Enable use of CID extension." \ |
| 3523 | -s "Enable use of CID extension." \ |
| 3524 | -c "client hello, adding CID extension" \ |
| 3525 | -s "found CID extension" \ |
| 3526 | -s "Use of CID extension negotiated" \ |
| 3527 | -s "server hello, adding CID extension" \ |
| 3528 | -c "found CID extension" \ |
| 3529 | -c "Use of CID extension negotiated" \ |
| 3530 | -s "Copy CIDs into SSL transform" \ |
| 3531 | -c "Copy CIDs into SSL transform" \ |
| 3532 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3533 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3534 | -s "Use of Connection ID has been negotiated" \ |
| 3535 | -c "Use of Connection ID has been negotiated" |
| 3536 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3537 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3538 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3539 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3540 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3541 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3542 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3543 | 0 \ |
| 3544 | -c "client hello, adding session ticket extension" \ |
| 3545 | -s "found session ticket extension" \ |
| 3546 | -S "server hello, adding session ticket extension" \ |
| 3547 | -C "found session_ticket extension" \ |
| 3548 | -C "parse new session ticket" \ |
| 3549 | -s "session successfully restored from cache" \ |
| 3550 | -S "session successfully restored from ticket" \ |
| 3551 | -s "a session has been resumed" \ |
| 3552 | -c "a session has been resumed" |
| 3553 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3554 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3555 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3556 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3557 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3558 | 0 \ |
| 3559 | -C "client hello, adding session ticket extension" \ |
| 3560 | -S "found session ticket extension" \ |
| 3561 | -S "server hello, adding session ticket extension" \ |
| 3562 | -C "found session_ticket extension" \ |
| 3563 | -C "parse new session ticket" \ |
| 3564 | -s "session successfully restored from cache" \ |
| 3565 | -S "session successfully restored from ticket" \ |
| 3566 | -s "a session has been resumed" \ |
| 3567 | -c "a session has been resumed" |
| 3568 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3569 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3570 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3571 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3572 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3573 | 0 \ |
| 3574 | -S "session successfully restored from cache" \ |
| 3575 | -S "session successfully restored from ticket" \ |
| 3576 | -S "a session has been resumed" \ |
| 3577 | -C "a session has been resumed" |
| 3578 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3579 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3580 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3581 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3582 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3583 | 0 \ |
| 3584 | -s "session successfully restored from cache" \ |
| 3585 | -S "session successfully restored from ticket" \ |
| 3586 | -s "a session has been resumed" \ |
| 3587 | -c "a session has been resumed" |
| 3588 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3589 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3590 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3591 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3592 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=0" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3593 | 0 \ |
| 3594 | -s "session successfully restored from cache" \ |
| 3595 | -S "session successfully restored from ticket" \ |
| 3596 | -s "a session has been resumed" \ |
| 3597 | -c "a session has been resumed" |
| 3598 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3599 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3600 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3601 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3602 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3603 | 0 \ |
| 3604 | -S "session successfully restored from cache" \ |
| 3605 | -S "session successfully restored from ticket" \ |
| 3606 | -S "a session has been resumed" \ |
| 3607 | -C "a session has been resumed" |
| 3608 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3609 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3610 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3611 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3612 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3613 | 0 \ |
| 3614 | -s "session successfully restored from cache" \ |
| 3615 | -S "session successfully restored from ticket" \ |
| 3616 | -s "a session has been resumed" \ |
| 3617 | -c "a session has been resumed" |
| 3618 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3619 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3620 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3621 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3622 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3623 | 0 \ |
| 3624 | -s "session successfully restored from cache" \ |
| 3625 | -S "session successfully restored from ticket" \ |
| 3626 | -s "a session has been resumed" \ |
| 3627 | -c "a session has been resumed" |
| 3628 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3629 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 7ca2f39 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 3630 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3631 | requires_openssl_next |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3632 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3633 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3634 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3635 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3636 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3637 | rm -f $SESSION )" \ |
| 3638 | 0 \ |
| 3639 | -s "found session ticket extension" \ |
| 3640 | -S "server hello, adding session ticket extension" \ |
| 3641 | -s "session successfully restored from cache" \ |
| 3642 | -S "session successfully restored from ticket" \ |
| 3643 | -s "a session has been resumed" |
| 3644 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3645 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3646 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3647 | "$O_SRV -dtls1" \ |
| 3648 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3649 | 0 \ |
| 3650 | -C "found session_ticket extension" \ |
| 3651 | -C "parse new session ticket" \ |
| 3652 | -c "a session has been resumed" |
| 3653 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3654 | # Tests for Max Fragment Length extension |
| 3655 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3656 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3657 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3658 | "$P_SRV debug_level=3" \ |
| 3659 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3660 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3661 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3662 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3663 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3664 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3665 | -C "client hello, adding max_fragment_length extension" \ |
| 3666 | -S "found max fragment length extension" \ |
| 3667 | -S "server hello, max_fragment_length extension" \ |
| 3668 | -C "found max_fragment_length extension" |
| 3669 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3670 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3671 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3672 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3673 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3674 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3675 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3676 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3677 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3678 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3679 | -C "client hello, adding max_fragment_length extension" \ |
| 3680 | -S "found max fragment length extension" \ |
| 3681 | -S "server hello, max_fragment_length extension" \ |
| 3682 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3683 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3684 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3685 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3686 | |
| 3687 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3688 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3689 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3690 | "$P_CLI debug_level=3 dtls=1 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3691 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3692 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3693 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3694 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3695 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3696 | -C "client hello, adding max_fragment_length extension" \ |
| 3697 | -S "found max fragment length extension" \ |
| 3698 | -S "server hello, max_fragment_length extension" \ |
| 3699 | -C "found max_fragment_length extension" \ |
| 3700 | -c "fragment larger than.*maximum " |
| 3701 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3702 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3703 | # (session fragment length will be 16384 regardless of mbedtls |
| 3704 | # content length configuration.) |
| 3705 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3706 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3707 | run_test "Max fragment length: disabled, larger message" \ |
| 3708 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3709 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3710 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3711 | -C "Maximum input fragment length is 16384" \ |
| 3712 | -C "Maximum output fragment length is 16384" \ |
| 3713 | -S "Maximum input fragment length is 16384" \ |
| 3714 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3715 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3716 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3717 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3718 | |
| 3719 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3720 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3721 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3722 | "$P_CLI debug_level=3 dtls=1 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3723 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3724 | -C "Maximum input fragment length is 16384" \ |
| 3725 | -C "Maximum output fragment length is 16384" \ |
| 3726 | -S "Maximum input fragment length is 16384" \ |
| 3727 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3728 | -c "fragment larger than.*maximum " |
| 3729 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3730 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3731 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3732 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3733 | "$P_SRV debug_level=3" \ |
| 3734 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3735 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3736 | -c "Maximum input fragment length is 4096" \ |
| 3737 | -c "Maximum output fragment length is 4096" \ |
| 3738 | -s "Maximum input fragment length is 4096" \ |
| 3739 | -s "Maximum output fragment length is 4096" \ |
| 3740 | -c "client hello, adding max_fragment_length extension" \ |
| 3741 | -s "found max fragment length extension" \ |
| 3742 | -s "server hello, max_fragment_length extension" \ |
| 3743 | -c "found max_fragment_length extension" |
| 3744 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3745 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3746 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3747 | run_test "Max fragment length: client 512, server 1024" \ |
| 3748 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3749 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3750 | 0 \ |
| 3751 | -c "Maximum input fragment length is 512" \ |
| 3752 | -c "Maximum output fragment length is 512" \ |
| 3753 | -s "Maximum input fragment length is 512" \ |
| 3754 | -s "Maximum output fragment length is 512" \ |
| 3755 | -c "client hello, adding max_fragment_length extension" \ |
| 3756 | -s "found max fragment length extension" \ |
| 3757 | -s "server hello, max_fragment_length extension" \ |
| 3758 | -c "found max_fragment_length extension" |
| 3759 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3760 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3761 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3762 | run_test "Max fragment length: client 512, server 2048" \ |
| 3763 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3764 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3765 | 0 \ |
| 3766 | -c "Maximum input fragment length is 512" \ |
| 3767 | -c "Maximum output fragment length is 512" \ |
| 3768 | -s "Maximum input fragment length is 512" \ |
| 3769 | -s "Maximum output fragment length is 512" \ |
| 3770 | -c "client hello, adding max_fragment_length extension" \ |
| 3771 | -s "found max fragment length extension" \ |
| 3772 | -s "server hello, max_fragment_length extension" \ |
| 3773 | -c "found max_fragment_length extension" |
| 3774 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3775 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3776 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3777 | run_test "Max fragment length: client 512, server 4096" \ |
| 3778 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3779 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3780 | 0 \ |
| 3781 | -c "Maximum input fragment length is 512" \ |
| 3782 | -c "Maximum output fragment length is 512" \ |
| 3783 | -s "Maximum input fragment length is 512" \ |
| 3784 | -s "Maximum output fragment length is 512" \ |
| 3785 | -c "client hello, adding max_fragment_length extension" \ |
| 3786 | -s "found max fragment length extension" \ |
| 3787 | -s "server hello, max_fragment_length extension" \ |
| 3788 | -c "found max_fragment_length extension" |
| 3789 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3790 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3791 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3792 | run_test "Max fragment length: client 1024, server 512" \ |
| 3793 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3794 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3795 | 0 \ |
| 3796 | -c "Maximum input fragment length is 1024" \ |
| 3797 | -c "Maximum output fragment length is 1024" \ |
| 3798 | -s "Maximum input fragment length is 1024" \ |
| 3799 | -s "Maximum output fragment length is 512" \ |
| 3800 | -c "client hello, adding max_fragment_length extension" \ |
| 3801 | -s "found max fragment length extension" \ |
| 3802 | -s "server hello, max_fragment_length extension" \ |
| 3803 | -c "found max_fragment_length extension" |
| 3804 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3805 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3806 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3807 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3808 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3809 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3810 | 0 \ |
| 3811 | -c "Maximum input fragment length is 1024" \ |
| 3812 | -c "Maximum output fragment length is 1024" \ |
| 3813 | -s "Maximum input fragment length is 1024" \ |
| 3814 | -s "Maximum output fragment length is 1024" \ |
| 3815 | -c "client hello, adding max_fragment_length extension" \ |
| 3816 | -s "found max fragment length extension" \ |
| 3817 | -s "server hello, max_fragment_length extension" \ |
| 3818 | -c "found max_fragment_length extension" |
| 3819 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3820 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3821 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3822 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3823 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3824 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3825 | 0 \ |
| 3826 | -c "Maximum input fragment length is 1024" \ |
| 3827 | -c "Maximum output fragment length is 1024" \ |
| 3828 | -s "Maximum input fragment length is 1024" \ |
| 3829 | -s "Maximum output fragment length is 1024" \ |
| 3830 | -c "client hello, adding max_fragment_length extension" \ |
| 3831 | -s "found max fragment length extension" \ |
| 3832 | -s "server hello, max_fragment_length extension" \ |
| 3833 | -c "found max_fragment_length extension" |
| 3834 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3835 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3836 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3837 | run_test "Max fragment length: client 2048, server 512" \ |
| 3838 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3839 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3840 | 0 \ |
| 3841 | -c "Maximum input fragment length is 2048" \ |
| 3842 | -c "Maximum output fragment length is 2048" \ |
| 3843 | -s "Maximum input fragment length is 2048" \ |
| 3844 | -s "Maximum output fragment length is 512" \ |
| 3845 | -c "client hello, adding max_fragment_length extension" \ |
| 3846 | -s "found max fragment length extension" \ |
| 3847 | -s "server hello, max_fragment_length extension" \ |
| 3848 | -c "found max_fragment_length extension" |
| 3849 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3850 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3851 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3852 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3853 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3854 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3855 | 0 \ |
| 3856 | -c "Maximum input fragment length is 2048" \ |
| 3857 | -c "Maximum output fragment length is 2048" \ |
| 3858 | -s "Maximum input fragment length is 2048" \ |
| 3859 | -s "Maximum output fragment length is 1024" \ |
| 3860 | -c "client hello, adding max_fragment_length extension" \ |
| 3861 | -s "found max fragment length extension" \ |
| 3862 | -s "server hello, max_fragment_length extension" \ |
| 3863 | -c "found max_fragment_length extension" |
| 3864 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3865 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3866 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3867 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3868 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3869 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3870 | 0 \ |
| 3871 | -c "Maximum input fragment length is 2048" \ |
| 3872 | -c "Maximum output fragment length is 2048" \ |
| 3873 | -s "Maximum input fragment length is 2048" \ |
| 3874 | -s "Maximum output fragment length is 2048" \ |
| 3875 | -c "client hello, adding max_fragment_length extension" \ |
| 3876 | -s "found max fragment length extension" \ |
| 3877 | -s "server hello, max_fragment_length extension" \ |
| 3878 | -c "found max_fragment_length extension" |
| 3879 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3880 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3881 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3882 | run_test "Max fragment length: client 4096, server 512" \ |
| 3883 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3884 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3885 | 0 \ |
| 3886 | -c "Maximum input fragment length is 4096" \ |
| 3887 | -c "Maximum output fragment length is 4096" \ |
| 3888 | -s "Maximum input fragment length is 4096" \ |
| 3889 | -s "Maximum output fragment length is 512" \ |
| 3890 | -c "client hello, adding max_fragment_length extension" \ |
| 3891 | -s "found max fragment length extension" \ |
| 3892 | -s "server hello, max_fragment_length extension" \ |
| 3893 | -c "found max_fragment_length extension" |
| 3894 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3895 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3896 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3897 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3898 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3899 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3900 | 0 \ |
| 3901 | -c "Maximum input fragment length is 4096" \ |
| 3902 | -c "Maximum output fragment length is 4096" \ |
| 3903 | -s "Maximum input fragment length is 4096" \ |
| 3904 | -s "Maximum output fragment length is 1024" \ |
| 3905 | -c "client hello, adding max_fragment_length extension" \ |
| 3906 | -s "found max fragment length extension" \ |
| 3907 | -s "server hello, max_fragment_length extension" \ |
| 3908 | -c "found max_fragment_length extension" |
| 3909 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3910 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3911 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3912 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3913 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3914 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3915 | 0 \ |
| 3916 | -c "Maximum input fragment length is 4096" \ |
| 3917 | -c "Maximum output fragment length is 4096" \ |
| 3918 | -s "Maximum input fragment length is 4096" \ |
| 3919 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3920 | -c "client hello, adding max_fragment_length extension" \ |
| 3921 | -s "found max fragment length extension" \ |
| 3922 | -s "server hello, max_fragment_length extension" \ |
| 3923 | -c "found max_fragment_length extension" |
| 3924 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3925 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3926 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3927 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3928 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3929 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3930 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3931 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3932 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3933 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3934 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3935 | -C "client hello, adding max_fragment_length extension" \ |
| 3936 | -S "found max fragment length extension" \ |
| 3937 | -S "server hello, max_fragment_length extension" \ |
| 3938 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3939 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3940 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3941 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3942 | requires_gnutls |
| 3943 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3944 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3945 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3946 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3947 | -c "Maximum input fragment length is 4096" \ |
| 3948 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3949 | -c "client hello, adding max_fragment_length extension" \ |
| 3950 | -c "found max_fragment_length extension" |
| 3951 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3952 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3953 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3954 | run_test "Max fragment length: client, message just fits" \ |
| 3955 | "$P_SRV debug_level=3" \ |
| 3956 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3957 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3958 | -c "Maximum input fragment length is 2048" \ |
| 3959 | -c "Maximum output fragment length is 2048" \ |
| 3960 | -s "Maximum input fragment length is 2048" \ |
| 3961 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3962 | -c "client hello, adding max_fragment_length extension" \ |
| 3963 | -s "found max fragment length extension" \ |
| 3964 | -s "server hello, max_fragment_length extension" \ |
| 3965 | -c "found max_fragment_length extension" \ |
| 3966 | -c "2048 bytes written in 1 fragments" \ |
| 3967 | -s "2048 bytes read" |
| 3968 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3969 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3970 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3971 | run_test "Max fragment length: client, larger message" \ |
| 3972 | "$P_SRV debug_level=3" \ |
| 3973 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3974 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3975 | -c "Maximum input fragment length is 2048" \ |
| 3976 | -c "Maximum output fragment length is 2048" \ |
| 3977 | -s "Maximum input fragment length is 2048" \ |
| 3978 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3979 | -c "client hello, adding max_fragment_length extension" \ |
| 3980 | -s "found max fragment length extension" \ |
| 3981 | -s "server hello, max_fragment_length extension" \ |
| 3982 | -c "found max_fragment_length extension" \ |
| 3983 | -c "2345 bytes written in 2 fragments" \ |
| 3984 | -s "2048 bytes read" \ |
| 3985 | -s "297 bytes read" |
| 3986 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3987 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3988 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3989 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3990 | "$P_SRV debug_level=3 dtls=1" \ |
| 3991 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3992 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3993 | -c "Maximum input fragment length is 2048" \ |
| 3994 | -c "Maximum output fragment length is 2048" \ |
| 3995 | -s "Maximum input fragment length is 2048" \ |
| 3996 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3997 | -c "client hello, adding max_fragment_length extension" \ |
| 3998 | -s "found max fragment length extension" \ |
| 3999 | -s "server hello, max_fragment_length extension" \ |
| 4000 | -c "found max_fragment_length extension" \ |
| 4001 | -c "fragment larger than.*maximum" |
| 4002 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4003 | # Tests for renegotiation |
| 4004 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4005 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4006 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4007 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4008 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4009 | 0 \ |
| 4010 | -C "client hello, adding renegotiation extension" \ |
| 4011 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4012 | -S "found renegotiation extension" \ |
| 4013 | -s "server hello, secure renegotiation extension" \ |
| 4014 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4015 | -C "=> renegotiate" \ |
| 4016 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4017 | -S "write hello request" |
| 4018 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4019 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4020 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4021 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4022 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4023 | 0 \ |
| 4024 | -c "client hello, adding renegotiation extension" \ |
| 4025 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4026 | -s "found renegotiation extension" \ |
| 4027 | -s "server hello, secure renegotiation extension" \ |
| 4028 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4029 | -c "=> renegotiate" \ |
| 4030 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4031 | -S "write hello request" |
| 4032 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4033 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4034 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4035 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4036 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4037 | 0 \ |
| 4038 | -c "client hello, adding renegotiation extension" \ |
| 4039 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4040 | -s "found renegotiation extension" \ |
| 4041 | -s "server hello, secure renegotiation extension" \ |
| 4042 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4043 | -c "=> renegotiate" \ |
| 4044 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4045 | -s "write hello request" |
| 4046 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4047 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4048 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 4049 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4050 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4051 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4052 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4053 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4054 | 0 \ |
| 4055 | -c "client hello, adding renegotiation extension" \ |
| 4056 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4057 | -s "found renegotiation extension" \ |
| 4058 | -s "server hello, secure renegotiation extension" \ |
| 4059 | -c "found renegotiation extension" \ |
| 4060 | -c "=> renegotiate" \ |
| 4061 | -s "=> renegotiate" \ |
| 4062 | -S "write hello request" \ |
| 4063 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4064 | |
| 4065 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4066 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 4067 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4068 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4069 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4070 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4071 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4072 | 0 \ |
| 4073 | -c "client hello, adding renegotiation extension" \ |
| 4074 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4075 | -s "found renegotiation extension" \ |
| 4076 | -s "server hello, secure renegotiation extension" \ |
| 4077 | -c "found renegotiation extension" \ |
| 4078 | -c "=> renegotiate" \ |
| 4079 | -s "=> renegotiate" \ |
| 4080 | -s "write hello request" \ |
| 4081 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4082 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4083 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4084 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4085 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4086 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4087 | 0 \ |
| 4088 | -c "client hello, adding renegotiation extension" \ |
| 4089 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4090 | -s "found renegotiation extension" \ |
| 4091 | -s "server hello, secure renegotiation extension" \ |
| 4092 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4093 | -c "=> renegotiate" \ |
| 4094 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4095 | -s "write hello request" |
| 4096 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4097 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4098 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4099 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4100 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4101 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4102 | "$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" \ |
| 4103 | 0 \ |
| 4104 | -c "Maximum input fragment length is 2048" \ |
| 4105 | -c "Maximum output fragment length is 2048" \ |
| 4106 | -s "Maximum input fragment length is 2048" \ |
| 4107 | -s "Maximum output fragment length is 512" \ |
| 4108 | -c "client hello, adding max_fragment_length extension" \ |
| 4109 | -s "found max fragment length extension" \ |
| 4110 | -s "server hello, max_fragment_length extension" \ |
| 4111 | -c "found max_fragment_length extension" \ |
| 4112 | -c "client hello, adding renegotiation extension" \ |
| 4113 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4114 | -s "found renegotiation extension" \ |
| 4115 | -s "server hello, secure renegotiation extension" \ |
| 4116 | -c "found renegotiation extension" \ |
| 4117 | -c "=> renegotiate" \ |
| 4118 | -s "=> renegotiate" \ |
| 4119 | -s "write hello request" |
| 4120 | |
| 4121 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4122 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4123 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4124 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4125 | 1 \ |
| 4126 | -c "client hello, adding renegotiation extension" \ |
| 4127 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4128 | -S "found renegotiation extension" \ |
| 4129 | -s "server hello, secure renegotiation extension" \ |
| 4130 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4131 | -c "=> renegotiate" \ |
| 4132 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4133 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4134 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4135 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4136 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4137 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4138 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4139 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4140 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4141 | 0 \ |
| 4142 | -C "client hello, adding renegotiation extension" \ |
| 4143 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4144 | -S "found renegotiation extension" \ |
| 4145 | -s "server hello, secure renegotiation extension" \ |
| 4146 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4147 | -C "=> renegotiate" \ |
| 4148 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4149 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4150 | -S "SSL - An unexpected message was received from our peer" \ |
| 4151 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4152 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4153 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4154 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4155 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4156 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4157 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4158 | 0 \ |
| 4159 | -C "client hello, adding renegotiation extension" \ |
| 4160 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4161 | -S "found renegotiation extension" \ |
| 4162 | -s "server hello, secure renegotiation extension" \ |
| 4163 | -c "found renegotiation extension" \ |
| 4164 | -C "=> renegotiate" \ |
| 4165 | -S "=> renegotiate" \ |
| 4166 | -s "write hello request" \ |
| 4167 | -S "SSL - An unexpected message was received from our peer" \ |
| 4168 | -S "failed" |
| 4169 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4170 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4171 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4172 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4173 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4174 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4175 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4176 | 0 \ |
| 4177 | -C "client hello, adding renegotiation extension" \ |
| 4178 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4179 | -S "found renegotiation extension" \ |
| 4180 | -s "server hello, secure renegotiation extension" \ |
| 4181 | -c "found renegotiation extension" \ |
| 4182 | -C "=> renegotiate" \ |
| 4183 | -S "=> renegotiate" \ |
| 4184 | -s "write hello request" \ |
| 4185 | -S "SSL - An unexpected message was received from our peer" \ |
| 4186 | -S "failed" |
| 4187 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4188 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4189 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4190 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4191 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4192 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4193 | 0 \ |
| 4194 | -C "client hello, adding renegotiation extension" \ |
| 4195 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4196 | -S "found renegotiation extension" \ |
| 4197 | -s "server hello, secure renegotiation extension" \ |
| 4198 | -c "found renegotiation extension" \ |
| 4199 | -C "=> renegotiate" \ |
| 4200 | -S "=> renegotiate" \ |
| 4201 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4202 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4203 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4204 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4205 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4206 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4207 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4208 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4209 | 0 \ |
| 4210 | -c "client hello, adding renegotiation extension" \ |
| 4211 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4212 | -s "found renegotiation extension" \ |
| 4213 | -s "server hello, secure renegotiation extension" \ |
| 4214 | -c "found renegotiation extension" \ |
| 4215 | -c "=> renegotiate" \ |
| 4216 | -s "=> renegotiate" \ |
| 4217 | -s "write hello request" \ |
| 4218 | -S "SSL - An unexpected message was received from our peer" \ |
| 4219 | -S "failed" |
| 4220 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4221 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4222 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4223 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4224 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4225 | 0 \ |
| 4226 | -C "client hello, adding renegotiation extension" \ |
| 4227 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4228 | -S "found renegotiation extension" \ |
| 4229 | -s "server hello, secure renegotiation extension" \ |
| 4230 | -c "found renegotiation extension" \ |
| 4231 | -S "record counter limit reached: renegotiate" \ |
| 4232 | -C "=> renegotiate" \ |
| 4233 | -S "=> renegotiate" \ |
| 4234 | -S "write hello request" \ |
| 4235 | -S "SSL - An unexpected message was received from our peer" \ |
| 4236 | -S "failed" |
| 4237 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4238 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4240 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4241 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4242 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4243 | 0 \ |
| 4244 | -c "client hello, adding renegotiation extension" \ |
| 4245 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4246 | -s "found renegotiation extension" \ |
| 4247 | -s "server hello, secure renegotiation extension" \ |
| 4248 | -c "found renegotiation extension" \ |
| 4249 | -s "record counter limit reached: renegotiate" \ |
| 4250 | -c "=> renegotiate" \ |
| 4251 | -s "=> renegotiate" \ |
| 4252 | -s "write hello request" \ |
| 4253 | -S "SSL - An unexpected message was received from our peer" \ |
| 4254 | -S "failed" |
| 4255 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4256 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4257 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4258 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4259 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4260 | 0 \ |
| 4261 | -c "client hello, adding renegotiation extension" \ |
| 4262 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4263 | -s "found renegotiation extension" \ |
| 4264 | -s "server hello, secure renegotiation extension" \ |
| 4265 | -c "found renegotiation extension" \ |
| 4266 | -s "record counter limit reached: renegotiate" \ |
| 4267 | -c "=> renegotiate" \ |
| 4268 | -s "=> renegotiate" \ |
| 4269 | -s "write hello request" \ |
| 4270 | -S "SSL - An unexpected message was received from our peer" \ |
| 4271 | -S "failed" |
| 4272 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4273 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4274 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4275 | "$P_SRV debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4276 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4277 | 0 \ |
| 4278 | -C "client hello, adding renegotiation extension" \ |
| 4279 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4280 | -S "found renegotiation extension" \ |
| 4281 | -s "server hello, secure renegotiation extension" \ |
| 4282 | -c "found renegotiation extension" \ |
| 4283 | -S "record counter limit reached: renegotiate" \ |
| 4284 | -C "=> renegotiate" \ |
| 4285 | -S "=> renegotiate" \ |
| 4286 | -S "write hello request" \ |
| 4287 | -S "SSL - An unexpected message was received from our peer" \ |
| 4288 | -S "failed" |
| 4289 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4290 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4291 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4292 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4293 | "$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 4294 | 0 \ |
| 4295 | -c "client hello, adding renegotiation extension" \ |
| 4296 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4297 | -s "found renegotiation extension" \ |
| 4298 | -s "server hello, secure renegotiation extension" \ |
| 4299 | -c "found renegotiation extension" \ |
| 4300 | -c "=> renegotiate" \ |
| 4301 | -s "=> renegotiate" \ |
| 4302 | -S "write hello request" |
| 4303 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4304 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4305 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4306 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4307 | "$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 4308 | 0 \ |
| 4309 | -c "client hello, adding renegotiation extension" \ |
| 4310 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4311 | -s "found renegotiation extension" \ |
| 4312 | -s "server hello, secure renegotiation extension" \ |
| 4313 | -c "found renegotiation extension" \ |
| 4314 | -c "=> renegotiate" \ |
| 4315 | -s "=> renegotiate" \ |
| 4316 | -s "write hello request" |
| 4317 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4318 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4319 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4320 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4321 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4322 | 0 \ |
| 4323 | -c "client hello, adding renegotiation extension" \ |
| 4324 | -c "found renegotiation extension" \ |
| 4325 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4326 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4327 | -C "error" \ |
| 4328 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4329 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4330 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4332 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 4333 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4334 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4335 | 0 \ |
| 4336 | -c "client hello, adding renegotiation extension" \ |
| 4337 | -c "found renegotiation extension" \ |
| 4338 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4339 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4340 | -C "error" \ |
| 4341 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4342 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4343 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4344 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4345 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 4346 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4347 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4348 | 1 \ |
| 4349 | -c "client hello, adding renegotiation extension" \ |
| 4350 | -C "found renegotiation extension" \ |
| 4351 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4352 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4353 | -c "error" \ |
| 4354 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4355 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4356 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4357 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4358 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 4359 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4360 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4361 | allow_legacy=0" \ |
| 4362 | 1 \ |
| 4363 | -c "client hello, adding renegotiation extension" \ |
| 4364 | -C "found renegotiation extension" \ |
| 4365 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4366 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4367 | -c "error" \ |
| 4368 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4369 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4370 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4371 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4372 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 4373 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4374 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4375 | allow_legacy=1" \ |
| 4376 | 0 \ |
| 4377 | -c "client hello, adding renegotiation extension" \ |
| 4378 | -C "found renegotiation extension" \ |
| 4379 | -c "=> renegotiate" \ |
| 4380 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4381 | -C "error" \ |
| 4382 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4383 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4384 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4385 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4386 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4387 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4388 | 0 \ |
| 4389 | -c "client hello, adding renegotiation extension" \ |
| 4390 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4391 | -s "found renegotiation extension" \ |
| 4392 | -s "server hello, secure renegotiation extension" \ |
| 4393 | -c "found renegotiation extension" \ |
| 4394 | -c "=> renegotiate" \ |
| 4395 | -s "=> renegotiate" \ |
| 4396 | -S "write hello request" |
| 4397 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4398 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4399 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4400 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | df9a0a8 | 2014-10-02 14:17:18 +0200 | [diff] [blame] | 4401 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4402 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4403 | 0 \ |
| 4404 | -c "client hello, adding renegotiation extension" \ |
| 4405 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4406 | -s "found renegotiation extension" \ |
| 4407 | -s "server hello, secure renegotiation extension" \ |
| 4408 | -c "found renegotiation extension" \ |
| 4409 | -c "=> renegotiate" \ |
| 4410 | -s "=> renegotiate" \ |
| 4411 | -s "write hello request" |
| 4412 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4413 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4414 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4415 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4416 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4417 | 0 \ |
| 4418 | -c "client hello, adding renegotiation extension" \ |
| 4419 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4420 | -s "found renegotiation extension" \ |
| 4421 | -s "server hello, secure renegotiation extension" \ |
| 4422 | -s "record counter limit reached: renegotiate" \ |
| 4423 | -c "=> renegotiate" \ |
| 4424 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4425 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4426 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4427 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4428 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4429 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4430 | "$G_SRV -u --mtu 4096" \ |
| 4431 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4432 | 0 \ |
| 4433 | -c "client hello, adding renegotiation extension" \ |
| 4434 | -c "found renegotiation extension" \ |
| 4435 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4436 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4437 | -C "error" \ |
| 4438 | -s "Extra-header:" |
| 4439 | |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 4440 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4441 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4442 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4443 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4444 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4445 | "$P_CLI debug_level=3" \ |
| 4446 | 0 \ |
| 4447 | -c "found renegotiation extension" \ |
| 4448 | -C "error" \ |
| 4449 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4450 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4451 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4452 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4453 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4454 | "$P_CLI debug_level=3" \ |
| 4455 | 0 \ |
| 4456 | -C "found renegotiation extension" \ |
| 4457 | -C "error" \ |
| 4458 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4459 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4460 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4461 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4462 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4463 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4464 | 1 \ |
| 4465 | -C "found renegotiation extension" \ |
| 4466 | -c "error" \ |
| 4467 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4468 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4469 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4470 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4471 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4472 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4473 | 0 \ |
| 4474 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4475 | -s "server hello, secure renegotiation extension" |
| 4476 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4477 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4478 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4479 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4480 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4481 | 0 \ |
| 4482 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4483 | -S "server hello, secure renegotiation extension" |
| 4484 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4485 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4486 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4487 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4488 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4489 | 1 \ |
| 4490 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4491 | -S "server hello, secure renegotiation extension" |
| 4492 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4493 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4494 | |
| 4495 | requires_gnutls |
| 4496 | run_test "DER format: no trailing bytes" \ |
| 4497 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4498 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4499 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4500 | 0 \ |
| 4501 | -c "Handshake was completed" \ |
| 4502 | |
| 4503 | requires_gnutls |
| 4504 | run_test "DER format: with a trailing zero byte" \ |
| 4505 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4506 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4507 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4508 | 0 \ |
| 4509 | -c "Handshake was completed" \ |
| 4510 | |
| 4511 | requires_gnutls |
| 4512 | run_test "DER format: with a trailing random byte" \ |
| 4513 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4514 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4515 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4516 | 0 \ |
| 4517 | -c "Handshake was completed" \ |
| 4518 | |
| 4519 | requires_gnutls |
| 4520 | run_test "DER format: with 2 trailing random bytes" \ |
| 4521 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4522 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4523 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4524 | 0 \ |
| 4525 | -c "Handshake was completed" \ |
| 4526 | |
| 4527 | requires_gnutls |
| 4528 | run_test "DER format: with 4 trailing random bytes" \ |
| 4529 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4530 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4531 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4532 | 0 \ |
| 4533 | -c "Handshake was completed" \ |
| 4534 | |
| 4535 | requires_gnutls |
| 4536 | run_test "DER format: with 8 trailing random bytes" \ |
| 4537 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4538 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4539 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4540 | 0 \ |
| 4541 | -c "Handshake was completed" \ |
| 4542 | |
| 4543 | requires_gnutls |
| 4544 | run_test "DER format: with 9 trailing random bytes" \ |
| 4545 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4546 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4547 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4548 | 0 \ |
| 4549 | -c "Handshake was completed" \ |
| 4550 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4551 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4552 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4553 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4554 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4555 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4556 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4557 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4558 | 1 \ |
| 4559 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4560 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4561 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4562 | -c "X509 - Certificate verification failed" |
| 4563 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4564 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4565 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4566 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4567 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4568 | 0 \ |
| 4569 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4570 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4571 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4572 | -C "X509 - Certificate verification failed" |
| 4573 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4574 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4575 | "$P_SRV" \ |
| 4576 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4577 | 0 \ |
| 4578 | -c "x509_verify_cert() returned" \ |
| 4579 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4580 | -c "! Certificate verification flags"\ |
| 4581 | -C "! mbedtls_ssl_handshake returned" \ |
| 4582 | -C "X509 - Certificate verification failed" \ |
| 4583 | -C "SSL - No CA Chain is set, but required to operate" |
| 4584 | |
| 4585 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4586 | "$P_SRV" \ |
| 4587 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4588 | 1 \ |
| 4589 | -c "x509_verify_cert() returned" \ |
| 4590 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4591 | -c "! Certificate verification flags"\ |
| 4592 | -c "! mbedtls_ssl_handshake returned" \ |
| 4593 | -c "SSL - No CA Chain is set, but required to operate" |
| 4594 | |
| 4595 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4596 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4597 | # the client informs the server about the supported curves - it does, though, in the |
| 4598 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4599 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4600 | # different means to have the server ignoring the client's supported curve list. |
| 4601 | |
| 4602 | requires_config_enabled MBEDTLS_ECP_C |
| 4603 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4604 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4605 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4606 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4607 | 1 \ |
| 4608 | -c "bad certificate (EC key curve)"\ |
| 4609 | -c "! Certificate verification flags"\ |
| 4610 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4611 | |
| 4612 | requires_config_enabled MBEDTLS_ECP_C |
| 4613 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4614 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4615 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4616 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4617 | 1 \ |
| 4618 | -c "bad certificate (EC key curve)"\ |
| 4619 | -c "! Certificate verification flags"\ |
| 4620 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4621 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4622 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4623 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4624 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4625 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4626 | 0 \ |
| 4627 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4628 | -C "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4629 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4630 | -C "X509 - Certificate verification failed" |
| 4631 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4632 | run_test "Authentication: client SHA256, server required" \ |
| 4633 | "$P_SRV auth_mode=required" \ |
| 4634 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4635 | key_file=data_files/server6.key \ |
| 4636 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4637 | 0 \ |
| 4638 | -c "Supported Signature Algorithm found: 4," \ |
| 4639 | -c "Supported Signature Algorithm found: 5," |
| 4640 | |
| 4641 | run_test "Authentication: client SHA384, server required" \ |
| 4642 | "$P_SRV auth_mode=required" \ |
| 4643 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4644 | key_file=data_files/server6.key \ |
| 4645 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4646 | 0 \ |
| 4647 | -c "Supported Signature Algorithm found: 4," \ |
| 4648 | -c "Supported Signature Algorithm found: 5," |
| 4649 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4650 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 4651 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 4652 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 4653 | key_file=data_files/server5.key" \ |
| 4654 | 1 \ |
| 4655 | -S "skip write certificate request" \ |
| 4656 | -C "skip parse certificate request" \ |
| 4657 | -c "got a certificate request" \ |
| 4658 | -c "got no certificate to send" \ |
| 4659 | -S "x509_verify_cert() returned" \ |
| 4660 | -s "client has no certificate" \ |
| 4661 | -s "! mbedtls_ssl_handshake returned" \ |
| 4662 | -c "! mbedtls_ssl_handshake returned" \ |
| 4663 | -s "No client certification received from the client, but required by the authentication mode" |
| 4664 | |
| 4665 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4666 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4667 | "$P_CLI debug_level=3 crt_file=none \ |
| 4668 | key_file=data_files/server5.key" \ |
| 4669 | 1 \ |
| 4670 | -S "skip write certificate request" \ |
| 4671 | -C "skip parse certificate request" \ |
| 4672 | -c "got a certificate request" \ |
| 4673 | -c "= write certificate$" \ |
| 4674 | -C "skip write certificate$" \ |
| 4675 | -S "x509_verify_cert() returned" \ |
| 4676 | -s "client has no certificate" \ |
| 4677 | -s "! mbedtls_ssl_handshake returned" \ |
| 4678 | -c "! mbedtls_ssl_handshake returned" \ |
| 4679 | -s "No client certification received from the client, but required by the authentication mode" |
| 4680 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4681 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4682 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4683 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4684 | key_file=data_files/server5.key" \ |
| 4685 | 1 \ |
| 4686 | -S "skip write certificate request" \ |
| 4687 | -C "skip parse certificate request" \ |
| 4688 | -c "got a certificate request" \ |
| 4689 | -C "skip write certificate" \ |
| 4690 | -C "skip write certificate verify" \ |
| 4691 | -S "skip parse certificate verify" \ |
| 4692 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4693 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4694 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4695 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4696 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4697 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4698 | # We don't check that the client receives the alert because it might |
| 4699 | # detect that its write end of the connection is closed and abort |
| 4700 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4701 | |
Gilles Peskine | 8c681b7 | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4702 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4703 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4704 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4705 | key_file=data_files/server5.key" \ |
| 4706 | 0 \ |
| 4707 | -S "skip write certificate request" \ |
| 4708 | -C "skip parse certificate request" \ |
| 4709 | -c "got a certificate request" \ |
| 4710 | -C "skip write certificate" \ |
| 4711 | -C "skip write certificate verify" \ |
| 4712 | -S "skip parse certificate verify" \ |
| 4713 | -S "x509_verify_cert() returned" \ |
| 4714 | -S "! The certificate is not correctly signed" \ |
| 4715 | -S "X509 - Certificate verification failed" |
| 4716 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4717 | run_test "Authentication: client cert not trusted, server required" \ |
| 4718 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4719 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4720 | key_file=data_files/server5.key" \ |
| 4721 | 1 \ |
| 4722 | -S "skip write certificate request" \ |
| 4723 | -C "skip parse certificate request" \ |
| 4724 | -c "got a certificate request" \ |
| 4725 | -C "skip write certificate" \ |
| 4726 | -C "skip write certificate verify" \ |
| 4727 | -S "skip parse certificate verify" \ |
| 4728 | -s "x509_verify_cert() returned" \ |
| 4729 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4730 | -s "! mbedtls_ssl_handshake returned" \ |
| 4731 | -c "! mbedtls_ssl_handshake returned" \ |
| 4732 | -s "X509 - Certificate verification failed" |
| 4733 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4734 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4735 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4736 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4737 | key_file=data_files/server5.key" \ |
| 4738 | 0 \ |
| 4739 | -S "skip write certificate request" \ |
| 4740 | -C "skip parse certificate request" \ |
| 4741 | -c "got a certificate request" \ |
| 4742 | -C "skip write certificate" \ |
| 4743 | -C "skip write certificate verify" \ |
| 4744 | -S "skip parse certificate verify" \ |
| 4745 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4746 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4747 | -S "! mbedtls_ssl_handshake returned" \ |
| 4748 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4749 | -S "X509 - Certificate verification failed" |
| 4750 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4751 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4752 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4753 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4754 | key_file=data_files/server5.key" \ |
| 4755 | 0 \ |
| 4756 | -s "skip write certificate request" \ |
| 4757 | -C "skip parse certificate request" \ |
| 4758 | -c "got no certificate request" \ |
| 4759 | -c "skip write certificate" \ |
| 4760 | -c "skip write certificate verify" \ |
| 4761 | -s "skip parse certificate verify" \ |
| 4762 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4763 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4764 | -S "! mbedtls_ssl_handshake returned" \ |
| 4765 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4766 | -S "X509 - Certificate verification failed" |
| 4767 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4768 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4769 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4770 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4771 | 0 \ |
| 4772 | -S "skip write certificate request" \ |
| 4773 | -C "skip parse certificate request" \ |
| 4774 | -c "got a certificate request" \ |
| 4775 | -C "skip write certificate$" \ |
| 4776 | -C "got no certificate to send" \ |
| 4777 | -S "SSLv3 client has no certificate" \ |
| 4778 | -c "skip write certificate verify" \ |
| 4779 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4780 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4781 | -S "! mbedtls_ssl_handshake returned" \ |
| 4782 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4783 | -S "X509 - Certificate verification failed" |
| 4784 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4785 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4786 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4787 | "$O_CLI" \ |
| 4788 | 0 \ |
| 4789 | -S "skip write certificate request" \ |
| 4790 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4791 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4792 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4793 | -S "X509 - Certificate verification failed" |
| 4794 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4795 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4796 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4797 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4798 | 0 \ |
| 4799 | -C "skip parse certificate request" \ |
| 4800 | -c "got a certificate request" \ |
| 4801 | -C "skip write certificate$" \ |
| 4802 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4803 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4804 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4805 | run_test "Authentication: client no cert, openssl server required" \ |
| 4806 | "$O_SRV -Verify 10" \ |
| 4807 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4808 | 1 \ |
| 4809 | -C "skip parse certificate request" \ |
| 4810 | -c "got a certificate request" \ |
| 4811 | -C "skip write certificate$" \ |
| 4812 | -c "skip write certificate verify" \ |
| 4813 | -c "! mbedtls_ssl_handshake returned" |
| 4814 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4815 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4816 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4817 | "$P_CLI debug_level=3 crt_file=none key_file=none min_version=ssl3" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4818 | 0 \ |
| 4819 | -S "skip write certificate request" \ |
| 4820 | -C "skip parse certificate request" \ |
| 4821 | -c "got a certificate request" \ |
| 4822 | -C "skip write certificate$" \ |
| 4823 | -c "skip write certificate verify" \ |
| 4824 | -c "got no certificate to send" \ |
| 4825 | -s "SSLv3 client has no certificate" \ |
| 4826 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4827 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4828 | -S "! mbedtls_ssl_handshake returned" \ |
| 4829 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4830 | -S "X509 - Certificate verification failed" |
| 4831 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4832 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4833 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4834 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4835 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4836 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4837 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4838 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4839 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4840 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4841 | # are in place so that the semantics are consistent with the test description. |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4842 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4843 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4844 | run_test "Authentication: server max_int chain, client default" \ |
| 4845 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4846 | key_file=data_files/dir-maxpath/09.key" \ |
| 4847 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4848 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4849 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4850 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4851 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4852 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4853 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4854 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4855 | key_file=data_files/dir-maxpath/10.key" \ |
| 4856 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4857 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4858 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4859 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4860 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4861 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4862 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4863 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4864 | key_file=data_files/dir-maxpath/10.key" \ |
| 4865 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4866 | auth_mode=optional" \ |
| 4867 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4868 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4869 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4870 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4871 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4872 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4873 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4874 | key_file=data_files/dir-maxpath/10.key" \ |
| 4875 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4876 | auth_mode=none" \ |
| 4877 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4878 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4879 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4880 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4881 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4882 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4883 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4884 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4885 | key_file=data_files/dir-maxpath/10.key" \ |
| 4886 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4887 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4888 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4889 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4890 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4891 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4892 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4893 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4894 | key_file=data_files/dir-maxpath/10.key" \ |
| 4895 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4896 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4897 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4898 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4899 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4900 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4901 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4902 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4903 | key_file=data_files/dir-maxpath/10.key" \ |
| 4904 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4905 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4906 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4907 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4908 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4909 | run_test "Authentication: client max_int chain, server required" \ |
| 4910 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4911 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4912 | key_file=data_files/dir-maxpath/09.key" \ |
| 4913 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4914 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4915 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4916 | # Tests for CA list in CertificateRequest messages |
| 4917 | |
| 4918 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4919 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4920 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4921 | key_file=data_files/server6.key" \ |
| 4922 | 0 \ |
| 4923 | -s "requested DN" |
| 4924 | |
| 4925 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4926 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4927 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4928 | key_file=data_files/server6.key" \ |
| 4929 | 0 \ |
| 4930 | -S "requested DN" |
| 4931 | |
| 4932 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4933 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4934 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4935 | key_file=data_files/server5.key" \ |
| 4936 | 1 \ |
| 4937 | -S "requested DN" \ |
| 4938 | -s "x509_verify_cert() returned" \ |
| 4939 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4940 | -s "! mbedtls_ssl_handshake returned" \ |
| 4941 | -c "! mbedtls_ssl_handshake returned" \ |
| 4942 | -s "X509 - Certificate verification failed" |
| 4943 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4944 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4945 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4946 | |
| 4947 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4948 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4949 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4950 | key_file=data_files/server5.key" \ |
| 4951 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4952 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4953 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4954 | -c "x509_verify_cert() returned" \ |
| 4955 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4956 | -c "! mbedtls_ssl_handshake returned" \ |
| 4957 | -c "X509 - Certificate verification failed" |
| 4958 | |
| 4959 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4960 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4961 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4962 | key_file=data_files/server5.key" \ |
| 4963 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4964 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4965 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4966 | -c "x509_verify_cert() returned" \ |
| 4967 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4968 | -C "! mbedtls_ssl_handshake returned" \ |
| 4969 | -C "X509 - Certificate verification failed" |
| 4970 | |
| 4971 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4972 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4973 | # the client informs the server about the supported curves - it does, though, in the |
| 4974 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4975 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4976 | # different means to have the server ignoring the client's supported curve list. |
| 4977 | |
| 4978 | requires_config_enabled MBEDTLS_ECP_C |
| 4979 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4980 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4981 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4982 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4983 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4984 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4985 | -c "use CA callback for X.509 CRT verification" \ |
| 4986 | -c "bad certificate (EC key curve)" \ |
| 4987 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4988 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4989 | |
| 4990 | requires_config_enabled MBEDTLS_ECP_C |
| 4991 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4992 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4993 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4994 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4995 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4996 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4997 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4998 | -c "bad certificate (EC key curve)"\ |
| 4999 | -c "! Certificate verification flags"\ |
| 5000 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5001 | |
| 5002 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5003 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5004 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5005 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5006 | key_file=data_files/server6.key \ |
| 5007 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5008 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5009 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5010 | -c "Supported Signature Algorithm found: 4," \ |
| 5011 | -c "Supported Signature Algorithm found: 5," |
| 5012 | |
| 5013 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5014 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5015 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5016 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5017 | key_file=data_files/server6.key \ |
| 5018 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5019 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5020 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5021 | -c "Supported Signature Algorithm found: 4," \ |
| 5022 | -c "Supported Signature Algorithm found: 5," |
| 5023 | |
| 5024 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5025 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5026 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5027 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5028 | key_file=data_files/server5.key" \ |
| 5029 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5030 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5031 | -S "skip write certificate request" \ |
| 5032 | -C "skip parse certificate request" \ |
| 5033 | -c "got a certificate request" \ |
| 5034 | -C "skip write certificate" \ |
| 5035 | -C "skip write certificate verify" \ |
| 5036 | -S "skip parse certificate verify" \ |
| 5037 | -s "x509_verify_cert() returned" \ |
| 5038 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5039 | -s "! mbedtls_ssl_handshake returned" \ |
| 5040 | -s "send alert level=2 message=48" \ |
| 5041 | -c "! mbedtls_ssl_handshake returned" \ |
| 5042 | -s "X509 - Certificate verification failed" |
| 5043 | # We don't check that the client receives the alert because it might |
| 5044 | # detect that its write end of the connection is closed and abort |
| 5045 | # before reading the alert message. |
| 5046 | |
| 5047 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5048 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5049 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5050 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5051 | key_file=data_files/server5.key" \ |
| 5052 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5053 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5054 | -S "skip write certificate request" \ |
| 5055 | -C "skip parse certificate request" \ |
| 5056 | -c "got a certificate request" \ |
| 5057 | -C "skip write certificate" \ |
| 5058 | -C "skip write certificate verify" \ |
| 5059 | -S "skip parse certificate verify" \ |
| 5060 | -s "x509_verify_cert() returned" \ |
| 5061 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5062 | -s "! mbedtls_ssl_handshake returned" \ |
| 5063 | -c "! mbedtls_ssl_handshake returned" \ |
| 5064 | -s "X509 - Certificate verification failed" |
| 5065 | |
| 5066 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5067 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5068 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5069 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5070 | key_file=data_files/server5.key" \ |
| 5071 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5072 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5073 | -S "skip write certificate request" \ |
| 5074 | -C "skip parse certificate request" \ |
| 5075 | -c "got a certificate request" \ |
| 5076 | -C "skip write certificate" \ |
| 5077 | -C "skip write certificate verify" \ |
| 5078 | -S "skip parse certificate verify" \ |
| 5079 | -s "x509_verify_cert() returned" \ |
| 5080 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5081 | -S "! mbedtls_ssl_handshake returned" \ |
| 5082 | -C "! mbedtls_ssl_handshake returned" \ |
| 5083 | -S "X509 - Certificate verification failed" |
| 5084 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5085 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5086 | requires_full_size_output_buffer |
| 5087 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5088 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5089 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5090 | key_file=data_files/dir-maxpath/09.key" \ |
| 5091 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5092 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5093 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5094 | -C "X509 - A fatal error occurred" |
| 5095 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5096 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5097 | requires_full_size_output_buffer |
| 5098 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5099 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5100 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5101 | key_file=data_files/dir-maxpath/10.key" \ |
| 5102 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5103 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5104 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5105 | -c "X509 - A fatal error occurred" |
| 5106 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5107 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5108 | requires_full_size_output_buffer |
| 5109 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5110 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5111 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5112 | key_file=data_files/dir-maxpath/10.key" \ |
| 5113 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5114 | debug_level=3 auth_mode=optional" \ |
| 5115 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5116 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5117 | -c "X509 - A fatal error occurred" |
| 5118 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5119 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5120 | requires_full_size_output_buffer |
| 5121 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5122 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5123 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5124 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5125 | key_file=data_files/dir-maxpath/10.key" \ |
| 5126 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5127 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5128 | -s "X509 - A fatal error occurred" |
| 5129 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5130 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5131 | requires_full_size_output_buffer |
| 5132 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5133 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5134 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5135 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5136 | key_file=data_files/dir-maxpath/10.key" \ |
| 5137 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5138 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5139 | -s "X509 - A fatal error occurred" |
| 5140 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5141 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5142 | requires_full_size_output_buffer |
| 5143 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5144 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5145 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5146 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5147 | key_file=data_files/dir-maxpath/09.key" \ |
| 5148 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5149 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5150 | -S "X509 - A fatal error occurred" |
| 5151 | |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5152 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5153 | |
| 5154 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 5155 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5156 | key_file=data_files/server5.key \ |
| 5157 | crt_file2=data_files/server5-sha1.crt \ |
| 5158 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5159 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5160 | 0 \ |
| 5161 | -c "signed using.*ECDSA with SHA256" \ |
| 5162 | -C "signed using.*ECDSA with SHA1" |
| 5163 | |
| 5164 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 5165 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5166 | key_file=data_files/server5.key \ |
| 5167 | crt_file2=data_files/server5-sha1.crt \ |
| 5168 | key_file2=data_files/server5.key" \ |
| 5169 | "$P_CLI force_version=tls1_1" \ |
| 5170 | 0 \ |
| 5171 | -C "signed using.*ECDSA with SHA256" \ |
| 5172 | -c "signed using.*ECDSA with SHA1" |
| 5173 | |
| 5174 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 5175 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5176 | key_file=data_files/server5.key \ |
| 5177 | crt_file2=data_files/server5-sha1.crt \ |
| 5178 | key_file2=data_files/server5.key" \ |
| 5179 | "$P_CLI force_version=tls1" \ |
| 5180 | 0 \ |
| 5181 | -C "signed using.*ECDSA with SHA256" \ |
| 5182 | -c "signed using.*ECDSA with SHA1" |
| 5183 | |
| 5184 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 5185 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5186 | key_file=data_files/server5.key \ |
| 5187 | crt_file2=data_files/server6.crt \ |
| 5188 | key_file2=data_files/server6.key" \ |
| 5189 | "$P_CLI force_version=tls1_1" \ |
| 5190 | 0 \ |
| 5191 | -c "serial number.*09" \ |
| 5192 | -c "signed using.*ECDSA with SHA256" \ |
| 5193 | -C "signed using.*ECDSA with SHA1" |
| 5194 | |
| 5195 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 5196 | "$P_SRV crt_file=data_files/server6.crt \ |
| 5197 | key_file=data_files/server6.key \ |
| 5198 | crt_file2=data_files/server5.crt \ |
| 5199 | key_file2=data_files/server5.key" \ |
| 5200 | "$P_CLI force_version=tls1_1" \ |
| 5201 | 0 \ |
| 5202 | -c "serial number.*0A" \ |
| 5203 | -c "signed using.*ECDSA with SHA256" \ |
| 5204 | -C "signed using.*ECDSA with SHA1" |
| 5205 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5206 | # tests for SNI |
| 5207 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5208 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5209 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5210 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5211 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5212 | 0 \ |
| 5213 | -S "parse ServerName extension" \ |
| 5214 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5215 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5216 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5217 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5218 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5219 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 5220 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5221 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5222 | 0 \ |
| 5223 | -s "parse ServerName extension" \ |
| 5224 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5225 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5226 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5227 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5228 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5229 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 5230 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5231 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5232 | 0 \ |
| 5233 | -s "parse ServerName extension" \ |
| 5234 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5235 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5236 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5237 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5238 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5239 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 5240 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5241 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5242 | 1 \ |
| 5243 | -s "parse ServerName extension" \ |
| 5244 | -s "ssl_sni_wrapper() returned" \ |
| 5245 | -s "mbedtls_ssl_handshake returned" \ |
| 5246 | -c "mbedtls_ssl_handshake returned" \ |
| 5247 | -c "SSL - A fatal alert message was received from our peer" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5248 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5249 | run_test "SNI: client auth no override: optional" \ |
| 5250 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5251 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5252 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5253 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5254 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5255 | -S "skip write certificate request" \ |
| 5256 | -C "skip parse certificate request" \ |
| 5257 | -c "got a certificate request" \ |
| 5258 | -C "skip write certificate" \ |
| 5259 | -C "skip write certificate verify" \ |
| 5260 | -S "skip parse certificate verify" |
| 5261 | |
| 5262 | run_test "SNI: client auth override: none -> optional" \ |
| 5263 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5264 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5265 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5266 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5267 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5268 | -S "skip write certificate request" \ |
| 5269 | -C "skip parse certificate request" \ |
| 5270 | -c "got a certificate request" \ |
| 5271 | -C "skip write certificate" \ |
| 5272 | -C "skip write certificate verify" \ |
| 5273 | -S "skip parse certificate verify" |
| 5274 | |
| 5275 | run_test "SNI: client auth override: optional -> none" \ |
| 5276 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5277 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5278 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5279 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5280 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5281 | -s "skip write certificate request" \ |
| 5282 | -C "skip parse certificate request" \ |
| 5283 | -c "got no certificate request" \ |
| 5284 | -c "skip write certificate" \ |
| 5285 | -c "skip write certificate verify" \ |
| 5286 | -s "skip parse certificate verify" |
| 5287 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5288 | run_test "SNI: CA no override" \ |
| 5289 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5290 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5291 | ca_file=data_files/test-ca.crt \ |
| 5292 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5293 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5294 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5295 | 1 \ |
| 5296 | -S "skip write certificate request" \ |
| 5297 | -C "skip parse certificate request" \ |
| 5298 | -c "got a certificate request" \ |
| 5299 | -C "skip write certificate" \ |
| 5300 | -C "skip write certificate verify" \ |
| 5301 | -S "skip parse certificate verify" \ |
| 5302 | -s "x509_verify_cert() returned" \ |
| 5303 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5304 | -S "The certificate has been revoked (is on a CRL)" |
| 5305 | |
| 5306 | run_test "SNI: CA override" \ |
| 5307 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5308 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5309 | ca_file=data_files/test-ca.crt \ |
| 5310 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5311 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5312 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5313 | 0 \ |
| 5314 | -S "skip write certificate request" \ |
| 5315 | -C "skip parse certificate request" \ |
| 5316 | -c "got a certificate request" \ |
| 5317 | -C "skip write certificate" \ |
| 5318 | -C "skip write certificate verify" \ |
| 5319 | -S "skip parse certificate verify" \ |
| 5320 | -S "x509_verify_cert() returned" \ |
| 5321 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5322 | -S "The certificate has been revoked (is on a CRL)" |
| 5323 | |
| 5324 | run_test "SNI: CA override with CRL" \ |
| 5325 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5326 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5327 | ca_file=data_files/test-ca.crt \ |
| 5328 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5329 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5330 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5331 | 1 \ |
| 5332 | -S "skip write certificate request" \ |
| 5333 | -C "skip parse certificate request" \ |
| 5334 | -c "got a certificate request" \ |
| 5335 | -C "skip write certificate" \ |
| 5336 | -C "skip write certificate verify" \ |
| 5337 | -S "skip parse certificate verify" \ |
| 5338 | -s "x509_verify_cert() returned" \ |
| 5339 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5340 | -s "The certificate has been revoked (is on a CRL)" |
| 5341 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5342 | # Tests for SNI and DTLS |
| 5343 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5344 | run_test "SNI: DTLS, no SNI callback" \ |
| 5345 | "$P_SRV debug_level=3 dtls=1 \ |
| 5346 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5347 | "$P_CLI server_name=localhost dtls=1" \ |
| 5348 | 0 \ |
| 5349 | -S "parse ServerName extension" \ |
| 5350 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5351 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5352 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5353 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5354 | "$P_SRV debug_level=3 dtls=1 \ |
| 5355 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5356 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5357 | "$P_CLI server_name=localhost dtls=1" \ |
| 5358 | 0 \ |
| 5359 | -s "parse ServerName extension" \ |
| 5360 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5361 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5362 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5363 | run_test "SNI: DTLS, matching cert 2" \ |
| 5364 | "$P_SRV debug_level=3 dtls=1 \ |
| 5365 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5366 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5367 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5368 | 0 \ |
| 5369 | -s "parse ServerName extension" \ |
| 5370 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5371 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5372 | |
| 5373 | run_test "SNI: DTLS, no matching cert" \ |
| 5374 | "$P_SRV debug_level=3 dtls=1 \ |
| 5375 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5376 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5377 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5378 | 1 \ |
| 5379 | -s "parse ServerName extension" \ |
| 5380 | -s "ssl_sni_wrapper() returned" \ |
| 5381 | -s "mbedtls_ssl_handshake returned" \ |
| 5382 | -c "mbedtls_ssl_handshake returned" \ |
| 5383 | -c "SSL - A fatal alert message was received from our peer" |
| 5384 | |
| 5385 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5386 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5387 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5388 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5389 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5390 | 0 \ |
| 5391 | -S "skip write certificate request" \ |
| 5392 | -C "skip parse certificate request" \ |
| 5393 | -c "got a certificate request" \ |
| 5394 | -C "skip write certificate" \ |
| 5395 | -C "skip write certificate verify" \ |
| 5396 | -S "skip parse certificate verify" |
| 5397 | |
| 5398 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5399 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5400 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5401 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5402 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5403 | 0 \ |
| 5404 | -S "skip write certificate request" \ |
| 5405 | -C "skip parse certificate request" \ |
| 5406 | -c "got a certificate request" \ |
| 5407 | -C "skip write certificate" \ |
| 5408 | -C "skip write certificate verify" \ |
| 5409 | -S "skip parse certificate verify" |
| 5410 | |
| 5411 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5412 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5413 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5414 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5415 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5416 | 0 \ |
| 5417 | -s "skip write certificate request" \ |
| 5418 | -C "skip parse certificate request" \ |
| 5419 | -c "got no certificate request" \ |
| 5420 | -c "skip write certificate" \ |
| 5421 | -c "skip write certificate verify" \ |
| 5422 | -s "skip parse certificate verify" |
| 5423 | |
| 5424 | run_test "SNI: DTLS, CA no override" \ |
| 5425 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5426 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5427 | ca_file=data_files/test-ca.crt \ |
| 5428 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5429 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5430 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5431 | 1 \ |
| 5432 | -S "skip write certificate request" \ |
| 5433 | -C "skip parse certificate request" \ |
| 5434 | -c "got a certificate request" \ |
| 5435 | -C "skip write certificate" \ |
| 5436 | -C "skip write certificate verify" \ |
| 5437 | -S "skip parse certificate verify" \ |
| 5438 | -s "x509_verify_cert() returned" \ |
| 5439 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5440 | -S "The certificate has been revoked (is on a CRL)" |
| 5441 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5442 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5443 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5444 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5445 | ca_file=data_files/test-ca.crt \ |
| 5446 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5447 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5448 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5449 | 0 \ |
| 5450 | -S "skip write certificate request" \ |
| 5451 | -C "skip parse certificate request" \ |
| 5452 | -c "got a certificate request" \ |
| 5453 | -C "skip write certificate" \ |
| 5454 | -C "skip write certificate verify" \ |
| 5455 | -S "skip parse certificate verify" \ |
| 5456 | -S "x509_verify_cert() returned" \ |
| 5457 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5458 | -S "The certificate has been revoked (is on a CRL)" |
| 5459 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5460 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5461 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5462 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5463 | ca_file=data_files/test-ca.crt \ |
| 5464 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5465 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5466 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5467 | 1 \ |
| 5468 | -S "skip write certificate request" \ |
| 5469 | -C "skip parse certificate request" \ |
| 5470 | -c "got a certificate request" \ |
| 5471 | -C "skip write certificate" \ |
| 5472 | -C "skip write certificate verify" \ |
| 5473 | -S "skip parse certificate verify" \ |
| 5474 | -s "x509_verify_cert() returned" \ |
| 5475 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5476 | -s "The certificate has been revoked (is on a CRL)" |
| 5477 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5478 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5479 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5480 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5481 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5482 | "$P_CLI nbio=2 tickets=0" \ |
| 5483 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5484 | -S "mbedtls_ssl_handshake returned" \ |
| 5485 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5486 | -c "Read from server: .* bytes read" |
| 5487 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5488 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5489 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5490 | "$P_CLI nbio=2 tickets=0" \ |
| 5491 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5492 | -S "mbedtls_ssl_handshake returned" \ |
| 5493 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5494 | -c "Read from server: .* bytes read" |
| 5495 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5496 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5497 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5498 | "$P_CLI nbio=2 tickets=1" \ |
| 5499 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5500 | -S "mbedtls_ssl_handshake returned" \ |
| 5501 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5502 | -c "Read from server: .* bytes read" |
| 5503 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5504 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5505 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5506 | "$P_CLI nbio=2 tickets=1" \ |
| 5507 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5508 | -S "mbedtls_ssl_handshake returned" \ |
| 5509 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5510 | -c "Read from server: .* bytes read" |
| 5511 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5512 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5513 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5514 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5515 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5516 | -S "mbedtls_ssl_handshake returned" \ |
| 5517 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5518 | -c "Read from server: .* bytes read" |
| 5519 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5520 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5521 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5522 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5523 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5524 | -S "mbedtls_ssl_handshake returned" \ |
| 5525 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5526 | -c "Read from server: .* bytes read" |
| 5527 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5528 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5529 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5530 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5531 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5532 | -S "mbedtls_ssl_handshake returned" \ |
| 5533 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5534 | -c "Read from server: .* bytes read" |
| 5535 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5536 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5537 | |
| 5538 | run_test "Event-driven I/O: basic handshake" \ |
| 5539 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5540 | "$P_CLI event=1 tickets=0" \ |
| 5541 | 0 \ |
| 5542 | -S "mbedtls_ssl_handshake returned" \ |
| 5543 | -C "mbedtls_ssl_handshake returned" \ |
| 5544 | -c "Read from server: .* bytes read" |
| 5545 | |
| 5546 | run_test "Event-driven I/O: client auth" \ |
| 5547 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5548 | "$P_CLI event=1 tickets=0" \ |
| 5549 | 0 \ |
| 5550 | -S "mbedtls_ssl_handshake returned" \ |
| 5551 | -C "mbedtls_ssl_handshake returned" \ |
| 5552 | -c "Read from server: .* bytes read" |
| 5553 | |
| 5554 | run_test "Event-driven I/O: ticket" \ |
| 5555 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5556 | "$P_CLI event=1 tickets=1" \ |
| 5557 | 0 \ |
| 5558 | -S "mbedtls_ssl_handshake returned" \ |
| 5559 | -C "mbedtls_ssl_handshake returned" \ |
| 5560 | -c "Read from server: .* bytes read" |
| 5561 | |
| 5562 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5563 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5564 | "$P_CLI event=1 tickets=1" \ |
| 5565 | 0 \ |
| 5566 | -S "mbedtls_ssl_handshake returned" \ |
| 5567 | -C "mbedtls_ssl_handshake returned" \ |
| 5568 | -c "Read from server: .* bytes read" |
| 5569 | |
| 5570 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5571 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5572 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5573 | 0 \ |
| 5574 | -S "mbedtls_ssl_handshake returned" \ |
| 5575 | -C "mbedtls_ssl_handshake returned" \ |
| 5576 | -c "Read from server: .* bytes read" |
| 5577 | |
| 5578 | run_test "Event-driven I/O: ticket + resume" \ |
| 5579 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5580 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5581 | 0 \ |
| 5582 | -S "mbedtls_ssl_handshake returned" \ |
| 5583 | -C "mbedtls_ssl_handshake returned" \ |
| 5584 | -c "Read from server: .* bytes read" |
| 5585 | |
| 5586 | run_test "Event-driven I/O: session-id resume" \ |
| 5587 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5588 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5589 | 0 \ |
| 5590 | -S "mbedtls_ssl_handshake returned" \ |
| 5591 | -C "mbedtls_ssl_handshake returned" \ |
| 5592 | -c "Read from server: .* bytes read" |
| 5593 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5594 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5595 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5596 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5597 | 0 \ |
| 5598 | -c "Read from server: .* bytes read" |
| 5599 | |
| 5600 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5601 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5602 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5603 | 0 \ |
| 5604 | -c "Read from server: .* bytes read" |
| 5605 | |
| 5606 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5607 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5608 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5609 | 0 \ |
| 5610 | -c "Read from server: .* bytes read" |
| 5611 | |
| 5612 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5613 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5614 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5615 | 0 \ |
| 5616 | -c "Read from server: .* bytes read" |
| 5617 | |
| 5618 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5619 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 5620 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5621 | 0 \ |
| 5622 | -c "Read from server: .* bytes read" |
| 5623 | |
| 5624 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5625 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 5626 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5627 | 0 \ |
| 5628 | -c "Read from server: .* bytes read" |
| 5629 | |
| 5630 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5631 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 5632 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5633 | 0 \ |
| 5634 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5635 | |
| 5636 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5637 | # During session resumption, the client will send its ApplicationData record |
| 5638 | # within the same datagram as the Finished messages. In this situation, the |
| 5639 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5640 | # because the ApplicationData request has already been queued internally. |
| 5641 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5642 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5643 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 5644 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5645 | 0 \ |
| 5646 | -c "Read from server: .* bytes read" |
| 5647 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5648 | # Tests for version negotiation |
| 5649 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5651 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5652 | "$P_SRV" \ |
| 5653 | "$P_CLI" \ |
| 5654 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5655 | -S "mbedtls_ssl_handshake returned" \ |
| 5656 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5657 | -s "Protocol is TLSv1.2" \ |
| 5658 | -c "Protocol is TLSv1.2" |
| 5659 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5661 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5662 | "$P_SRV" \ |
| 5663 | "$P_CLI max_version=tls1_1" \ |
| 5664 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5665 | -S "mbedtls_ssl_handshake returned" \ |
| 5666 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5667 | -s "Protocol is TLSv1.1" \ |
| 5668 | -c "Protocol is TLSv1.1" |
| 5669 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5671 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5672 | "$P_SRV max_version=tls1_1" \ |
| 5673 | "$P_CLI" \ |
| 5674 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5675 | -S "mbedtls_ssl_handshake returned" \ |
| 5676 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5677 | -s "Protocol is TLSv1.1" \ |
| 5678 | -c "Protocol is TLSv1.1" |
| 5679 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5681 | run_test "Version check: cli+srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5682 | "$P_SRV max_version=tls1_1" \ |
| 5683 | "$P_CLI max_version=tls1_1" \ |
| 5684 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5685 | -S "mbedtls_ssl_handshake returned" \ |
| 5686 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5687 | -s "Protocol is TLSv1.1" \ |
| 5688 | -c "Protocol is TLSv1.1" |
| 5689 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5691 | run_test "Version check: cli max 1.1, srv min 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5692 | "$P_SRV min_version=tls1_1" \ |
| 5693 | "$P_CLI max_version=tls1_1" \ |
| 5694 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5695 | -S "mbedtls_ssl_handshake returned" \ |
| 5696 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5697 | -s "Protocol is TLSv1.1" \ |
| 5698 | -c "Protocol is TLSv1.1" |
| 5699 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5701 | run_test "Version check: cli min 1.1, srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5702 | "$P_SRV max_version=tls1_1" \ |
| 5703 | "$P_CLI min_version=tls1_1" \ |
| 5704 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5705 | -S "mbedtls_ssl_handshake returned" \ |
| 5706 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5707 | -s "Protocol is TLSv1.1" \ |
| 5708 | -c "Protocol is TLSv1.1" |
| 5709 | |
Gilles Peskine | bcb2ab0 | 2022-04-09 00:11:16 +0200 | [diff] [blame] | 5710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5712 | run_test "Version check: cli min 1.2, srv max 1.1 -> fail" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5713 | "$P_SRV max_version=tls1_1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5714 | "$P_CLI min_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5715 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5716 | -s "mbedtls_ssl_handshake returned" \ |
| 5717 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5718 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5719 | |
Gilles Peskine | bcb2ab0 | 2022-04-09 00:11:16 +0200 | [diff] [blame] | 5720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5722 | run_test "Version check: srv min 1.2, cli max 1.1 -> fail" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5723 | "$P_SRV min_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5724 | "$P_CLI max_version=tls1_1" \ |
| 5725 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5726 | -s "mbedtls_ssl_handshake returned" \ |
| 5727 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5728 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5729 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5730 | # Tests for ALPN extension |
| 5731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5732 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5733 | "$P_SRV debug_level=3" \ |
| 5734 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5735 | 0 \ |
| 5736 | -C "client hello, adding alpn extension" \ |
| 5737 | -S "found alpn extension" \ |
| 5738 | -C "got an alert message, type: \\[2:120]" \ |
| 5739 | -S "server hello, adding alpn extension" \ |
| 5740 | -C "found alpn extension " \ |
| 5741 | -C "Application Layer Protocol is" \ |
| 5742 | -S "Application Layer Protocol is" |
| 5743 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5744 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5745 | "$P_SRV debug_level=3" \ |
| 5746 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5747 | 0 \ |
| 5748 | -c "client hello, adding alpn extension" \ |
| 5749 | -s "found alpn extension" \ |
| 5750 | -C "got an alert message, type: \\[2:120]" \ |
| 5751 | -S "server hello, adding alpn extension" \ |
| 5752 | -C "found alpn extension " \ |
| 5753 | -c "Application Layer Protocol is (none)" \ |
| 5754 | -S "Application Layer Protocol is" |
| 5755 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5756 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5757 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5758 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5759 | 0 \ |
| 5760 | -C "client hello, adding alpn extension" \ |
| 5761 | -S "found alpn extension" \ |
| 5762 | -C "got an alert message, type: \\[2:120]" \ |
| 5763 | -S "server hello, adding alpn extension" \ |
| 5764 | -C "found alpn extension " \ |
| 5765 | -C "Application Layer Protocol is" \ |
| 5766 | -s "Application Layer Protocol is (none)" |
| 5767 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5768 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5769 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5770 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5771 | 0 \ |
| 5772 | -c "client hello, adding alpn extension" \ |
| 5773 | -s "found alpn extension" \ |
| 5774 | -C "got an alert message, type: \\[2:120]" \ |
| 5775 | -s "server hello, adding alpn extension" \ |
| 5776 | -c "found alpn extension" \ |
| 5777 | -c "Application Layer Protocol is abc" \ |
| 5778 | -s "Application Layer Protocol is abc" |
| 5779 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5780 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5781 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5782 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5783 | 0 \ |
| 5784 | -c "client hello, adding alpn extension" \ |
| 5785 | -s "found alpn extension" \ |
| 5786 | -C "got an alert message, type: \\[2:120]" \ |
| 5787 | -s "server hello, adding alpn extension" \ |
| 5788 | -c "found alpn extension" \ |
| 5789 | -c "Application Layer Protocol is abc" \ |
| 5790 | -s "Application Layer Protocol is abc" |
| 5791 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5792 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5793 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5794 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5795 | 0 \ |
| 5796 | -c "client hello, adding alpn extension" \ |
| 5797 | -s "found alpn extension" \ |
| 5798 | -C "got an alert message, type: \\[2:120]" \ |
| 5799 | -s "server hello, adding alpn extension" \ |
| 5800 | -c "found alpn extension" \ |
| 5801 | -c "Application Layer Protocol is 1234" \ |
| 5802 | -s "Application Layer Protocol is 1234" |
| 5803 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5804 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5805 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5806 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5807 | 1 \ |
| 5808 | -c "client hello, adding alpn extension" \ |
| 5809 | -s "found alpn extension" \ |
| 5810 | -c "got an alert message, type: \\[2:120]" \ |
| 5811 | -S "server hello, adding alpn extension" \ |
| 5812 | -C "found alpn extension" \ |
| 5813 | -C "Application Layer Protocol is 1234" \ |
| 5814 | -S "Application Layer Protocol is 1234" |
| 5815 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5816 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5817 | # Tests for keyUsage in leaf certificates, part 1: |
| 5818 | # server-side certificate/suite selection |
| 5819 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5820 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5821 | "$P_SRV key_file=data_files/server2.key \ |
| 5822 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5823 | "$P_CLI" \ |
| 5824 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5825 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5826 | |
| 5827 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5828 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5829 | "$P_SRV key_file=data_files/server2.key \ |
| 5830 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5831 | "$P_CLI" \ |
| 5832 | 0 \ |
| 5833 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5835 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5836 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5837 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5838 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5839 | 1 \ |
| 5840 | -C "Ciphersuite is " |
| 5841 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5842 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5843 | "$P_SRV key_file=data_files/server5.key \ |
| 5844 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5845 | "$P_CLI" \ |
| 5846 | 0 \ |
| 5847 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5848 | |
| 5849 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5850 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5851 | "$P_SRV key_file=data_files/server5.key \ |
| 5852 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5853 | "$P_CLI" \ |
| 5854 | 0 \ |
| 5855 | -c "Ciphersuite is TLS-ECDH-" |
| 5856 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5857 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5858 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5859 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5860 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5861 | 1 \ |
| 5862 | -C "Ciphersuite is " |
| 5863 | |
| 5864 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5865 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5866 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5867 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5868 | "$O_SRV -key data_files/server2.key \ |
| 5869 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5870 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5871 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5872 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5873 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5874 | -C "Processing of the Certificate handshake message failed" \ |
| 5875 | -c "Ciphersuite is TLS-" |
| 5876 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5877 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5878 | "$O_SRV -key data_files/server2.key \ |
| 5879 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5880 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5881 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5882 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5883 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5884 | -C "Processing of the Certificate handshake message failed" \ |
| 5885 | -c "Ciphersuite is TLS-" |
| 5886 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5887 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5888 | "$O_SRV -key data_files/server2.key \ |
| 5889 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5890 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5891 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5892 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5893 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5894 | -C "Processing of the Certificate handshake message failed" \ |
| 5895 | -c "Ciphersuite is TLS-" |
| 5896 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5897 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5898 | "$O_SRV -key data_files/server2.key \ |
| 5899 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5900 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5901 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5902 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5903 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5904 | -c "Processing of the Certificate handshake message failed" \ |
| 5905 | -C "Ciphersuite is TLS-" |
| 5906 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5907 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5908 | "$O_SRV -key data_files/server2.key \ |
| 5909 | -cert data_files/server2.ku-ke.crt" \ |
| 5910 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5911 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5912 | 0 \ |
| 5913 | -c "bad certificate (usage extensions)" \ |
| 5914 | -C "Processing of the Certificate handshake message failed" \ |
| 5915 | -c "Ciphersuite is TLS-" \ |
| 5916 | -c "! Usage does not match the keyUsage extension" |
| 5917 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5918 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5919 | "$O_SRV -key data_files/server2.key \ |
| 5920 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5921 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5922 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5923 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5924 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5925 | -C "Processing of the Certificate handshake message failed" \ |
| 5926 | -c "Ciphersuite is TLS-" |
| 5927 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5928 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5929 | "$O_SRV -key data_files/server2.key \ |
| 5930 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5931 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5932 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5933 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5934 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5935 | -c "Processing of the Certificate handshake message failed" \ |
| 5936 | -C "Ciphersuite is TLS-" |
| 5937 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5938 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5939 | "$O_SRV -key data_files/server2.key \ |
| 5940 | -cert data_files/server2.ku-ds.crt" \ |
| 5941 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5942 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5943 | 0 \ |
| 5944 | -c "bad certificate (usage extensions)" \ |
| 5945 | -C "Processing of the Certificate handshake message failed" \ |
| 5946 | -c "Ciphersuite is TLS-" \ |
| 5947 | -c "! Usage does not match the keyUsage extension" |
| 5948 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5949 | # Tests for keyUsage in leaf certificates, part 3: |
| 5950 | # server-side checking of client cert |
| 5951 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5952 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5953 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5954 | "$O_CLI -key data_files/server2.key \ |
| 5955 | -cert data_files/server2.ku-ds.crt" \ |
| 5956 | 0 \ |
| 5957 | -S "bad certificate (usage extensions)" \ |
| 5958 | -S "Processing of the Certificate handshake message failed" |
| 5959 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5960 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5961 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5962 | "$O_CLI -key data_files/server2.key \ |
| 5963 | -cert data_files/server2.ku-ke.crt" \ |
| 5964 | 0 \ |
| 5965 | -s "bad certificate (usage extensions)" \ |
| 5966 | -S "Processing of the Certificate handshake message failed" |
| 5967 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5968 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5969 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5970 | "$O_CLI -key data_files/server2.key \ |
| 5971 | -cert data_files/server2.ku-ke.crt" \ |
| 5972 | 1 \ |
| 5973 | -s "bad certificate (usage extensions)" \ |
| 5974 | -s "Processing of the Certificate handshake message failed" |
| 5975 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5976 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5977 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5978 | "$O_CLI -key data_files/server5.key \ |
| 5979 | -cert data_files/server5.ku-ds.crt" \ |
| 5980 | 0 \ |
| 5981 | -S "bad certificate (usage extensions)" \ |
| 5982 | -S "Processing of the Certificate handshake message failed" |
| 5983 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5984 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5985 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5986 | "$O_CLI -key data_files/server5.key \ |
| 5987 | -cert data_files/server5.ku-ka.crt" \ |
| 5988 | 0 \ |
| 5989 | -s "bad certificate (usage extensions)" \ |
| 5990 | -S "Processing of the Certificate handshake message failed" |
| 5991 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5992 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5993 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5994 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5995 | "$P_SRV key_file=data_files/server5.key \ |
| 5996 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5997 | "$P_CLI" \ |
| 5998 | 0 |
| 5999 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6000 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6001 | "$P_SRV key_file=data_files/server5.key \ |
| 6002 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6003 | "$P_CLI" \ |
| 6004 | 0 |
| 6005 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6006 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6007 | "$P_SRV key_file=data_files/server5.key \ |
| 6008 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6009 | "$P_CLI" \ |
| 6010 | 0 |
| 6011 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6012 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6013 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6014 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6015 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6016 | 1 |
| 6017 | |
| 6018 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6019 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6020 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6021 | "$O_SRV -key data_files/server5.key \ |
| 6022 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6023 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6024 | 0 \ |
| 6025 | -C "bad certificate (usage extensions)" \ |
| 6026 | -C "Processing of the Certificate handshake message failed" \ |
| 6027 | -c "Ciphersuite is TLS-" |
| 6028 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6029 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6030 | "$O_SRV -key data_files/server5.key \ |
| 6031 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6032 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6033 | 0 \ |
| 6034 | -C "bad certificate (usage extensions)" \ |
| 6035 | -C "Processing of the Certificate handshake message failed" \ |
| 6036 | -c "Ciphersuite is TLS-" |
| 6037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6038 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6039 | "$O_SRV -key data_files/server5.key \ |
| 6040 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6041 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6042 | 0 \ |
| 6043 | -C "bad certificate (usage extensions)" \ |
| 6044 | -C "Processing of the Certificate handshake message failed" \ |
| 6045 | -c "Ciphersuite is TLS-" |
| 6046 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6047 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6048 | "$O_SRV -key data_files/server5.key \ |
| 6049 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6050 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6051 | 1 \ |
| 6052 | -c "bad certificate (usage extensions)" \ |
| 6053 | -c "Processing of the Certificate handshake message failed" \ |
| 6054 | -C "Ciphersuite is TLS-" |
| 6055 | |
| 6056 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6057 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6058 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6059 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6060 | "$O_CLI -key data_files/server5.key \ |
| 6061 | -cert data_files/server5.eku-cli.crt" \ |
| 6062 | 0 \ |
| 6063 | -S "bad certificate (usage extensions)" \ |
| 6064 | -S "Processing of the Certificate handshake message failed" |
| 6065 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6066 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6067 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6068 | "$O_CLI -key data_files/server5.key \ |
| 6069 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6070 | 0 \ |
| 6071 | -S "bad certificate (usage extensions)" \ |
| 6072 | -S "Processing of the Certificate handshake message failed" |
| 6073 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6074 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6075 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6076 | "$O_CLI -key data_files/server5.key \ |
| 6077 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6078 | 0 \ |
| 6079 | -S "bad certificate (usage extensions)" \ |
| 6080 | -S "Processing of the Certificate handshake message failed" |
| 6081 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6082 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6083 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6084 | "$O_CLI -key data_files/server5.key \ |
| 6085 | -cert data_files/server5.eku-cs.crt" \ |
| 6086 | 0 \ |
| 6087 | -s "bad certificate (usage extensions)" \ |
| 6088 | -S "Processing of the Certificate handshake message failed" |
| 6089 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6090 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6091 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6092 | "$O_CLI -key data_files/server5.key \ |
| 6093 | -cert data_files/server5.eku-cs.crt" \ |
| 6094 | 1 \ |
| 6095 | -s "bad certificate (usage extensions)" \ |
| 6096 | -s "Processing of the Certificate handshake message failed" |
| 6097 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6098 | # Tests for DHM parameters loading |
| 6099 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6100 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6101 | "$P_SRV" \ |
| 6102 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6103 | debug_level=3" \ |
| 6104 | 0 \ |
| 6105 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 6106 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6107 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6108 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6109 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6110 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6111 | debug_level=3" \ |
| 6112 | 0 \ |
| 6113 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 6114 | -c "value of 'DHM: G ' (2 bits)" |
| 6115 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6116 | # Tests for DHM client-side size checking |
| 6117 | |
| 6118 | run_test "DHM size: server default, client default, OK" \ |
| 6119 | "$P_SRV" \ |
| 6120 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6121 | debug_level=1" \ |
| 6122 | 0 \ |
| 6123 | -C "DHM prime too short:" |
| 6124 | |
| 6125 | run_test "DHM size: server default, client 2048, OK" \ |
| 6126 | "$P_SRV" \ |
| 6127 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6128 | debug_level=1 dhmlen=2048" \ |
| 6129 | 0 \ |
| 6130 | -C "DHM prime too short:" |
| 6131 | |
| 6132 | run_test "DHM size: server 1024, client default, OK" \ |
| 6133 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6134 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6135 | debug_level=1" \ |
| 6136 | 0 \ |
| 6137 | -C "DHM prime too short:" |
| 6138 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6139 | run_test "DHM size: server 999, client 999, OK" \ |
| 6140 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6141 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6142 | debug_level=1 dhmlen=999" \ |
| 6143 | 0 \ |
| 6144 | -C "DHM prime too short:" |
| 6145 | |
| 6146 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 6147 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6148 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6149 | debug_level=1 dhmlen=1000" \ |
| 6150 | 0 \ |
| 6151 | -C "DHM prime too short:" |
| 6152 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6153 | run_test "DHM size: server 1000, client default, rejected" \ |
| 6154 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6155 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6156 | debug_level=1" \ |
| 6157 | 1 \ |
| 6158 | -c "DHM prime too short:" |
| 6159 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6160 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 6161 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6162 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6163 | debug_level=1 dhmlen=1001" \ |
| 6164 | 1 \ |
| 6165 | -c "DHM prime too short:" |
| 6166 | |
| 6167 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 6168 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6169 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6170 | debug_level=1 dhmlen=1000" \ |
| 6171 | 1 \ |
| 6172 | -c "DHM prime too short:" |
| 6173 | |
| 6174 | run_test "DHM size: server 998, client 999, rejected" \ |
| 6175 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 6176 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6177 | debug_level=1 dhmlen=999" \ |
| 6178 | 1 \ |
| 6179 | -c "DHM prime too short:" |
| 6180 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6181 | run_test "DHM size: server default, client 2049, rejected" \ |
| 6182 | "$P_SRV" \ |
| 6183 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6184 | debug_level=1 dhmlen=2049" \ |
| 6185 | 1 \ |
| 6186 | -c "DHM prime too short:" |
| 6187 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6188 | # Tests for PSK callback |
| 6189 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6190 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6191 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 6192 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6193 | psk_identity=foo psk=abc123" \ |
| 6194 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6195 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6196 | -S "SSL - Unknown identity received" \ |
| 6197 | -S "SSL - Verification of the message MAC failed" |
| 6198 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6199 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6200 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 6201 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6202 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 6203 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6204 | 0 \ |
| 6205 | -c "skip PMS generation for opaque PSK"\ |
| 6206 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6207 | -C "session hash for extended master secret"\ |
| 6208 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6209 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6210 | -S "SSL - Unknown identity received" \ |
| 6211 | -S "SSL - Verification of the message MAC failed" |
| 6212 | |
| 6213 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6214 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 6215 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6216 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 6217 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6218 | 0 \ |
| 6219 | -c "skip PMS generation for opaque PSK"\ |
| 6220 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6221 | -C "session hash for extended master secret"\ |
| 6222 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6223 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6224 | -S "SSL - Unknown identity received" \ |
| 6225 | -S "SSL - Verification of the message MAC failed" |
| 6226 | |
| 6227 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6228 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 6229 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6230 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 6231 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6232 | 0 \ |
| 6233 | -c "skip PMS generation for opaque PSK"\ |
| 6234 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6235 | -c "session hash for extended master secret"\ |
| 6236 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6237 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6238 | -S "SSL - Unknown identity received" \ |
| 6239 | -S "SSL - Verification of the message MAC failed" |
| 6240 | |
| 6241 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6242 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 6243 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6244 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 6245 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6246 | 0 \ |
| 6247 | -c "skip PMS generation for opaque PSK"\ |
| 6248 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6249 | -c "session hash for extended master secret"\ |
| 6250 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6251 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6252 | -S "SSL - Unknown identity received" \ |
| 6253 | -S "SSL - Verification of the message MAC failed" |
| 6254 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6255 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6256 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6257 | "$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" \ |
| 6258 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6259 | psk_identity=foo psk=abc123" \ |
| 6260 | 0 \ |
| 6261 | -C "skip PMS generation for opaque PSK"\ |
| 6262 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6263 | -C "session hash for extended master secret"\ |
| 6264 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6265 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6266 | -S "SSL - Unknown identity received" \ |
| 6267 | -S "SSL - Verification of the message MAC failed" |
| 6268 | |
| 6269 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6270 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6271 | "$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" \ |
| 6272 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6273 | psk_identity=foo psk=abc123" \ |
| 6274 | 0 \ |
| 6275 | -C "skip PMS generation for opaque PSK"\ |
| 6276 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6277 | -C "session hash for extended master secret"\ |
| 6278 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6279 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6280 | -S "SSL - Unknown identity received" \ |
| 6281 | -S "SSL - Verification of the message MAC failed" |
| 6282 | |
| 6283 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6284 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6285 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6286 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6287 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6288 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6289 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6290 | -c "session hash for extended master secret"\ |
| 6291 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6292 | -C "skip PMS generation for opaque PSK"\ |
| 6293 | -s "skip PMS generation for opaque PSK"\ |
| 6294 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6295 | -S "SSL - Unknown identity received" \ |
| 6296 | -S "SSL - Verification of the message MAC failed" |
| 6297 | |
| 6298 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6299 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6300 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6301 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6302 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6303 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6304 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6305 | -c "session hash for extended master secret"\ |
| 6306 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6307 | -C "skip PMS generation for opaque PSK"\ |
| 6308 | -s "skip PMS generation for opaque PSK"\ |
| 6309 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6310 | -S "SSL - Unknown identity received" \ |
| 6311 | -S "SSL - Verification of the message MAC failed" |
| 6312 | |
| 6313 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6314 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6315 | "$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" \ |
| 6316 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6317 | psk_identity=def psk=beef" \ |
| 6318 | 0 \ |
| 6319 | -C "skip PMS generation for opaque PSK"\ |
| 6320 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6321 | -C "session hash for extended master secret"\ |
| 6322 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6323 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6324 | -S "SSL - Unknown identity received" \ |
| 6325 | -S "SSL - Verification of the message MAC failed" |
| 6326 | |
| 6327 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6328 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6329 | "$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" \ |
| 6330 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6331 | psk_identity=def psk=beef" \ |
| 6332 | 0 \ |
| 6333 | -C "skip PMS generation for opaque PSK"\ |
| 6334 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6335 | -C "session hash for extended master secret"\ |
| 6336 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6337 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6338 | -S "SSL - Unknown identity received" \ |
| 6339 | -S "SSL - Verification of the message MAC failed" |
| 6340 | |
| 6341 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6342 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6343 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6344 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6345 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6346 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6347 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6348 | -c "session hash for extended master secret"\ |
| 6349 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6350 | -C "skip PMS generation for opaque PSK"\ |
| 6351 | -s "skip PMS generation for opaque PSK"\ |
| 6352 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6353 | -S "SSL - Unknown identity received" \ |
| 6354 | -S "SSL - Verification of the message MAC failed" |
| 6355 | |
| 6356 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6357 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6358 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6359 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6360 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6361 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6362 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6363 | -c "session hash for extended master secret"\ |
| 6364 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6365 | -C "skip PMS generation for opaque PSK"\ |
| 6366 | -s "skip PMS generation for opaque PSK"\ |
| 6367 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6368 | -S "SSL - Unknown identity received" \ |
| 6369 | -S "SSL - Verification of the message MAC failed" |
| 6370 | |
| 6371 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6372 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6373 | "$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" \ |
| 6374 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6375 | psk_identity=def psk=beef" \ |
| 6376 | 0 \ |
| 6377 | -C "skip PMS generation for opaque PSK"\ |
| 6378 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6379 | -C "session hash for extended master secret"\ |
| 6380 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6381 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6382 | -S "SSL - Unknown identity received" \ |
| 6383 | -S "SSL - Verification of the message MAC failed" |
| 6384 | |
| 6385 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6386 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6387 | "$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" \ |
| 6388 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6389 | psk_identity=def psk=beef" \ |
| 6390 | 0 \ |
| 6391 | -C "skip PMS generation for opaque PSK"\ |
| 6392 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6393 | -C "session hash for extended master secret"\ |
| 6394 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6395 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6396 | -S "SSL - Unknown identity received" \ |
| 6397 | -S "SSL - Verification of the message MAC failed" |
| 6398 | |
| 6399 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6400 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6401 | "$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" \ |
| 6402 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6403 | psk_identity=def psk=beef" \ |
| 6404 | 0 \ |
| 6405 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6406 | -C "session hash for extended master secret"\ |
| 6407 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6408 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6409 | -S "SSL - Unknown identity received" \ |
| 6410 | -S "SSL - Verification of the message MAC failed" |
| 6411 | |
| 6412 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6413 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6414 | "$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" \ |
| 6415 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6416 | psk_identity=def psk=beef" \ |
| 6417 | 0 \ |
| 6418 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6419 | -C "session hash for extended master secret"\ |
| 6420 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6421 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6422 | -S "SSL - Unknown identity received" \ |
| 6423 | -S "SSL - Verification of the message MAC failed" |
| 6424 | |
| 6425 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6426 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6427 | "$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" \ |
| 6428 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6429 | psk_identity=def psk=beef" \ |
| 6430 | 1 \ |
| 6431 | -s "SSL - Verification of the message MAC failed" |
| 6432 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6433 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6434 | "$P_SRV" \ |
| 6435 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6436 | psk_identity=foo psk=abc123" \ |
| 6437 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6438 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6439 | -S "SSL - Unknown identity received" \ |
| 6440 | -S "SSL - Verification of the message MAC failed" |
| 6441 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6442 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6443 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 6444 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6445 | psk_identity=foo psk=abc123" \ |
| 6446 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6447 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6448 | -s "SSL - Unknown identity received" \ |
| 6449 | -S "SSL - Verification of the message MAC failed" |
| 6450 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6451 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6452 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6453 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6454 | psk_identity=abc psk=dead" \ |
| 6455 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6456 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6457 | -S "SSL - Unknown identity received" \ |
| 6458 | -S "SSL - Verification of the message MAC failed" |
| 6459 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6460 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6461 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6462 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6463 | psk_identity=def psk=beef" \ |
| 6464 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6465 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6466 | -S "SSL - Unknown identity received" \ |
| 6467 | -S "SSL - Verification of the message MAC failed" |
| 6468 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6469 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6470 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6471 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6472 | psk_identity=ghi psk=beef" \ |
| 6473 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6474 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6475 | -s "SSL - Unknown identity received" \ |
| 6476 | -S "SSL - Verification of the message MAC failed" |
| 6477 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6478 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6479 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6480 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6481 | psk_identity=abc psk=beef" \ |
| 6482 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6483 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6484 | -S "SSL - Unknown identity received" \ |
| 6485 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6486 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6487 | # Tests for EC J-PAKE |
| 6488 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6489 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6490 | run_test "ECJPAKE: client not configured" \ |
| 6491 | "$P_SRV debug_level=3" \ |
| 6492 | "$P_CLI debug_level=3" \ |
| 6493 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6494 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6495 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6496 | -S "found ecjpake kkpp extension" \ |
| 6497 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6498 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6499 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6500 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6501 | -S "None of the common ciphersuites is usable" |
| 6502 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6503 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6504 | run_test "ECJPAKE: server not configured" \ |
| 6505 | "$P_SRV debug_level=3" \ |
| 6506 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6507 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6508 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6509 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6510 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6511 | -s "found ecjpake kkpp extension" \ |
| 6512 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6513 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6514 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6515 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6516 | -s "None of the common ciphersuites is usable" |
| 6517 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6518 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6519 | run_test "ECJPAKE: working, TLS" \ |
| 6520 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6521 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6522 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6523 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6524 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6525 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6526 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6527 | -s "found ecjpake kkpp extension" \ |
| 6528 | -S "skip ecjpake kkpp extension" \ |
| 6529 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6530 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6531 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6532 | -S "None of the common ciphersuites is usable" \ |
| 6533 | -S "SSL - Verification of the message MAC failed" |
| 6534 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6535 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6536 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6537 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6538 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6539 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6540 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6541 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6542 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6543 | -s "SSL - Verification of the message MAC failed" |
| 6544 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6545 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6546 | run_test "ECJPAKE: working, DTLS" \ |
| 6547 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6548 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6549 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6550 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6551 | -c "re-using cached ecjpake parameters" \ |
| 6552 | -S "SSL - Verification of the message MAC failed" |
| 6553 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6554 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6555 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6556 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6557 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6558 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6559 | 0 \ |
| 6560 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6561 | -S "SSL - Verification of the message MAC failed" |
| 6562 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6563 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6564 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6565 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6566 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6567 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6568 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6569 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6570 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6571 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6572 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6573 | # for tests with configs/config-thread.h |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6574 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6575 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6576 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6577 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6578 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6579 | 0 |
| 6580 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6581 | # Tests for ciphersuites per version |
| 6582 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6583 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6584 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6585 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6586 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6587 | "$P_CLI force_version=ssl3" \ |
| 6588 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6589 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6590 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6591 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6592 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6593 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6594 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 6595 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6596 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6597 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6598 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6599 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6600 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6601 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6602 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6603 | "$P_CLI force_version=tls1_1" \ |
| 6604 | 0 \ |
| 6605 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 6606 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6607 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6608 | requires_config_enabled MBEDTLS_AES_C |
Przemek Stekiel | efc894b | 2022-10-06 12:15:21 +0200 | [diff] [blame] | 6609 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6610 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6611 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6612 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6613 | 0 \ |
| 6614 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 6615 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6616 | # Test for ClientHello without extensions |
| 6617 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6618 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6619 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6620 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6621 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6622 | 0 \ |
| 6623 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6624 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6625 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6626 | |
Gilles Peskine | 5a1b3bd | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6627 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6628 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | 5a1b3bd | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6629 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6630 | "$P_CLI request_size=100" \ |
| 6631 | 0 \ |
| 6632 | -s "Read from client: 100 bytes read$" |
| 6633 | |
Gilles Peskine | 5a1b3bd | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6634 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 6635 | "$P_SRV buffer_size=100" \ |
| 6636 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6637 | 0 \ |
Gilles Peskine | 5a1b3bd | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6638 | -s "Read from client: 101 bytes read (100 + 1)" |
| 6639 | |
| 6640 | requires_max_content_len 200 |
| 6641 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 6642 | "$P_SRV buffer_size=100" \ |
| 6643 | "$P_CLI request_size=200" \ |
| 6644 | 0 \ |
| 6645 | -s "Read from client: 200 bytes read (100 + 100)" |
| 6646 | |
| 6647 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 6648 | "$P_SRV buffer_size=100" \ |
| 6649 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 6650 | 0 \ |
| 6651 | -s "Read from client: $MAX_CONTENT_LEN bytes read (100 + $((MAX_CONTENT_LEN - 100)))" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6652 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6653 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6654 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6655 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6656 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6657 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6658 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6659 | 0 \ |
| 6660 | -s "Read from client: 1 bytes read" |
| 6661 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6662 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6663 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6664 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6665 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6666 | 0 \ |
| 6667 | -s "Read from client: 1 bytes read" |
| 6668 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6669 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6670 | "$P_SRV" \ |
| 6671 | "$P_CLI request_size=1 force_version=tls1 \ |
| 6672 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6673 | 0 \ |
| 6674 | -s "Read from client: 1 bytes read" |
| 6675 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6676 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6677 | "$P_SRV" \ |
| 6678 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 6679 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6680 | 0 \ |
| 6681 | -s "Read from client: 1 bytes read" |
| 6682 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6683 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6684 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6685 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6686 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6687 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6688 | 0 \ |
| 6689 | -s "Read from client: 1 bytes read" |
| 6690 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6691 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6692 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6693 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6694 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6695 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6696 | 0 \ |
| 6697 | -s "Read from client: 1 bytes read" |
| 6698 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6699 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6700 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6701 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6702 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6703 | 0 \ |
| 6704 | -s "Read from client: 1 bytes read" |
| 6705 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6706 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6707 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6708 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6709 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6710 | 0 \ |
| 6711 | -s "Read from client: 1 bytes read" |
| 6712 | |
| 6713 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6714 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6715 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6716 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6717 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6718 | 0 \ |
| 6719 | -s "Read from client: 1 bytes read" |
| 6720 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6721 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6722 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6723 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6724 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6725 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6726 | 0 \ |
| 6727 | -s "Read from client: 1 bytes read" |
| 6728 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6729 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6730 | "$P_SRV" \ |
| 6731 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6732 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6733 | 0 \ |
| 6734 | -s "Read from client: 1 bytes read" |
| 6735 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6736 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6737 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6738 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6739 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6740 | 0 \ |
| 6741 | -s "Read from client: 1 bytes read" |
| 6742 | |
| 6743 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6744 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6745 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6746 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6747 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6748 | 0 \ |
| 6749 | -s "Read from client: 1 bytes read" |
| 6750 | |
| 6751 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6752 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6753 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6754 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6755 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6756 | 0 \ |
| 6757 | -s "Read from client: 1 bytes read" |
| 6758 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6759 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6760 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6761 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6762 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6763 | 0 \ |
| 6764 | -s "Read from client: 1 bytes read" |
| 6765 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6766 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6767 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6768 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6769 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6770 | 0 \ |
| 6771 | -s "Read from client: 1 bytes read" |
| 6772 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6773 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6774 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6775 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6776 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6777 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6778 | 0 \ |
| 6779 | -s "Read from client: 1 bytes read" |
| 6780 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6781 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6782 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6783 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6784 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6785 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6786 | 0 \ |
| 6787 | -s "Read from client: 1 bytes read" |
| 6788 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6789 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6790 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6791 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6792 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6793 | 0 \ |
| 6794 | -s "Read from client: 1 bytes read" |
| 6795 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6796 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6797 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6798 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6799 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6800 | 0 \ |
| 6801 | -s "Read from client: 1 bytes read" |
| 6802 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6803 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6804 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6805 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6806 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6807 | 0 \ |
| 6808 | -s "Read from client: 1 bytes read" |
| 6809 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6810 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6811 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6812 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6813 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6814 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6815 | 0 \ |
| 6816 | -s "Read from client: 1 bytes read" |
| 6817 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6818 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6819 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6820 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6821 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6822 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6823 | 0 \ |
| 6824 | -s "Read from client: 1 bytes read" |
| 6825 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6826 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6827 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6828 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6829 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6830 | 0 \ |
| 6831 | -s "Read from client: 1 bytes read" |
| 6832 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6833 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6834 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6835 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6836 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6837 | 0 \ |
| 6838 | -s "Read from client: 1 bytes read" |
| 6839 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6840 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6841 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6842 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6843 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6844 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6845 | 0 \ |
| 6846 | -s "Read from client: 1 bytes read" |
| 6847 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6848 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6849 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6850 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6851 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6852 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6853 | 0 \ |
| 6854 | -s "Read from client: 1 bytes read" |
| 6855 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6856 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6857 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6858 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6859 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6860 | 0 \ |
| 6861 | -s "Read from client: 1 bytes read" |
| 6862 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6863 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6864 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6865 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6866 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6867 | 0 \ |
| 6868 | -s "Read from client: 1 bytes read" |
| 6869 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6870 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6871 | |
| 6872 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6873 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6874 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6875 | "$P_CLI dtls=1 request_size=1 \ |
| 6876 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6877 | 0 \ |
| 6878 | -s "Read from client: 1 bytes read" |
| 6879 | |
| 6880 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6881 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6882 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6883 | "$P_CLI dtls=1 request_size=1 \ |
| 6884 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6885 | 0 \ |
| 6886 | -s "Read from client: 1 bytes read" |
| 6887 | |
| 6888 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6889 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6890 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6891 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6892 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6893 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6894 | 0 \ |
| 6895 | -s "Read from client: 1 bytes read" |
| 6896 | |
| 6897 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6898 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6899 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6900 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6901 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6902 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6903 | 0 \ |
| 6904 | -s "Read from client: 1 bytes read" |
| 6905 | |
| 6906 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6907 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6908 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6909 | "$P_CLI dtls=1 request_size=1 \ |
| 6910 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6911 | 0 \ |
| 6912 | -s "Read from client: 1 bytes read" |
| 6913 | |
| 6914 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6915 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6916 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6917 | "$P_CLI dtls=1 request_size=1 \ |
| 6918 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6919 | 0 \ |
| 6920 | -s "Read from client: 1 bytes read" |
| 6921 | |
| 6922 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6923 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6924 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6925 | "$P_SRV dtls=1 force_version=dtls12 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6926 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6927 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6928 | 0 \ |
| 6929 | -s "Read from client: 1 bytes read" |
| 6930 | |
| 6931 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6932 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6933 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6934 | "$P_SRV dtls=1 force_version=dtls12 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6935 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6936 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6937 | 0 \ |
| 6938 | -s "Read from client: 1 bytes read" |
| 6939 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6940 | # Tests for small server packets |
| 6941 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6942 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 6943 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 6944 | "$P_CLI force_version=ssl3 \ |
| 6945 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6946 | 0 \ |
| 6947 | -c "Read from server: 1 bytes read" |
| 6948 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6949 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 6950 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6951 | "$P_CLI force_version=ssl3 \ |
| 6952 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6953 | 0 \ |
| 6954 | -c "Read from server: 1 bytes read" |
| 6955 | |
| 6956 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6957 | "$P_SRV response_size=1" \ |
| 6958 | "$P_CLI force_version=tls1 \ |
| 6959 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6960 | 0 \ |
| 6961 | -c "Read from server: 1 bytes read" |
| 6962 | |
| 6963 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6964 | "$P_SRV response_size=1" \ |
| 6965 | "$P_CLI force_version=tls1 etm=0 \ |
| 6966 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6967 | 0 \ |
| 6968 | -c "Read from server: 1 bytes read" |
| 6969 | |
| 6970 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6971 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6972 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6973 | "$P_CLI force_version=tls1 \ |
| 6974 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6975 | 0 \ |
| 6976 | -c "Read from server: 1 bytes read" |
| 6977 | |
| 6978 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6979 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6980 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6981 | "$P_CLI force_version=tls1 \ |
| 6982 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6983 | 0 \ |
| 6984 | -c "Read from server: 1 bytes read" |
| 6985 | |
| 6986 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6987 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6988 | "$P_CLI force_version=tls1 \ |
| 6989 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6990 | 0 \ |
| 6991 | -c "Read from server: 1 bytes read" |
| 6992 | |
| 6993 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6994 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6995 | "$P_CLI force_version=tls1 \ |
| 6996 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6997 | 0 \ |
| 6998 | -c "Read from server: 1 bytes read" |
| 6999 | |
| 7000 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7001 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 7002 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7003 | "$P_CLI force_version=tls1 \ |
| 7004 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7005 | 0 \ |
| 7006 | -c "Read from server: 1 bytes read" |
| 7007 | |
| 7008 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7009 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 7010 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7011 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7012 | trunc_hmac=1 etm=0" \ |
| 7013 | 0 \ |
| 7014 | -c "Read from server: 1 bytes read" |
| 7015 | |
| 7016 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 7017 | "$P_SRV response_size=1" \ |
| 7018 | "$P_CLI force_version=tls1_1 \ |
| 7019 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7020 | 0 \ |
| 7021 | -c "Read from server: 1 bytes read" |
| 7022 | |
| 7023 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 7024 | "$P_SRV response_size=1" \ |
| 7025 | "$P_CLI force_version=tls1_1 \ |
| 7026 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 7027 | 0 \ |
| 7028 | -c "Read from server: 1 bytes read" |
| 7029 | |
| 7030 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7031 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 7032 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 7033 | "$P_CLI force_version=tls1_1 \ |
| 7034 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 7035 | 0 \ |
| 7036 | -c "Read from server: 1 bytes read" |
| 7037 | |
| 7038 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7039 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 7040 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 7041 | "$P_CLI force_version=tls1_1 \ |
| 7042 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7043 | 0 \ |
| 7044 | -c "Read from server: 1 bytes read" |
| 7045 | |
| 7046 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 7047 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7048 | "$P_CLI force_version=tls1_1 \ |
| 7049 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7050 | 0 \ |
| 7051 | -c "Read from server: 1 bytes read" |
| 7052 | |
| 7053 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 7054 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7055 | "$P_CLI force_version=tls1_1 \ |
| 7056 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7057 | 0 \ |
| 7058 | -c "Read from server: 1 bytes read" |
| 7059 | |
| 7060 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7061 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 7062 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7063 | "$P_CLI force_version=tls1_1 \ |
| 7064 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7065 | 0 \ |
| 7066 | -c "Read from server: 1 bytes read" |
| 7067 | |
| 7068 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7069 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 7070 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7071 | "$P_CLI force_version=tls1_1 \ |
| 7072 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7073 | 0 \ |
| 7074 | -c "Read from server: 1 bytes read" |
| 7075 | |
| 7076 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 7077 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7078 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7079 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7080 | 0 \ |
| 7081 | -c "Read from server: 1 bytes read" |
| 7082 | |
| 7083 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 7084 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7085 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7086 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 7087 | 0 \ |
| 7088 | -c "Read from server: 1 bytes read" |
| 7089 | |
| 7090 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 7091 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7092 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7093 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 7094 | 0 \ |
| 7095 | -c "Read from server: 1 bytes read" |
| 7096 | |
| 7097 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7098 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 7099 | "$P_SRV response_size=1 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7100 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7101 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 7102 | 0 \ |
| 7103 | -c "Read from server: 1 bytes read" |
| 7104 | |
| 7105 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7106 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 7107 | "$P_SRV response_size=1 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7108 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7109 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7110 | 0 \ |
| 7111 | -c "Read from server: 1 bytes read" |
| 7112 | |
| 7113 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 7114 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7115 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7116 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7117 | 0 \ |
| 7118 | -c "Read from server: 1 bytes read" |
| 7119 | |
| 7120 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 7121 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7122 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7123 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7124 | 0 \ |
| 7125 | -c "Read from server: 1 bytes read" |
| 7126 | |
| 7127 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7128 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 7129 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7130 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7131 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7132 | 0 \ |
| 7133 | -c "Read from server: 1 bytes read" |
| 7134 | |
| 7135 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7136 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 7137 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7138 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7139 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7140 | 0 \ |
| 7141 | -c "Read from server: 1 bytes read" |
| 7142 | |
| 7143 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 7144 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7145 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7146 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7147 | 0 \ |
| 7148 | -c "Read from server: 1 bytes read" |
| 7149 | |
| 7150 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 7151 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7152 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7153 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7154 | 0 \ |
| 7155 | -c "Read from server: 1 bytes read" |
| 7156 | |
| 7157 | # Tests for small server packets in DTLS |
| 7158 | |
| 7159 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7160 | run_test "Small server packet DTLS 1.0" \ |
| 7161 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 7162 | "$P_CLI dtls=1 \ |
| 7163 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7164 | 0 \ |
| 7165 | -c "Read from server: 1 bytes read" |
| 7166 | |
| 7167 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7168 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 7169 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 7170 | "$P_CLI dtls=1 \ |
| 7171 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7172 | 0 \ |
| 7173 | -c "Read from server: 1 bytes read" |
| 7174 | |
| 7175 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7176 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7177 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 7178 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 7179 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 7180 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7181 | 0 \ |
| 7182 | -c "Read from server: 1 bytes read" |
| 7183 | |
| 7184 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7185 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7186 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 7187 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 7188 | "$P_CLI dtls=1 \ |
| 7189 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 7190 | 0 \ |
| 7191 | -c "Read from server: 1 bytes read" |
| 7192 | |
| 7193 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7194 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7195 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7196 | "$P_CLI dtls=1 \ |
| 7197 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7198 | 0 \ |
| 7199 | -c "Read from server: 1 bytes read" |
| 7200 | |
| 7201 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7202 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7203 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7204 | "$P_CLI dtls=1 \ |
| 7205 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7206 | 0 \ |
| 7207 | -c "Read from server: 1 bytes read" |
| 7208 | |
| 7209 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7210 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7211 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7212 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 trunc_hmac=1" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7213 | "$P_CLI dtls=1 \ |
| 7214 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 7215 | 0 \ |
| 7216 | -c "Read from server: 1 bytes read" |
| 7217 | |
| 7218 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7219 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7220 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7221 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 trunc_hmac=1 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7222 | "$P_CLI dtls=1 \ |
| 7223 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 7224 | 0 \ |
| 7225 | -c "Read from server: 1 bytes read" |
| 7226 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 7227 | # A test for extensions in SSLv3 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7228 | requires_max_content_len 4096 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 7229 | run_test "SSLv3 with extensions, server side" \ |
| 7230 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 7231 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 7232 | 0 \ |
| 7233 | -S "dumping 'client hello extensions'" \ |
| 7234 | -S "server hello, total extension length:" |
| 7235 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7236 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7237 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7238 | # How many fragments do we expect to write $1 bytes? |
| 7239 | fragments_for_write() { |
| 7240 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 7241 | } |
| 7242 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7243 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 7244 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7245 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7246 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7247 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7248 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7249 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7250 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7251 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7252 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7253 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 7254 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7255 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7256 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7257 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7258 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7259 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7260 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7261 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7262 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7263 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7264 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7265 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7266 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7267 | run_test "Large client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7268 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7269 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 7270 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7271 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7272 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7273 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7274 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7275 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7276 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7277 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7278 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7279 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7280 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7281 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7282 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7283 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7284 | run_test "Large client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7285 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7286 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7287 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7288 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7289 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7290 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7291 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7292 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7293 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7294 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7295 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7296 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7297 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7298 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7299 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7300 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7301 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7302 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7303 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7304 | |
| 7305 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7306 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7307 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7308 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7309 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7310 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7311 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7312 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7313 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7314 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7315 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7316 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7317 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7318 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7319 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7320 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7321 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7322 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7323 | "$P_SRV" \ |
| 7324 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 7325 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7326 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7327 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7328 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7329 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7330 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7331 | "$P_SRV" \ |
| 7332 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 7333 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7334 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7335 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7336 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7337 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7338 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7339 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7340 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7341 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7342 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7343 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7344 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7345 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7346 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7347 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7348 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7349 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7350 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7351 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7352 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7353 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7354 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7355 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 7356 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7357 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7358 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7359 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7360 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7361 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7362 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7363 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7364 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7365 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7366 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7367 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7368 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7369 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7370 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7371 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7372 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7373 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7374 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7375 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7376 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7377 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7378 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7379 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7380 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7381 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7382 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7383 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7384 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7385 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7386 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7387 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7388 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7389 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7390 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7391 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7392 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7393 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7394 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7395 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7396 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7397 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7398 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7399 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7400 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7401 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7402 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7403 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7404 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7405 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7406 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7407 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7408 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7409 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7410 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7411 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7412 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7413 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7414 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7415 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7416 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7417 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7418 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7419 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7420 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7421 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7422 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7423 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7424 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7425 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7426 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7427 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7428 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7429 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7430 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7431 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7432 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7433 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7434 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7435 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7436 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7437 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7438 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7439 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7440 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7441 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7442 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7443 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7444 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7445 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7446 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7447 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7448 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7449 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7450 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7451 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7452 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7453 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7454 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7455 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7456 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7457 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7458 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7459 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7460 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7461 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7462 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7463 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7464 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7465 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7466 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7467 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7468 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7469 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7470 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7471 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7472 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7473 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7474 | # Test for large server packets |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7475 | # The tests below fail when the server's OUT_CONTENT_LEN is less than 16384. |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7476 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 7477 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7478 | "$P_CLI force_version=ssl3 \ |
| 7479 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7480 | 0 \ |
| 7481 | -c "Read from server: 16384 bytes read" |
| 7482 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 7483 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 7484 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 7485 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 7486 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 7487 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7488 | 0 \ |
| 7489 | -c "Read from server: 1 bytes read"\ |
| 7490 | -c "16383 bytes read"\ |
| 7491 | -C "Read from server: 16384 bytes read" |
| 7492 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7493 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 7494 | "$P_SRV response_size=16384" \ |
| 7495 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7496 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7497 | 0 \ |
| 7498 | -c "Read from server: 1 bytes read"\ |
| 7499 | -c "16383 bytes read"\ |
| 7500 | -C "Read from server: 16384 bytes read" |
| 7501 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7502 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 7503 | "$P_SRV response_size=16384" \ |
| 7504 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 7505 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7506 | 0 \ |
| 7507 | -c "Read from server: 1 bytes read"\ |
| 7508 | -c "16383 bytes read"\ |
| 7509 | -C "Read from server: 16384 bytes read" |
| 7510 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7511 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7512 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 7513 | "$P_SRV response_size=16384" \ |
| 7514 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7515 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7516 | trunc_hmac=1" \ |
| 7517 | 0 \ |
| 7518 | -c "Read from server: 1 bytes read"\ |
| 7519 | -c "16383 bytes read"\ |
| 7520 | -C "Read from server: 16384 bytes read" |
| 7521 | |
| 7522 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7523 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 7524 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7525 | "$P_CLI force_version=tls1 \ |
| 7526 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7527 | trunc_hmac=1" \ |
| 7528 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7529 | -s "16384 bytes written in 1 fragments" \ |
| 7530 | -c "Read from server: 16384 bytes read" |
| 7531 | |
| 7532 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 7533 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7534 | "$P_CLI force_version=tls1 \ |
| 7535 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7536 | 0 \ |
| 7537 | -s "16384 bytes written in 1 fragments" \ |
| 7538 | -c "Read from server: 16384 bytes read" |
| 7539 | |
| 7540 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 7541 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7542 | "$P_CLI force_version=tls1 \ |
| 7543 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7544 | 0 \ |
| 7545 | -s "16384 bytes written in 1 fragments" \ |
| 7546 | -c "Read from server: 16384 bytes read" |
| 7547 | |
| 7548 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7549 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 7550 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7551 | "$P_CLI force_version=tls1 \ |
| 7552 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7553 | 0 \ |
| 7554 | -s "16384 bytes written in 1 fragments" \ |
| 7555 | -c "Read from server: 16384 bytes read" |
| 7556 | |
| 7557 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7558 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 7559 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7560 | "$P_CLI force_version=tls1 \ |
| 7561 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7562 | 0 \ |
| 7563 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7564 | -c "Read from server: 16384 bytes read" |
| 7565 | |
| 7566 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 7567 | "$P_SRV response_size=16384" \ |
| 7568 | "$P_CLI force_version=tls1_1 \ |
| 7569 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7570 | 0 \ |
| 7571 | -c "Read from server: 16384 bytes read" |
| 7572 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7573 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 7574 | "$P_SRV response_size=16384" \ |
| 7575 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 7576 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7577 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7578 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7579 | -c "Read from server: 16384 bytes read" |
| 7580 | |
| 7581 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7582 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 7583 | "$P_SRV response_size=16384" \ |
| 7584 | "$P_CLI force_version=tls1_1 \ |
| 7585 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7586 | trunc_hmac=1" \ |
| 7587 | 0 \ |
| 7588 | -c "Read from server: 16384 bytes read" |
| 7589 | |
| 7590 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7591 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 7592 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 7593 | "$P_CLI force_version=tls1_1 \ |
| 7594 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7595 | 0 \ |
| 7596 | -s "16384 bytes written in 1 fragments" \ |
| 7597 | -c "Read from server: 16384 bytes read" |
| 7598 | |
| 7599 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 7600 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7601 | "$P_CLI force_version=tls1_1 \ |
| 7602 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7603 | 0 \ |
| 7604 | -c "Read from server: 16384 bytes read" |
| 7605 | |
| 7606 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 7607 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7608 | "$P_CLI force_version=tls1_1 \ |
| 7609 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7610 | 0 \ |
| 7611 | -s "16384 bytes written in 1 fragments" \ |
| 7612 | -c "Read from server: 16384 bytes read" |
| 7613 | |
| 7614 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7615 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 7616 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7617 | "$P_CLI force_version=tls1_1 \ |
| 7618 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7619 | trunc_hmac=1" \ |
| 7620 | 0 \ |
| 7621 | -c "Read from server: 16384 bytes read" |
| 7622 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7623 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 7624 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7625 | "$P_CLI force_version=tls1_1 \ |
| 7626 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7627 | 0 \ |
| 7628 | -s "16384 bytes written in 1 fragments" \ |
| 7629 | -c "Read from server: 16384 bytes read" |
| 7630 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7631 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 7632 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7633 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7634 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7635 | 0 \ |
| 7636 | -c "Read from server: 16384 bytes read" |
| 7637 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7638 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 7639 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7640 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7641 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7642 | 0 \ |
| 7643 | -s "16384 bytes written in 1 fragments" \ |
| 7644 | -c "Read from server: 16384 bytes read" |
| 7645 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7646 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 7647 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7648 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7649 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 7650 | 0 \ |
| 7651 | -c "Read from server: 16384 bytes read" |
| 7652 | |
| 7653 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7654 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 7655 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7656 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7657 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7658 | trunc_hmac=1" \ |
| 7659 | 0 \ |
| 7660 | -c "Read from server: 16384 bytes read" |
| 7661 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7662 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 7663 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7664 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7665 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7666 | 0 \ |
| 7667 | -s "16384 bytes written in 1 fragments" \ |
| 7668 | -c "Read from server: 16384 bytes read" |
| 7669 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7670 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 7671 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7672 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7673 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7674 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7675 | -s "16384 bytes written in 1 fragments" \ |
| 7676 | -c "Read from server: 16384 bytes read" |
| 7677 | |
| 7678 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 7679 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7680 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7681 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7682 | 0 \ |
| 7683 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7684 | -c "Read from server: 16384 bytes read" |
| 7685 | |
| 7686 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7687 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 7688 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7689 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7690 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7691 | trunc_hmac=1" \ |
| 7692 | 0 \ |
| 7693 | -c "Read from server: 16384 bytes read" |
| 7694 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7695 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7696 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 7697 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7698 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7699 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7700 | 0 \ |
| 7701 | -s "16384 bytes written in 1 fragments" \ |
| 7702 | -c "Read from server: 16384 bytes read" |
| 7703 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7704 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 7705 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7706 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7707 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7708 | 0 \ |
| 7709 | -c "Read from server: 16384 bytes read" |
| 7710 | |
| 7711 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 7712 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7713 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7714 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7715 | 0 \ |
| 7716 | -c "Read from server: 16384 bytes read" |
| 7717 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7718 | # Tests for restartable ECC |
| 7719 | |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7720 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 7721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7722 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7723 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7724 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7725 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7726 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7727 | debug_level=1" \ |
| 7728 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7729 | -C "x509_verify_cert.*4b00" \ |
| 7730 | -C "mbedtls_pk_verify.*4b00" \ |
| 7731 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7732 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7733 | |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7734 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 7735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7736 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7737 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7738 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7739 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7740 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7741 | debug_level=1 ec_max_ops=0" \ |
| 7742 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7743 | -C "x509_verify_cert.*4b00" \ |
| 7744 | -C "mbedtls_pk_verify.*4b00" \ |
| 7745 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7746 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7747 | |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7748 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 7749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7750 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7751 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7752 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7753 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7754 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7755 | debug_level=1 ec_max_ops=65535" \ |
| 7756 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7757 | -C "x509_verify_cert.*4b00" \ |
| 7758 | -C "mbedtls_pk_verify.*4b00" \ |
| 7759 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7760 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7761 | |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7762 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 7763 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7764 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7765 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7766 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7767 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7768 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7769 | debug_level=1 ec_max_ops=1000" \ |
| 7770 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7771 | -c "x509_verify_cert.*4b00" \ |
| 7772 | -c "mbedtls_pk_verify.*4b00" \ |
| 7773 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7774 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7775 | |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7776 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 7777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7778 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7779 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 7780 | "$P_SRV auth_mode=required \ |
| 7781 | crt_file=data_files/server5-badsign.crt \ |
| 7782 | key_file=data_files/server5.key" \ |
| 7783 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7784 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7785 | debug_level=1 ec_max_ops=1000" \ |
| 7786 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7787 | -c "x509_verify_cert.*4b00" \ |
| 7788 | -C "mbedtls_pk_verify.*4b00" \ |
| 7789 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7790 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7791 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7792 | -c "! mbedtls_ssl_handshake returned" \ |
| 7793 | -c "X509 - Certificate verification failed" |
| 7794 | |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7795 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 7796 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7797 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7798 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 7799 | "$P_SRV auth_mode=required \ |
| 7800 | crt_file=data_files/server5-badsign.crt \ |
| 7801 | key_file=data_files/server5.key" \ |
| 7802 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7803 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7804 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7805 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7806 | -c "x509_verify_cert.*4b00" \ |
| 7807 | -c "mbedtls_pk_verify.*4b00" \ |
| 7808 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7809 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7810 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7811 | -C "! mbedtls_ssl_handshake returned" \ |
| 7812 | -C "X509 - Certificate verification failed" |
| 7813 | |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7814 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 7815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7816 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7817 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 7818 | "$P_SRV auth_mode=required \ |
| 7819 | crt_file=data_files/server5-badsign.crt \ |
| 7820 | key_file=data_files/server5.key" \ |
| 7821 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7822 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7823 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7824 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7825 | -C "x509_verify_cert.*4b00" \ |
| 7826 | -c "mbedtls_pk_verify.*4b00" \ |
| 7827 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7828 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7829 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7830 | -C "! mbedtls_ssl_handshake returned" \ |
| 7831 | -C "X509 - Certificate verification failed" |
| 7832 | |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7833 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 7834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7835 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7836 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7837 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7838 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7839 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7840 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7841 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7842 | -c "x509_verify_cert.*4b00" \ |
| 7843 | -c "mbedtls_pk_verify.*4b00" \ |
| 7844 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7845 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7846 | |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7847 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 7848 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7849 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7850 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 7851 | "$P_SRV" \ |
| 7852 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7853 | debug_level=1 ec_max_ops=1000" \ |
| 7854 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7855 | -c "x509_verify_cert.*4b00" \ |
| 7856 | -c "mbedtls_pk_verify.*4b00" \ |
| 7857 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7858 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7859 | |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7860 | |
| 7861 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 7862 | # restartable behaviour at all (not even client auth). |
| 7863 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 7864 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7865 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 875d1eb | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 7866 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 7867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7868 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
| 7869 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
| 7870 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
| 7871 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7872 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7873 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7874 | -C "x509_verify_cert.*4b00" \ |
| 7875 | -C "mbedtls_pk_verify.*4b00" \ |
| 7876 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7877 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7878 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7879 | # Tests of asynchronous private key support in SSL |
| 7880 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7881 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7882 | run_test "SSL async private: sign, delay=0" \ |
| 7883 | "$P_SRV \ |
| 7884 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7885 | "$P_CLI" \ |
| 7886 | 0 \ |
| 7887 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7888 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7889 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7890 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7891 | run_test "SSL async private: sign, delay=1" \ |
| 7892 | "$P_SRV \ |
| 7893 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7894 | "$P_CLI" \ |
| 7895 | 0 \ |
| 7896 | -s "Async sign callback: using key slot " \ |
| 7897 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7898 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7899 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7900 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7901 | run_test "SSL async private: sign, delay=2" \ |
| 7902 | "$P_SRV \ |
| 7903 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7904 | "$P_CLI" \ |
| 7905 | 0 \ |
| 7906 | -s "Async sign callback: using key slot " \ |
| 7907 | -U "Async sign callback: using key slot " \ |
| 7908 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7909 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7910 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7911 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7912 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7913 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7914 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7915 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7916 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7917 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7918 | "$P_CLI force_version=tls1_1" \ |
| 7919 | 0 \ |
| 7920 | -s "Async sign callback: using key slot " \ |
| 7921 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7922 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7923 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7924 | run_test "SSL async private: sign, SNI" \ |
| 7925 | "$P_SRV debug_level=3 \ |
| 7926 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7927 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7928 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7929 | "$P_CLI server_name=polarssl.example" \ |
| 7930 | 0 \ |
| 7931 | -s "Async sign callback: using key slot " \ |
| 7932 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7933 | -s "parse ServerName extension" \ |
| 7934 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7935 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7936 | |
| 7937 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7938 | run_test "SSL async private: decrypt, delay=0" \ |
| 7939 | "$P_SRV \ |
| 7940 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7941 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7942 | 0 \ |
| 7943 | -s "Async decrypt callback: using key slot " \ |
| 7944 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7945 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7946 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7947 | run_test "SSL async private: decrypt, delay=1" \ |
| 7948 | "$P_SRV \ |
| 7949 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7950 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7951 | 0 \ |
| 7952 | -s "Async decrypt callback: using key slot " \ |
| 7953 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7954 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7955 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7956 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7957 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7958 | "$P_SRV psk=abc123 \ |
| 7959 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7960 | "$P_CLI psk=abc123 \ |
| 7961 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7962 | 0 \ |
| 7963 | -s "Async decrypt callback: using key slot " \ |
| 7964 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7965 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7966 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7967 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7968 | "$P_SRV psk=abc123 \ |
| 7969 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7970 | "$P_CLI psk=abc123 \ |
| 7971 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7972 | 0 \ |
| 7973 | -s "Async decrypt callback: using key slot " \ |
| 7974 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7975 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7976 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7977 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7978 | run_test "SSL async private: sign callback not present" \ |
| 7979 | "$P_SRV \ |
| 7980 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7981 | "$P_CLI; [ \$? -eq 1 ] && |
| 7982 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7983 | 0 \ |
| 7984 | -S "Async sign callback" \ |
| 7985 | -s "! mbedtls_ssl_handshake returned" \ |
| 7986 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7987 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7988 | -s "Successful connection" |
| 7989 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7990 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7991 | run_test "SSL async private: decrypt callback not present" \ |
| 7992 | "$P_SRV debug_level=1 \ |
| 7993 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7994 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7995 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7996 | 0 \ |
| 7997 | -S "Async decrypt callback" \ |
| 7998 | -s "! mbedtls_ssl_handshake returned" \ |
| 7999 | -s "got no RSA private key" \ |
| 8000 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8001 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8002 | |
| 8003 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8004 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8005 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8006 | "$P_SRV \ |
| 8007 | async_operations=s async_private_delay1=1 \ |
| 8008 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8009 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8010 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8011 | 0 \ |
| 8012 | -s "Async sign callback: using key slot 0," \ |
| 8013 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8014 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8015 | |
| 8016 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8017 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8018 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8019 | "$P_SRV \ |
| 8020 | async_operations=s async_private_delay2=1 \ |
| 8021 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8022 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8023 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8024 | 0 \ |
| 8025 | -s "Async sign callback: using key slot 0," \ |
| 8026 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8027 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8028 | |
| 8029 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8030 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8031 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8032 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8033 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8034 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8035 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8036 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8037 | 0 \ |
| 8038 | -s "Async sign callback: using key slot 1," \ |
| 8039 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8040 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8041 | |
| 8042 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8043 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8044 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8045 | "$P_SRV \ |
| 8046 | async_operations=s async_private_delay1=1 \ |
| 8047 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8048 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8049 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8050 | 0 \ |
| 8051 | -s "Async sign callback: no key matches this certificate." |
| 8052 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8053 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8054 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8055 | "$P_SRV \ |
| 8056 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8057 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8058 | "$P_CLI" \ |
| 8059 | 1 \ |
| 8060 | -s "Async sign callback: injected error" \ |
| 8061 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8062 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8063 | -s "! mbedtls_ssl_handshake returned" |
| 8064 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8065 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8066 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8067 | "$P_SRV \ |
| 8068 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8069 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8070 | "$P_CLI" \ |
| 8071 | 1 \ |
| 8072 | -s "Async sign callback: using key slot " \ |
| 8073 | -S "Async resume" \ |
| 8074 | -s "Async cancel" |
| 8075 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8076 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8077 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8078 | "$P_SRV \ |
| 8079 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8080 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8081 | "$P_CLI" \ |
| 8082 | 1 \ |
| 8083 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8084 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8085 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8086 | -s "! mbedtls_ssl_handshake returned" |
| 8087 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8088 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8089 | run_test "SSL async private: decrypt, error in start" \ |
| 8090 | "$P_SRV \ |
| 8091 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8092 | async_private_error=1" \ |
| 8093 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8094 | 1 \ |
| 8095 | -s "Async decrypt callback: injected error" \ |
| 8096 | -S "Async resume" \ |
| 8097 | -S "Async cancel" \ |
| 8098 | -s "! mbedtls_ssl_handshake returned" |
| 8099 | |
| 8100 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8101 | run_test "SSL async private: decrypt, cancel after start" \ |
| 8102 | "$P_SRV \ |
| 8103 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8104 | async_private_error=2" \ |
| 8105 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8106 | 1 \ |
| 8107 | -s "Async decrypt callback: using key slot " \ |
| 8108 | -S "Async resume" \ |
| 8109 | -s "Async cancel" |
| 8110 | |
| 8111 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8112 | run_test "SSL async private: decrypt, error in resume" \ |
| 8113 | "$P_SRV \ |
| 8114 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8115 | async_private_error=3" \ |
| 8116 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8117 | 1 \ |
| 8118 | -s "Async decrypt callback: using key slot " \ |
| 8119 | -s "Async resume callback: decrypt done but injected error" \ |
| 8120 | -S "Async cancel" \ |
| 8121 | -s "! mbedtls_ssl_handshake returned" |
| 8122 | |
| 8123 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8124 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8125 | "$P_SRV \ |
| 8126 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8127 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8128 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8129 | 0 \ |
| 8130 | -s "Async cancel" \ |
| 8131 | -s "! mbedtls_ssl_handshake returned" \ |
| 8132 | -s "Async resume" \ |
| 8133 | -s "Successful connection" |
| 8134 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8135 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8136 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8137 | "$P_SRV \ |
| 8138 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8139 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8140 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8141 | 0 \ |
| 8142 | -s "! mbedtls_ssl_handshake returned" \ |
| 8143 | -s "Async resume" \ |
| 8144 | -s "Successful connection" |
| 8145 | |
| 8146 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8147 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8148 | run_test "SSL async private: cancel after start then fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8149 | "$P_SRV \ |
| 8150 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 8151 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8152 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8153 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8154 | [ \$? -eq 1 ] && |
| 8155 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8156 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 8157 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8158 | -S "Async resume" \ |
| 8159 | -s "Async cancel" \ |
| 8160 | -s "! mbedtls_ssl_handshake returned" \ |
| 8161 | -s "Async sign callback: no key matches this certificate." \ |
| 8162 | -s "Successful connection" |
| 8163 | |
| 8164 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8165 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8166 | run_test "SSL async private: sign, error in resume then fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8167 | "$P_SRV \ |
| 8168 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 8169 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8170 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8171 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8172 | [ \$? -eq 1 ] && |
| 8173 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8174 | 0 \ |
| 8175 | -s "Async resume" \ |
| 8176 | -s "! mbedtls_ssl_handshake returned" \ |
| 8177 | -s "Async sign callback: no key matches this certificate." \ |
| 8178 | -s "Successful connection" |
| 8179 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8180 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8181 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8182 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8183 | "$P_SRV \ |
| 8184 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8185 | exchanges=2 renegotiation=1" \ |
| 8186 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8187 | 0 \ |
| 8188 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8189 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8190 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8191 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8192 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8193 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8194 | "$P_SRV \ |
| 8195 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8196 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8197 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8198 | 0 \ |
| 8199 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8200 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8201 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8202 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8203 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8204 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8205 | "$P_SRV \ |
| 8206 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8207 | exchanges=2 renegotiation=1" \ |
| 8208 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8209 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8210 | 0 \ |
| 8211 | -s "Async decrypt callback: using key slot " \ |
| 8212 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8213 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8214 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8215 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8216 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8217 | "$P_SRV \ |
| 8218 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8219 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8220 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 8221 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8222 | 0 \ |
| 8223 | -s "Async decrypt callback: using key slot " \ |
| 8224 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8225 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8226 | # Tests for ECC extensions (rfc 4492) |
| 8227 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8228 | requires_config_enabled MBEDTLS_AES_C |
| 8229 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8230 | requires_config_enabled MBEDTLS_SHA256_C |
| 8231 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8232 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 8233 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8234 | "$P_CLI debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8235 | 0 \ |
| 8236 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 8237 | -C "client hello, adding supported_point_formats extension" \ |
| 8238 | -S "found supported elliptic curves extension" \ |
| 8239 | -S "found supported point formats extension" |
| 8240 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8241 | requires_config_enabled MBEDTLS_AES_C |
| 8242 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8243 | requires_config_enabled MBEDTLS_SHA256_C |
| 8244 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8245 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8246 | "$P_SRV debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8247 | "$P_CLI debug_level=3" \ |
| 8248 | 0 \ |
| 8249 | -C "found supported_point_formats extension" \ |
| 8250 | -S "server hello, supported_point_formats extension" |
| 8251 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8252 | requires_config_enabled MBEDTLS_AES_C |
| 8253 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8254 | requires_config_enabled MBEDTLS_SHA256_C |
| 8255 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8256 | run_test "Force an ECC ciphersuite in the client side" \ |
| 8257 | "$P_SRV debug_level=3" \ |
| 8258 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8259 | 0 \ |
| 8260 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 8261 | -c "client hello, adding supported_point_formats extension" \ |
| 8262 | -s "found supported elliptic curves extension" \ |
| 8263 | -s "found supported point formats extension" |
| 8264 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8265 | requires_config_enabled MBEDTLS_AES_C |
| 8266 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8267 | requires_config_enabled MBEDTLS_SHA256_C |
| 8268 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8269 | run_test "Force an ECC ciphersuite in the server side" \ |
| 8270 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8271 | "$P_CLI debug_level=3" \ |
| 8272 | 0 \ |
| 8273 | -c "found supported_point_formats extension" \ |
| 8274 | -s "server hello, supported_point_formats extension" |
| 8275 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8276 | # Tests for DTLS HelloVerifyRequest |
| 8277 | |
| 8278 | run_test "DTLS cookie: enabled" \ |
| 8279 | "$P_SRV dtls=1 debug_level=2" \ |
| 8280 | "$P_CLI dtls=1 debug_level=2" \ |
| 8281 | 0 \ |
| 8282 | -s "cookie verification failed" \ |
| 8283 | -s "cookie verification passed" \ |
| 8284 | -S "cookie verification skipped" \ |
| 8285 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8286 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8287 | -S "SSL - The requested feature is not available" |
| 8288 | |
| 8289 | run_test "DTLS cookie: disabled" \ |
| 8290 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 8291 | "$P_CLI dtls=1 debug_level=2" \ |
| 8292 | 0 \ |
| 8293 | -S "cookie verification failed" \ |
| 8294 | -S "cookie verification passed" \ |
| 8295 | -s "cookie verification skipped" \ |
| 8296 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8297 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8298 | -S "SSL - The requested feature is not available" |
| 8299 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8300 | run_test "DTLS cookie: default (failing)" \ |
| 8301 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8302 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8303 | 1 \ |
| 8304 | -s "cookie verification failed" \ |
| 8305 | -S "cookie verification passed" \ |
| 8306 | -S "cookie verification skipped" \ |
| 8307 | -C "received hello verify request" \ |
| 8308 | -S "hello verification requested" \ |
| 8309 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8310 | |
| 8311 | requires_ipv6 |
| 8312 | run_test "DTLS cookie: enabled, IPv6" \ |
| 8313 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 8314 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 8315 | 0 \ |
| 8316 | -s "cookie verification failed" \ |
| 8317 | -s "cookie verification passed" \ |
| 8318 | -S "cookie verification skipped" \ |
| 8319 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8320 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8321 | -S "SSL - The requested feature is not available" |
| 8322 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8323 | run_test "DTLS cookie: enabled, nbio" \ |
| 8324 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 8325 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8326 | 0 \ |
| 8327 | -s "cookie verification failed" \ |
| 8328 | -s "cookie verification passed" \ |
| 8329 | -S "cookie verification skipped" \ |
| 8330 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8331 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8332 | -S "SSL - The requested feature is not available" |
| 8333 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8334 | # Tests for client reconnecting from the same port with DTLS |
| 8335 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8336 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8337 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8338 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8339 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8340 | 0 \ |
| 8341 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8342 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8343 | -S "Client initiated reconnection from same port" |
| 8344 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8345 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8346 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8347 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8348 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000 reconnect_hard=1" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8349 | 0 \ |
| 8350 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8351 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8352 | -s "Client initiated reconnection from same port" |
| 8353 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8354 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 8355 | run_test "DTLS client reconnect from same port: reconnect, nbio, no valgrind" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8356 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 8357 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000 reconnect_hard=1" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8358 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8359 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8360 | -s "Client initiated reconnection from same port" |
| 8361 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8362 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 8363 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 8364 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 8365 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 8366 | 0 \ |
| 8367 | -S "The operation timed out" \ |
| 8368 | -s "Client initiated reconnection from same port" |
| 8369 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8370 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 8371 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 cookies=0" \ |
Manuel Pégourié-Gonnard | 6ad23b9 | 2015-09-15 12:57:46 +0200 | [diff] [blame] | 8372 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 8373 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8374 | -s "The operation timed out" \ |
| 8375 | -S "Client initiated reconnection from same port" |
| 8376 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 8377 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 8378 | -p "$P_PXY inject_clihlo=1" \ |
| 8379 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 8380 | "$P_CLI dtls=1 exchanges=2" \ |
| 8381 | 0 \ |
| 8382 | -s "possible client reconnect from the same port" \ |
| 8383 | -S "Client initiated reconnection from same port" |
| 8384 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8385 | # Tests for various cases of client authentication with DTLS |
| 8386 | # (focused on handshake flows and message parsing) |
| 8387 | |
| 8388 | run_test "DTLS client auth: required" \ |
| 8389 | "$P_SRV dtls=1 auth_mode=required" \ |
| 8390 | "$P_CLI dtls=1" \ |
| 8391 | 0 \ |
| 8392 | -s "Verifying peer X.509 certificate... ok" |
| 8393 | |
| 8394 | run_test "DTLS client auth: optional, client has no cert" \ |
| 8395 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 8396 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 8397 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8398 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8399 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8400 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8401 | "$P_SRV dtls=1 auth_mode=none" \ |
| 8402 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 8403 | 0 \ |
| 8404 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8405 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8406 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 8407 | run_test "DTLS wrong PSK: badmac alert" \ |
| 8408 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 8409 | "$P_CLI dtls=1 psk=abc124" \ |
| 8410 | 1 \ |
| 8411 | -s "SSL - Verification of the message MAC failed" \ |
| 8412 | -c "SSL - A fatal alert message was received from our peer" |
| 8413 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8414 | # Tests for receiving fragmented handshake messages with DTLS |
| 8415 | |
| 8416 | requires_gnutls |
| 8417 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 8418 | "$G_SRV -u --mtu 2048 -a" \ |
| 8419 | "$P_CLI dtls=1 debug_level=2" \ |
| 8420 | 0 \ |
| 8421 | -C "found fragmented DTLS handshake message" \ |
| 8422 | -C "error" |
| 8423 | |
| 8424 | requires_gnutls |
| 8425 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 8426 | "$G_SRV -u --mtu 512" \ |
| 8427 | "$P_CLI dtls=1 debug_level=2" \ |
| 8428 | 0 \ |
| 8429 | -c "found fragmented DTLS handshake message" \ |
| 8430 | -C "error" |
| 8431 | |
| 8432 | requires_gnutls |
| 8433 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 8434 | "$G_SRV -u --mtu 128" \ |
| 8435 | "$P_CLI dtls=1 debug_level=2" \ |
| 8436 | 0 \ |
| 8437 | -c "found fragmented DTLS handshake message" \ |
| 8438 | -C "error" |
| 8439 | |
| 8440 | requires_gnutls |
| 8441 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 8442 | "$G_SRV -u --mtu 128" \ |
| 8443 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8444 | 0 \ |
| 8445 | -c "found fragmented DTLS handshake message" \ |
| 8446 | -C "error" |
| 8447 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8448 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8449 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8450 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 8451 | "$G_SRV -u --mtu 256" \ |
| 8452 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8453 | 0 \ |
| 8454 | -c "found fragmented DTLS handshake message" \ |
| 8455 | -c "client hello, adding renegotiation extension" \ |
| 8456 | -c "found renegotiation extension" \ |
| 8457 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8458 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8459 | -C "error" \ |
| 8460 | -s "Extra-header:" |
| 8461 | |
| 8462 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8463 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8464 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 8465 | "$G_SRV -u --mtu 256" \ |
| 8466 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8467 | 0 \ |
| 8468 | -c "found fragmented DTLS handshake message" \ |
| 8469 | -c "client hello, adding renegotiation extension" \ |
| 8470 | -c "found renegotiation extension" \ |
| 8471 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8472 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8473 | -C "error" \ |
| 8474 | -s "Extra-header:" |
| 8475 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8476 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 8477 | "$O_SRV -dtls1 -mtu 2048" \ |
| 8478 | "$P_CLI dtls=1 debug_level=2" \ |
| 8479 | 0 \ |
| 8480 | -C "found fragmented DTLS handshake message" \ |
| 8481 | -C "error" |
| 8482 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8483 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 8484 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8485 | "$P_CLI dtls=1 debug_level=2" \ |
| 8486 | 0 \ |
| 8487 | -c "found fragmented DTLS handshake message" \ |
| 8488 | -C "error" |
| 8489 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8490 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8491 | "$O_SRV -dtls1 -mtu 256" \ |
| 8492 | "$P_CLI dtls=1 debug_level=2" \ |
| 8493 | 0 \ |
| 8494 | -c "found fragmented DTLS handshake message" \ |
| 8495 | -C "error" |
| 8496 | |
| 8497 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 8498 | "$O_SRV -dtls1 -mtu 256" \ |
| 8499 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8500 | 0 \ |
| 8501 | -c "found fragmented DTLS handshake message" \ |
| 8502 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8503 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8504 | # Tests for sending fragmented handshake messages with DTLS |
| 8505 | # |
| 8506 | # Use client auth when we need the client to send large messages, |
| 8507 | # and use large cert chains on both sides too (the long chains we have all use |
| 8508 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 8509 | # Sizes reached (UDP payload): |
| 8510 | # - 2037B for server certificate |
| 8511 | # - 1542B for client certificate |
| 8512 | # - 1013B for newsessionticket |
| 8513 | # - all others below 512B |
| 8514 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 8515 | |
| 8516 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8517 | requires_config_enabled MBEDTLS_RSA_C |
| 8518 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8519 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8520 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8521 | run_test "DTLS fragmenting: none (for reference)" \ |
| 8522 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8523 | crt_file=data_files/server7_int-ca.crt \ |
| 8524 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8525 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8526 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8527 | "$P_CLI dtls=1 debug_level=2 \ |
| 8528 | crt_file=data_files/server8_int-ca2.crt \ |
| 8529 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8530 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8531 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8532 | 0 \ |
| 8533 | -S "found fragmented DTLS handshake message" \ |
| 8534 | -C "found fragmented DTLS handshake message" \ |
| 8535 | -C "error" |
| 8536 | |
| 8537 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8538 | requires_config_enabled MBEDTLS_RSA_C |
| 8539 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8540 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8541 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8542 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8543 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8544 | crt_file=data_files/server7_int-ca.crt \ |
| 8545 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8546 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8547 | max_frag_len=1024" \ |
| 8548 | "$P_CLI dtls=1 debug_level=2 \ |
| 8549 | crt_file=data_files/server8_int-ca2.crt \ |
| 8550 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8551 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8552 | max_frag_len=2048" \ |
| 8553 | 0 \ |
| 8554 | -S "found fragmented DTLS handshake message" \ |
| 8555 | -c "found fragmented DTLS handshake message" \ |
| 8556 | -C "error" |
| 8557 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8558 | # With the MFL extension, the server has no way of forcing |
| 8559 | # the client to not exceed a certain MTU; hence, the following |
| 8560 | # test can't be replicated with an MTU proxy such as the one |
| 8561 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8562 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8563 | requires_config_enabled MBEDTLS_RSA_C |
| 8564 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8565 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8566 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8567 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8568 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8569 | crt_file=data_files/server7_int-ca.crt \ |
| 8570 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8571 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8572 | max_frag_len=512" \ |
| 8573 | "$P_CLI dtls=1 debug_level=2 \ |
| 8574 | crt_file=data_files/server8_int-ca2.crt \ |
| 8575 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8576 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8577 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8578 | 0 \ |
| 8579 | -S "found fragmented DTLS handshake message" \ |
| 8580 | -c "found fragmented DTLS handshake message" \ |
| 8581 | -C "error" |
| 8582 | |
| 8583 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8584 | requires_config_enabled MBEDTLS_RSA_C |
| 8585 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8586 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8587 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8588 | run_test "DTLS fragmenting: client-initiated, server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8589 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8590 | crt_file=data_files/server7_int-ca.crt \ |
| 8591 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8592 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8593 | max_frag_len=2048" \ |
| 8594 | "$P_CLI dtls=1 debug_level=2 \ |
| 8595 | crt_file=data_files/server8_int-ca2.crt \ |
| 8596 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8597 | hs_timeout=2500-60000 \ |
| 8598 | max_frag_len=1024" \ |
| 8599 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8600 | -S "found fragmented DTLS handshake message" \ |
| 8601 | -c "found fragmented DTLS handshake message" \ |
| 8602 | -C "error" |
| 8603 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8604 | # While not required by the standard defining the MFL extension |
| 8605 | # (according to which it only applies to records, not to datagrams), |
| 8606 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8607 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8608 | # to the peer. |
| 8609 | # The next test checks that no datagrams significantly larger than the |
| 8610 | # negotiated MFL are sent. |
| 8611 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8612 | requires_config_enabled MBEDTLS_RSA_C |
| 8613 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8614 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8615 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8616 | run_test "DTLS fragmenting: client-initiated, server only (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8617 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8618 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8619 | crt_file=data_files/server7_int-ca.crt \ |
| 8620 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8621 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8622 | max_frag_len=2048" \ |
| 8623 | "$P_CLI dtls=1 debug_level=2 \ |
| 8624 | crt_file=data_files/server8_int-ca2.crt \ |
| 8625 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8626 | hs_timeout=2500-60000 \ |
| 8627 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8628 | 0 \ |
| 8629 | -S "found fragmented DTLS handshake message" \ |
| 8630 | -c "found fragmented DTLS handshake message" \ |
| 8631 | -C "error" |
| 8632 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8633 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8634 | requires_config_enabled MBEDTLS_RSA_C |
| 8635 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8636 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8637 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8638 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8639 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8640 | crt_file=data_files/server7_int-ca.crt \ |
| 8641 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8642 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8643 | max_frag_len=2048" \ |
| 8644 | "$P_CLI dtls=1 debug_level=2 \ |
| 8645 | crt_file=data_files/server8_int-ca2.crt \ |
| 8646 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8647 | hs_timeout=2500-60000 \ |
| 8648 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8649 | 0 \ |
| 8650 | -s "found fragmented DTLS handshake message" \ |
| 8651 | -c "found fragmented DTLS handshake message" \ |
| 8652 | -C "error" |
| 8653 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8654 | # While not required by the standard defining the MFL extension |
| 8655 | # (according to which it only applies to records, not to datagrams), |
| 8656 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8657 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8658 | # to the peer. |
| 8659 | # The next test checks that no datagrams significantly larger than the |
| 8660 | # negotiated MFL are sent. |
| 8661 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8662 | requires_config_enabled MBEDTLS_RSA_C |
| 8663 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8664 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8665 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8666 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8667 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8668 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8669 | crt_file=data_files/server7_int-ca.crt \ |
| 8670 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8671 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8672 | max_frag_len=2048" \ |
| 8673 | "$P_CLI dtls=1 debug_level=2 \ |
| 8674 | crt_file=data_files/server8_int-ca2.crt \ |
| 8675 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8676 | hs_timeout=2500-60000 \ |
| 8677 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8678 | 0 \ |
| 8679 | -s "found fragmented DTLS handshake message" \ |
| 8680 | -c "found fragmented DTLS handshake message" \ |
| 8681 | -C "error" |
| 8682 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8683 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8684 | requires_config_enabled MBEDTLS_RSA_C |
| 8685 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8686 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8687 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 8688 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8689 | crt_file=data_files/server7_int-ca.crt \ |
| 8690 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8691 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8692 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8693 | "$P_CLI dtls=1 debug_level=2 \ |
| 8694 | crt_file=data_files/server8_int-ca2.crt \ |
| 8695 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8696 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8697 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8698 | 0 \ |
| 8699 | -S "found fragmented DTLS handshake message" \ |
| 8700 | -C "found fragmented DTLS handshake message" \ |
| 8701 | -C "error" |
| 8702 | |
| 8703 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8704 | requires_config_enabled MBEDTLS_RSA_C |
| 8705 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8706 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8707 | run_test "DTLS fragmenting: client (MTU)" \ |
| 8708 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8709 | crt_file=data_files/server7_int-ca.crt \ |
| 8710 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8711 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8712 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8713 | "$P_CLI dtls=1 debug_level=2 \ |
| 8714 | crt_file=data_files/server8_int-ca2.crt \ |
| 8715 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8716 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8717 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8718 | 0 \ |
| 8719 | -s "found fragmented DTLS handshake message" \ |
| 8720 | -C "found fragmented DTLS handshake message" \ |
| 8721 | -C "error" |
| 8722 | |
| 8723 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8724 | requires_config_enabled MBEDTLS_RSA_C |
| 8725 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8726 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8727 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8728 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8729 | crt_file=data_files/server7_int-ca.crt \ |
| 8730 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8731 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8732 | mtu=512" \ |
| 8733 | "$P_CLI dtls=1 debug_level=2 \ |
| 8734 | crt_file=data_files/server8_int-ca2.crt \ |
| 8735 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8736 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8737 | mtu=2048" \ |
| 8738 | 0 \ |
| 8739 | -S "found fragmented DTLS handshake message" \ |
| 8740 | -c "found fragmented DTLS handshake message" \ |
| 8741 | -C "error" |
| 8742 | |
| 8743 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8744 | requires_config_enabled MBEDTLS_RSA_C |
| 8745 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8746 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8747 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8748 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8749 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8750 | crt_file=data_files/server7_int-ca.crt \ |
| 8751 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8752 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8753 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8754 | "$P_CLI dtls=1 debug_level=2 \ |
| 8755 | crt_file=data_files/server8_int-ca2.crt \ |
| 8756 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8757 | hs_timeout=2500-60000 \ |
| 8758 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8759 | 0 \ |
| 8760 | -s "found fragmented DTLS handshake message" \ |
| 8761 | -c "found fragmented DTLS handshake message" \ |
| 8762 | -C "error" |
| 8763 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8764 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8765 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8766 | requires_config_enabled MBEDTLS_RSA_C |
| 8767 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8768 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8769 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8770 | requires_config_enabled MBEDTLS_AES_C |
| 8771 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8772 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8773 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8774 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8775 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8776 | crt_file=data_files/server7_int-ca.crt \ |
| 8777 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8778 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8779 | mtu=512" \ |
| 8780 | "$P_CLI dtls=1 debug_level=2 \ |
| 8781 | crt_file=data_files/server8_int-ca2.crt \ |
| 8782 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8783 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8784 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8785 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8786 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8787 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8788 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8789 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8790 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8791 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8792 | # Forcing ciphersuite for this test to fit the MTU of 508 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8793 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8794 | # retransmissions, but in some cases (like both the server and client using |
| 8795 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8796 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8797 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8798 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8799 | requires_config_enabled MBEDTLS_RSA_C |
| 8800 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8801 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8802 | requires_config_enabled MBEDTLS_AES_C |
| 8803 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8804 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8805 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8806 | -p "$P_PXY mtu=508" \ |
| 8807 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8808 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8809 | key_file=data_files/server7.key \ |
| 8810 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8811 | "$P_CLI dtls=1 debug_level=2 \ |
| 8812 | crt_file=data_files/server8_int-ca2.crt \ |
| 8813 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8814 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8815 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8816 | 0 \ |
| 8817 | -s "found fragmented DTLS handshake message" \ |
| 8818 | -c "found fragmented DTLS handshake message" \ |
| 8819 | -C "error" |
| 8820 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8821 | # Forcing ciphersuite for this test to fit the MTU of 508 with full config. |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8822 | only_with_valgrind |
| 8823 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8824 | requires_config_enabled MBEDTLS_RSA_C |
| 8825 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8826 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8827 | requires_config_enabled MBEDTLS_AES_C |
| 8828 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8829 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8830 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8831 | -p "$P_PXY mtu=508" \ |
| 8832 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8833 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8834 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8835 | hs_timeout=250-10000" \ |
| 8836 | "$P_CLI dtls=1 debug_level=2 \ |
| 8837 | crt_file=data_files/server8_int-ca2.crt \ |
| 8838 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8839 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8840 | hs_timeout=250-10000" \ |
| 8841 | 0 \ |
| 8842 | -s "found fragmented DTLS handshake message" \ |
| 8843 | -c "found fragmented DTLS handshake message" \ |
| 8844 | -C "error" |
| 8845 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8846 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
Manuel Pégourié-Gonnard | 3d183ce | 2018-08-22 09:56:22 +0200 | [diff] [blame] | 8847 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8848 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8849 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8850 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8851 | requires_config_enabled MBEDTLS_RSA_C |
| 8852 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8853 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8854 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8855 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8856 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8857 | crt_file=data_files/server7_int-ca.crt \ |
| 8858 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8859 | hs_timeout=10000-60000 \ |
| 8860 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8861 | "$P_CLI dtls=1 debug_level=2 \ |
| 8862 | crt_file=data_files/server8_int-ca2.crt \ |
| 8863 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8864 | hs_timeout=10000-60000 \ |
| 8865 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8866 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8867 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8868 | -s "found fragmented DTLS handshake message" \ |
| 8869 | -c "found fragmented DTLS handshake message" \ |
| 8870 | -C "error" |
| 8871 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8872 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8873 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8874 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8875 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8876 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8877 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8878 | requires_config_enabled MBEDTLS_RSA_C |
| 8879 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8880 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8881 | requires_config_enabled MBEDTLS_AES_C |
| 8882 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8883 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8884 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8885 | -p "$P_PXY mtu=512" \ |
| 8886 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8887 | crt_file=data_files/server7_int-ca.crt \ |
| 8888 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8889 | hs_timeout=10000-60000 \ |
| 8890 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8891 | "$P_CLI dtls=1 debug_level=2 \ |
| 8892 | crt_file=data_files/server8_int-ca2.crt \ |
| 8893 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8894 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8895 | hs_timeout=10000-60000 \ |
| 8896 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8897 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8898 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8899 | -s "found fragmented DTLS handshake message" \ |
| 8900 | -c "found fragmented DTLS handshake message" \ |
| 8901 | -C "error" |
| 8902 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8903 | not_with_valgrind # spurious autoreduction due to timeout |
| 8904 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8905 | requires_config_enabled MBEDTLS_RSA_C |
| 8906 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8907 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8908 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8909 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8910 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8911 | crt_file=data_files/server7_int-ca.crt \ |
| 8912 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8913 | hs_timeout=10000-60000 \ |
| 8914 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8915 | "$P_CLI dtls=1 debug_level=2 \ |
| 8916 | crt_file=data_files/server8_int-ca2.crt \ |
| 8917 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8918 | hs_timeout=10000-60000 \ |
| 8919 | mtu=1024 nbio=2" \ |
| 8920 | 0 \ |
| 8921 | -S "autoreduction" \ |
| 8922 | -s "found fragmented DTLS handshake message" \ |
| 8923 | -c "found fragmented DTLS handshake message" \ |
| 8924 | -C "error" |
| 8925 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8926 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8927 | not_with_valgrind # spurious autoreduction due to timeout |
| 8928 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8929 | requires_config_enabled MBEDTLS_RSA_C |
| 8930 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8931 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8932 | requires_config_enabled MBEDTLS_AES_C |
| 8933 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8934 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8935 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8936 | -p "$P_PXY mtu=512" \ |
| 8937 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8938 | crt_file=data_files/server7_int-ca.crt \ |
| 8939 | key_file=data_files/server7.key \ |
| 8940 | hs_timeout=10000-60000 \ |
| 8941 | mtu=512 nbio=2" \ |
| 8942 | "$P_CLI dtls=1 debug_level=2 \ |
| 8943 | crt_file=data_files/server8_int-ca2.crt \ |
| 8944 | key_file=data_files/server8.key \ |
| 8945 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8946 | hs_timeout=10000-60000 \ |
| 8947 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8948 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8949 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8950 | -s "found fragmented DTLS handshake message" \ |
| 8951 | -c "found fragmented DTLS handshake message" \ |
| 8952 | -C "error" |
| 8953 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8954 | # Forcing ciphersuite for this test to fit the MTU of 1450 with full config. |
Hanno Becker | b841b4f | 2018-08-28 10:25:51 +0100 | [diff] [blame] | 8955 | # This ensures things still work after session_reset(). |
| 8956 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8957 | # Since we don't support reading fragmented ClientHello yet, |
| 8958 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8959 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8960 | # An autoreduction on the client-side might happen if the server is |
| 8961 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8962 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8963 | # resumed listening, which would result in a spurious autoreduction. |
| 8964 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8965 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8966 | requires_config_enabled MBEDTLS_RSA_C |
| 8967 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8968 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8969 | requires_config_enabled MBEDTLS_AES_C |
| 8970 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8971 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8972 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8973 | -p "$P_PXY mtu=1450" \ |
| 8974 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8975 | crt_file=data_files/server7_int-ca.crt \ |
| 8976 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8977 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8978 | mtu=1450" \ |
| 8979 | "$P_CLI dtls=1 debug_level=2 \ |
| 8980 | crt_file=data_files/server8_int-ca2.crt \ |
| 8981 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8982 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8983 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8984 | mtu=1450 reconnect=1 skip_close_notify=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8985 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8986 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8987 | -s "found fragmented DTLS handshake message" \ |
| 8988 | -c "found fragmented DTLS handshake message" \ |
| 8989 | -C "error" |
| 8990 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8991 | # An autoreduction on the client-side might happen if the server is |
| 8992 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8993 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8994 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8995 | requires_config_enabled MBEDTLS_RSA_C |
| 8996 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8997 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8998 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8999 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9000 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9001 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9002 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9003 | -p "$P_PXY mtu=512" \ |
| 9004 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9005 | crt_file=data_files/server7_int-ca.crt \ |
| 9006 | key_file=data_files/server7.key \ |
| 9007 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9008 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9009 | mtu=512" \ |
| 9010 | "$P_CLI dtls=1 debug_level=2 \ |
| 9011 | crt_file=data_files/server8_int-ca2.crt \ |
| 9012 | key_file=data_files/server8.key \ |
| 9013 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9014 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9015 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9016 | mtu=512" \ |
| 9017 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9018 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9019 | -s "found fragmented DTLS handshake message" \ |
| 9020 | -c "found fragmented DTLS handshake message" \ |
| 9021 | -C "error" |
| 9022 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9023 | # An autoreduction on the client-side might happen if the server is |
| 9024 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9025 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9026 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9027 | requires_config_enabled MBEDTLS_RSA_C |
| 9028 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9029 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9030 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9031 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9032 | requires_config_enabled MBEDTLS_AES_C |
| 9033 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9034 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9035 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 9036 | -p "$P_PXY mtu=512" \ |
| 9037 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9038 | crt_file=data_files/server7_int-ca.crt \ |
| 9039 | key_file=data_files/server7.key \ |
| 9040 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9041 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9042 | mtu=512" \ |
| 9043 | "$P_CLI dtls=1 debug_level=2 \ |
| 9044 | crt_file=data_files/server8_int-ca2.crt \ |
| 9045 | key_file=data_files/server8.key \ |
| 9046 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9047 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9048 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9049 | mtu=512" \ |
| 9050 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9051 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9052 | -s "found fragmented DTLS handshake message" \ |
| 9053 | -c "found fragmented DTLS handshake message" \ |
| 9054 | -C "error" |
| 9055 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9056 | # An autoreduction on the client-side might happen if the server is |
| 9057 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9058 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9059 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9060 | requires_config_enabled MBEDTLS_RSA_C |
| 9061 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9062 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9063 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9064 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9065 | requires_config_enabled MBEDTLS_AES_C |
| 9066 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9067 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9068 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9069 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9070 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9071 | crt_file=data_files/server7_int-ca.crt \ |
| 9072 | key_file=data_files/server7.key \ |
| 9073 | exchanges=2 renegotiation=1 \ |
| 9074 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9075 | hs_timeout=10000-60000 \ |
| 9076 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9077 | "$P_CLI dtls=1 debug_level=2 \ |
| 9078 | crt_file=data_files/server8_int-ca2.crt \ |
| 9079 | key_file=data_files/server8.key \ |
| 9080 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9081 | hs_timeout=10000-60000 \ |
| 9082 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9083 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9084 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9085 | -s "found fragmented DTLS handshake message" \ |
| 9086 | -c "found fragmented DTLS handshake message" \ |
| 9087 | -C "error" |
| 9088 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9089 | # An autoreduction on the client-side might happen if the server is |
| 9090 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9091 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9092 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9093 | requires_config_enabled MBEDTLS_RSA_C |
| 9094 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9095 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9096 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9097 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9098 | requires_config_enabled MBEDTLS_AES_C |
| 9099 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 9100 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9101 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9102 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9103 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9104 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9105 | crt_file=data_files/server7_int-ca.crt \ |
| 9106 | key_file=data_files/server7.key \ |
| 9107 | exchanges=2 renegotiation=1 \ |
| 9108 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9109 | hs_timeout=10000-60000 \ |
| 9110 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9111 | "$P_CLI dtls=1 debug_level=2 \ |
| 9112 | crt_file=data_files/server8_int-ca2.crt \ |
| 9113 | key_file=data_files/server8.key \ |
| 9114 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9115 | hs_timeout=10000-60000 \ |
| 9116 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9117 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9118 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9119 | -s "found fragmented DTLS handshake message" \ |
| 9120 | -c "found fragmented DTLS handshake message" \ |
| 9121 | -C "error" |
| 9122 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9123 | # An autoreduction on the client-side might happen if the server is |
| 9124 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9125 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9126 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9127 | requires_config_enabled MBEDTLS_RSA_C |
| 9128 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9129 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9130 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9131 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9132 | requires_config_enabled MBEDTLS_AES_C |
| 9133 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9134 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9135 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9136 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9137 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9138 | crt_file=data_files/server7_int-ca.crt \ |
| 9139 | key_file=data_files/server7.key \ |
| 9140 | exchanges=2 renegotiation=1 \ |
| 9141 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9142 | hs_timeout=10000-60000 \ |
| 9143 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9144 | "$P_CLI dtls=1 debug_level=2 \ |
| 9145 | crt_file=data_files/server8_int-ca2.crt \ |
| 9146 | key_file=data_files/server8.key \ |
| 9147 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9148 | hs_timeout=10000-60000 \ |
| 9149 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9150 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9151 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9152 | -s "found fragmented DTLS handshake message" \ |
| 9153 | -c "found fragmented DTLS handshake message" \ |
| 9154 | -C "error" |
| 9155 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9156 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9157 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9158 | requires_config_enabled MBEDTLS_RSA_C |
| 9159 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9160 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9161 | requires_config_enabled MBEDTLS_AES_C |
| 9162 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9163 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9164 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9165 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9166 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9167 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 auth_mode=required \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9168 | crt_file=data_files/server7_int-ca.crt \ |
| 9169 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9170 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9171 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9172 | crt_file=data_files/server8_int-ca2.crt \ |
| 9173 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9174 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9175 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9176 | 0 \ |
| 9177 | -s "found fragmented DTLS handshake message" \ |
| 9178 | -c "found fragmented DTLS handshake message" \ |
| 9179 | -C "error" |
| 9180 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9181 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9182 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9183 | requires_config_enabled MBEDTLS_RSA_C |
| 9184 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9185 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9186 | requires_config_enabled MBEDTLS_AES_C |
| 9187 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9188 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9189 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9190 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9191 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9192 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9193 | crt_file=data_files/server7_int-ca.crt \ |
| 9194 | key_file=data_files/server7.key \ |
| 9195 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9196 | "$P_CLI dtls=1 debug_level=2 \ |
| 9197 | crt_file=data_files/server8_int-ca2.crt \ |
| 9198 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9199 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9200 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9201 | 0 \ |
| 9202 | -s "found fragmented DTLS handshake message" \ |
| 9203 | -c "found fragmented DTLS handshake message" \ |
| 9204 | -C "error" |
| 9205 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9206 | # interop tests for DTLS fragmentating with reliable connection |
| 9207 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9208 | # here and below we just want to test that the we fragment in a way that |
| 9209 | # pleases other implementations, so we don't need the peer to fragment |
| 9210 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9211 | requires_config_enabled MBEDTLS_RSA_C |
| 9212 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9213 | requires_gnutls |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9214 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9215 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9216 | "$G_SRV -u" \ |
| 9217 | "$P_CLI dtls=1 debug_level=2 \ |
| 9218 | crt_file=data_files/server8_int-ca2.crt \ |
| 9219 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9220 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9221 | 0 \ |
| 9222 | -c "fragmenting handshake message" \ |
| 9223 | -C "error" |
| 9224 | |
| 9225 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9226 | requires_config_enabled MBEDTLS_RSA_C |
| 9227 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9228 | requires_gnutls |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9229 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9230 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 9231 | "$G_SRV -u" \ |
| 9232 | "$P_CLI dtls=1 debug_level=2 \ |
| 9233 | crt_file=data_files/server8_int-ca2.crt \ |
| 9234 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9235 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9236 | 0 \ |
| 9237 | -c "fragmenting handshake message" \ |
| 9238 | -C "error" |
| 9239 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9240 | # We use --insecure for the GnuTLS client because it expects |
| 9241 | # the hostname / IP it connects to to be the name used in the |
| 9242 | # certificate obtained from the server. Here, however, it |
| 9243 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 9244 | # as the server name in the certificate. This will make the |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9245 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9246 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9247 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9248 | requires_config_enabled MBEDTLS_RSA_C |
| 9249 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9250 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9251 | requires_not_i686 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9252 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9253 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9254 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9255 | crt_file=data_files/server7_int-ca.crt \ |
| 9256 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9257 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9258 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9259 | 0 \ |
| 9260 | -s "fragmenting handshake message" |
| 9261 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9262 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9263 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9264 | requires_config_enabled MBEDTLS_RSA_C |
| 9265 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9266 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9267 | requires_not_i686 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9268 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9269 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9270 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9271 | crt_file=data_files/server7_int-ca.crt \ |
| 9272 | key_file=data_files/server7.key \ |
| 9273 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9274 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9275 | 0 \ |
| 9276 | -s "fragmenting handshake message" |
| 9277 | |
| 9278 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9279 | requires_config_enabled MBEDTLS_RSA_C |
| 9280 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9281 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9282 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 9283 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9284 | "$P_CLI dtls=1 debug_level=2 \ |
| 9285 | crt_file=data_files/server8_int-ca2.crt \ |
| 9286 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9287 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9288 | 0 \ |
| 9289 | -c "fragmenting handshake message" \ |
| 9290 | -C "error" |
| 9291 | |
| 9292 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9293 | requires_config_enabled MBEDTLS_RSA_C |
| 9294 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9295 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9296 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 9297 | "$O_SRV -dtls1 -verify 10" \ |
| 9298 | "$P_CLI dtls=1 debug_level=2 \ |
| 9299 | crt_file=data_files/server8_int-ca2.crt \ |
| 9300 | key_file=data_files/server8.key \ |
| 9301 | mtu=512 force_version=dtls1" \ |
| 9302 | 0 \ |
| 9303 | -c "fragmenting handshake message" \ |
| 9304 | -C "error" |
| 9305 | |
| 9306 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9307 | requires_config_enabled MBEDTLS_RSA_C |
| 9308 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9309 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9310 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9311 | "$P_SRV dtls=1 debug_level=2 \ |
| 9312 | crt_file=data_files/server7_int-ca.crt \ |
| 9313 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9314 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9315 | "$O_CLI -dtls1_2" \ |
| 9316 | 0 \ |
| 9317 | -s "fragmenting handshake message" |
| 9318 | |
| 9319 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9320 | requires_config_enabled MBEDTLS_RSA_C |
| 9321 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9322 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9323 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 9324 | "$P_SRV dtls=1 debug_level=2 \ |
| 9325 | crt_file=data_files/server7_int-ca.crt \ |
| 9326 | key_file=data_files/server7.key \ |
| 9327 | mtu=512 force_version=dtls1" \ |
| 9328 | "$O_CLI -dtls1" \ |
| 9329 | 0 \ |
| 9330 | -s "fragmenting handshake message" |
| 9331 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9332 | # interop tests for DTLS fragmentating with unreliable connection |
| 9333 | # |
| 9334 | # again we just want to test that the we fragment in a way that |
| 9335 | # pleases other implementations, so we don't need the peer to fragment |
| 9336 | requires_gnutls_next |
| 9337 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9338 | requires_config_enabled MBEDTLS_RSA_C |
| 9339 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9340 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9341 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9342 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 9343 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9344 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9345 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9346 | crt_file=data_files/server8_int-ca2.crt \ |
| 9347 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9348 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9349 | 0 \ |
| 9350 | -c "fragmenting handshake message" \ |
| 9351 | -C "error" |
| 9352 | |
| 9353 | requires_gnutls_next |
| 9354 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9355 | requires_config_enabled MBEDTLS_RSA_C |
| 9356 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9357 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9358 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9359 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 9360 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9361 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9362 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9363 | crt_file=data_files/server8_int-ca2.crt \ |
| 9364 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9365 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9366 | 0 \ |
| 9367 | -c "fragmenting handshake message" \ |
| 9368 | -C "error" |
| 9369 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9370 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9371 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9372 | requires_config_enabled MBEDTLS_RSA_C |
| 9373 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9374 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9375 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9376 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 9377 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9378 | "$P_SRV dtls=1 debug_level=2 \ |
| 9379 | crt_file=data_files/server7_int-ca.crt \ |
| 9380 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9381 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9382 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9383 | 0 \ |
| 9384 | -s "fragmenting handshake message" |
| 9385 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9386 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9387 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9388 | requires_config_enabled MBEDTLS_RSA_C |
| 9389 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9390 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9391 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9392 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 9393 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9394 | "$P_SRV dtls=1 debug_level=2 \ |
| 9395 | crt_file=data_files/server7_int-ca.crt \ |
| 9396 | key_file=data_files/server7.key \ |
| 9397 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9398 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9399 | 0 \ |
| 9400 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9401 | |
Zhangsen Wang | 1c981f5 | 2022-08-02 06:18:40 +0000 | [diff] [blame] | 9402 | ## The two tests below require 1.1.1a or higher version of openssl, otherwise |
Zhangsen Wang | 7d0e658 | 2022-06-29 07:33:35 +0000 | [diff] [blame] | 9403 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 9404 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9405 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9406 | requires_config_enabled MBEDTLS_RSA_C |
| 9407 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9408 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9409 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9410 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9411 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 7d0e658 | 2022-06-29 07:33:35 +0000 | [diff] [blame] | 9412 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9413 | "$P_CLI dtls=1 debug_level=2 \ |
| 9414 | crt_file=data_files/server8_int-ca2.crt \ |
| 9415 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9416 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9417 | 0 \ |
| 9418 | -c "fragmenting handshake message" \ |
| 9419 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9420 | |
Zhangsen Wang | 7d0e658 | 2022-06-29 07:33:35 +0000 | [diff] [blame] | 9421 | requires_openssl_next |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9422 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9423 | requires_config_enabled MBEDTLS_RSA_C |
| 9424 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9425 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9426 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9427 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 9428 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 7d0e658 | 2022-06-29 07:33:35 +0000 | [diff] [blame] | 9429 | "$O_NEXT_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9430 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9431 | crt_file=data_files/server8_int-ca2.crt \ |
| 9432 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9433 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9434 | 0 \ |
| 9435 | -c "fragmenting handshake message" \ |
| 9436 | -C "error" |
| 9437 | |
Zhangsen Wang | 1c981f5 | 2022-08-02 06:18:40 +0000 | [diff] [blame] | 9438 | ## the two tests below will time out with certain seed. |
| 9439 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 9440 | skip_next_test |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9441 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9442 | requires_config_enabled MBEDTLS_RSA_C |
| 9443 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9444 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9445 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9446 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9447 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9448 | "$P_SRV dtls=1 debug_level=2 \ |
| 9449 | crt_file=data_files/server7_int-ca.crt \ |
| 9450 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9451 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9452 | "$O_CLI -dtls1_2" \ |
| 9453 | 0 \ |
| 9454 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9455 | |
| 9456 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 9457 | # messages at the end of the handshake |
Zhangsen Wang | 1c981f5 | 2022-08-02 06:18:40 +0000 | [diff] [blame] | 9458 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9459 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9460 | requires_config_enabled MBEDTLS_RSA_C |
| 9461 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9462 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9463 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9464 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 9465 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9466 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9467 | crt_file=data_files/server7_int-ca.crt \ |
| 9468 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9469 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9470 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9471 | 0 \ |
| 9472 | -s "fragmenting handshake message" |
| 9473 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9474 | # Tests for DTLS-SRTP (RFC 5764) |
| 9475 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9476 | run_test "DTLS-SRTP all profiles supported" \ |
| 9477 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9478 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9479 | 0 \ |
| 9480 | -s "found use_srtp extension" \ |
| 9481 | -s "found srtp profile" \ |
| 9482 | -s "selected srtp profile" \ |
| 9483 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9484 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9485 | -c "client hello, adding use_srtp extension" \ |
| 9486 | -c "found use_srtp extension" \ |
| 9487 | -c "found srtp profile" \ |
| 9488 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9489 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9490 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9491 | -C "error" |
| 9492 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9493 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9494 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9495 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 9496 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9497 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=5 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9498 | 0 \ |
| 9499 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9500 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 9501 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9502 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9503 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9504 | -c "client hello, adding use_srtp extension" \ |
| 9505 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9506 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9507 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9508 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9509 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9510 | -C "error" |
| 9511 | |
| 9512 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9513 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9514 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9515 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9516 | 0 \ |
| 9517 | -s "found use_srtp extension" \ |
| 9518 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9519 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9520 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9521 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9522 | -c "client hello, adding use_srtp extension" \ |
| 9523 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9524 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9525 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9526 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9527 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9528 | -C "error" |
| 9529 | |
| 9530 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9531 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 9532 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9533 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9534 | 0 \ |
| 9535 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9536 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9537 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9538 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9539 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9540 | -c "client hello, adding use_srtp extension" \ |
| 9541 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9542 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9543 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9544 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9545 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9546 | -C "error" |
| 9547 | |
| 9548 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9549 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 9550 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9551 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9552 | 0 \ |
| 9553 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9554 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9555 | -S "selected srtp profile" \ |
| 9556 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9557 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9558 | -c "client hello, adding use_srtp extension" \ |
| 9559 | -C "found use_srtp extension" \ |
| 9560 | -C "found srtp profile" \ |
| 9561 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9562 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9563 | -C "error" |
| 9564 | |
| 9565 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9566 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 9567 | "$P_SRV dtls=1 debug_level=3" \ |
| 9568 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9569 | 0 \ |
| 9570 | -s "found use_srtp extension" \ |
| 9571 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9572 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9573 | -c "client hello, adding use_srtp extension" \ |
| 9574 | -C "found use_srtp extension" \ |
| 9575 | -C "found srtp profile" \ |
| 9576 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9577 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9578 | -C "error" |
| 9579 | |
| 9580 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9581 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 9582 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 9583 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9584 | 0 \ |
| 9585 | -s "found use_srtp extension" \ |
| 9586 | -s "found srtp profile" \ |
| 9587 | -s "selected srtp profile" \ |
| 9588 | -s "server hello, adding use_srtp extension" \ |
| 9589 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9590 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9591 | -c "client hello, adding use_srtp extension" \ |
| 9592 | -c "found use_srtp extension" \ |
| 9593 | -c "found srtp profile" \ |
| 9594 | -c "selected srtp profile" \ |
| 9595 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9596 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9597 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9598 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9599 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9600 | -C "error" |
| 9601 | |
| 9602 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9603 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 9604 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9605 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9606 | 0 \ |
| 9607 | -s "found use_srtp extension" \ |
| 9608 | -s "found srtp profile" \ |
| 9609 | -s "selected srtp profile" \ |
| 9610 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9611 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9612 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9613 | -S "dumping 'using mki' (8 bytes)" \ |
| 9614 | -c "client hello, adding use_srtp extension" \ |
| 9615 | -c "found use_srtp extension" \ |
| 9616 | -c "found srtp profile" \ |
| 9617 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9618 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9619 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9620 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9621 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9622 | -C "dumping 'received mki' (8 bytes)" \ |
| 9623 | -C "error" |
| 9624 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9625 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9626 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 9627 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9628 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9629 | 0 \ |
| 9630 | -s "found use_srtp extension" \ |
| 9631 | -s "found srtp profile" \ |
| 9632 | -s "selected srtp profile" \ |
| 9633 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9634 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9635 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9636 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 9637 | |
| 9638 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9639 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 9640 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9641 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9642 | 0 \ |
| 9643 | -s "found use_srtp extension" \ |
| 9644 | -s "found srtp profile" \ |
| 9645 | -s "selected srtp profile" \ |
| 9646 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9647 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9648 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9649 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9650 | |
| 9651 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9652 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 9653 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9654 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9655 | 0 \ |
| 9656 | -s "found use_srtp extension" \ |
| 9657 | -s "found srtp profile" \ |
| 9658 | -s "selected srtp profile" \ |
| 9659 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9660 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9661 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9662 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9663 | |
| 9664 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9665 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 9666 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9667 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9668 | 0 \ |
| 9669 | -s "found use_srtp extension" \ |
| 9670 | -s "found srtp profile" \ |
| 9671 | -s "selected srtp profile" \ |
| 9672 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9673 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9674 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9675 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9676 | |
| 9677 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9678 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 9679 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9680 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9681 | 0 \ |
| 9682 | -s "found use_srtp extension" \ |
| 9683 | -s "found srtp profile" \ |
| 9684 | -s "selected srtp profile" \ |
| 9685 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9686 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9687 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9688 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9689 | |
| 9690 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9691 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 9692 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9693 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9694 | 0 \ |
| 9695 | -s "found use_srtp extension" \ |
| 9696 | -s "found srtp profile" \ |
| 9697 | -S "selected srtp profile" \ |
| 9698 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9699 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9700 | -C "SRTP Extension negotiated, profile" |
| 9701 | |
| 9702 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9703 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 9704 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9705 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9706 | 0 \ |
| 9707 | -s "found use_srtp extension" \ |
| 9708 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9709 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9710 | -C "SRTP Extension negotiated, profile" |
| 9711 | |
| 9712 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9713 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9714 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9715 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9716 | 0 \ |
| 9717 | -c "client hello, adding use_srtp extension" \ |
| 9718 | -c "found use_srtp extension" \ |
| 9719 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9720 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9721 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9722 | -C "error" |
| 9723 | |
| 9724 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9725 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9726 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9727 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9728 | 0 \ |
| 9729 | -c "client hello, adding use_srtp extension" \ |
| 9730 | -c "found use_srtp extension" \ |
| 9731 | -c "found srtp profile" \ |
| 9732 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9733 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9734 | -C "error" |
| 9735 | |
| 9736 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9737 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9738 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9739 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9740 | 0 \ |
| 9741 | -c "client hello, adding use_srtp extension" \ |
| 9742 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9743 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9744 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9745 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9746 | -C "error" |
| 9747 | |
| 9748 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9749 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9750 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9751 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9752 | 0 \ |
| 9753 | -c "client hello, adding use_srtp extension" \ |
| 9754 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9755 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9756 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9757 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9758 | -C "error" |
| 9759 | |
| 9760 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9761 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9762 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9763 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9764 | 0 \ |
| 9765 | -c "client hello, adding use_srtp extension" \ |
| 9766 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9767 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9768 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9769 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9770 | -C "error" |
| 9771 | |
| 9772 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9773 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9774 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9775 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9776 | 0 \ |
| 9777 | -c "client hello, adding use_srtp extension" \ |
| 9778 | -C "found use_srtp extension" \ |
| 9779 | -C "found srtp profile" \ |
| 9780 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9781 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9782 | -C "error" |
| 9783 | |
| 9784 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9785 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9786 | "$O_SRV -dtls1" \ |
| 9787 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9788 | 0 \ |
| 9789 | -c "client hello, adding use_srtp extension" \ |
| 9790 | -C "found use_srtp extension" \ |
| 9791 | -C "found srtp profile" \ |
| 9792 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9793 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9794 | -C "error" |
| 9795 | |
| 9796 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9797 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9798 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9799 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9800 | 0 \ |
| 9801 | -c "client hello, adding use_srtp extension" \ |
| 9802 | -c "found use_srtp extension" \ |
| 9803 | -c "found srtp profile" \ |
| 9804 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9805 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9806 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9807 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9808 | -C "dumping 'received mki' (8 bytes)" \ |
| 9809 | -C "error" |
| 9810 | |
| 9811 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9812 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9813 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9814 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9815 | "$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" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9816 | 0 \ |
| 9817 | -s "found use_srtp extension" \ |
| 9818 | -s "found srtp profile" \ |
| 9819 | -s "selected srtp profile" \ |
| 9820 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9821 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9822 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9823 | |
| 9824 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9825 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9826 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9827 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9828 | "$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" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9829 | 0 \ |
| 9830 | -s "found use_srtp extension" \ |
| 9831 | -s "found srtp profile" \ |
| 9832 | -s "selected srtp profile" \ |
| 9833 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9834 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9835 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9836 | |
| 9837 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9838 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9839 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9840 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9841 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9842 | 0 \ |
| 9843 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9844 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9845 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9846 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9847 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9848 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9849 | |
| 9850 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9851 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9852 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls client." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9853 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9854 | "$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" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9855 | 0 \ |
| 9856 | -s "found use_srtp extension" \ |
| 9857 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9858 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9859 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9860 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9861 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9862 | |
| 9863 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9864 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9865 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9866 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9867 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9868 | 0 \ |
| 9869 | -s "found use_srtp extension" \ |
| 9870 | -s "found srtp profile" \ |
| 9871 | -s "selected srtp profile" \ |
| 9872 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9873 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9874 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9875 | |
| 9876 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9877 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9878 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9879 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9880 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9881 | 0 \ |
| 9882 | -s "found use_srtp extension" \ |
| 9883 | -s "found srtp profile" \ |
| 9884 | -S "selected srtp profile" \ |
| 9885 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9886 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9887 | -C "SRTP profile:" |
| 9888 | |
| 9889 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9890 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9891 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls client" \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9892 | "$P_SRV dtls=1 debug_level=3" \ |
| 9893 | "$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" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9894 | 0 \ |
| 9895 | -s "found use_srtp extension" \ |
| 9896 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9897 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9898 | -C "SRTP profile:" |
| 9899 | |
| 9900 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9901 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9902 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9903 | "$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" \ |
| 9904 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9905 | 0 \ |
| 9906 | -c "client hello, adding use_srtp extension" \ |
| 9907 | -c "found use_srtp extension" \ |
| 9908 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9909 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9910 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9911 | -C "error" |
| 9912 | |
| 9913 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9914 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9915 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9916 | "$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" \ |
| 9917 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9918 | 0 \ |
| 9919 | -c "client hello, adding use_srtp extension" \ |
| 9920 | -c "found use_srtp extension" \ |
| 9921 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9922 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9923 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9924 | -C "error" |
| 9925 | |
| 9926 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9927 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9928 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9929 | "$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" \ |
| 9930 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9931 | 0 \ |
| 9932 | -c "client hello, adding use_srtp extension" \ |
| 9933 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9934 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9935 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9936 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9937 | -C "error" |
| 9938 | |
| 9939 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9940 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9941 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9942 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9943 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9944 | 0 \ |
| 9945 | -c "client hello, adding use_srtp extension" \ |
| 9946 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9947 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9948 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9949 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9950 | -C "error" |
| 9951 | |
| 9952 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9953 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9954 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9955 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9956 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9957 | 0 \ |
| 9958 | -c "client hello, adding use_srtp extension" \ |
| 9959 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9960 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9961 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9962 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9963 | -C "error" |
| 9964 | |
| 9965 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9966 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9967 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9968 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9969 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9970 | 0 \ |
| 9971 | -c "client hello, adding use_srtp extension" \ |
| 9972 | -C "found use_srtp extension" \ |
| 9973 | -C "found srtp profile" \ |
| 9974 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9975 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9976 | -C "error" |
| 9977 | |
| 9978 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9979 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9980 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9981 | "$G_SRV -u" \ |
| 9982 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9983 | 0 \ |
| 9984 | -c "client hello, adding use_srtp extension" \ |
| 9985 | -C "found use_srtp extension" \ |
| 9986 | -C "found srtp profile" \ |
| 9987 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9988 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9989 | -C "error" |
| 9990 | |
| 9991 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9992 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9993 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9994 | "$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" \ |
| 9995 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9996 | 0 \ |
| 9997 | -c "client hello, adding use_srtp extension" \ |
| 9998 | -c "found use_srtp extension" \ |
| 9999 | -c "found srtp profile" \ |
| 10000 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10001 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10002 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10003 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10004 | -c "dumping 'received mki' (8 bytes)" \ |
| 10005 | -C "error" |
| 10006 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10007 | # Tests for specific things with "unreliable" UDP connection |
| 10008 | |
| 10009 | not_with_valgrind # spurious resend due to timeout |
| 10010 | run_test "DTLS proxy: reference" \ |
| 10011 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10012 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10013 | "$P_CLI dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10014 | 0 \ |
| 10015 | -C "replayed record" \ |
| 10016 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10017 | -C "Buffer record from epoch" \ |
| 10018 | -S "Buffer record from epoch" \ |
| 10019 | -C "ssl_buffer_message" \ |
| 10020 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10021 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10022 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10023 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10024 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10025 | -c "HTTP/1.0 200 OK" |
| 10026 | |
| 10027 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10028 | run_test "DTLS proxy: duplicate every packet" \ |
| 10029 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10030 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10031 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10032 | 0 \ |
| 10033 | -c "replayed record" \ |
| 10034 | -s "replayed record" \ |
| 10035 | -c "record from another epoch" \ |
| 10036 | -s "record from another epoch" \ |
| 10037 | -S "resend" \ |
| 10038 | -s "Extra-header:" \ |
| 10039 | -c "HTTP/1.0 200 OK" |
| 10040 | |
| 10041 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10042 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10043 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10044 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10045 | 0 \ |
| 10046 | -c "replayed record" \ |
| 10047 | -S "replayed record" \ |
| 10048 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10049 | -s "record from another epoch" \ |
| 10050 | -c "resend" \ |
| 10051 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10052 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10053 | -c "HTTP/1.0 200 OK" |
| 10054 | |
| 10055 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10056 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10057 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10058 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10059 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10060 | -c "next record in same datagram" \ |
| 10061 | -s "next record in same datagram" |
| 10062 | |
| 10063 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10064 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10065 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10066 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10067 | 0 \ |
| 10068 | -c "next record in same datagram" \ |
| 10069 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10070 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10071 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10072 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10073 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10074 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10075 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10076 | -c "discarding invalid record (mac)" \ |
| 10077 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10078 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10079 | -c "HTTP/1.0 200 OK" \ |
| 10080 | -S "too many records with bad MAC" \ |
| 10081 | -S "Verification of the message MAC failed" |
| 10082 | |
| 10083 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10084 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10085 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10086 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10087 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10088 | -C "discarding invalid record (mac)" \ |
| 10089 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10090 | -S "Extra-header:" \ |
| 10091 | -C "HTTP/1.0 200 OK" \ |
| 10092 | -s "too many records with bad MAC" \ |
| 10093 | -s "Verification of the message MAC failed" |
| 10094 | |
| 10095 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10096 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10097 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10098 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10099 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10100 | -c "discarding invalid record (mac)" \ |
| 10101 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10102 | -s "Extra-header:" \ |
| 10103 | -c "HTTP/1.0 200 OK" \ |
| 10104 | -S "too many records with bad MAC" \ |
| 10105 | -S "Verification of the message MAC failed" |
| 10106 | |
| 10107 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 10108 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10109 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 10110 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100 exchanges=2" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10111 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10112 | -c "discarding invalid record (mac)" \ |
| 10113 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10114 | -s "Extra-header:" \ |
| 10115 | -c "HTTP/1.0 200 OK" \ |
| 10116 | -s "too many records with bad MAC" \ |
| 10117 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10118 | |
| 10119 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 10120 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 10121 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 10122 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10123 | 0 \ |
| 10124 | -c "record from another epoch" \ |
| 10125 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10126 | -s "Extra-header:" \ |
| 10127 | -c "HTTP/1.0 200 OK" |
| 10128 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10129 | # Tests for reordering support with DTLS |
| 10130 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10131 | requires_certificate_authentication |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10132 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 10133 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10134 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10135 | hs_timeout=2500-60000" \ |
| 10136 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10137 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10138 | 0 \ |
| 10139 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10140 | -c "Next handshake message has been buffered - load"\ |
| 10141 | -S "Buffering HS message" \ |
| 10142 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10143 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10144 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10145 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10146 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10147 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10148 | requires_certificate_authentication |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10149 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 10150 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10151 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10152 | hs_timeout=2500-60000" \ |
| 10153 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10154 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10155 | 0 \ |
| 10156 | -c "Buffering HS message" \ |
| 10157 | -c "found fragmented DTLS handshake message"\ |
| 10158 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 10159 | -c "Next handshake message has been buffered - load"\ |
| 10160 | -S "Buffering HS message" \ |
| 10161 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10162 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10163 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10164 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10165 | -S "Remember CCS message" |
| 10166 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10167 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 10168 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 10169 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 10170 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10171 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10172 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 10173 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10174 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10175 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10176 | hs_timeout=2500-60000" \ |
| 10177 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10178 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10179 | 0 \ |
| 10180 | -c "Buffering HS message" \ |
| 10181 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10182 | -C "attempt to make space by freeing buffered messages" \ |
| 10183 | -S "Buffering HS message" \ |
| 10184 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10185 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10186 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10187 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10188 | -S "Remember CCS message" |
| 10189 | |
| 10190 | # The size constraints ensure that the delayed certificate message can't |
| 10191 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 10192 | # when dropping it first. |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10193 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10194 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 10195 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 10196 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 10197 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10198 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10199 | hs_timeout=2500-60000" \ |
| 10200 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10201 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10202 | 0 \ |
| 10203 | -c "Buffering HS message" \ |
| 10204 | -c "attempt to make space by freeing buffered future messages" \ |
| 10205 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10206 | -S "Buffering HS message" \ |
| 10207 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10208 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10209 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10210 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10211 | -S "Remember CCS message" |
| 10212 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10213 | requires_certificate_authentication |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10214 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10215 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10216 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10217 | hs_timeout=2500-60000" \ |
| 10218 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10219 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10220 | 0 \ |
| 10221 | -C "Buffering HS message" \ |
| 10222 | -C "Next handshake message has been buffered - load"\ |
| 10223 | -s "Buffering HS message" \ |
| 10224 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10225 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10226 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10227 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10228 | -S "Remember CCS message" |
| 10229 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10230 | requires_certificate_authentication |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10231 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10232 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10233 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10234 | hs_timeout=2500-60000" \ |
| 10235 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10236 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10237 | 0 \ |
| 10238 | -C "Buffering HS message" \ |
| 10239 | -C "Next handshake message has been buffered - load"\ |
| 10240 | -S "Buffering HS message" \ |
| 10241 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10242 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10243 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10244 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10245 | -S "Remember CCS message" |
| 10246 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10247 | requires_certificate_authentication |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10248 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10249 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10250 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10251 | hs_timeout=2500-60000" \ |
| 10252 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10253 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10254 | 0 \ |
| 10255 | -C "Buffering HS message" \ |
| 10256 | -C "Next handshake message has been buffered - load"\ |
| 10257 | -S "Buffering HS message" \ |
| 10258 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10259 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10260 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10261 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10262 | -s "Remember CCS message" |
| 10263 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10264 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10265 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10266 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10267 | hs_timeout=2500-60000" \ |
| 10268 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10269 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10270 | 0 \ |
| 10271 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10272 | -s "Found buffered record from current epoch - load" \ |
| 10273 | -c "Buffer record from epoch 1" \ |
| 10274 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10275 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10276 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10277 | # from the server are delayed, so that the encrypted Finished message |
| 10278 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10279 | # in afterwards, the encrypted Finished message must be freed in order |
| 10280 | # to make space for the NewSessionTicket to be reassembled. |
| 10281 | # This works only in very particular circumstances: |
| 10282 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10283 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10284 | # the encrypted Finished message. |
| 10285 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10286 | # needs to be fragmented. |
| 10287 | # - All messages sent by the server must be small enough to be either sent |
| 10288 | # without fragmentation or be reassembled within the bounds of |
| 10289 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10290 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10291 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10292 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10293 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10294 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10295 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10296 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10297 | 0 \ |
| 10298 | -s "Buffer record from epoch 1" \ |
| 10299 | -s "Found buffered record from current epoch - load" \ |
| 10300 | -c "Buffer record from epoch 1" \ |
| 10301 | -C "Found buffered record from current epoch - load" \ |
| 10302 | -c "Enough space available after freeing future epoch record" |
| 10303 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10304 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10305 | |
| 10306 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10307 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10308 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10309 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10310 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10311 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10312 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10313 | 0 \ |
| 10314 | -s "Extra-header:" \ |
| 10315 | -c "HTTP/1.0 200 OK" |
| 10316 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10317 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10318 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10319 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10320 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10321 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10322 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10323 | 0 \ |
| 10324 | -s "Extra-header:" \ |
| 10325 | -c "HTTP/1.0 200 OK" |
| 10326 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10327 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10328 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10329 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10330 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10331 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10332 | 0 \ |
| 10333 | -s "Extra-header:" \ |
| 10334 | -c "HTTP/1.0 200 OK" |
| 10335 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10336 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10337 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10338 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10339 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 10340 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10341 | 0 \ |
| 10342 | -s "Extra-header:" \ |
| 10343 | -c "HTTP/1.0 200 OK" |
| 10344 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10345 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10346 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 10347 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10348 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 10349 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10350 | 0 \ |
| 10351 | -s "Extra-header:" \ |
| 10352 | -c "HTTP/1.0 200 OK" |
| 10353 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10354 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10355 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 10356 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10357 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 10358 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10359 | 0 \ |
| 10360 | -s "Extra-header:" \ |
| 10361 | -c "HTTP/1.0 200 OK" |
| 10362 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10363 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10364 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 10365 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10366 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 10367 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10368 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10369 | 0 \ |
| 10370 | -s "Extra-header:" \ |
| 10371 | -c "HTTP/1.0 200 OK" |
| 10372 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10373 | client_needs_more_time 4 |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10374 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10375 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 10376 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10377 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10378 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10379 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 10380 | debug_level=3 reconnect=1 skip_close_notify=1 read_timeout=1000 max_resend=10 \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10381 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10382 | 0 \ |
| 10383 | -s "a session has been resumed" \ |
| 10384 | -c "a session has been resumed" \ |
| 10385 | -s "Extra-header:" \ |
| 10386 | -c "HTTP/1.0 200 OK" |
| 10387 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10388 | client_needs_more_time 4 |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10389 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10390 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 10391 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10392 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10393 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10394 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 10395 | debug_level=3 reconnect=1 skip_close_notify=1 read_timeout=1000 max_resend=10 \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10396 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 10397 | 0 \ |
| 10398 | -s "a session has been resumed" \ |
| 10399 | -c "a session has been resumed" \ |
| 10400 | -s "Extra-header:" \ |
| 10401 | -c "HTTP/1.0 200 OK" |
| 10402 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10403 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10404 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10405 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10406 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10407 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 10408 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10409 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 10410 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10411 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10412 | 0 \ |
| 10413 | -c "=> renegotiate" \ |
| 10414 | -s "=> renegotiate" \ |
| 10415 | -s "Extra-header:" \ |
| 10416 | -c "HTTP/1.0 200 OK" |
| 10417 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10418 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10419 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10420 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 10421 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10422 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 10423 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10424 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 10425 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10426 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10427 | 0 \ |
| 10428 | -c "=> renegotiate" \ |
| 10429 | -s "=> renegotiate" \ |
| 10430 | -s "Extra-header:" \ |
| 10431 | -c "HTTP/1.0 200 OK" |
| 10432 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10433 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10435 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10436 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10437 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10438 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10439 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10440 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10441 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10442 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10443 | 0 \ |
| 10444 | -c "=> renegotiate" \ |
| 10445 | -s "=> renegotiate" \ |
| 10446 | -s "Extra-header:" \ |
| 10447 | -c "HTTP/1.0 200 OK" |
| 10448 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10449 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10450 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10451 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego, nbio" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10452 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10453 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10454 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10455 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10456 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10457 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10458 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10459 | 0 \ |
| 10460 | -c "=> renegotiate" \ |
| 10461 | -s "=> renegotiate" \ |
| 10462 | -s "Extra-header:" \ |
| 10463 | -c "HTTP/1.0 200 OK" |
| 10464 | |
Zhangsen Wang | 7d0e658 | 2022-06-29 07:33:35 +0000 | [diff] [blame] | 10465 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 10466 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 10467 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10468 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10469 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10470 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10471 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 7d0e658 | 2022-06-29 07:33:35 +0000 | [diff] [blame] | 10472 | "$O_NEXT_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10473 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10474 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10475 | -c "HTTP/1.0 200 OK" |
| 10476 | |
Zhangsen Wang | 7d0e658 | 2022-06-29 07:33:35 +0000 | [diff] [blame] | 10477 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10478 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10479 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10480 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 10481 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 7d0e658 | 2022-06-29 07:33:35 +0000 | [diff] [blame] | 10482 | "$O_NEXT_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10483 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10484 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10485 | -c "HTTP/1.0 200 OK" |
| 10486 | |
Zhangsen Wang | 7d0e658 | 2022-06-29 07:33:35 +0000 | [diff] [blame] | 10487 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10488 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10489 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10490 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 10491 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 1c981f5 | 2022-08-02 06:18:40 +0000 | [diff] [blame] | 10492 | "$O_NEXT_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10493 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2 tickets=0" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10494 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10495 | -c "HTTP/1.0 200 OK" |
| 10496 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 10497 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10498 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10499 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10500 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 10501 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 10502 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10503 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10504 | 0 \ |
| 10505 | -s "Extra-header:" \ |
| 10506 | -c "Extra-header:" |
| 10507 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10508 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10509 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10510 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10511 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 10512 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10513 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10514 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10515 | 0 \ |
| 10516 | -s "Extra-header:" \ |
| 10517 | -c "Extra-header:" |
| 10518 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10519 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10520 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10521 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10522 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 10523 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10524 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10525 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10526 | 0 \ |
| 10527 | -s "Extra-header:" \ |
| 10528 | -c "Extra-header:" |
| 10529 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10530 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 10531 | run_test "export keys functionality" \ |
| 10532 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 10533 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 10534 | 0 \ |
| 10535 | -s "exported maclen is " \ |
| 10536 | -s "exported keylen is " \ |
| 10537 | -s "exported ivlen is " \ |
| 10538 | -c "exported maclen is " \ |
| 10539 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 10540 | -c "exported ivlen is " \ |
| 10541 | -c "EAP-TLS key material is:"\ |
| 10542 | -s "EAP-TLS key material is:"\ |
| 10543 | -c "EAP-TLS IV is:" \ |
| 10544 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10545 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10546 | # Test heap memory usage after handshake |
| 10547 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 10548 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 10549 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10550 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10551 | run_tests_memory_after_hanshake |
| 10552 | |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 10553 | if [ "$LIST_TESTS" -eq 0 ]; then |
| 10554 | # Final report |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 10555 | |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 10556 | echo "------------------------------------------------------------------------" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10557 | |
Tomás González | cbb2e45 | 2023-09-13 11:47:13 +0100 | [diff] [blame] | 10558 | if [ $FAILS = 0 ]; then |
| 10559 | printf "PASSED" |
| 10560 | else |
| 10561 | printf "FAILED" |
| 10562 | fi |
| 10563 | PASSES=$(( $TESTS - $FAILS )) |
| 10564 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10565 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10566 | |
Tom Cosgrove | c1ae9f9 | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 10567 | if [ $FAILS -gt 255 ]; then |
| 10568 | # Clamp at 255 as caller gets exit code & 0xFF |
| 10569 | # (so 256 would be 0, or success, etc) |
| 10570 | FAILS=255 |
| 10571 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10572 | exit $FAILS |