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 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 6 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 7 | # Copyright (c) 2016, ARM Limited, All Rights Reserved |
| 8 | # |
| 9 | # Purpose |
| 10 | # |
| 11 | # Executes tests to prove various TLS/SSL options and extensions. |
| 12 | # |
| 13 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 14 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 15 | # (session resumption from cache or ticket, renego, etc). |
| 16 | # |
| 17 | # The tests assume a build with default options, with exceptions expressed |
| 18 | # with a dependency. The tests focus on functionality and do not consider |
| 19 | # performance. |
| 20 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 21 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 22 | set -u |
| 23 | |
Jaeden Amero | a258ccd | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 24 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 25 | # where it may output seemingly unlimited length error logs. |
| 26 | ulimit -f 20971520 |
| 27 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 28 | if cd $( dirname $0 ); then :; else |
| 29 | echo "cd $( dirname $0 ) failed" >&2 |
| 30 | exit 1 |
| 31 | fi |
| 32 | |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 33 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 34 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 35 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 36 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 37 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
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 | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 42 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 43 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 44 | 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] | 45 | 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] | 46 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 47 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 48 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 49 | |
| 50 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 51 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 52 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 53 | else |
| 54 | O_LEGACY_SRV=false |
| 55 | O_LEGACY_CLI=false |
| 56 | fi |
| 57 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 58 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 59 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 60 | else |
| 61 | G_NEXT_SRV=false |
| 62 | fi |
| 63 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 64 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 65 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 66 | else |
| 67 | G_NEXT_CLI=false |
| 68 | fi |
| 69 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 70 | TESTS=0 |
| 71 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 72 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 73 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 74 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 75 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 76 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 77 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 78 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 79 | RUN_TEST_NUMBER='' |
| 80 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 81 | PRESERVE_LOGS=0 |
| 82 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 83 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 84 | # port which is this plus 10000. Each port number may be independently |
| 85 | # overridden by a command line option. |
| 86 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 87 | PXY_PORT=$((SRV_PORT + 10000)) |
| 88 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 89 | print_usage() { |
| 90 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 91 | printf " -h|--help\tPrint this help.\n" |
| 92 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 93 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 94 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 95 | 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] | 96 | 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] | 97 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 98 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 99 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 100 | 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] | 101 | } |
| 102 | |
| 103 | get_options() { |
| 104 | while [ $# -gt 0 ]; do |
| 105 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 106 | -f|--filter) |
| 107 | shift; FILTER=$1 |
| 108 | ;; |
| 109 | -e|--exclude) |
| 110 | shift; EXCLUDE=$1 |
| 111 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 112 | -m|--memcheck) |
| 113 | MEMCHECK=1 |
| 114 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 115 | -n|--number) |
| 116 | shift; RUN_TEST_NUMBER=$1 |
| 117 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 118 | -s|--show-numbers) |
| 119 | SHOW_TEST_NUMBER=1 |
| 120 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 121 | -p|--preserve-logs) |
| 122 | PRESERVE_LOGS=1 |
| 123 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 124 | --port) |
| 125 | shift; SRV_PORT=$1 |
| 126 | ;; |
| 127 | --proxy-port) |
| 128 | shift; PXY_PORT=$1 |
| 129 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 130 | --seed) |
| 131 | shift; SEED="$1" |
| 132 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 133 | -h|--help) |
| 134 | print_usage |
| 135 | exit 0 |
| 136 | ;; |
| 137 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 138 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 139 | print_usage |
| 140 | exit 1 |
| 141 | ;; |
| 142 | esac |
| 143 | shift |
| 144 | done |
| 145 | } |
| 146 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 147 | # Skip next test; use this macro to skip tests which are legitimate |
| 148 | # in theory and expected to be re-introduced at some point, but |
| 149 | # aren't expected to succeed at the moment due to problems outside |
| 150 | # our control (such as bugs in other TLS implementations). |
| 151 | skip_next_test() { |
| 152 | SKIP_NEXT="YES" |
| 153 | } |
| 154 | |
Hanno Becker | 9190036 | 2019-07-03 13:22:59 +0100 | [diff] [blame] | 155 | requires_ciphersuite_enabled() { |
| 156 | if [ -z "$($P_CLI --help | grep "$1")" ]; then |
| 157 | SKIP_NEXT="YES" |
| 158 | fi |
| 159 | } |
| 160 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 161 | get_config_value_or_default() { |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 162 | # This function uses the query_config command line option to query the |
| 163 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 164 | # program. The command will always return a success value if the |
| 165 | # configuration is defined and the value will be printed to stdout. |
| 166 | # |
| 167 | # Note that if the configuration is not defined or is defined to nothing, |
| 168 | # the output of this function will be an empty string. |
| 169 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 170 | } |
| 171 | |
Hanno Becker | ab9a29b | 2019-09-24 16:14:39 +0100 | [diff] [blame] | 172 | # skip next test if the flag is enabled in config.h |
| 173 | requires_config_disabled() { |
| 174 | if get_config_value_or_default $1; then |
| 175 | SKIP_NEXT="YES" |
| 176 | fi |
| 177 | } |
| 178 | |
| 179 | requires_config_enabled() { |
| 180 | if ! get_config_value_or_default $1; then |
| 181 | SKIP_NEXT="YES" |
| 182 | fi |
| 183 | } |
| 184 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 185 | requires_config_value_at_least() { |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 186 | VAL="$( get_config_value_or_default "$1" )" |
| 187 | if [ -z "$VAL" ]; then |
| 188 | # Should never happen |
| 189 | echo "Mbed TLS configuration $1 is not defined" |
| 190 | exit 1 |
| 191 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 192 | SKIP_NEXT="YES" |
| 193 | fi |
| 194 | } |
| 195 | |
| 196 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 197 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 198 | if [ -z "$VAL" ]; then |
| 199 | # Should never happen |
| 200 | echo "Mbed TLS configuration $1 is not defined" |
| 201 | exit 1 |
| 202 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 203 | SKIP_NEXT="YES" |
| 204 | fi |
| 205 | } |
| 206 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 207 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 208 | requires_openssl_with_fallback_scsv() { |
| 209 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 210 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 211 | then |
| 212 | OPENSSL_HAS_FBSCSV="YES" |
| 213 | else |
| 214 | OPENSSL_HAS_FBSCSV="NO" |
| 215 | fi |
| 216 | fi |
| 217 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 218 | SKIP_NEXT="YES" |
| 219 | fi |
| 220 | } |
| 221 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 222 | # skip next test if GnuTLS isn't available |
| 223 | requires_gnutls() { |
| 224 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 225 | 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] | 226 | GNUTLS_AVAILABLE="YES" |
| 227 | else |
| 228 | GNUTLS_AVAILABLE="NO" |
| 229 | fi |
| 230 | fi |
| 231 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 232 | SKIP_NEXT="YES" |
| 233 | fi |
| 234 | } |
| 235 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 236 | # skip next test if GnuTLS-next isn't available |
| 237 | requires_gnutls_next() { |
| 238 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 239 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 240 | GNUTLS_NEXT_AVAILABLE="YES" |
| 241 | else |
| 242 | GNUTLS_NEXT_AVAILABLE="NO" |
| 243 | fi |
| 244 | fi |
| 245 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 246 | SKIP_NEXT="YES" |
| 247 | fi |
| 248 | } |
| 249 | |
| 250 | # skip next test if OpenSSL-legacy isn't available |
| 251 | requires_openssl_legacy() { |
| 252 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 253 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 254 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 255 | else |
| 256 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 257 | fi |
| 258 | fi |
| 259 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 260 | SKIP_NEXT="YES" |
| 261 | fi |
| 262 | } |
| 263 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 264 | # skip next test if IPv6 isn't available on this host |
| 265 | requires_ipv6() { |
| 266 | if [ -z "${HAS_IPV6:-}" ]; then |
| 267 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 268 | SRV_PID=$! |
| 269 | sleep 1 |
| 270 | kill $SRV_PID >/dev/null 2>&1 |
| 271 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 272 | HAS_IPV6="NO" |
| 273 | else |
| 274 | HAS_IPV6="YES" |
| 275 | fi |
| 276 | rm -r $SRV_OUT |
| 277 | fi |
| 278 | |
| 279 | if [ "$HAS_IPV6" = "NO" ]; then |
| 280 | SKIP_NEXT="YES" |
| 281 | fi |
| 282 | } |
| 283 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 284 | # skip next test if it's i686 or uname is not available |
| 285 | requires_not_i686() { |
| 286 | if [ -z "${IS_I686:-}" ]; then |
| 287 | IS_I686="YES" |
| 288 | if which "uname" >/dev/null 2>&1; then |
| 289 | if [ -z "$(uname -a | grep i686)" ]; then |
| 290 | IS_I686="NO" |
| 291 | fi |
| 292 | fi |
| 293 | fi |
| 294 | if [ "$IS_I686" = "YES" ]; then |
| 295 | SKIP_NEXT="YES" |
| 296 | fi |
| 297 | } |
| 298 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 299 | # Calculate the input & output maximum content lengths set in the config |
Arto Kinnunen | 7821352 | 2019-09-26 11:06:39 +0300 | [diff] [blame] | 300 | MAX_CONTENT_LEN="$( get_config_value_or_default MBEDTLS_SSL_MAX_CONTENT_LEN )" |
| 301 | if [ -z "$MAX_CONTENT_LEN" ]; then |
| 302 | MAX_CONTENT_LEN=16384 |
| 303 | fi |
| 304 | |
| 305 | MAX_IN_LEN="$( get_config_value_or_default MBEDTLS_SSL_IN_CONTENT_LEN )" |
| 306 | if [ -z "$MAX_IN_LEN" ]; then |
| 307 | MAX_IN_LEN=$MAX_CONTENT_LEN |
| 308 | fi |
| 309 | |
| 310 | MAX_OUT_LEN="$( get_config_value_or_default MBEDTLS_SSL_OUT_CONTENT_LEN )" |
| 311 | if [ -z "$MAX_OUT_LEN" ]; then |
| 312 | MAX_OUT_LEN=$MAX_CONTENT_LEN |
| 313 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 314 | |
| 315 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 316 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 317 | fi |
| 318 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 319 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 320 | fi |
| 321 | |
| 322 | # skip the next test if the SSL output buffer is less than 16KB |
| 323 | requires_full_size_output_buffer() { |
| 324 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 325 | SKIP_NEXT="YES" |
| 326 | fi |
| 327 | } |
| 328 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 329 | # skip the next test if valgrind is in use |
| 330 | not_with_valgrind() { |
| 331 | if [ "$MEMCHECK" -gt 0 ]; then |
| 332 | SKIP_NEXT="YES" |
| 333 | fi |
| 334 | } |
| 335 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 336 | # skip the next test if valgrind is NOT in use |
| 337 | only_with_valgrind() { |
| 338 | if [ "$MEMCHECK" -eq 0 ]; then |
| 339 | SKIP_NEXT="YES" |
| 340 | fi |
| 341 | } |
| 342 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 343 | # 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] | 344 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 345 | CLI_DELAY_FACTOR=$1 |
| 346 | } |
| 347 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 348 | # wait for the given seconds after the client finished in the next test |
| 349 | server_needs_more_time() { |
| 350 | SRV_DELAY_SECONDS=$1 |
| 351 | } |
| 352 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 353 | # print_name <name> |
| 354 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 355 | TESTS=$(( $TESTS + 1 )) |
| 356 | LINE="" |
| 357 | |
| 358 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 359 | LINE="$TESTS " |
| 360 | fi |
| 361 | |
| 362 | LINE="$LINE$1" |
| 363 | printf "$LINE " |
| 364 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 365 | for i in `seq 1 $LEN`; do printf '.'; done |
| 366 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 367 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 368 | } |
| 369 | |
| 370 | # fail <message> |
| 371 | fail() { |
| 372 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 373 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 374 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 375 | mv $SRV_OUT o-srv-${TESTS}.log |
| 376 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 377 | if [ -n "$PXY_CMD" ]; then |
| 378 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 379 | fi |
| 380 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 381 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 382 | if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot -o "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 383 | echo " ! server output:" |
| 384 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 385 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 386 | echo " ! client output:" |
| 387 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 388 | if [ -n "$PXY_CMD" ]; then |
| 389 | echo " ! ========================================================" |
| 390 | echo " ! proxy output:" |
| 391 | cat o-pxy-${TESTS}.log |
| 392 | fi |
| 393 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 394 | fi |
| 395 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 396 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 397 | } |
| 398 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 399 | # is_polar <cmd_line> |
| 400 | is_polar() { |
| 401 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 402 | } |
| 403 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 404 | # openssl s_server doesn't have -www with DTLS |
| 405 | check_osrv_dtls() { |
| 406 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 407 | NEEDS_INPUT=1 |
| 408 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 409 | else |
| 410 | NEEDS_INPUT=0 |
| 411 | fi |
| 412 | } |
| 413 | |
| 414 | # provide input to commands that need it |
| 415 | provide_input() { |
| 416 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 417 | return |
| 418 | fi |
| 419 | |
| 420 | while true; do |
| 421 | echo "HTTP/1.0 200 OK" |
| 422 | sleep 1 |
| 423 | done |
| 424 | } |
| 425 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 426 | # has_mem_err <log_file_name> |
| 427 | has_mem_err() { |
| 428 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 429 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 430 | then |
| 431 | return 1 # false: does not have errors |
| 432 | else |
| 433 | return 0 # true: has errors |
| 434 | fi |
| 435 | } |
| 436 | |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 437 | # 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] | 438 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 439 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 440 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 441 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 442 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 443 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 444 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 445 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 446 | # Make a tight loop, server normally takes less than 1s to start. |
| 447 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 448 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 449 | echo "$3 START TIMEOUT" |
| 450 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 451 | break |
| 452 | fi |
| 453 | # Linux and *BSD support decimal arguments to sleep. On other |
| 454 | # OSes this may be a tight loop. |
| 455 | sleep 0.1 2>/dev/null || true |
| 456 | done |
| 457 | } |
| 458 | else |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 459 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 460 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 461 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 462 | } |
| 463 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 464 | |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 465 | # Wait for server process $2 to be listening on port $1. |
| 466 | wait_server_start() { |
| 467 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 468 | } |
| 469 | |
| 470 | # Wait for proxy process $2 to be listening on port $1. |
| 471 | wait_proxy_start() { |
| 472 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 473 | } |
| 474 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 475 | # 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] | 476 | # 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] | 477 | # acceptable bounds |
| 478 | check_server_hello_time() { |
| 479 | # 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] | 480 | 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] | 481 | # Get the Unix timestamp for now |
| 482 | CUR_TIME=$(date +'%s') |
| 483 | THRESHOLD_IN_SECS=300 |
| 484 | |
| 485 | # Check if the ServerHello time was printed |
| 486 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 487 | return 1 |
| 488 | fi |
| 489 | |
| 490 | # Check the time in ServerHello is within acceptable bounds |
| 491 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 492 | # The time in ServerHello is at least 5 minutes before now |
| 493 | return 1 |
| 494 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 495 | # 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] | 496 | return 1 |
| 497 | else |
| 498 | return 0 |
| 499 | fi |
| 500 | } |
| 501 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 502 | # wait for client to terminate and set CLI_EXIT |
| 503 | # must be called right after starting the client |
| 504 | wait_client_done() { |
| 505 | CLI_PID=$! |
| 506 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 507 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 508 | CLI_DELAY_FACTOR=1 |
| 509 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 510 | ( 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] | 511 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 512 | |
| 513 | wait $CLI_PID |
| 514 | CLI_EXIT=$? |
| 515 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 516 | kill $DOG_PID >/dev/null 2>&1 |
| 517 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 518 | |
| 519 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 520 | |
| 521 | sleep $SRV_DELAY_SECONDS |
| 522 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 523 | } |
| 524 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 525 | # check if the given command uses dtls and sets global variable DTLS |
| 526 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 527 | if echo "$1" | grep 'dtls=1\|-dtls1\|-u' >/dev/null; then |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 528 | DTLS=1 |
| 529 | else |
| 530 | DTLS=0 |
| 531 | fi |
| 532 | } |
| 533 | |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 534 | # Strip off a particular parameter from the command line |
| 535 | # and return its value. |
| 536 | # Parameter 1: Command line parameter to strip off |
| 537 | # ENV I/O: CMD command line to search and modify |
| 538 | extract_cmdline_argument() { |
| 539 | __ARG=$(echo "$CMD" | sed -n "s/^.* $1=\([^ ]*\).*$/\1/p") |
| 540 | CMD=$(echo "$CMD" | sed "s/$1=\([^ ]*\)//") |
| 541 | } |
| 542 | |
| 543 | # Check compatibility of the ssl_client2/ssl_server2 command-line |
| 544 | # with a particular compile-time configurable option. |
| 545 | # Parameter 1: Command-line argument (e.g. extended_ms) |
| 546 | # Parameter 2: Corresponding compile-time configuration |
| 547 | # (e.g. MBEDTLS_SSL_CONF_EXTENDED_MASTER_SECRET) |
| 548 | # ENV I/O: CMD command line to search and modify |
| 549 | # SKIP_NEXT set to "YES" on a mismatch |
| 550 | check_cmdline_param_compat() { |
| 551 | __VAL="$( get_config_value_or_default "$2" )" |
| 552 | if [ ! -z "$__VAL" ]; then |
| 553 | extract_cmdline_argument "$1" |
| 554 | if [ ! -z "$__ARG" ] && [ "$__ARG" != "$__VAL" ]; then |
| 555 | SKIP_NEXT="YES" |
| 556 | fi |
| 557 | fi |
| 558 | } |
| 559 | |
Hanno Becker | a43f85c | 2019-09-05 14:51:20 +0100 | [diff] [blame] | 560 | check_cmdline_check_tls_dtls() { |
Hanno Becker | 73b72d1 | 2019-07-26 12:00:38 +0100 | [diff] [blame] | 561 | detect_dtls "$CMD" |
| 562 | if [ "$DTLS" = "0" ]; then |
| 563 | requires_config_disabled MBEDTLS_SSL_PROTO_NO_TLS |
Hanno Becker | a43f85c | 2019-09-05 14:51:20 +0100 | [diff] [blame] | 564 | elif [ "$DTLS" = "1" ]; then |
| 565 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Hanno Becker | 73b72d1 | 2019-07-26 12:00:38 +0100 | [diff] [blame] | 566 | fi |
| 567 | } |
| 568 | |
Hanno Becker | acd4fc0 | 2019-06-12 16:40:50 +0100 | [diff] [blame] | 569 | check_cmdline_authmode_compat() { |
| 570 | __VAL="$( get_config_value_or_default "MBEDTLS_SSL_CONF_AUTHMODE" )" |
| 571 | if [ ! -z "$__VAL" ]; then |
| 572 | extract_cmdline_argument "auth_mode" |
| 573 | if [ "$__ARG" = "none" ] && [ "$__VAL" != "0" ]; then |
| 574 | SKIP_NEXT="YES"; |
| 575 | elif [ "$__ARG" = "optional" ] && [ "$__VAL" != "1" ]; then |
| 576 | SKIP_NEXT="YES" |
| 577 | elif [ "$__ARG" = "required" ] && [ "$__VAL" != "2" ]; then |
| 578 | SKIP_NEXT="YES" |
| 579 | fi |
| 580 | fi |
| 581 | } |
| 582 | |
Hanno Becker | b0b2b67 | 2019-06-12 16:58:10 +0100 | [diff] [blame] | 583 | check_cmdline_legacy_renego_compat() { |
| 584 | __VAL="$( get_config_value_or_default "MBEDTLS_SSL_CONF_ALLOW_LEGACY_RENEGOTIATION" )" |
| 585 | if [ ! -z "$__VAL" ]; then |
| 586 | extract_cmdline_argument "allow_legacy" |
| 587 | if [ "$__ARG" = "-1" ] && [ "$__VAL" != "2" ]; then |
| 588 | SKIP_NEXT="YES"; |
| 589 | elif [ "$__ARG" = "0" ] && [ "$__VAL" != "0" ]; then |
| 590 | SKIP_NEXT="YES" |
| 591 | elif [ "$__ARG" = "1" ] && [ "$__VAL" != "1" ]; then |
| 592 | SKIP_NEXT="YES" |
| 593 | fi |
| 594 | fi |
| 595 | } |
| 596 | |
Hanno Becker | d82a030 | 2019-07-05 11:40:52 +0100 | [diff] [blame] | 597 | check_cmdline_min_minor_version_compat() { |
| 598 | __VAL="$( get_config_value_or_default "MBEDTLS_SSL_CONF_MIN_MINOR_VER" )" |
| 599 | if [ ! -z "$__VAL" ]; then |
| 600 | extract_cmdline_argument "min_version" |
| 601 | if [ "$__ARG" = "ssl3" ] && [ "$__VAL" != "0" ]; then |
| 602 | SKIP_NEXT="YES"; |
| 603 | elif [ "$__ARG" = "tls1" ] && [ "$__VAL" != "1" ]; then |
| 604 | SKIP_NEXT="YES" |
| 605 | elif [ "$__ARG" = "tls1_1" ] && [ "$__VAL" != "2" ]; then |
| 606 | SKIP_NEXT="YES" |
| 607 | elif [ "$__ARG" = "tls1_2" ] && [ "$__VAL" != "3" ]; then |
| 608 | SKIP_NEXT="YES" |
| 609 | fi |
| 610 | fi |
| 611 | } |
| 612 | |
| 613 | check_cmdline_max_minor_version_compat() { |
| 614 | __VAL="$( get_config_value_or_default "MBEDTLS_SSL_CONF_MAX_MINOR_VER" )" |
| 615 | if [ ! -z "$__VAL" ]; then |
| 616 | extract_cmdline_argument "max_version" |
| 617 | if [ "$__ARG" = "ssl3" ] && [ "$__VAL" != "0" ]; then |
| 618 | SKIP_NEXT="YES"; |
| 619 | elif [ "$__ARG" = "tls1" ] && [ "$__VAL" != "1" ]; then |
| 620 | SKIP_NEXT="YES" |
| 621 | elif [ "$__ARG" = "tls1_1" ] && [ "$__VAL" != "2" ]; then |
| 622 | SKIP_NEXT="YES" |
| 623 | elif [ "$__ARG" = "tls1_2" ] && [ "$__VAL" != "3" ]; then |
| 624 | SKIP_NEXT="YES" |
| 625 | fi |
| 626 | fi |
| 627 | } |
| 628 | |
| 629 | check_cmdline_force_version_compat() { |
| 630 | __VAL_MAX="$( get_config_value_or_default "MBEDTLS_SSL_CONF_MAX_MINOR_VER" )" |
| 631 | __VAL_MIN="$( get_config_value_or_default "MBEDTLS_SSL_CONF_MIN_MINOR_VER" )" |
| 632 | if [ ! -z "$__VAL_MIN" ]; then |
| 633 | |
| 634 | # SSL cli/srv cmd line |
| 635 | |
| 636 | extract_cmdline_argument "force_version" |
| 637 | if [ "$__ARG" = "ssl3" ] && \ |
| 638 | ( [ "$__VAL_MIN" != "0" ] || [ "$__VAL_MAX" != "0" ] ); then |
| 639 | SKIP_NEXT="YES"; |
| 640 | elif [ "$__ARG" = "tls1" ] && \ |
| 641 | ( [ "$__VAL_MIN" != "1" ] || [ "$__VAL_MAX" != "1" ] ); then |
| 642 | SKIP_NEXT="YES" |
| 643 | elif ( [ "$__ARG" = "tls1_1" ] || [ "$__ARG" = "dtls1" ] ) && \ |
| 644 | ( [ "$__VAL_MIN" != "2" ] || [ "$__VAL_MAX" != "2" ] ); then |
| 645 | SKIP_NEXT="YES" |
| 646 | elif ( [ "$__ARG" = "tls1_2" ] || [ "$__ARG" = "dtls1_2" ] ) && \ |
| 647 | ( [ "$__VAL_MIN" != "3" ] || [ "$__VAL_MAX" != "3" ] ); then |
| 648 | echo "FORCE SKIP" |
| 649 | SKIP_NEXT="YES" |
| 650 | fi |
| 651 | |
| 652 | # OpenSSL cmd line |
| 653 | |
| 654 | if echo "$CMD" | grep -e "-tls1\($\|[^_]\)" > /dev/null; then |
| 655 | if [ "$__VAL_MIN" != "1" ] || [ "$__VAL_MAX" != "1" ]; then |
| 656 | SKIP_NEXT="YES" |
| 657 | fi |
| 658 | fi |
| 659 | |
| 660 | if echo "$CMD" | grep -e "-\(dtls1\($\|[^_]\)\|tls1_1\)" > /dev/null; then |
| 661 | if [ "$__VAL_MIN" != "2" ] || [ "$__VAL_MAX" != "2" ]; then |
| 662 | SKIP_NEXT="YES" |
| 663 | fi |
| 664 | fi |
| 665 | |
| 666 | if echo "$CMD" | grep -e "-\(dtls1_2\($\|[^_]\)\|tls1_2\)" > /dev/null; then |
| 667 | if [ "$__VAL_MIN" != "3" ] || [ "$__VAL_MAX" != "3" ]; then |
| 668 | SKIP_NEXT="YES" |
| 669 | fi |
| 670 | fi |
| 671 | |
| 672 | fi |
| 673 | } |
| 674 | |
Hanno Becker | 69c6cde | 2019-09-02 14:34:23 +0100 | [diff] [blame] | 675 | check_cmdline_crt_key_files_compat() { |
| 676 | |
| 677 | # test-ca2.crt |
| 678 | if echo "$CMD" | grep -e "test-ca2" > /dev/null; then |
| 679 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 680 | fi |
| 681 | |
| 682 | # Variants of server5.key and server5.crt |
| 683 | if echo "$CMD" | grep -e "server5" > /dev/null; then |
| 684 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 685 | fi |
| 686 | |
| 687 | # Variants of server6.key and server6.crt |
| 688 | if echo "$CMD" | grep -e "server6" > /dev/null; then |
| 689 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 690 | fi |
| 691 | |
| 692 | } |
| 693 | |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 694 | # Go through all options that can be hardcoded at compile-time and |
| 695 | # detect whether the command line configures them in a conflicting |
| 696 | # way. If so, skip the test. Otherwise, remove the corresponding |
| 697 | # entry. |
| 698 | # Parameter 1: Command line to inspect |
| 699 | # Output: Modified command line |
| 700 | # ENV I/O: SKIP_TEST set to 1 on mismatch. |
| 701 | check_cmdline_compat() { |
| 702 | CMD="$1" |
| 703 | |
Hanno Becker | 69c6cde | 2019-09-02 14:34:23 +0100 | [diff] [blame] | 704 | # Check that if we're specifying particular certificate and/or |
| 705 | # ECC key files, the corresponding curve is enabled. |
| 706 | check_cmdline_crt_key_files_compat |
| 707 | |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 708 | # ExtendedMasterSecret configuration |
| 709 | check_cmdline_param_compat "extended_ms" \ |
| 710 | "MBEDTLS_SSL_CONF_EXTENDED_MASTER_SECRET" |
| 711 | check_cmdline_param_compat "enforce_extended_master_secret" \ |
| 712 | "MBEDTLS_SSL_CONF_ENFORCE_EXTENDED_MASTER_SECRET" |
Hanno Becker | 7f376f4 | 2019-06-12 16:20:48 +0100 | [diff] [blame] | 713 | |
| 714 | # DTLS anti replay protection configuration |
| 715 | check_cmdline_param_compat "anti_replay" \ |
| 716 | "MBEDTLS_SSL_CONF_ANTI_REPLAY" |
| 717 | |
Hanno Becker | de67154 | 2019-06-12 16:30:46 +0100 | [diff] [blame] | 718 | # DTLS bad MAC limit |
| 719 | check_cmdline_param_compat "badmac_limit" \ |
| 720 | "MBEDTLS_SSL_CONF_BADMAC_LIMIT" |
Hanno Becker | acd4fc0 | 2019-06-12 16:40:50 +0100 | [diff] [blame] | 721 | |
Hanno Becker | a43f85c | 2019-09-05 14:51:20 +0100 | [diff] [blame] | 722 | # Skip tests relying on TLS/DTLS in configs that disable it. |
| 723 | check_cmdline_check_tls_dtls |
Hanno Becker | 73b72d1 | 2019-07-26 12:00:38 +0100 | [diff] [blame] | 724 | |
Hanno Becker | acd4fc0 | 2019-06-12 16:40:50 +0100 | [diff] [blame] | 725 | # Authentication mode |
| 726 | check_cmdline_authmode_compat |
Hanno Becker | b0b2b67 | 2019-06-12 16:58:10 +0100 | [diff] [blame] | 727 | |
| 728 | # Legacy renegotiation |
| 729 | check_cmdline_legacy_renego_compat |
Hanno Becker | d82a030 | 2019-07-05 11:40:52 +0100 | [diff] [blame] | 730 | |
| 731 | # Version configuration |
| 732 | check_cmdline_min_minor_version_compat |
| 733 | check_cmdline_max_minor_version_compat |
| 734 | check_cmdline_force_version_compat |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 735 | } |
| 736 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 737 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 738 | # Options: -s pattern pattern that must be present in server output |
| 739 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 740 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 741 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 742 | # -S pattern pattern that must be absent in server output |
| 743 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 744 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 745 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 746 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 747 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 748 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 749 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 750 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 751 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 752 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 753 | return |
| 754 | fi |
| 755 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 756 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 757 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 758 | # Do we only run numbered tests? |
| 759 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 760 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 761 | else |
| 762 | SKIP_NEXT="YES" |
| 763 | fi |
| 764 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 765 | # does this test use a proxy? |
| 766 | if [ "X$1" = "X-p" ]; then |
| 767 | PXY_CMD="$2" |
| 768 | shift 2 |
| 769 | else |
| 770 | PXY_CMD="" |
| 771 | fi |
| 772 | |
| 773 | # get commands and client output |
| 774 | SRV_CMD="$1" |
| 775 | CLI_CMD="$2" |
| 776 | CLI_EXPECT="$3" |
| 777 | shift 3 |
| 778 | |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 779 | check_cmdline_compat "$SRV_CMD" |
| 780 | SRV_CMD="$CMD" |
| 781 | |
| 782 | check_cmdline_compat "$CLI_CMD" |
| 783 | CLI_CMD="$CMD" |
| 784 | |
Hanno Becker | 7a11e72 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 785 | # Check if test uses files |
| 786 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) |
| 787 | if [ ! -z "$TEST_USES_FILES" ]; then |
| 788 | requires_config_enabled MBEDTLS_FS_IO |
| 789 | fi |
| 790 | |
| 791 | # should we skip? |
| 792 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 793 | SKIP_NEXT="NO" |
| 794 | echo "SKIP" |
| 795 | SKIPS=$(( $SKIPS + 1 )) |
| 796 | return |
| 797 | fi |
| 798 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 799 | # fix client port |
| 800 | if [ -n "$PXY_CMD" ]; then |
| 801 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 802 | else |
| 803 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 804 | fi |
| 805 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 806 | # update DTLS variable |
| 807 | detect_dtls "$SRV_CMD" |
| 808 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 809 | # prepend valgrind to our commands if active |
| 810 | if [ "$MEMCHECK" -gt 0 ]; then |
| 811 | if is_polar "$SRV_CMD"; then |
| 812 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 813 | fi |
| 814 | if is_polar "$CLI_CMD"; then |
| 815 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 816 | fi |
| 817 | fi |
| 818 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 819 | TIMES_LEFT=2 |
| 820 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 821 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 822 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 823 | # run the commands |
| 824 | if [ -n "$PXY_CMD" ]; then |
| 825 | echo "$PXY_CMD" > $PXY_OUT |
| 826 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 827 | PXY_PID=$! |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 828 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 829 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 830 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 831 | check_osrv_dtls |
| 832 | echo "$SRV_CMD" > $SRV_OUT |
| 833 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 834 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 835 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 836 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 837 | echo "$CLI_CMD" > $CLI_OUT |
| 838 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 839 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 840 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 841 | sleep 0.05 |
| 842 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 843 | # terminate the server (and the proxy) |
| 844 | kill $SRV_PID |
| 845 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 846 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 847 | if [ -n "$PXY_CMD" ]; then |
| 848 | kill $PXY_PID >/dev/null 2>&1 |
| 849 | wait $PXY_PID |
| 850 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 851 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 852 | # retry only on timeouts |
| 853 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 854 | printf "RETRY " |
| 855 | else |
| 856 | TIMES_LEFT=0 |
| 857 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 858 | done |
| 859 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 860 | # 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] | 861 | # (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] | 862 | # expected client exit to incorrectly succeed in case of catastrophic |
| 863 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 864 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 865 | 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] | 866 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 867 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 868 | return |
| 869 | fi |
| 870 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 871 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 872 | 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] | 873 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 874 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 875 | return |
| 876 | fi |
| 877 | fi |
| 878 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 879 | # check server exit code |
| 880 | if [ $? != 0 ]; then |
| 881 | fail "server fail" |
| 882 | return |
| 883 | fi |
| 884 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 885 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 886 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 887 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 888 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 889 | 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] | 890 | return |
| 891 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 892 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 893 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 894 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 895 | # 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] | 896 | while [ $# -gt 0 ] |
| 897 | do |
| 898 | case $1 in |
| 899 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 900 | 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] | 901 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 902 | return |
| 903 | fi |
| 904 | ;; |
| 905 | |
| 906 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 907 | 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] | 908 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 909 | return |
| 910 | fi |
| 911 | ;; |
| 912 | |
| 913 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 914 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 915 | fail "pattern '$2' MUST NOT be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 916 | return |
| 917 | fi |
| 918 | ;; |
| 919 | |
| 920 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 921 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 922 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 923 | return |
| 924 | fi |
| 925 | ;; |
| 926 | |
| 927 | # The filtering in the following two options (-u and -U) do the following |
| 928 | # - ignore valgrind output |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 929 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 930 | # - keep one of each non-unique line |
| 931 | # - count how many lines remain |
| 932 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 933 | # if there were no duplicates. |
| 934 | "-U") |
| 935 | 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 |
| 936 | fail "lines following pattern '$2' must be unique in Server output" |
| 937 | return |
| 938 | fi |
| 939 | ;; |
| 940 | |
| 941 | "-u") |
| 942 | 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 |
| 943 | 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] | 944 | return |
| 945 | fi |
| 946 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 947 | "-F") |
| 948 | if ! $2 "$SRV_OUT"; then |
| 949 | fail "function call to '$2' failed on Server output" |
| 950 | return |
| 951 | fi |
| 952 | ;; |
| 953 | "-f") |
| 954 | if ! $2 "$CLI_OUT"; then |
| 955 | fail "function call to '$2' failed on Client output" |
| 956 | return |
| 957 | fi |
| 958 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 959 | |
| 960 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 961 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 962 | exit 1 |
| 963 | esac |
| 964 | shift 2 |
| 965 | done |
| 966 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 967 | # check valgrind's results |
| 968 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 969 | 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] | 970 | fail "Server has memory errors" |
| 971 | return |
| 972 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 973 | 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] | 974 | fail "Client has memory errors" |
| 975 | return |
| 976 | fi |
| 977 | fi |
| 978 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 979 | # if we're here, everything is ok |
| 980 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 981 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 982 | mv $SRV_OUT o-srv-${TESTS}.log |
| 983 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 984 | if [ -n "$PXY_CMD" ]; then |
| 985 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 986 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 987 | fi |
| 988 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 989 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 990 | } |
| 991 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 992 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 993 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 994 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 995 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 996 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 997 | 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] | 998 | exit 1 |
| 999 | } |
| 1000 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1001 | # |
| 1002 | # MAIN |
| 1003 | # |
| 1004 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1005 | get_options "$@" |
| 1006 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1007 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1008 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1009 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1010 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1011 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1012 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1013 | exit 1 |
| 1014 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1015 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1016 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1017 | exit 1 |
| 1018 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1019 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1020 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1021 | exit 1 |
| 1022 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1023 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1024 | if which valgrind >/dev/null 2>&1; then :; else |
| 1025 | echo "Memcheck not possible. Valgrind not found" |
| 1026 | exit 1 |
| 1027 | fi |
| 1028 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1029 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1030 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1031 | exit 1 |
| 1032 | fi |
| 1033 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1034 | # used by watchdog |
| 1035 | MAIN_PID="$$" |
| 1036 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1037 | # We use somewhat arbitrary delays for tests: |
| 1038 | # - how long do we wait for the server to start (when lsof not available)? |
| 1039 | # - how long do we allow for the client to finish? |
| 1040 | # (not to check performance, just to avoid waiting indefinitely) |
| 1041 | # Things are slower with valgrind, so give extra time here. |
| 1042 | # |
| 1043 | # Note: without lsof, there is a trade-off between the running time of this |
| 1044 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1045 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1046 | # the script, only the case where a client or server gets stuck. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1047 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1048 | START_DELAY=6 |
| 1049 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1050 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1051 | START_DELAY=2 |
| 1052 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1053 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1054 | |
| 1055 | # some particular tests need more time: |
| 1056 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1057 | # - for the server, we sleep for a number of seconds after the client exits |
| 1058 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1059 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1060 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1061 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1062 | # fix commands to use this port, force IPv4 while at it |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 1063 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1064 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1065 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 1066 | 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"}" |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 1067 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1068 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 1069 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1070 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1071 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1072 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1073 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1074 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1075 | fi |
| 1076 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1077 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1078 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1079 | fi |
| 1080 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1081 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1082 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1083 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1084 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1085 | # Allow SHA-1, because many of our test certificates use it |
| 1086 | P_SRV="$P_SRV allow_sha1=1" |
| 1087 | P_CLI="$P_CLI allow_sha1=1" |
| 1088 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1089 | # Also pick a unique name for intermediate files |
| 1090 | SRV_OUT="srv_out.$$" |
| 1091 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1092 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1093 | SESSION="session.$$" |
| 1094 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1095 | SKIP_NEXT="NO" |
| 1096 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1097 | trap cleanup INT TERM HUP |
| 1098 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1099 | # Basic test |
| 1100 | |
Hanno Becker | 9190036 | 2019-07-03 13:22:59 +0100 | [diff] [blame] | 1101 | run_test "Default" \ |
| 1102 | "$P_SRV debug_level=3" \ |
| 1103 | "$P_CLI" \ |
| 1104 | 0 |
| 1105 | |
| 1106 | run_test "Default, DTLS" \ |
| 1107 | "$P_SRV dtls=1" \ |
| 1108 | "$P_CLI dtls=1" \ |
| 1109 | 0 |
| 1110 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1111 | # Checks that: |
| 1112 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1113 | # - the expected (highest security) parameters are selected |
| 1114 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Hanno Becker | 9190036 | 2019-07-03 13:22:59 +0100 | [diff] [blame] | 1115 | requires_ciphersuite_enabled "TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
| 1116 | requires_config_enabled MBEDTLS_SHA512_C |
| 1117 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1118 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1119 | run_test "Default, choose highest security suite and hash" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1120 | "$P_SRV debug_level=3" \ |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 1121 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1122 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1123 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1124 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1125 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1126 | -s "ECDHE curve: secp521r1" \ |
| 1127 | -S "error" \ |
| 1128 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1129 | |
Hanno Becker | 9190036 | 2019-07-03 13:22:59 +0100 | [diff] [blame] | 1130 | requires_ciphersuite_enabled "TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
| 1131 | requires_config_enabled MBEDTLS_SHA512_C |
| 1132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1133 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1134 | run_test "Default, choose highest security suite and hash, DTLS" \ |
| 1135 | "$P_SRV debug_level=3 dtls=1" \ |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1136 | "$P_CLI dtls=1" \ |
| 1137 | 0 \ |
| 1138 | -s "Protocol is DTLSv1.2" \ |
Hanno Becker | 9190036 | 2019-07-03 13:22:59 +0100 | [diff] [blame] | 1139 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1140 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1141 | -s "ECDHE curve: secp521r1" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1142 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1143 | # Test current time in ServerHello |
| 1144 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1145 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1146 | "$P_SRV debug_level=3" \ |
| 1147 | "$P_CLI debug_level=3" \ |
| 1148 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1149 | -f "check_server_hello_time" \ |
| 1150 | -F "check_server_hello_time" |
| 1151 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1152 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1153 | run_test "Unique IV in GCM" \ |
| 1154 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1155 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1156 | 0 \ |
| 1157 | -u "IV used" \ |
| 1158 | -U "IV used" |
| 1159 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1160 | # Tests for rc4 option |
| 1161 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1162 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1163 | run_test "RC4: server disabled, client enabled" \ |
| 1164 | "$P_SRV" \ |
| 1165 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1166 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1167 | -s "SSL - The server has no ciphersuites in common" |
| 1168 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1169 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1170 | run_test "RC4: server half, client enabled" \ |
| 1171 | "$P_SRV arc4=1" \ |
| 1172 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1173 | 1 \ |
| 1174 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1175 | |
| 1176 | run_test "RC4: server enabled, client disabled" \ |
| 1177 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1178 | "$P_CLI" \ |
| 1179 | 1 \ |
| 1180 | -s "SSL - The server has no ciphersuites in common" |
| 1181 | |
| 1182 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1183 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1184 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1185 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1186 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1187 | -S "SSL - The server has no ciphersuites in common" |
| 1188 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1189 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1190 | |
| 1191 | requires_gnutls |
| 1192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1193 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1194 | "$G_SRV"\ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 1195 | "$P_CLI force_version=tls1_1 ca_file=data_files/test-ca2.crt" \ |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1196 | 0 |
| 1197 | |
| 1198 | requires_gnutls |
| 1199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1200 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1201 | "$G_SRV"\ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 1202 | "$P_CLI force_version=tls1 ca_file=data_files/test-ca2.crt" \ |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1203 | 0 |
| 1204 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1205 | # Tests for SHA-1 support |
| 1206 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1207 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 1208 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 1209 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1210 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1211 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1212 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1213 | 1 \ |
| 1214 | -c "The certificate is signed with an unacceptable hash" |
| 1215 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1216 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1217 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1218 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1219 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1220 | 0 |
| 1221 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1222 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1223 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1224 | "$P_CLI allow_sha1=1" \ |
| 1225 | 0 |
| 1226 | |
| 1227 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1228 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1229 | "$P_CLI allow_sha1=0" \ |
| 1230 | 0 |
| 1231 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1232 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 1233 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 1234 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1235 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1236 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1237 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1238 | 1 \ |
| 1239 | -s "The certificate is signed with an unacceptable hash" |
| 1240 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1241 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1242 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1243 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1244 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1245 | 0 |
| 1246 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1247 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1248 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1249 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1250 | 0 |
| 1251 | |
| 1252 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1253 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1254 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1255 | 0 |
| 1256 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1257 | # Tests for datagram packing |
| 1258 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1259 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1260 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1261 | 0 \ |
| 1262 | -c "next record in same datagram" \ |
| 1263 | -s "next record in same datagram" |
| 1264 | |
| 1265 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1266 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1267 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1268 | 0 \ |
| 1269 | -s "next record in same datagram" \ |
| 1270 | -C "next record in same datagram" |
| 1271 | |
| 1272 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1273 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1274 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1275 | 0 \ |
| 1276 | -S "next record in same datagram" \ |
| 1277 | -c "next record in same datagram" |
| 1278 | |
| 1279 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1280 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1281 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1282 | 0 \ |
| 1283 | -S "next record in same datagram" \ |
| 1284 | -C "next record in same datagram" |
| 1285 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1286 | # Tests for Truncated HMAC extension |
| 1287 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1288 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1289 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1290 | "$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] | 1291 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1292 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1293 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1294 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1295 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1296 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1297 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1298 | "$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] | 1299 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1300 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1301 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1302 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1303 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1304 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1305 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1306 | "$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] | 1307 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1308 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1309 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1310 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1311 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1312 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1313 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1314 | "$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] | 1315 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1316 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1317 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1318 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1319 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1320 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1321 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1322 | "$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] | 1323 | 0 \ |
| 1324 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1325 | -S "dumping 'expected mac' (10 bytes)" |
| 1326 | |
| 1327 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1328 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1329 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1330 | "$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] | 1331 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1332 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1333 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1334 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1335 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1336 | "$P_SRV dtls=1 debug_level=4" \ |
| 1337 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1338 | 0 \ |
| 1339 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1340 | -S "dumping 'expected mac' (10 bytes)" |
| 1341 | |
| 1342 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1343 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1344 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1345 | "$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] | 1346 | 0 \ |
| 1347 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1348 | -S "dumping 'expected mac' (10 bytes)" |
| 1349 | |
| 1350 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1351 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1352 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1353 | "$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] | 1354 | 0 \ |
| 1355 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1356 | -S "dumping 'expected mac' (10 bytes)" |
| 1357 | |
| 1358 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1359 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1360 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1361 | "$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] | 1362 | 0 \ |
| 1363 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1364 | -S "dumping 'expected mac' (10 bytes)" |
| 1365 | |
| 1366 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1367 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1368 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1369 | "$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] | 1370 | 0 \ |
| 1371 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1372 | -S "dumping 'expected mac' (10 bytes)" |
| 1373 | |
| 1374 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1375 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1376 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1377 | "$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] | 1378 | 0 \ |
| 1379 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1380 | -s "dumping 'expected mac' (10 bytes)" |
| 1381 | |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1382 | # Tests for Context serialization |
| 1383 | |
| 1384 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1385 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 0d83271 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1386 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1387 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1388 | 0 \ |
Jarno Lamsa | dcfc2a7 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1389 | -c "Deserializing connection..." \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1390 | -S "Deserializing connection..." |
| 1391 | |
| 1392 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1393 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
Manuel Pégourié-Gonnard | 0d83271 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1394 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1395 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1396 | 0 \ |
| 1397 | -c "Deserializing connection..." \ |
| 1398 | -S "Deserializing connection..." |
| 1399 | |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1400 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1401 | run_test "Context serialization, client serializes, GCM" \ |
| 1402 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1403 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1404 | 0 \ |
| 1405 | -c "Deserializing connection..." \ |
| 1406 | -S "Deserializing connection..." |
Jarno Lamsa | cc281b8 | 2019-06-04 15:21:13 +0300 | [diff] [blame] | 1407 | |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1408 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e80c1b0 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1409 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1410 | run_test "Context serialization, client serializes, with CID" \ |
| 1411 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1412 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1413 | 0 \ |
| 1414 | -c "Deserializing connection..." \ |
| 1415 | -S "Deserializing connection..." |
| 1416 | |
| 1417 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1418 | run_test "Context serialization, server serializes, CCM" \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1419 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1420 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1421 | 0 \ |
| 1422 | -C "Deserializing connection..." \ |
| 1423 | -s "Deserializing connection..." |
| 1424 | |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1425 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1426 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1427 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1428 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1429 | 0 \ |
| 1430 | -C "Deserializing connection..." \ |
| 1431 | -s "Deserializing connection..." |
| 1432 | |
| 1433 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1434 | run_test "Context serialization, server serializes, GCM" \ |
| 1435 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1436 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1437 | 0 \ |
| 1438 | -C "Deserializing connection..." \ |
Jarno Lamsa | cc281b8 | 2019-06-04 15:21:13 +0300 | [diff] [blame] | 1439 | -s "Deserializing connection..." |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1440 | |
| 1441 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e80c1b0 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1442 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1443 | run_test "Context serialization, server serializes, with CID" \ |
| 1444 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1445 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1446 | 0 \ |
| 1447 | -C "Deserializing connection..." \ |
| 1448 | -s "Deserializing connection..." |
| 1449 | |
| 1450 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1451 | run_test "Context serialization, both serialize, CCM" \ |
Jarno Lamsa | dcfc2a7 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1452 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1453 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1454 | 0 \ |
| 1455 | -c "Deserializing connection..." \ |
| 1456 | -s "Deserializing connection..." |
| 1457 | |
| 1458 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1459 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1460 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1461 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1462 | 0 \ |
| 1463 | -c "Deserializing connection..." \ |
| 1464 | -s "Deserializing connection..." |
| 1465 | |
| 1466 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1467 | run_test "Context serialization, both serialize, GCM" \ |
| 1468 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1469 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1470 | 0 \ |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1471 | -c "Deserializing connection..." \ |
| 1472 | -s "Deserializing connection..." |
| 1473 | |
| 1474 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e80c1b0 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1475 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1476 | run_test "Context serialization, both serialize, with CID" \ |
| 1477 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1478 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1479 | 0 \ |
| 1480 | -c "Deserializing connection..." \ |
| 1481 | -s "Deserializing connection..." |
| 1482 | |
| 1483 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1484 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1485 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1486 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1487 | 0 \ |
| 1488 | -c "Deserializing connection..." \ |
| 1489 | -S "Deserializing connection..." |
| 1490 | |
| 1491 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1492 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1493 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1494 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1495 | 0 \ |
| 1496 | -c "Deserializing connection..." \ |
| 1497 | -S "Deserializing connection..." |
| 1498 | |
| 1499 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1500 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1501 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1502 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1503 | 0 \ |
| 1504 | -c "Deserializing connection..." \ |
| 1505 | -S "Deserializing connection..." |
| 1506 | |
| 1507 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e80c1b0 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1508 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1509 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1510 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1511 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1512 | 0 \ |
| 1513 | -c "Deserializing connection..." \ |
| 1514 | -S "Deserializing connection..." |
| 1515 | |
| 1516 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1517 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 0d83271 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1518 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1519 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1520 | 0 \ |
| 1521 | -C "Deserializing connection..." \ |
| 1522 | -s "Deserializing connection..." |
| 1523 | |
| 1524 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1525 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1526 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1527 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1528 | 0 \ |
| 1529 | -C "Deserializing connection..." \ |
| 1530 | -s "Deserializing connection..." |
| 1531 | |
| 1532 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1533 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1534 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1535 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1536 | 0 \ |
| 1537 | -C "Deserializing connection..." \ |
| 1538 | -s "Deserializing connection..." |
| 1539 | |
| 1540 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e80c1b0 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1541 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1542 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1543 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1544 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1545 | 0 \ |
| 1546 | -C "Deserializing connection..." \ |
| 1547 | -s "Deserializing connection..." |
| 1548 | |
| 1549 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1550 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 0d83271 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1551 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | 2e72dd8 | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1552 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1553 | 0 \ |
| 1554 | -c "Deserializing connection..." \ |
| 1555 | -s "Deserializing connection..." |
| 1556 | |
| 1557 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1558 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1559 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1560 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1561 | 0 \ |
| 1562 | -c "Deserializing connection..." \ |
| 1563 | -s "Deserializing connection..." |
| 1564 | |
| 1565 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1566 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1567 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1568 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1569 | 0 \ |
| 1570 | -c "Deserializing connection..." \ |
| 1571 | -s "Deserializing connection..." |
| 1572 | |
Hanno Becker | e80c1b0 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1573 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1574 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1575 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1576 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1577 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1578 | 0 \ |
| 1579 | -c "Deserializing connection..." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1580 | -s "Deserializing connection..." |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1581 | |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1582 | # Tests for DTLS Connection ID extension |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1583 | |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1584 | # So far, the CID API isn't implemented, so we can't |
| 1585 | # grep for output witnessing its use. This needs to be |
Hanno Becker | 6a3ff28 | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1586 | # changed once the CID extension is implemented. |
Hanno Becker | ad8e2c9 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1587 | |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1588 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1589 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1590 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1591 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1592 | 0 \ |
| 1593 | -s "Disable use of CID extension." \ |
| 1594 | -s "found CID extension" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1595 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1596 | -c "Enable use of CID extension." \ |
| 1597 | -c "client hello, adding CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1598 | -S "server hello, adding CID extension" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1599 | -C "found CID extension" \ |
| 1600 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1601 | -C "Copy CIDs into SSL transform" \ |
| 1602 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1603 | |
| 1604 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1605 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
| 1606 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1607 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1608 | 0 \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1609 | -c "Disable use of CID extension." \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1610 | -C "client hello, adding CID extension" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1611 | -S "found CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1612 | -s "Enable use of CID extension." \ |
| 1613 | -S "server hello, adding CID extension" \ |
| 1614 | -C "found CID extension" \ |
| 1615 | -S "Copy CIDs into SSL transform" \ |
| 1616 | -C "Copy CIDs into SSL transform" \ |
| 1617 | -s "Use of Connection ID was not offered by client" |
| 1618 | |
| 1619 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1620 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1621 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1622 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1623 | 0 \ |
| 1624 | -c "Enable use of CID extension." \ |
| 1625 | -s "Enable use of CID extension." \ |
| 1626 | -c "client hello, adding CID extension" \ |
| 1627 | -s "found CID extension" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1628 | -s "Use of CID extension negotiated" \ |
| 1629 | -s "server hello, adding CID extension" \ |
| 1630 | -c "found CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1631 | -c "Use of CID extension negotiated" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1632 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1633 | -c "Copy CIDs into SSL transform" \ |
| 1634 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1635 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1636 | -s "Use of Connection ID has been negotiated" \ |
| 1637 | -c "Use of Connection ID has been negotiated" |
| 1638 | |
| 1639 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1640 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1641 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
| 1642 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1643 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1644 | 0 \ |
| 1645 | -c "Enable use of CID extension." \ |
| 1646 | -s "Enable use of CID extension." \ |
| 1647 | -c "client hello, adding CID extension" \ |
| 1648 | -s "found CID extension" \ |
| 1649 | -s "Use of CID extension negotiated" \ |
| 1650 | -s "server hello, adding CID extension" \ |
| 1651 | -c "found CID extension" \ |
| 1652 | -c "Use of CID extension negotiated" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1653 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1654 | -c "Copy CIDs into SSL transform" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1655 | -c "Peer CID (length 2 Bytes): de ad" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1656 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1657 | -s "Use of Connection ID has been negotiated" \ |
| 1658 | -c "Use of Connection ID has been negotiated" \ |
| 1659 | -c "ignoring unexpected CID" \ |
| 1660 | -s "ignoring unexpected CID" |
| 1661 | |
| 1662 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1663 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1664 | -p "$P_PXY mtu=800" \ |
| 1665 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1666 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1667 | 0 \ |
| 1668 | -c "Enable use of CID extension." \ |
| 1669 | -s "Enable use of CID extension." \ |
| 1670 | -c "client hello, adding CID extension" \ |
| 1671 | -s "found CID extension" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1672 | -s "Use of CID extension negotiated" \ |
| 1673 | -s "server hello, adding CID extension" \ |
| 1674 | -c "found CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1675 | -c "Use of CID extension negotiated" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1676 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1677 | -c "Copy CIDs into SSL transform" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1678 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1679 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1680 | -s "Use of Connection ID has been negotiated" \ |
| 1681 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1682 | |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1683 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1684 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1685 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1686 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1687 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1688 | 0 \ |
| 1689 | -c "Enable use of CID extension." \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1690 | -s "Enable use of CID extension." \ |
| 1691 | -c "client hello, adding CID extension" \ |
| 1692 | -s "found CID extension" \ |
| 1693 | -s "Use of CID extension negotiated" \ |
| 1694 | -s "server hello, adding CID extension" \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1695 | -c "found CID extension" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1696 | -c "Use of CID extension negotiated" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1697 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1698 | -c "Copy CIDs into SSL transform" \ |
| 1699 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1700 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1701 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1702 | -c "Use of Connection ID has been negotiated" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1703 | -c "ignoring unexpected CID" \ |
| 1704 | -s "ignoring unexpected CID" |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1705 | |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1706 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1707 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1708 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1709 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1710 | 0 \ |
| 1711 | -c "Enable use of CID extension." \ |
| 1712 | -s "Enable use of CID extension." \ |
| 1713 | -c "client hello, adding CID extension" \ |
| 1714 | -s "found CID extension" \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1715 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1716 | -s "server hello, adding CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1717 | -c "found CID extension" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1718 | -c "Use of CID extension negotiated" \ |
| 1719 | -s "Copy CIDs into SSL transform" \ |
| 1720 | -c "Copy CIDs into SSL transform" \ |
| 1721 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1722 | -s "Peer CID (length 0 Bytes):" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1723 | -s "Use of Connection ID has been negotiated" \ |
| 1724 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1725 | |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1726 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1727 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1728 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1729 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
Hanno Becker | 6a3ff28 | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1730 | 0 \ |
| 1731 | -c "Enable use of CID extension." \ |
| 1732 | -s "Enable use of CID extension." \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1733 | -c "client hello, adding CID extension" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1734 | -s "found CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1735 | -s "Use of CID extension negotiated" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1736 | -s "server hello, adding CID extension" \ |
| 1737 | -c "found CID extension" \ |
| 1738 | -c "Use of CID extension negotiated" \ |
| 1739 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1740 | -c "Copy CIDs into SSL transform" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1741 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1742 | -c "Peer CID (length 0 Bytes):" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1743 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1744 | -c "Use of Connection ID has been negotiated" |
| 1745 | |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1746 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1747 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1748 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1749 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1750 | 0 \ |
| 1751 | -c "Enable use of CID extension." \ |
| 1752 | -s "Enable use of CID extension." \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1753 | -c "client hello, adding CID extension" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1754 | -s "found CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1755 | -s "Use of CID extension negotiated" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1756 | -s "server hello, adding CID extension" \ |
| 1757 | -c "found CID extension" \ |
| 1758 | -c "Use of CID extension negotiated" \ |
| 1759 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1760 | -c "Copy CIDs into SSL transform" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1761 | -S "Use of Connection ID has been negotiated" \ |
| 1762 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1763 | |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1764 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1765 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1766 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1767 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1768 | 0 \ |
| 1769 | -c "Enable use of CID extension." \ |
| 1770 | -s "Enable use of CID extension." \ |
| 1771 | -c "client hello, adding CID extension" \ |
| 1772 | -s "found CID extension" \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1773 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1774 | -s "server hello, adding CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1775 | -c "found CID extension" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1776 | -c "Use of CID extension negotiated" \ |
| 1777 | -s "Copy CIDs into SSL transform" \ |
| 1778 | -c "Copy CIDs into SSL transform" \ |
| 1779 | -c "Peer CID (length 2 Bytes): de ad" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1780 | -s "Peer CID (length 2 Bytes): be ef" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1781 | -s "Use of Connection ID has been negotiated" \ |
| 1782 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1783 | |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1784 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1785 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1786 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1787 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1788 | 0 \ |
| 1789 | -c "Enable use of CID extension." \ |
| 1790 | -s "Enable use of CID extension." \ |
| 1791 | -c "client hello, adding CID extension" \ |
| 1792 | -s "found CID extension" \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1793 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1794 | -s "server hello, adding CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1795 | -c "found CID extension" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1796 | -c "Use of CID extension negotiated" \ |
| 1797 | -s "Copy CIDs into SSL transform" \ |
| 1798 | -c "Copy CIDs into SSL transform" \ |
| 1799 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1800 | -s "Peer CID (length 0 Bytes):" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1801 | -s "Use of Connection ID has been negotiated" \ |
| 1802 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1803 | |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1804 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1805 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1806 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1807 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
Hanno Becker | 6a3ff28 | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1808 | 0 \ |
| 1809 | -c "Enable use of CID extension." \ |
| 1810 | -s "Enable use of CID extension." \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1811 | -c "client hello, adding CID extension" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1812 | -s "found CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1813 | -s "Use of CID extension negotiated" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1814 | -s "server hello, adding CID extension" \ |
| 1815 | -c "found CID extension" \ |
| 1816 | -c "Use of CID extension negotiated" \ |
| 1817 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1818 | -c "Copy CIDs into SSL transform" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1819 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1820 | -c "Peer CID (length 0 Bytes):" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1821 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1822 | -c "Use of Connection ID has been negotiated" |
| 1823 | |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1824 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1825 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1826 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1827 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1828 | 0 \ |
| 1829 | -c "Enable use of CID extension." \ |
| 1830 | -s "Enable use of CID extension." \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1831 | -c "client hello, adding CID extension" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1832 | -s "found CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1833 | -s "Use of CID extension negotiated" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1834 | -s "server hello, adding CID extension" \ |
| 1835 | -c "found CID extension" \ |
| 1836 | -c "Use of CID extension negotiated" \ |
| 1837 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1838 | -c "Copy CIDs into SSL transform" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1839 | -S "Use of Connection ID has been negotiated" \ |
| 1840 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1841 | |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1842 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1843 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1844 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1845 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1846 | 0 \ |
| 1847 | -c "Enable use of CID extension." \ |
| 1848 | -s "Enable use of CID extension." \ |
| 1849 | -c "client hello, adding CID extension" \ |
| 1850 | -s "found CID extension" \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1851 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1852 | -s "server hello, adding CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1853 | -c "found CID extension" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1854 | -c "Use of CID extension negotiated" \ |
| 1855 | -s "Copy CIDs into SSL transform" \ |
| 1856 | -c "Copy CIDs into SSL transform" \ |
| 1857 | -c "Peer CID (length 2 Bytes): de ad" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1858 | -s "Peer CID (length 2 Bytes): be ef" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1859 | -s "Use of Connection ID has been negotiated" \ |
| 1860 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1861 | |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1862 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1863 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1864 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1865 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1866 | 0 \ |
| 1867 | -c "Enable use of CID extension." \ |
| 1868 | -s "Enable use of CID extension." \ |
| 1869 | -c "client hello, adding CID extension" \ |
| 1870 | -s "found CID extension" \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1871 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1872 | -s "server hello, adding CID extension" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1873 | -c "found CID extension" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1874 | -c "Use of CID extension negotiated" \ |
| 1875 | -s "Copy CIDs into SSL transform" \ |
| 1876 | -c "Copy CIDs into SSL transform" \ |
| 1877 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1878 | -s "Peer CID (length 0 Bytes):" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1879 | -s "Use of Connection ID has been negotiated" \ |
| 1880 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1881 | |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1882 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1883 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1884 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1885 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
Hanno Becker | 6a3ff28 | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1886 | 0 \ |
| 1887 | -c "Enable use of CID extension." \ |
| 1888 | -s "Enable use of CID extension." \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1889 | -c "client hello, adding CID extension" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1890 | -s "found CID extension" \ |
Hanno Becker | 963cb35 | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 1891 | -s "Use of CID extension negotiated" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1892 | -s "server hello, adding CID extension" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1893 | -c "found CID extension" \ |
| 1894 | -c "Use of CID extension negotiated" \ |
| 1895 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1896 | -c "Copy CIDs into SSL transform" \ |
| 1897 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1898 | -c "Peer CID (length 0 Bytes):" \ |
| 1899 | -s "Use of Connection ID has been negotiated" \ |
| 1900 | -c "Use of Connection ID has been negotiated" |
| 1901 | |
| 1902 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1903 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CBC" \ |
| 1904 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1905 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1906 | 0 \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1907 | -c "Enable use of CID extension." \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1908 | -s "Enable use of CID extension." \ |
| 1909 | -c "client hello, adding CID extension" \ |
| 1910 | -s "found CID extension" \ |
| 1911 | -s "Use of CID extension negotiated" \ |
| 1912 | -s "server hello, adding CID extension" \ |
| 1913 | -c "found CID extension" \ |
| 1914 | -c "Use of CID extension negotiated" \ |
| 1915 | -s "Copy CIDs into SSL transform" \ |
| 1916 | -c "Copy CIDs into SSL transform" \ |
| 1917 | -S "Use of Connection ID has been negotiated" \ |
| 1918 | -C "Use of Connection ID has been negotiated" |
| 1919 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1920 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1921 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1922 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
| 1923 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1924 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1925 | 0 \ |
| 1926 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1927 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1928 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1929 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1930 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1931 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1932 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1933 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1934 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1935 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1936 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1937 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1938 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1939 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1940 | 0 \ |
| 1941 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1942 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1943 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1944 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1945 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1946 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1947 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1948 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1949 | |
| 1950 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1951 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1952 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1953 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1954 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1955 | 0 \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1956 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1957 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1958 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1959 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1960 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1961 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1962 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1963 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1964 | |
| 1965 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1966 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1967 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1968 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1969 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1970 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1971 | 0 \ |
| 1972 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1973 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1974 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1975 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1976 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1977 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1978 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1979 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1980 | -c "ignoring unexpected CID" \ |
| 1981 | -s "ignoring unexpected CID" |
| 1982 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1983 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1984 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1985 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1986 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1987 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1988 | 0 \ |
| 1989 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1990 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1991 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1992 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1993 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1994 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1995 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1996 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1997 | |
| 1998 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1999 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2000 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2001 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2002 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2003 | 0 \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2004 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2005 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2006 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2007 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2008 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2009 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2010 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2011 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2012 | |
| 2013 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2014 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2015 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2016 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
| 2017 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2018 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2019 | 0 \ |
| 2020 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2021 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2022 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2023 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2024 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2025 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2026 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2027 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2028 | -c "ignoring unexpected CID" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2029 | -s "ignoring unexpected CID" |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2030 | |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2031 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2032 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2033 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
| 2034 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2035 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2036 | 0 \ |
| 2037 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2038 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2039 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2040 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2041 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2042 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2043 | |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2044 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2045 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2046 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2047 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2048 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2049 | 0 \ |
| 2050 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2051 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2052 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2053 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2054 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2055 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2056 | |
| 2057 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2058 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2059 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2060 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2061 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2062 | "$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" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2063 | 0 \ |
| 2064 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2065 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2066 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2067 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2068 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2069 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2070 | -c "ignoring unexpected CID" \ |
| 2071 | -s "ignoring unexpected CID" |
| 2072 | |
| 2073 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2074 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2075 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
| 2076 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2077 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2078 | 0 \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2079 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2080 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2081 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2082 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2083 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2084 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2085 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2086 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2087 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2088 | |
| 2089 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2090 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2091 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
| 2092 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
| 2093 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2094 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2095 | 0 \ |
| 2096 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2097 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2098 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2099 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2100 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2101 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2102 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2103 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2104 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2105 | -c "ignoring unexpected CID" \ |
| 2106 | -s "ignoring unexpected CID" |
| 2107 | |
| 2108 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2109 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2110 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2111 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2112 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2113 | 0 \ |
| 2114 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2115 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2116 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2117 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2118 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2119 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2120 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2121 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2122 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2123 | |
| 2124 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2125 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2126 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2127 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2128 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2129 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2130 | 0 \ |
| 2131 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2132 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2133 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2134 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2135 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2136 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2137 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2138 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2139 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2140 | -c "ignoring unexpected CID" \ |
| 2141 | -s "ignoring unexpected CID" |
| 2142 | |
| 2143 | # Tests for Encrypt-then-MAC extension |
| 2144 | |
| 2145 | run_test "Encrypt then MAC: default" \ |
| 2146 | "$P_SRV debug_level=3 \ |
| 2147 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2148 | "$P_CLI debug_level=3" \ |
| 2149 | 0 \ |
| 2150 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2151 | -s "found encrypt then mac extension" \ |
| 2152 | -s "server hello, adding encrypt then mac extension" \ |
| 2153 | -c "found encrypt_then_mac extension" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2154 | -c "using encrypt then mac" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2155 | -s "using encrypt then mac" |
| 2156 | |
| 2157 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
| 2158 | "$P_SRV debug_level=3 etm=0 \ |
| 2159 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2160 | "$P_CLI debug_level=3 etm=1" \ |
| 2161 | 0 \ |
| 2162 | -c "client hello, adding encrypt_then_mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2163 | -s "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2164 | -S "server hello, adding encrypt then mac extension" \ |
| 2165 | -C "found encrypt_then_mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2166 | -C "using encrypt then mac" \ |
| 2167 | -S "using encrypt then mac" |
| 2168 | |
| 2169 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2170 | "$P_SRV debug_level=3 etm=1 \ |
| 2171 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2172 | "$P_CLI debug_level=3 etm=1" \ |
| 2173 | 0 \ |
| 2174 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2175 | -s "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2176 | -S "server hello, adding encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2177 | -C "found encrypt_then_mac extension" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2178 | -C "using encrypt then mac" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2179 | -S "using encrypt then mac" |
| 2180 | |
| 2181 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2182 | "$P_SRV debug_level=3 etm=1 \ |
| 2183 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2184 | "$P_CLI debug_level=3 etm=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 2185 | 0 \ |
| 2186 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2187 | -s "found encrypt then mac extension" \ |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2188 | -S "server hello, adding encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2189 | -C "found encrypt_then_mac extension" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2190 | -C "using encrypt then mac" \ |
| 2191 | -S "using encrypt then mac" |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2192 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2193 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
| 2194 | "$P_SRV debug_level=3 etm=1 \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2195 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2196 | "$P_CLI debug_level=3 etm=0" \ |
| 2197 | 0 \ |
| 2198 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2199 | -S "found encrypt then mac extension" \ |
| 2200 | -S "server hello, adding encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2201 | -C "found encrypt_then_mac extension" \ |
| 2202 | -C "using encrypt then mac" \ |
Jarno Lamsa | 31d940b | 2019-06-12 10:21:33 +0300 | [diff] [blame] | 2203 | -S "using encrypt then mac" |
| 2204 | |
| 2205 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2206 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
| 2207 | "$P_SRV debug_level=3 min_version=ssl3 \ |
| 2208 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2209 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2210 | 0 \ |
| 2211 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2212 | -S "found encrypt then mac extension" \ |
| 2213 | -S "server hello, adding encrypt then mac extension" \ |
| 2214 | -C "found encrypt_then_mac extension" \ |
Jarno Lamsa | 41b3591 | 2019-06-10 15:51:11 +0300 | [diff] [blame] | 2215 | -C "using encrypt then mac" \ |
| 2216 | -S "using encrypt then mac" |
| 2217 | |
| 2218 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2219 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
| 2220 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2221 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 2222 | "$P_CLI debug_level=3 min_version=ssl3" \ |
| 2223 | 0 \ |
| 2224 | -c "client hello, adding encrypt_then_mac extension" \ |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 2225 | -S "found encrypt then mac extension" \ |
| 2226 | -S "server hello, adding encrypt then mac extension" \ |
| 2227 | -C "found encrypt_then_mac extension" \ |
| 2228 | -C "using encrypt then mac" \ |
| 2229 | -S "using encrypt then mac" |
| 2230 | |
| 2231 | # Tests for Extended Master Secret extension |
| 2232 | |
| 2233 | run_test "Extended Master Secret: default (not enforcing)" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2234 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=0 " \ |
| 2235 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=0" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2236 | 0 \ |
| 2237 | -c "client hello, adding extended_master_secret extension" \ |
| 2238 | -s "found extended master secret extension" \ |
| 2239 | -s "server hello, adding extended master secret extension" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2240 | -c "found extended_master_secret extension" \ |
| 2241 | -c "session hash for extended master secret" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2242 | -s "session hash for extended master secret" |
| 2243 | |
Jarno Lamsa | 41b3591 | 2019-06-10 15:51:11 +0300 | [diff] [blame] | 2244 | run_test "Extended Master Secret: both enabled, both enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2245 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
| 2246 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
Jarno Lamsa | 41b3591 | 2019-06-10 15:51:11 +0300 | [diff] [blame] | 2247 | 0 \ |
| 2248 | -c "client hello, adding extended_master_secret extension" \ |
| 2249 | -s "found extended master secret extension" \ |
| 2250 | -s "server hello, adding extended master secret extension" \ |
| 2251 | -c "found extended_master_secret extension" \ |
| 2252 | -c "session hash for extended master secret" \ |
| 2253 | -s "session hash for extended master secret" |
| 2254 | |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 2255 | run_test "Extended Master Secret: both enabled, client enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2256 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=0" \ |
| 2257 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 2258 | 0 \ |
| 2259 | -c "client hello, adding extended_master_secret extension" \ |
| 2260 | -s "found extended master secret extension" \ |
| 2261 | -s "server hello, adding extended master secret extension" \ |
| 2262 | -c "found extended_master_secret extension" \ |
| 2263 | -c "session hash for extended master secret" \ |
| 2264 | -s "session hash for extended master secret" |
| 2265 | |
| 2266 | run_test "Extended Master Secret: both enabled, server enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2267 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
| 2268 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=0" \ |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 2269 | 0 \ |
| 2270 | -c "client hello, adding extended_master_secret extension" \ |
| 2271 | -s "found extended master secret extension" \ |
| 2272 | -s "server hello, adding extended master secret extension" \ |
| 2273 | -c "found extended_master_secret extension" \ |
| 2274 | -c "session hash for extended master secret" \ |
| 2275 | -s "session hash for extended master secret" |
| 2276 | |
| 2277 | run_test "Extended Master Secret: client enabled, server disabled, client enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2278 | "$P_SRV debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
Jarno Lamsa | 41b3591 | 2019-06-10 15:51:11 +0300 | [diff] [blame] | 2279 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
| 2280 | 1 \ |
| 2281 | -c "client hello, adding extended_master_secret extension" \ |
| 2282 | -s "found extended master secret extension" \ |
| 2283 | -S "server hello, adding extended master secret extension" \ |
| 2284 | -C "found extended_master_secret extension" \ |
| 2285 | -c "Peer not offering extended master secret, while it is enforced" |
| 2286 | |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 2287 | run_test "Extended Master Secret enforced: client disabled, server enabled, server enforcing" \ |
Jarno Lamsa | 41b3591 | 2019-06-10 15:51:11 +0300 | [diff] [blame] | 2288 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2289 | "$P_CLI debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
Jarno Lamsa | 41b3591 | 2019-06-10 15:51:11 +0300 | [diff] [blame] | 2290 | 1 \ |
| 2291 | -C "client hello, adding extended_master_secret extension" \ |
| 2292 | -S "found extended master secret extension" \ |
| 2293 | -S "server hello, adding extended master secret extension" \ |
| 2294 | -C "found extended_master_secret extension" \ |
| 2295 | -s "Peer not offering extended master secret, while it is enforced" |
| 2296 | |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 2297 | run_test "Extended Master Secret: client enabled, server disabled, not enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2298 | "$P_SRV debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
| 2299 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=0" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2300 | 0 \ |
| 2301 | -c "client hello, adding extended_master_secret extension" \ |
| 2302 | -s "found extended master secret extension" \ |
| 2303 | -S "server hello, adding extended master secret extension" \ |
| 2304 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 9c5bcc9 | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2305 | -C "session hash for extended master secret" \ |
| 2306 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2307 | |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 2308 | run_test "Extended Master Secret: client disabled, server enabled, not enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2309 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=0" \ |
| 2310 | "$P_CLI debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2311 | 0 \ |
| 2312 | -C "client hello, adding extended_master_secret extension" \ |
| 2313 | -S "found extended master secret extension" \ |
| 2314 | -S "server hello, adding extended master secret extension" \ |
| 2315 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 9c5bcc9 | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2316 | -C "session hash for extended master secret" \ |
| 2317 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2318 | |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 2319 | run_test "Extended Master Secret: client disabled, server disabled" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2320 | "$P_SRV debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
| 2321 | "$P_CLI debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 2322 | 0 \ |
| 2323 | -C "client hello, adding extended_master_secret extension" \ |
| 2324 | -S "found extended master secret extension" \ |
| 2325 | -S "server hello, adding extended master secret extension" \ |
| 2326 | -C "found extended_master_secret extension" \ |
| 2327 | -C "session hash for extended master secret" \ |
| 2328 | -S "session hash for extended master secret" |
| 2329 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2331 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2332 | "$P_SRV debug_level=3 min_version=ssl3 extended_ms=1 enforce_extended_master_secret=0" \ |
| 2333 | "$P_CLI debug_level=3 force_version=ssl3 extended_ms=1 enforce_extended_master_secret=0" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2334 | 0 \ |
| 2335 | -C "client hello, adding extended_master_secret extension" \ |
| 2336 | -S "found extended master secret extension" \ |
| 2337 | -S "server hello, adding extended master secret extension" \ |
| 2338 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 9c5bcc9 | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2339 | -C "session hash for extended master secret" \ |
| 2340 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2341 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2342 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2343 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2344 | "$P_SRV debug_level=3 force_version=ssl3 extended_ms=1 enforce_extended_master_secret=0" \ |
| 2345 | "$P_CLI debug_level=3 min_version=ssl3 extended_ms=1 enforce_extended_master_secret=0" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2346 | 0 \ |
| 2347 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2348 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2349 | -S "server hello, adding extended master secret extension" \ |
| 2350 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 9c5bcc9 | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2351 | -C "session hash for extended master secret" \ |
| 2352 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2353 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2354 | # Tests for FALLBACK_SCSV |
| 2355 | |
| 2356 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2357 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2358 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2359 | 0 \ |
| 2360 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2361 | -S "received FALLBACK_SCSV" \ |
| 2362 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2363 | -C "is a fatal alert message (msg 86)" |
| 2364 | |
| 2365 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2366 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2367 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2368 | 0 \ |
| 2369 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2370 | -S "received FALLBACK_SCSV" \ |
| 2371 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2372 | -C "is a fatal alert message (msg 86)" |
| 2373 | |
| 2374 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2375 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2376 | "$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] | 2377 | 1 \ |
| 2378 | -c "adding FALLBACK_SCSV" \ |
| 2379 | -s "received FALLBACK_SCSV" \ |
| 2380 | -s "inapropriate fallback" \ |
| 2381 | -c "is a fatal alert message (msg 86)" |
| 2382 | |
| 2383 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2384 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2385 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2386 | 0 \ |
| 2387 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2388 | -s "received FALLBACK_SCSV" \ |
| 2389 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2390 | -C "is a fatal alert message (msg 86)" |
| 2391 | |
| 2392 | requires_openssl_with_fallback_scsv |
| 2393 | run_test "Fallback SCSV: default, openssl server" \ |
| 2394 | "$O_SRV" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 2395 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2396 | 0 \ |
| 2397 | -C "adding FALLBACK_SCSV" \ |
| 2398 | -C "is a fatal alert message (msg 86)" |
| 2399 | |
| 2400 | requires_openssl_with_fallback_scsv |
| 2401 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2402 | "$O_SRV" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 2403 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2404 | 1 \ |
| 2405 | -c "adding FALLBACK_SCSV" \ |
| 2406 | -c "is a fatal alert message (msg 86)" |
| 2407 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2408 | requires_openssl_with_fallback_scsv |
| 2409 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2410 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2411 | "$O_CLI -tls1_1" \ |
| 2412 | 0 \ |
| 2413 | -S "received FALLBACK_SCSV" \ |
| 2414 | -S "inapropriate fallback" |
| 2415 | |
| 2416 | requires_openssl_with_fallback_scsv |
| 2417 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2418 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2419 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2420 | 1 \ |
| 2421 | -s "received FALLBACK_SCSV" \ |
| 2422 | -s "inapropriate fallback" |
| 2423 | |
| 2424 | requires_openssl_with_fallback_scsv |
| 2425 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2426 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2427 | "$O_CLI -fallback_scsv" \ |
| 2428 | 0 \ |
| 2429 | -s "received FALLBACK_SCSV" \ |
| 2430 | -S "inapropriate fallback" |
| 2431 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2432 | # Test sending and receiving empty application data records |
| 2433 | |
| 2434 | run_test "Encrypt then MAC: empty application data record" \ |
| 2435 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2436 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2437 | 0 \ |
| 2438 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2439 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2440 | -c "0 bytes written in 1 fragments" |
| 2441 | |
| 2442 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 2443 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2444 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2445 | 0 \ |
| 2446 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2447 | -c "0 bytes written in 1 fragments" |
| 2448 | |
| 2449 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2450 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2451 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2452 | 0 \ |
| 2453 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2454 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2455 | -c "0 bytes written in 1 fragments" |
| 2456 | |
| 2457 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 2458 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2459 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2460 | 0 \ |
| 2461 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2462 | -c "0 bytes written in 1 fragments" |
| 2463 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2464 | ## ClientHello generated with |
| 2465 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2466 | ## then manually twiddling the ciphersuite list. |
| 2467 | ## The ClientHello content is spelled out below as a hex string as |
| 2468 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2469 | ## The expected response is an inappropriate_fallback alert. |
| 2470 | requires_openssl_with_fallback_scsv |
| 2471 | run_test "Fallback SCSV: beginning of list" \ |
| 2472 | "$P_SRV debug_level=2" \ |
| 2473 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2474 | 0 \ |
| 2475 | -s "received FALLBACK_SCSV" \ |
| 2476 | -s "inapropriate fallback" |
| 2477 | |
| 2478 | requires_openssl_with_fallback_scsv |
| 2479 | run_test "Fallback SCSV: end of list" \ |
| 2480 | "$P_SRV debug_level=2" \ |
| 2481 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2482 | 0 \ |
| 2483 | -s "received FALLBACK_SCSV" \ |
| 2484 | -s "inapropriate fallback" |
| 2485 | |
| 2486 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
Manuel Pégourié-Gonnard | f1c6ad4 | 2019-07-01 10:13:04 +0200 | [diff] [blame] | 2487 | ## Due to the way the clienthello was generated, this currently needs the |
| 2488 | ## server to have support for session tickets. |
| 2489 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2490 | requires_openssl_with_fallback_scsv |
| 2491 | run_test "Fallback SCSV: not in list" \ |
| 2492 | "$P_SRV debug_level=2" \ |
| 2493 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2494 | 0 \ |
| 2495 | -S "received FALLBACK_SCSV" \ |
| 2496 | -S "inapropriate fallback" |
| 2497 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2498 | # Tests for CBC 1/n-1 record splitting |
| 2499 | |
| 2500 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2501 | "$P_SRV" \ |
| 2502 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2503 | request_size=123 force_version=tls1_2" \ |
| 2504 | 0 \ |
| 2505 | -s "Read from client: 123 bytes read" \ |
| 2506 | -S "Read from client: 1 bytes read" \ |
| 2507 | -S "122 bytes read" |
| 2508 | |
| 2509 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2510 | "$P_SRV" \ |
| 2511 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2512 | request_size=123 force_version=tls1_1" \ |
| 2513 | 0 \ |
| 2514 | -s "Read from client: 123 bytes read" \ |
| 2515 | -S "Read from client: 1 bytes read" \ |
| 2516 | -S "122 bytes read" |
| 2517 | |
| 2518 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2519 | "$P_SRV" \ |
| 2520 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2521 | request_size=123 force_version=tls1" \ |
| 2522 | 0 \ |
| 2523 | -S "Read from client: 123 bytes read" \ |
| 2524 | -s "Read from client: 1 bytes read" \ |
| 2525 | -s "122 bytes read" |
| 2526 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2527 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2528 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2529 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2530 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2531 | request_size=123 force_version=ssl3" \ |
| 2532 | 0 \ |
| 2533 | -S "Read from client: 123 bytes read" \ |
| 2534 | -s "Read from client: 1 bytes read" \ |
| 2535 | -s "122 bytes read" |
| 2536 | |
| 2537 | 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] | 2538 | "$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] | 2539 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2540 | request_size=123 force_version=tls1" \ |
| 2541 | 0 \ |
| 2542 | -s "Read from client: 123 bytes read" \ |
| 2543 | -S "Read from client: 1 bytes read" \ |
| 2544 | -S "122 bytes read" |
| 2545 | |
| 2546 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2547 | "$P_SRV" \ |
| 2548 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2549 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2550 | 0 \ |
| 2551 | -s "Read from client: 123 bytes read" \ |
| 2552 | -S "Read from client: 1 bytes read" \ |
| 2553 | -S "122 bytes read" |
| 2554 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2555 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2556 | "$P_SRV nbio=2" \ |
| 2557 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2558 | request_size=123 force_version=tls1" \ |
| 2559 | 0 \ |
| 2560 | -S "Read from client: 123 bytes read" \ |
| 2561 | -s "Read from client: 1 bytes read" \ |
| 2562 | -s "122 bytes read" |
| 2563 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2564 | # Tests for Session Tickets |
| 2565 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2566 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2567 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2568 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2569 | "$P_SRV debug_level=3 tickets=1" \ |
| 2570 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2571 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2572 | -c "client hello, adding session ticket extension" \ |
| 2573 | -s "found session ticket extension" \ |
| 2574 | -s "server hello, adding session ticket extension" \ |
| 2575 | -c "found session_ticket extension" \ |
| 2576 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2577 | -S "session successfully restored from cache" \ |
| 2578 | -s "session successfully restored from ticket" \ |
| 2579 | -s "a session has been resumed" \ |
| 2580 | -c "a session has been resumed" |
| 2581 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2582 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2583 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2584 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2585 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2586 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2587 | 0 \ |
| 2588 | -c "client hello, adding session ticket extension" \ |
| 2589 | -s "found session ticket extension" \ |
| 2590 | -s "server hello, adding session ticket extension" \ |
| 2591 | -c "found session_ticket extension" \ |
| 2592 | -c "parse new session ticket" \ |
| 2593 | -S "session successfully restored from cache" \ |
| 2594 | -s "session successfully restored from ticket" \ |
| 2595 | -s "a session has been resumed" \ |
| 2596 | -c "a session has been resumed" |
| 2597 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2598 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2599 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2600 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2601 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2602 | "$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] | 2603 | 0 \ |
| 2604 | -c "client hello, adding session ticket extension" \ |
| 2605 | -s "found session ticket extension" \ |
| 2606 | -s "server hello, adding session ticket extension" \ |
| 2607 | -c "found session_ticket extension" \ |
| 2608 | -c "parse new session ticket" \ |
| 2609 | -S "session successfully restored from cache" \ |
| 2610 | -S "session successfully restored from ticket" \ |
| 2611 | -S "a session has been resumed" \ |
| 2612 | -C "a session has been resumed" |
| 2613 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2614 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2615 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 57a348b | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2616 | run_test "Session resume using tickets: session copy" \ |
| 2617 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2618 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2619 | 0 \ |
| 2620 | -c "client hello, adding session ticket extension" \ |
| 2621 | -s "found session ticket extension" \ |
| 2622 | -s "server hello, adding session ticket extension" \ |
| 2623 | -c "found session_ticket extension" \ |
| 2624 | -c "parse new session ticket" \ |
| 2625 | -S "session successfully restored from cache" \ |
| 2626 | -s "session successfully restored from ticket" \ |
| 2627 | -s "a session has been resumed" \ |
| 2628 | -c "a session has been resumed" |
| 2629 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2630 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2631 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2632 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2633 | "$O_SRV" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 2634 | "$P_CLI debug_level=3 tickets=1 reconnect=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2635 | 0 \ |
| 2636 | -c "client hello, adding session ticket extension" \ |
| 2637 | -c "found session_ticket extension" \ |
| 2638 | -c "parse new session ticket" \ |
| 2639 | -c "a session has been resumed" |
| 2640 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2641 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2642 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2643 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2644 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2645 | "( $O_CLI -sess_out $SESSION; \ |
| 2646 | $O_CLI -sess_in $SESSION; \ |
| 2647 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2648 | 0 \ |
| 2649 | -s "found session ticket extension" \ |
| 2650 | -s "server hello, adding session ticket extension" \ |
| 2651 | -S "session successfully restored from cache" \ |
| 2652 | -s "session successfully restored from ticket" \ |
| 2653 | -s "a session has been resumed" |
| 2654 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2655 | # Tests for Session Tickets with DTLS |
| 2656 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2657 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2658 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2659 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2660 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 2661 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2662 | 0 \ |
| 2663 | -c "client hello, adding session ticket extension" \ |
| 2664 | -s "found session ticket extension" \ |
| 2665 | -s "server hello, adding session ticket extension" \ |
| 2666 | -c "found session_ticket extension" \ |
| 2667 | -c "parse new session ticket" \ |
| 2668 | -S "session successfully restored from cache" \ |
| 2669 | -s "session successfully restored from ticket" \ |
| 2670 | -s "a session has been resumed" \ |
| 2671 | -c "a session has been resumed" |
| 2672 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2673 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2674 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2675 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2676 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2677 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2678 | 0 \ |
| 2679 | -c "client hello, adding session ticket extension" \ |
| 2680 | -s "found session ticket extension" \ |
| 2681 | -s "server hello, adding session ticket extension" \ |
| 2682 | -c "found session_ticket extension" \ |
| 2683 | -c "parse new session ticket" \ |
| 2684 | -S "session successfully restored from cache" \ |
| 2685 | -s "session successfully restored from ticket" \ |
| 2686 | -s "a session has been resumed" \ |
| 2687 | -c "a session has been resumed" |
| 2688 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2689 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2690 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2691 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2692 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2693 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 2694 | 0 \ |
| 2695 | -c "client hello, adding session ticket extension" \ |
| 2696 | -s "found session ticket extension" \ |
| 2697 | -s "server hello, adding session ticket extension" \ |
| 2698 | -c "found session_ticket extension" \ |
| 2699 | -c "parse new session ticket" \ |
| 2700 | -S "session successfully restored from cache" \ |
| 2701 | -S "session successfully restored from ticket" \ |
| 2702 | -S "a session has been resumed" \ |
| 2703 | -C "a session has been resumed" |
| 2704 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2705 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2706 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 57a348b | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2707 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2708 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2709 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_mode=0" \ |
| 2710 | 0 \ |
| 2711 | -c "client hello, adding session ticket extension" \ |
| 2712 | -s "found session ticket extension" \ |
| 2713 | -s "server hello, adding session ticket extension" \ |
| 2714 | -c "found session_ticket extension" \ |
| 2715 | -c "parse new session ticket" \ |
| 2716 | -S "session successfully restored from cache" \ |
| 2717 | -s "session successfully restored from ticket" \ |
| 2718 | -s "a session has been resumed" \ |
| 2719 | -c "a session has been resumed" |
| 2720 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2721 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2722 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2723 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2724 | "$O_SRV -dtls1" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 2725 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1 ca_file=data_files/test-ca2.crt" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2726 | 0 \ |
| 2727 | -c "client hello, adding session ticket extension" \ |
| 2728 | -c "found session_ticket extension" \ |
| 2729 | -c "parse new session ticket" \ |
| 2730 | -c "a session has been resumed" |
| 2731 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2732 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2733 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2734 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2735 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2736 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2737 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2738 | rm -f $SESSION )" \ |
| 2739 | 0 \ |
| 2740 | -s "found session ticket extension" \ |
| 2741 | -s "server hello, adding session ticket extension" \ |
| 2742 | -S "session successfully restored from cache" \ |
| 2743 | -s "session successfully restored from ticket" \ |
| 2744 | -s "a session has been resumed" |
| 2745 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2746 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2747 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2748 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2749 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2750 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2751 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2752 | "$P_SRV debug_level=3 tickets=0" \ |
| 2753 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2754 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2755 | -c "client hello, adding session ticket extension" \ |
| 2756 | -s "found session ticket extension" \ |
| 2757 | -S "server hello, adding session ticket extension" \ |
| 2758 | -C "found session_ticket extension" \ |
| 2759 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2760 | -s "session successfully restored from cache" \ |
| 2761 | -S "session successfully restored from ticket" \ |
| 2762 | -s "a session has been resumed" \ |
| 2763 | -c "a session has been resumed" |
| 2764 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2765 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2766 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2767 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2768 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2769 | "$P_SRV debug_level=3 tickets=1" \ |
| 2770 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2771 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2772 | -C "client hello, adding session ticket extension" \ |
| 2773 | -S "found session ticket extension" \ |
| 2774 | -S "server hello, adding session ticket extension" \ |
| 2775 | -C "found session_ticket extension" \ |
| 2776 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2777 | -s "session successfully restored from cache" \ |
| 2778 | -S "session successfully restored from ticket" \ |
| 2779 | -s "a session has been resumed" \ |
| 2780 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2781 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2782 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2783 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2784 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2785 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2786 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2787 | 0 \ |
| 2788 | -S "session successfully restored from cache" \ |
| 2789 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2790 | -S "a session has been resumed" \ |
| 2791 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2792 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2793 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2794 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2795 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2796 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2797 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2798 | 0 \ |
| 2799 | -s "session successfully restored from cache" \ |
| 2800 | -S "session successfully restored from ticket" \ |
| 2801 | -s "a session has been resumed" \ |
| 2802 | -c "a session has been resumed" |
| 2803 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2804 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2805 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2806 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2807 | "$P_SRV debug_level=3 tickets=0" \ |
| 2808 | "$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] | 2809 | 0 \ |
| 2810 | -s "session successfully restored from cache" \ |
| 2811 | -S "session successfully restored from ticket" \ |
| 2812 | -s "a session has been resumed" \ |
| 2813 | -c "a session has been resumed" |
| 2814 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2815 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2816 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2817 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2818 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2819 | "$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] | 2820 | 0 \ |
| 2821 | -S "session successfully restored from cache" \ |
| 2822 | -S "session successfully restored from ticket" \ |
| 2823 | -S "a session has been resumed" \ |
| 2824 | -C "a session has been resumed" |
| 2825 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2826 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2827 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2828 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2829 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2830 | "$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] | 2831 | 0 \ |
| 2832 | -s "session successfully restored from cache" \ |
| 2833 | -S "session successfully restored from ticket" \ |
| 2834 | -s "a session has been resumed" \ |
| 2835 | -c "a session has been resumed" |
| 2836 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2837 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2838 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 57a348b | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2839 | run_test "Session resume using cache: session copy" \ |
| 2840 | "$P_SRV debug_level=3 tickets=0" \ |
| 2841 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2842 | 0 \ |
| 2843 | -s "session successfully restored from cache" \ |
| 2844 | -S "session successfully restored from ticket" \ |
| 2845 | -s "a session has been resumed" \ |
| 2846 | -c "a session has been resumed" |
| 2847 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2848 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2849 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2850 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2851 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2852 | "( $O_CLI -sess_out $SESSION; \ |
| 2853 | $O_CLI -sess_in $SESSION; \ |
| 2854 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2855 | 0 \ |
| 2856 | -s "found session ticket extension" \ |
| 2857 | -S "server hello, adding session ticket extension" \ |
| 2858 | -s "session successfully restored from cache" \ |
| 2859 | -S "session successfully restored from ticket" \ |
| 2860 | -s "a session has been resumed" |
| 2861 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2862 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2863 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2864 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2865 | "$O_SRV" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 2866 | "$P_CLI debug_level=3 tickets=0 reconnect=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2867 | 0 \ |
| 2868 | -C "found session_ticket extension" \ |
| 2869 | -C "parse new session ticket" \ |
| 2870 | -c "a session has been resumed" |
| 2871 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2872 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2873 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2874 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2875 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2876 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2877 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2878 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2879 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2880 | 0 \ |
| 2881 | -c "client hello, adding session ticket extension" \ |
| 2882 | -s "found session ticket extension" \ |
| 2883 | -S "server hello, adding session ticket extension" \ |
| 2884 | -C "found session_ticket extension" \ |
| 2885 | -C "parse new session ticket" \ |
| 2886 | -s "session successfully restored from cache" \ |
| 2887 | -S "session successfully restored from ticket" \ |
| 2888 | -s "a session has been resumed" \ |
| 2889 | -c "a session has been resumed" |
| 2890 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2891 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 2892 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2893 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2894 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2895 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2896 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2897 | 0 \ |
| 2898 | -C "client hello, adding session ticket extension" \ |
| 2899 | -S "found session ticket extension" \ |
| 2900 | -S "server hello, adding session ticket extension" \ |
| 2901 | -C "found session_ticket extension" \ |
| 2902 | -C "parse new session ticket" \ |
| 2903 | -s "session successfully restored from cache" \ |
| 2904 | -S "session successfully restored from ticket" \ |
| 2905 | -s "a session has been resumed" \ |
| 2906 | -c "a session has been resumed" |
| 2907 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2908 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2909 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2910 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2911 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 2912 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2913 | 0 \ |
| 2914 | -S "session successfully restored from cache" \ |
| 2915 | -S "session successfully restored from ticket" \ |
| 2916 | -S "a session has been resumed" \ |
| 2917 | -C "a session has been resumed" |
| 2918 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2919 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2920 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2921 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2922 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 2923 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2924 | 0 \ |
| 2925 | -s "session successfully restored from cache" \ |
| 2926 | -S "session successfully restored from ticket" \ |
| 2927 | -s "a session has been resumed" \ |
| 2928 | -c "a session has been resumed" |
| 2929 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2930 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2931 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2932 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2933 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2934 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 2935 | 0 \ |
| 2936 | -s "session successfully restored from cache" \ |
| 2937 | -S "session successfully restored from ticket" \ |
| 2938 | -s "a session has been resumed" \ |
| 2939 | -c "a session has been resumed" |
| 2940 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2941 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2942 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2943 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2944 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 2945 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2946 | 0 \ |
| 2947 | -S "session successfully restored from cache" \ |
| 2948 | -S "session successfully restored from ticket" \ |
| 2949 | -S "a session has been resumed" \ |
| 2950 | -C "a session has been resumed" |
| 2951 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2952 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2953 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2954 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2955 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 2956 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2957 | 0 \ |
| 2958 | -s "session successfully restored from cache" \ |
| 2959 | -S "session successfully restored from ticket" \ |
| 2960 | -s "a session has been resumed" \ |
| 2961 | -c "a session has been resumed" |
| 2962 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2963 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2964 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 57a348b | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2965 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2966 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2967 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2968 | 0 \ |
| 2969 | -s "session successfully restored from cache" \ |
| 2970 | -S "session successfully restored from ticket" \ |
| 2971 | -s "a session has been resumed" \ |
| 2972 | -c "a session has been resumed" |
| 2973 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2974 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2975 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2976 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2977 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2978 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2979 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2980 | rm -f $SESSION )" \ |
| 2981 | 0 \ |
| 2982 | -s "found session ticket extension" \ |
| 2983 | -S "server hello, adding session ticket extension" \ |
| 2984 | -s "session successfully restored from cache" \ |
| 2985 | -S "session successfully restored from ticket" \ |
| 2986 | -s "a session has been resumed" |
| 2987 | |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 2988 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
| 2989 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2990 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2991 | "$O_SRV -dtls1" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 2992 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 ca_file=data_files/test-ca2.crt" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2993 | 0 \ |
| 2994 | -C "found session_ticket extension" \ |
| 2995 | -C "parse new session ticket" \ |
| 2996 | -c "a session has been resumed" |
| 2997 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2998 | # Tests for Max Fragment Length extension |
| 2999 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3000 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 3001 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 3002 | fi |
| 3003 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3004 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3005 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3006 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3007 | "$P_SRV debug_level=3" \ |
| 3008 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3009 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3010 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 3011 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3012 | -C "client hello, adding max_fragment_length extension" \ |
| 3013 | -S "found max fragment length extension" \ |
| 3014 | -S "server hello, max_fragment_length extension" \ |
| 3015 | -C "found max_fragment_length extension" |
| 3016 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3017 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3018 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3019 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3020 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3021 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3022 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3023 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 3024 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3025 | -C "client hello, adding max_fragment_length extension" \ |
| 3026 | -S "found max fragment length extension" \ |
| 3027 | -S "server hello, max_fragment_length extension" \ |
| 3028 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3029 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3030 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3031 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3032 | |
| 3033 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3034 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3035 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3036 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3037 | "$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] | 3038 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3039 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 3040 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3041 | -C "client hello, adding max_fragment_length extension" \ |
| 3042 | -S "found max fragment length extension" \ |
| 3043 | -S "server hello, max_fragment_length extension" \ |
| 3044 | -C "found max_fragment_length extension" \ |
| 3045 | -c "fragment larger than.*maximum " |
| 3046 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3047 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3048 | # (session fragment length will be 16384 regardless of mbedtls |
| 3049 | # content length configuration.) |
| 3050 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3051 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3052 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3053 | run_test "Max fragment length: disabled, larger message" \ |
| 3054 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3055 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3056 | 0 \ |
| 3057 | -C "Maximum fragment length is 16384" \ |
| 3058 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3059 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3060 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3061 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3062 | |
| 3063 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3064 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3065 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 3066 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3067 | "$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] | 3068 | 1 \ |
| 3069 | -C "Maximum fragment length is 16384" \ |
| 3070 | -S "Maximum fragment length is 16384" \ |
| 3071 | -c "fragment larger than.*maximum " |
| 3072 | |
| 3073 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3074 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3075 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3076 | "$P_SRV debug_level=3" \ |
| 3077 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3078 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3079 | -c "Maximum fragment length is 4096" \ |
| 3080 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3081 | -c "client hello, adding max_fragment_length extension" \ |
| 3082 | -s "found max fragment length extension" \ |
| 3083 | -s "server hello, max_fragment_length extension" \ |
| 3084 | -c "found max_fragment_length extension" |
| 3085 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3086 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3087 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3088 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3089 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3090 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3091 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3092 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3093 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3094 | -C "client hello, adding max_fragment_length extension" \ |
| 3095 | -S "found max fragment length extension" \ |
| 3096 | -S "server hello, max_fragment_length extension" \ |
| 3097 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3098 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3099 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3100 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3101 | requires_gnutls |
| 3102 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3103 | "$G_SRV" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3104 | "$P_CLI debug_level=3 max_frag_len=4096 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3105 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3106 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3107 | -c "client hello, adding max_fragment_length extension" \ |
| 3108 | -c "found max_fragment_length extension" |
| 3109 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3110 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3111 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3112 | run_test "Max fragment length: client, message just fits" \ |
| 3113 | "$P_SRV debug_level=3" \ |
| 3114 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3115 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3116 | -c "Maximum fragment length is 2048" \ |
| 3117 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3118 | -c "client hello, adding max_fragment_length extension" \ |
| 3119 | -s "found max fragment length extension" \ |
| 3120 | -s "server hello, max_fragment_length extension" \ |
| 3121 | -c "found max_fragment_length extension" \ |
| 3122 | -c "2048 bytes written in 1 fragments" \ |
| 3123 | -s "2048 bytes read" |
| 3124 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3125 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3126 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3127 | run_test "Max fragment length: client, larger message" \ |
| 3128 | "$P_SRV debug_level=3" \ |
| 3129 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3130 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3131 | -c "Maximum fragment length is 2048" \ |
| 3132 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3133 | -c "client hello, adding max_fragment_length extension" \ |
| 3134 | -s "found max fragment length extension" \ |
| 3135 | -s "server hello, max_fragment_length extension" \ |
| 3136 | -c "found max_fragment_length extension" \ |
| 3137 | -c "2345 bytes written in 2 fragments" \ |
| 3138 | -s "2048 bytes read" \ |
| 3139 | -s "297 bytes read" |
| 3140 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3141 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3142 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3143 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3144 | "$P_SRV debug_level=3 dtls=1" \ |
| 3145 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3146 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3147 | -c "Maximum fragment length is 2048" \ |
| 3148 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3149 | -c "client hello, adding max_fragment_length extension" \ |
| 3150 | -s "found max fragment length extension" \ |
| 3151 | -s "server hello, max_fragment_length extension" \ |
| 3152 | -c "found max_fragment_length extension" \ |
| 3153 | -c "fragment larger than.*maximum" |
| 3154 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3155 | # Tests for renegotiation |
| 3156 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3157 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3158 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3159 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3160 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3161 | 0 \ |
| 3162 | -C "client hello, adding renegotiation extension" \ |
| 3163 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3164 | -S "found renegotiation extension" \ |
| 3165 | -s "server hello, secure renegotiation extension" \ |
| 3166 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3167 | -C "=> renegotiate" \ |
| 3168 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3169 | -S "write hello request" |
| 3170 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3171 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3172 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3173 | "$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] | 3174 | "$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] | 3175 | 0 \ |
| 3176 | -c "client hello, adding renegotiation extension" \ |
| 3177 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3178 | -s "found renegotiation extension" \ |
| 3179 | -s "server hello, secure renegotiation extension" \ |
| 3180 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3181 | -c "=> renegotiate" \ |
| 3182 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3183 | -S "write hello request" |
| 3184 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3185 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3186 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3187 | "$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] | 3188 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3189 | 0 \ |
| 3190 | -c "client hello, adding renegotiation extension" \ |
| 3191 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3192 | -s "found renegotiation extension" \ |
| 3193 | -s "server hello, secure renegotiation extension" \ |
| 3194 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3195 | -c "=> renegotiate" \ |
| 3196 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3197 | -s "write hello request" |
| 3198 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3199 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3200 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3201 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3202 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3203 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3204 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3205 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3206 | 0 \ |
| 3207 | -c "client hello, adding renegotiation extension" \ |
| 3208 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3209 | -s "found renegotiation extension" \ |
| 3210 | -s "server hello, secure renegotiation extension" \ |
| 3211 | -c "found renegotiation extension" \ |
| 3212 | -c "=> renegotiate" \ |
| 3213 | -s "=> renegotiate" \ |
| 3214 | -S "write hello request" \ |
| 3215 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3216 | |
| 3217 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3218 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3219 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3220 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3221 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3222 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3223 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3224 | 0 \ |
| 3225 | -c "client hello, adding renegotiation extension" \ |
| 3226 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3227 | -s "found renegotiation extension" \ |
| 3228 | -s "server hello, secure renegotiation extension" \ |
| 3229 | -c "found renegotiation extension" \ |
| 3230 | -c "=> renegotiate" \ |
| 3231 | -s "=> renegotiate" \ |
| 3232 | -s "write hello request" \ |
| 3233 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3234 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3235 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3236 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3237 | "$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] | 3238 | "$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] | 3239 | 0 \ |
| 3240 | -c "client hello, adding renegotiation extension" \ |
| 3241 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3242 | -s "found renegotiation extension" \ |
| 3243 | -s "server hello, secure renegotiation extension" \ |
| 3244 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3245 | -c "=> renegotiate" \ |
| 3246 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3247 | -s "write hello request" |
| 3248 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3249 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3250 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3251 | "$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] | 3252 | "$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] | 3253 | 1 \ |
| 3254 | -c "client hello, adding renegotiation extension" \ |
| 3255 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3256 | -S "found renegotiation extension" \ |
| 3257 | -s "server hello, secure renegotiation extension" \ |
| 3258 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3259 | -c "=> renegotiate" \ |
| 3260 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3261 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3262 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3263 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3264 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3265 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3266 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3267 | "$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] | 3268 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3269 | 0 \ |
| 3270 | -C "client hello, adding renegotiation extension" \ |
| 3271 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3272 | -S "found renegotiation extension" \ |
| 3273 | -s "server hello, secure renegotiation extension" \ |
| 3274 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3275 | -C "=> renegotiate" \ |
| 3276 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3277 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3278 | -S "SSL - An unexpected message was received from our peer" \ |
| 3279 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3280 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3281 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3282 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3283 | "$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] | 3284 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3285 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3286 | 0 \ |
| 3287 | -C "client hello, adding renegotiation extension" \ |
| 3288 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3289 | -S "found renegotiation extension" \ |
| 3290 | -s "server hello, secure renegotiation extension" \ |
| 3291 | -c "found renegotiation extension" \ |
| 3292 | -C "=> renegotiate" \ |
| 3293 | -S "=> renegotiate" \ |
| 3294 | -s "write hello request" \ |
| 3295 | -S "SSL - An unexpected message was received from our peer" \ |
| 3296 | -S "failed" |
| 3297 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3298 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3299 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3300 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3301 | "$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] | 3302 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3303 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3304 | 0 \ |
| 3305 | -C "client hello, adding renegotiation extension" \ |
| 3306 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3307 | -S "found renegotiation extension" \ |
| 3308 | -s "server hello, secure renegotiation extension" \ |
| 3309 | -c "found renegotiation extension" \ |
| 3310 | -C "=> renegotiate" \ |
| 3311 | -S "=> renegotiate" \ |
| 3312 | -s "write hello request" \ |
| 3313 | -S "SSL - An unexpected message was received from our peer" \ |
| 3314 | -S "failed" |
| 3315 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3316 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3317 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3318 | "$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] | 3319 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3320 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3321 | 0 \ |
| 3322 | -C "client hello, adding renegotiation extension" \ |
| 3323 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3324 | -S "found renegotiation extension" \ |
| 3325 | -s "server hello, secure renegotiation extension" \ |
| 3326 | -c "found renegotiation extension" \ |
| 3327 | -C "=> renegotiate" \ |
| 3328 | -S "=> renegotiate" \ |
| 3329 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3330 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3331 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3332 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3333 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3334 | "$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] | 3335 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3336 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3337 | 0 \ |
| 3338 | -c "client hello, adding renegotiation extension" \ |
| 3339 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3340 | -s "found renegotiation extension" \ |
| 3341 | -s "server hello, secure renegotiation extension" \ |
| 3342 | -c "found renegotiation extension" \ |
| 3343 | -c "=> renegotiate" \ |
| 3344 | -s "=> renegotiate" \ |
| 3345 | -s "write hello request" \ |
| 3346 | -S "SSL - An unexpected message was received from our peer" \ |
| 3347 | -S "failed" |
| 3348 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3349 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3350 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3351 | "$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] | 3352 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3353 | 0 \ |
| 3354 | -C "client hello, adding renegotiation extension" \ |
| 3355 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3356 | -S "found renegotiation extension" \ |
| 3357 | -s "server hello, secure renegotiation extension" \ |
| 3358 | -c "found renegotiation extension" \ |
| 3359 | -S "record counter limit reached: renegotiate" \ |
| 3360 | -C "=> renegotiate" \ |
| 3361 | -S "=> renegotiate" \ |
| 3362 | -S "write hello request" \ |
| 3363 | -S "SSL - An unexpected message was received from our peer" \ |
| 3364 | -S "failed" |
| 3365 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3366 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3367 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3368 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3369 | "$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] | 3370 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3371 | 0 \ |
| 3372 | -c "client hello, adding renegotiation extension" \ |
| 3373 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3374 | -s "found renegotiation extension" \ |
| 3375 | -s "server hello, secure renegotiation extension" \ |
| 3376 | -c "found renegotiation extension" \ |
| 3377 | -s "record counter limit reached: renegotiate" \ |
| 3378 | -c "=> renegotiate" \ |
| 3379 | -s "=> renegotiate" \ |
| 3380 | -s "write hello request" \ |
| 3381 | -S "SSL - An unexpected message was received from our peer" \ |
| 3382 | -S "failed" |
| 3383 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3384 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3385 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3386 | "$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] | 3387 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3388 | 0 \ |
| 3389 | -c "client hello, adding renegotiation extension" \ |
| 3390 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3391 | -s "found renegotiation extension" \ |
| 3392 | -s "server hello, secure renegotiation extension" \ |
| 3393 | -c "found renegotiation extension" \ |
| 3394 | -s "record counter limit reached: renegotiate" \ |
| 3395 | -c "=> renegotiate" \ |
| 3396 | -s "=> renegotiate" \ |
| 3397 | -s "write hello request" \ |
| 3398 | -S "SSL - An unexpected message was received from our peer" \ |
| 3399 | -S "failed" |
| 3400 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3401 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3402 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3403 | "$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] | 3404 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3405 | 0 \ |
| 3406 | -C "client hello, adding renegotiation extension" \ |
| 3407 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3408 | -S "found renegotiation extension" \ |
| 3409 | -s "server hello, secure renegotiation extension" \ |
| 3410 | -c "found renegotiation extension" \ |
| 3411 | -S "record counter limit reached: renegotiate" \ |
| 3412 | -C "=> renegotiate" \ |
| 3413 | -S "=> renegotiate" \ |
| 3414 | -S "write hello request" \ |
| 3415 | -S "SSL - An unexpected message was received from our peer" \ |
| 3416 | -S "failed" |
| 3417 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3418 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3419 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3420 | "$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] | 3421 | "$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] | 3422 | 0 \ |
| 3423 | -c "client hello, adding renegotiation extension" \ |
| 3424 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3425 | -s "found renegotiation extension" \ |
| 3426 | -s "server hello, secure renegotiation extension" \ |
| 3427 | -c "found renegotiation extension" \ |
| 3428 | -c "=> renegotiate" \ |
| 3429 | -s "=> renegotiate" \ |
| 3430 | -S "write hello request" |
| 3431 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3432 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3433 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3434 | "$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] | 3435 | "$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] | 3436 | 0 \ |
| 3437 | -c "client hello, adding renegotiation extension" \ |
| 3438 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3439 | -s "found renegotiation extension" \ |
| 3440 | -s "server hello, secure renegotiation extension" \ |
| 3441 | -c "found renegotiation extension" \ |
| 3442 | -c "=> renegotiate" \ |
| 3443 | -s "=> renegotiate" \ |
| 3444 | -s "write hello request" |
| 3445 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3446 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3447 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3448 | "$O_SRV -www" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3449 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3450 | 0 \ |
| 3451 | -c "client hello, adding renegotiation extension" \ |
| 3452 | -c "found renegotiation extension" \ |
| 3453 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3454 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3455 | -C "error" \ |
| 3456 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3457 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3458 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3459 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3460 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3461 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3462 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3463 | 0 \ |
| 3464 | -c "client hello, adding renegotiation extension" \ |
| 3465 | -c "found renegotiation extension" \ |
| 3466 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3467 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3468 | -C "error" \ |
| 3469 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3470 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3471 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3472 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3473 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3474 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3475 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3476 | 1 \ |
| 3477 | -c "client hello, adding renegotiation extension" \ |
| 3478 | -C "found renegotiation extension" \ |
| 3479 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3480 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3481 | -c "error" \ |
| 3482 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3483 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3484 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3485 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3486 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3487 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3488 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3489 | allow_legacy=0" \ |
| 3490 | 1 \ |
| 3491 | -c "client hello, adding renegotiation extension" \ |
| 3492 | -C "found renegotiation extension" \ |
| 3493 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3494 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3495 | -c "error" \ |
| 3496 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3497 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3498 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3499 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3500 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3501 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3502 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3503 | allow_legacy=1" \ |
| 3504 | 0 \ |
| 3505 | -c "client hello, adding renegotiation extension" \ |
| 3506 | -C "found renegotiation extension" \ |
| 3507 | -c "=> renegotiate" \ |
| 3508 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3509 | -C "error" \ |
| 3510 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3511 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3512 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3513 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3514 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3515 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3516 | 0 \ |
| 3517 | -c "client hello, adding renegotiation extension" \ |
| 3518 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3519 | -s "found renegotiation extension" \ |
| 3520 | -s "server hello, secure renegotiation extension" \ |
| 3521 | -c "found renegotiation extension" \ |
| 3522 | -c "=> renegotiate" \ |
| 3523 | -s "=> renegotiate" \ |
| 3524 | -S "write hello request" |
| 3525 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3526 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3527 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3528 | "$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] | 3529 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3530 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3531 | 0 \ |
| 3532 | -c "client hello, adding renegotiation extension" \ |
| 3533 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3534 | -s "found renegotiation extension" \ |
| 3535 | -s "server hello, secure renegotiation extension" \ |
| 3536 | -c "found renegotiation extension" \ |
| 3537 | -c "=> renegotiate" \ |
| 3538 | -s "=> renegotiate" \ |
| 3539 | -s "write hello request" |
| 3540 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3541 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3542 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3543 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3544 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3545 | 0 \ |
| 3546 | -c "client hello, adding renegotiation extension" \ |
| 3547 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3548 | -s "found renegotiation extension" \ |
| 3549 | -s "server hello, secure renegotiation extension" \ |
| 3550 | -s "record counter limit reached: renegotiate" \ |
| 3551 | -c "=> renegotiate" \ |
| 3552 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3553 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3554 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3555 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3556 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3557 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3558 | "$G_SRV -u --mtu 4096" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3559 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3560 | 0 \ |
| 3561 | -c "client hello, adding renegotiation extension" \ |
| 3562 | -c "found renegotiation extension" \ |
| 3563 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3564 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3565 | -C "error" \ |
| 3566 | -s "Extra-header:" |
| 3567 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3568 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3569 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3570 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3571 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3572 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3573 | "$P_CLI debug_level=3 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3574 | 0 \ |
| 3575 | -c "found renegotiation extension" \ |
| 3576 | -C "error" \ |
| 3577 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3578 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3579 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3580 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3581 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3582 | "$P_CLI debug_level=3 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3583 | 0 \ |
| 3584 | -C "found renegotiation extension" \ |
| 3585 | -C "error" \ |
| 3586 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3587 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3588 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3589 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3590 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3591 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3592 | 1 \ |
| 3593 | -C "found renegotiation extension" \ |
| 3594 | -c "error" \ |
| 3595 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3596 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3597 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3598 | run_test "Renego ext: gnutls client strict, server default" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3599 | "$P_SRV debug_level=3 crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3600 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3601 | 0 \ |
| 3602 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3603 | -s "server hello, secure renegotiation extension" |
| 3604 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3605 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3606 | run_test "Renego ext: gnutls client unsafe, server default" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3607 | "$P_SRV debug_level=3 crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3608 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3609 | 0 \ |
| 3610 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3611 | -S "server hello, secure renegotiation extension" |
| 3612 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3613 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3614 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3615 | "$P_SRV debug_level=3 allow_legacy=-1 crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3616 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3617 | 1 \ |
| 3618 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3619 | -S "server hello, secure renegotiation extension" |
| 3620 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3621 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3622 | |
| 3623 | requires_gnutls |
| 3624 | run_test "DER format: no trailing bytes" \ |
| 3625 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3626 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3627 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3628 | 0 \ |
| 3629 | -c "Handshake was completed" \ |
| 3630 | |
| 3631 | requires_gnutls |
| 3632 | run_test "DER format: with a trailing zero byte" \ |
| 3633 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3634 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3635 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3636 | 0 \ |
| 3637 | -c "Handshake was completed" \ |
| 3638 | |
| 3639 | requires_gnutls |
| 3640 | run_test "DER format: with a trailing random byte" \ |
| 3641 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3642 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3643 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3644 | 0 \ |
| 3645 | -c "Handshake was completed" \ |
| 3646 | |
| 3647 | requires_gnutls |
| 3648 | run_test "DER format: with 2 trailing random bytes" \ |
| 3649 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3650 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3651 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3652 | 0 \ |
| 3653 | -c "Handshake was completed" \ |
| 3654 | |
| 3655 | requires_gnutls |
| 3656 | run_test "DER format: with 4 trailing random bytes" \ |
| 3657 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3658 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3659 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3660 | 0 \ |
| 3661 | -c "Handshake was completed" \ |
| 3662 | |
| 3663 | requires_gnutls |
| 3664 | run_test "DER format: with 8 trailing random bytes" \ |
| 3665 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3666 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3667 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3668 | 0 \ |
| 3669 | -c "Handshake was completed" \ |
| 3670 | |
| 3671 | requires_gnutls |
| 3672 | run_test "DER format: with 9 trailing random bytes" \ |
| 3673 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3674 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3675 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3676 | 0 \ |
| 3677 | -c "Handshake was completed" \ |
| 3678 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3679 | # Tests for auth_mode |
| 3680 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3681 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 3682 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3683 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3684 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3685 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3686 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3687 | 1 \ |
| 3688 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3689 | -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] | 3690 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3691 | -c "X509 - Certificate verification failed" |
| 3692 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3693 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 3694 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3695 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3696 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3697 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3698 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3699 | 0 \ |
| 3700 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3701 | -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] | 3702 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3703 | -C "X509 - Certificate verification failed" |
| 3704 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3705 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 3706 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3707 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3708 | "$P_SRV" \ |
| 3709 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3710 | 0 \ |
| 3711 | -c "x509_verify_cert() returned" \ |
| 3712 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3713 | -c "! Certificate verification flags"\ |
| 3714 | -C "! mbedtls_ssl_handshake returned" \ |
| 3715 | -C "X509 - Certificate verification failed" \ |
| 3716 | -C "SSL - No CA Chain is set, but required to operate" |
| 3717 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3718 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 3719 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3720 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3721 | "$P_SRV" \ |
| 3722 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3723 | 1 \ |
| 3724 | -c "x509_verify_cert() returned" \ |
| 3725 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3726 | -c "! Certificate verification flags"\ |
| 3727 | -c "! mbedtls_ssl_handshake returned" \ |
| 3728 | -c "SSL - No CA Chain is set, but required to operate" |
| 3729 | |
| 3730 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3731 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3732 | # the client informs the server about the supported curves - it does, though, in the |
| 3733 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3734 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3735 | # different means to have the server ignoring the client's supported curve list. |
| 3736 | |
| 3737 | requires_config_enabled MBEDTLS_ECP_C |
| 3738 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3739 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3740 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3741 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3742 | 1 \ |
| 3743 | -c "bad certificate (EC key curve)"\ |
| 3744 | -c "! Certificate verification flags"\ |
| 3745 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3746 | |
| 3747 | requires_config_enabled MBEDTLS_ECP_C |
| 3748 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3749 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3750 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3751 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3752 | 1 \ |
| 3753 | -c "bad certificate (EC key curve)"\ |
| 3754 | -c "! Certificate verification flags"\ |
| 3755 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3756 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3757 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3758 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3759 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3760 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3761 | 0 \ |
| 3762 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3763 | -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] | 3764 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3765 | -C "X509 - Certificate verification failed" |
| 3766 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3767 | run_test "Authentication: client SHA256, server required" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3768 | "$P_SRV auth_mode=required ca_file=data_files/test-ca2.crt" \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3769 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3770 | key_file=data_files/server6.key \ |
| 3771 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3772 | 0 \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3773 | -c "Supported Signature Algorithm found: 5," |
| 3774 | |
| 3775 | run_test "Authentication: client SHA384, server required" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3776 | "$P_SRV auth_mode=required ca_file=data_files/test-ca2.crt" \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3777 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3778 | key_file=data_files/server6.key \ |
| 3779 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3780 | 0 \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3781 | -c "Supported Signature Algorithm found: 5," |
| 3782 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3783 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3784 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 3785 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 3786 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 3787 | key_file=data_files/server5.key" \ |
| 3788 | 1 \ |
| 3789 | -S "skip write certificate request" \ |
| 3790 | -C "skip parse certificate request" \ |
| 3791 | -c "got a certificate request" \ |
| 3792 | -c "got no certificate to send" \ |
| 3793 | -S "x509_verify_cert() returned" \ |
| 3794 | -s "client has no certificate" \ |
| 3795 | -s "! mbedtls_ssl_handshake returned" \ |
| 3796 | -c "! mbedtls_ssl_handshake returned" \ |
| 3797 | -s "No client certification received from the client, but required by the authentication mode" |
| 3798 | |
| 3799 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3800 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3801 | "$P_CLI debug_level=3 crt_file=none \ |
| 3802 | key_file=data_files/server5.key" \ |
| 3803 | 1 \ |
| 3804 | -S "skip write certificate request" \ |
| 3805 | -C "skip parse certificate request" \ |
| 3806 | -c "got a certificate request" \ |
| 3807 | -c "= write certificate$" \ |
| 3808 | -C "skip write certificate$" \ |
| 3809 | -S "x509_verify_cert() returned" \ |
| 3810 | -s "client has no certificate" \ |
| 3811 | -s "! mbedtls_ssl_handshake returned" \ |
| 3812 | -c "! mbedtls_ssl_handshake returned" \ |
| 3813 | -s "No client certification received from the client, but required by the authentication mode" |
| 3814 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3815 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 3816 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3817 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3818 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3819 | "$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] | 3820 | key_file=data_files/server5.key" \ |
| 3821 | 1 \ |
| 3822 | -S "skip write certificate request" \ |
| 3823 | -C "skip parse certificate request" \ |
| 3824 | -c "got a certificate request" \ |
| 3825 | -C "skip write certificate" \ |
| 3826 | -C "skip write certificate verify" \ |
| 3827 | -S "skip parse certificate verify" \ |
| 3828 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3829 | -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] | 3830 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3831 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3832 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3833 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3834 | # We don't check that the client receives the alert because it might |
| 3835 | # detect that its write end of the connection is closed and abort |
| 3836 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3837 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3838 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 3839 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3840 | run_test "Authentication: client cert not trusted, server required" \ |
| 3841 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3842 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3843 | key_file=data_files/server5.key" \ |
| 3844 | 1 \ |
| 3845 | -S "skip write certificate request" \ |
| 3846 | -C "skip parse certificate request" \ |
| 3847 | -c "got a certificate request" \ |
| 3848 | -C "skip write certificate" \ |
| 3849 | -C "skip write certificate verify" \ |
| 3850 | -S "skip parse certificate verify" \ |
| 3851 | -s "x509_verify_cert() returned" \ |
| 3852 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3853 | -s "! mbedtls_ssl_handshake returned" \ |
| 3854 | -c "! mbedtls_ssl_handshake returned" \ |
| 3855 | -s "X509 - Certificate verification failed" |
| 3856 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3857 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 3858 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3859 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3860 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3861 | "$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] | 3862 | key_file=data_files/server5.key" \ |
| 3863 | 0 \ |
| 3864 | -S "skip write certificate request" \ |
| 3865 | -C "skip parse certificate request" \ |
| 3866 | -c "got a certificate request" \ |
| 3867 | -C "skip write certificate" \ |
| 3868 | -C "skip write certificate verify" \ |
| 3869 | -S "skip parse certificate verify" \ |
| 3870 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3871 | -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] | 3872 | -S "! mbedtls_ssl_handshake returned" \ |
| 3873 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3874 | -S "X509 - Certificate verification failed" |
| 3875 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3876 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3877 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3878 | "$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] | 3879 | key_file=data_files/server5.key" \ |
| 3880 | 0 \ |
| 3881 | -s "skip write certificate request" \ |
| 3882 | -C "skip parse certificate request" \ |
| 3883 | -c "got no certificate request" \ |
| 3884 | -c "skip write certificate" \ |
| 3885 | -c "skip write certificate verify" \ |
| 3886 | -s "skip parse certificate verify" \ |
| 3887 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3888 | -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] | 3889 | -S "! mbedtls_ssl_handshake returned" \ |
| 3890 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3891 | -S "X509 - Certificate verification failed" |
| 3892 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3893 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 3894 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3895 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3896 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3897 | "$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] | 3898 | 0 \ |
| 3899 | -S "skip write certificate request" \ |
| 3900 | -C "skip parse certificate request" \ |
| 3901 | -c "got a certificate request" \ |
| 3902 | -C "skip write certificate$" \ |
| 3903 | -C "got no certificate to send" \ |
| 3904 | -S "SSLv3 client has no certificate" \ |
| 3905 | -c "skip write certificate verify" \ |
| 3906 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3907 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3908 | -S "! mbedtls_ssl_handshake returned" \ |
| 3909 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3910 | -S "X509 - Certificate verification failed" |
| 3911 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3912 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 3913 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3914 | run_test "Authentication: openssl client no cert, server optional" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3915 | "$P_SRV debug_level=3 auth_mode=optional ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3916 | "$O_CLI" \ |
| 3917 | 0 \ |
| 3918 | -S "skip write certificate request" \ |
| 3919 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3920 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3921 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3922 | -S "X509 - Certificate verification failed" |
| 3923 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3924 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3925 | "$O_SRV -verify 10" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3926 | "$P_CLI debug_level=3 crt_file=none key_file=none ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3927 | 0 \ |
| 3928 | -C "skip parse certificate request" \ |
| 3929 | -c "got a certificate request" \ |
| 3930 | -C "skip write certificate$" \ |
| 3931 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3932 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3933 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3934 | run_test "Authentication: client no cert, openssl server required" \ |
| 3935 | "$O_SRV -Verify 10" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 3936 | "$P_CLI debug_level=3 crt_file=none key_file=none ca_file=data_files/test-ca2.crt" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3937 | 1 \ |
| 3938 | -C "skip parse certificate request" \ |
| 3939 | -c "got a certificate request" \ |
| 3940 | -C "skip write certificate$" \ |
| 3941 | -c "skip write certificate verify" \ |
| 3942 | -c "! mbedtls_ssl_handshake returned" |
| 3943 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3944 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Hanno Becker | b2c6383 | 2019-06-17 08:35:16 +0100 | [diff] [blame] | 3945 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 3946 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3947 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3948 | "$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] | 3949 | "$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] | 3950 | 0 \ |
| 3951 | -S "skip write certificate request" \ |
| 3952 | -C "skip parse certificate request" \ |
| 3953 | -c "got a certificate request" \ |
| 3954 | -C "skip write certificate$" \ |
| 3955 | -c "skip write certificate verify" \ |
| 3956 | -c "got no certificate to send" \ |
| 3957 | -s "SSLv3 client has no certificate" \ |
| 3958 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3959 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3960 | -S "! mbedtls_ssl_handshake returned" \ |
| 3961 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3962 | -S "X509 - Certificate verification failed" |
| 3963 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 3964 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 3965 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3966 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3967 | MAX_IM_CA='8' |
Arto Kinnunen | 7821352 | 2019-09-26 11:06:39 +0300 | [diff] [blame] | 3968 | MAX_IM_CA_CONFIG="$( get_config_value_or_default MBEDTLS_X509_MAX_INTERMEDIATE_CA )" |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3969 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3970 | if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then |
Hanno Becker | ab9a29b | 2019-09-24 16:14:39 +0100 | [diff] [blame] | 3971 | printf "The configuration file contains a value for the configuration of\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3972 | printf "MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script’s\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3973 | printf "test value of ${MAX_IM_CA}. \n" |
| 3974 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3975 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 3976 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3977 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3978 | |
| 3979 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3980 | fi |
| 3981 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3982 | requires_full_size_output_buffer |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3983 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3984 | run_test "Authentication: server max_int chain, client default" \ |
| 3985 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3986 | key_file=data_files/dir-maxpath/09.key" \ |
| 3987 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3988 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3989 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3990 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3991 | requires_full_size_output_buffer |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 3992 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3993 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3994 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3995 | key_file=data_files/dir-maxpath/10.key" \ |
| 3996 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3997 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3998 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3999 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4000 | requires_full_size_output_buffer |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 4001 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4002 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4003 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4004 | key_file=data_files/dir-maxpath/10.key" \ |
| 4005 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4006 | auth_mode=optional" \ |
| 4007 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4008 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4009 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4010 | requires_full_size_output_buffer |
Arto Kinnunen | 3f1190d | 2019-09-26 17:18:57 +0300 | [diff] [blame^] | 4011 | requires_config_value_at_least "MBEDTLS_SSL_MAX_CONTENT_LEN" 4096 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4012 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4013 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4014 | key_file=data_files/dir-maxpath/10.key" \ |
| 4015 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4016 | auth_mode=none" \ |
| 4017 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4018 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4019 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4020 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4021 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4022 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4023 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4024 | key_file=data_files/dir-maxpath/10.key" \ |
| 4025 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4026 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4027 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4028 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4029 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4030 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4031 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4032 | key_file=data_files/dir-maxpath/10.key" \ |
| 4033 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4034 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4035 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4036 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4037 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4038 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4039 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4040 | key_file=data_files/dir-maxpath/10.key" \ |
| 4041 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4042 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4043 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4044 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4045 | run_test "Authentication: client max_int chain, server required" \ |
| 4046 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4047 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4048 | key_file=data_files/dir-maxpath/09.key" \ |
| 4049 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4050 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4051 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4052 | # Tests for CA list in CertificateRequest messages |
| 4053 | |
| 4054 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4055 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/test-ca2.crt" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4056 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4057 | key_file=data_files/server6.key" \ |
| 4058 | 0 \ |
| 4059 | -s "requested DN" |
| 4060 | |
| 4061 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4062 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0 ca_file=data_files/test-ca2.crt" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4063 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4064 | key_file=data_files/server6.key" \ |
| 4065 | 0 \ |
| 4066 | -S "requested DN" |
| 4067 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4068 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4069 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4070 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4071 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4072 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4073 | key_file=data_files/server5.key" \ |
| 4074 | 1 \ |
| 4075 | -S "requested DN" \ |
| 4076 | -s "x509_verify_cert() returned" \ |
| 4077 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4078 | -s "! mbedtls_ssl_handshake returned" \ |
| 4079 | -c "! mbedtls_ssl_handshake returned" \ |
| 4080 | -s "X509 - Certificate verification failed" |
| 4081 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4082 | # Tests for certificate selection based on SHA verson |
| 4083 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4084 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4085 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4086 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4087 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4088 | key_file=data_files/server5.key \ |
| 4089 | crt_file2=data_files/server5-sha1.crt \ |
| 4090 | key_file2=data_files/server5.key" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4091 | "$P_CLI force_version=tls1_2 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4092 | 0 \ |
| 4093 | -c "signed using.*ECDSA with SHA256" \ |
| 4094 | -C "signed using.*ECDSA with SHA1" |
| 4095 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4096 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4097 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4098 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4099 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4100 | key_file=data_files/server5.key \ |
| 4101 | crt_file2=data_files/server5-sha1.crt \ |
| 4102 | key_file2=data_files/server5.key" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4103 | "$P_CLI force_version=tls1_1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4104 | 0 \ |
| 4105 | -C "signed using.*ECDSA with SHA256" \ |
| 4106 | -c "signed using.*ECDSA with SHA1" |
| 4107 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4108 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4109 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4110 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4111 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4112 | key_file=data_files/server5.key \ |
| 4113 | crt_file2=data_files/server5-sha1.crt \ |
| 4114 | key_file2=data_files/server5.key" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4115 | "$P_CLI force_version=tls1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4116 | 0 \ |
| 4117 | -C "signed using.*ECDSA with SHA256" \ |
| 4118 | -c "signed using.*ECDSA with SHA1" |
| 4119 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4120 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4121 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4122 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4123 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4124 | key_file=data_files/server5.key \ |
| 4125 | crt_file2=data_files/server6.crt \ |
| 4126 | key_file2=data_files/server6.key" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4127 | "$P_CLI force_version=tls1_1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4128 | 0 \ |
| 4129 | -c "serial number.*09" \ |
| 4130 | -c "signed using.*ECDSA with SHA256" \ |
| 4131 | -C "signed using.*ECDSA with SHA1" |
| 4132 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4133 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4134 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4135 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4136 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4137 | key_file=data_files/server6.key \ |
| 4138 | crt_file2=data_files/server5.crt \ |
| 4139 | key_file2=data_files/server5.key" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4140 | "$P_CLI force_version=tls1_1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4141 | 0 \ |
| 4142 | -c "serial number.*0A" \ |
| 4143 | -c "signed using.*ECDSA with SHA256" \ |
| 4144 | -C "signed using.*ECDSA with SHA1" |
| 4145 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4146 | # tests for SNI |
| 4147 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4148 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4149 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4150 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4151 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4152 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4153 | "$P_CLI server_name=localhost ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4154 | 0 \ |
| 4155 | -S "parse ServerName extension" \ |
| 4156 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4157 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4158 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4159 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4160 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4161 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4162 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4163 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4164 | 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] | 4165 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4166 | "$P_CLI server_name=localhost ca_file=data_files/test-ca.crt" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4167 | 0 \ |
| 4168 | -s "parse ServerName extension" \ |
| 4169 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4170 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4171 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4172 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4173 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4174 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4175 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4176 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4177 | 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] | 4178 | 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] | 4179 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4180 | 0 \ |
| 4181 | -s "parse ServerName extension" \ |
| 4182 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4183 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4184 | |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4185 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4186 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4187 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4188 | 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] | 4189 | 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] | 4190 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4191 | 1 \ |
| 4192 | -s "parse ServerName extension" \ |
| 4193 | -s "ssl_sni_wrapper() returned" \ |
| 4194 | -s "mbedtls_ssl_handshake returned" \ |
| 4195 | -c "mbedtls_ssl_handshake returned" \ |
| 4196 | -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] | 4197 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4198 | run_test "SNI: client auth no override: optional" \ |
| 4199 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4200 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4201 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4202 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4203 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4204 | -S "skip write certificate request" \ |
| 4205 | -C "skip parse certificate request" \ |
| 4206 | -c "got a certificate request" \ |
| 4207 | -C "skip write certificate" \ |
| 4208 | -C "skip write certificate verify" \ |
| 4209 | -S "skip parse certificate verify" |
| 4210 | |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4211 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4212 | run_test "SNI: client auth override: none -> optional" \ |
| 4213 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4214 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4215 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4216 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4217 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4218 | -S "skip write certificate request" \ |
| 4219 | -C "skip parse certificate request" \ |
| 4220 | -c "got a certificate request" \ |
| 4221 | -C "skip write certificate" \ |
| 4222 | -C "skip write certificate verify" \ |
| 4223 | -S "skip parse certificate verify" |
| 4224 | |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4225 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4226 | run_test "SNI: client auth override: optional -> none" \ |
| 4227 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4228 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4229 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4230 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4231 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4232 | -s "skip write certificate request" \ |
| 4233 | -C "skip parse certificate request" \ |
| 4234 | -c "got no certificate request" \ |
| 4235 | -c "skip write certificate" \ |
| 4236 | -c "skip write certificate verify" \ |
| 4237 | -s "skip parse certificate verify" |
| 4238 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4239 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4240 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4241 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4242 | run_test "SNI: CA no override" \ |
| 4243 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4244 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4245 | ca_file=data_files/test-ca.crt \ |
| 4246 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4247 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4248 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4249 | 1 \ |
| 4250 | -S "skip write certificate request" \ |
| 4251 | -C "skip parse certificate request" \ |
| 4252 | -c "got a certificate request" \ |
| 4253 | -C "skip write certificate" \ |
| 4254 | -C "skip write certificate verify" \ |
| 4255 | -S "skip parse certificate verify" \ |
| 4256 | -s "x509_verify_cert() returned" \ |
| 4257 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4258 | -S "The certificate has been revoked (is on a CRL)" |
| 4259 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4260 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4261 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4262 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4263 | run_test "SNI: CA override" \ |
| 4264 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4265 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4266 | ca_file=data_files/test-ca.crt \ |
| 4267 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4268 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4269 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4270 | 0 \ |
| 4271 | -S "skip write certificate request" \ |
| 4272 | -C "skip parse certificate request" \ |
| 4273 | -c "got a certificate request" \ |
| 4274 | -C "skip write certificate" \ |
| 4275 | -C "skip write certificate verify" \ |
| 4276 | -S "skip parse certificate verify" \ |
| 4277 | -S "x509_verify_cert() returned" \ |
| 4278 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4279 | -S "The certificate has been revoked (is on a CRL)" |
| 4280 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4281 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4282 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4283 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4284 | run_test "SNI: CA override with CRL" \ |
| 4285 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4286 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4287 | ca_file=data_files/test-ca.crt \ |
| 4288 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4289 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4290 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4291 | 1 \ |
| 4292 | -S "skip write certificate request" \ |
| 4293 | -C "skip parse certificate request" \ |
| 4294 | -c "got a certificate request" \ |
| 4295 | -C "skip write certificate" \ |
| 4296 | -C "skip write certificate verify" \ |
| 4297 | -S "skip parse certificate verify" \ |
| 4298 | -s "x509_verify_cert() returned" \ |
| 4299 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4300 | -s "The certificate has been revoked (is on a CRL)" |
| 4301 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4302 | # Tests for SNI and DTLS |
| 4303 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4304 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4305 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4306 | run_test "SNI: DTLS, no SNI callback" \ |
| 4307 | "$P_SRV debug_level=3 dtls=1 \ |
| 4308 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4309 | "$P_CLI server_name=localhost dtls=1 ca_file=data_files/test-ca2.crt" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4310 | 0 \ |
| 4311 | -S "parse ServerName extension" \ |
| 4312 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4313 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4314 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4315 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4316 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4317 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4318 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4319 | "$P_SRV debug_level=3 dtls=1 \ |
| 4320 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4321 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4322 | "$P_CLI server_name=localhost dtls=1 ca_file=data_files/test-ca.crt" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4323 | 0 \ |
| 4324 | -s "parse ServerName extension" \ |
| 4325 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4326 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4327 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4328 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4329 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4330 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4331 | run_test "SNI: DTLS, matching cert 2" \ |
| 4332 | "$P_SRV debug_level=3 dtls=1 \ |
| 4333 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4334 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4335 | "$P_CLI server_name=polarssl.example dtls=1 ca_file=data_files/test-ca.crt" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4336 | 0 \ |
| 4337 | -s "parse ServerName extension" \ |
| 4338 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4339 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4340 | |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4341 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4342 | run_test "SNI: DTLS, no matching cert" \ |
| 4343 | "$P_SRV debug_level=3 dtls=1 \ |
| 4344 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4345 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4346 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4347 | 1 \ |
| 4348 | -s "parse ServerName extension" \ |
| 4349 | -s "ssl_sni_wrapper() returned" \ |
| 4350 | -s "mbedtls_ssl_handshake returned" \ |
| 4351 | -c "mbedtls_ssl_handshake returned" \ |
| 4352 | -c "SSL - A fatal alert message was received from our peer" |
| 4353 | |
| 4354 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4355 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4356 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4357 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4358 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4359 | 0 \ |
| 4360 | -S "skip write certificate request" \ |
| 4361 | -C "skip parse certificate request" \ |
| 4362 | -c "got a certificate request" \ |
| 4363 | -C "skip write certificate" \ |
| 4364 | -C "skip write certificate verify" \ |
| 4365 | -S "skip parse certificate verify" |
| 4366 | |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4367 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4368 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4369 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4370 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4371 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4372 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4373 | 0 \ |
| 4374 | -S "skip write certificate request" \ |
| 4375 | -C "skip parse certificate request" \ |
| 4376 | -c "got a certificate request" \ |
| 4377 | -C "skip write certificate" \ |
| 4378 | -C "skip write certificate verify" \ |
| 4379 | -S "skip parse certificate verify" |
| 4380 | |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4381 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4382 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4383 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4384 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4385 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4386 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4387 | 0 \ |
| 4388 | -s "skip write certificate request" \ |
| 4389 | -C "skip parse certificate request" \ |
| 4390 | -c "got no certificate request" \ |
| 4391 | -c "skip write certificate" \ |
| 4392 | -c "skip write certificate verify" \ |
| 4393 | -s "skip parse certificate verify" |
| 4394 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4395 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4396 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4397 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4398 | run_test "SNI: DTLS, CA no override" \ |
| 4399 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4400 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4401 | ca_file=data_files/test-ca.crt \ |
| 4402 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4403 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4404 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4405 | 1 \ |
| 4406 | -S "skip write certificate request" \ |
| 4407 | -C "skip parse certificate request" \ |
| 4408 | -c "got a certificate request" \ |
| 4409 | -C "skip write certificate" \ |
| 4410 | -C "skip write certificate verify" \ |
| 4411 | -S "skip parse certificate verify" \ |
| 4412 | -s "x509_verify_cert() returned" \ |
| 4413 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4414 | -S "The certificate has been revoked (is on a CRL)" |
| 4415 | |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4416 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4417 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4418 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4419 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4420 | ca_file=data_files/test-ca.crt \ |
| 4421 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4422 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4423 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4424 | 0 \ |
| 4425 | -S "skip write certificate request" \ |
| 4426 | -C "skip parse certificate request" \ |
| 4427 | -c "got a certificate request" \ |
| 4428 | -C "skip write certificate" \ |
| 4429 | -C "skip write certificate verify" \ |
| 4430 | -S "skip parse certificate verify" \ |
| 4431 | -S "x509_verify_cert() returned" \ |
| 4432 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4433 | -S "The certificate has been revoked (is on a CRL)" |
| 4434 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4435 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 4436 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4437 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4438 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4439 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4440 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4441 | ca_file=data_files/test-ca.crt \ |
| 4442 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4443 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4444 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4445 | 1 \ |
| 4446 | -S "skip write certificate request" \ |
| 4447 | -C "skip parse certificate request" \ |
| 4448 | -c "got a certificate request" \ |
| 4449 | -C "skip write certificate" \ |
| 4450 | -C "skip write certificate verify" \ |
| 4451 | -S "skip parse certificate verify" \ |
| 4452 | -s "x509_verify_cert() returned" \ |
| 4453 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4454 | -s "The certificate has been revoked (is on a CRL)" |
| 4455 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4456 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4457 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4458 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4459 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4460 | "$P_CLI nbio=2 tickets=0" \ |
| 4461 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4462 | -S "mbedtls_ssl_handshake returned" \ |
| 4463 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4464 | -c "Read from server: .* bytes read" |
| 4465 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4466 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4467 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4468 | "$P_CLI nbio=2 tickets=0" \ |
| 4469 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4470 | -S "mbedtls_ssl_handshake returned" \ |
| 4471 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4472 | -c "Read from server: .* bytes read" |
| 4473 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4474 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4475 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4476 | "$P_CLI nbio=2 tickets=1" \ |
| 4477 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4478 | -S "mbedtls_ssl_handshake returned" \ |
| 4479 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4480 | -c "Read from server: .* bytes read" |
| 4481 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4482 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4483 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4484 | "$P_CLI nbio=2 tickets=1" \ |
| 4485 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4486 | -S "mbedtls_ssl_handshake returned" \ |
| 4487 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4488 | -c "Read from server: .* bytes read" |
| 4489 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4490 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4491 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4492 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4493 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4494 | -S "mbedtls_ssl_handshake returned" \ |
| 4495 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4496 | -c "Read from server: .* bytes read" |
| 4497 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4498 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4499 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4500 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4501 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4502 | -S "mbedtls_ssl_handshake returned" \ |
| 4503 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4504 | -c "Read from server: .* bytes read" |
| 4505 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4506 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4507 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4508 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4509 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4510 | -S "mbedtls_ssl_handshake returned" \ |
| 4511 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4512 | -c "Read from server: .* bytes read" |
| 4513 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4514 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4515 | |
| 4516 | run_test "Event-driven I/O: basic handshake" \ |
| 4517 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4518 | "$P_CLI event=1 tickets=0" \ |
| 4519 | 0 \ |
| 4520 | -S "mbedtls_ssl_handshake returned" \ |
| 4521 | -C "mbedtls_ssl_handshake returned" \ |
| 4522 | -c "Read from server: .* bytes read" |
| 4523 | |
| 4524 | run_test "Event-driven I/O: client auth" \ |
| 4525 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4526 | "$P_CLI event=1 tickets=0" \ |
| 4527 | 0 \ |
| 4528 | -S "mbedtls_ssl_handshake returned" \ |
| 4529 | -C "mbedtls_ssl_handshake returned" \ |
| 4530 | -c "Read from server: .* bytes read" |
| 4531 | |
| 4532 | run_test "Event-driven I/O: ticket" \ |
| 4533 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4534 | "$P_CLI event=1 tickets=1" \ |
| 4535 | 0 \ |
| 4536 | -S "mbedtls_ssl_handshake returned" \ |
| 4537 | -C "mbedtls_ssl_handshake returned" \ |
| 4538 | -c "Read from server: .* bytes read" |
| 4539 | |
| 4540 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4541 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4542 | "$P_CLI event=1 tickets=1" \ |
| 4543 | 0 \ |
| 4544 | -S "mbedtls_ssl_handshake returned" \ |
| 4545 | -C "mbedtls_ssl_handshake returned" \ |
| 4546 | -c "Read from server: .* bytes read" |
| 4547 | |
| 4548 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4549 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4550 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4551 | 0 \ |
| 4552 | -S "mbedtls_ssl_handshake returned" \ |
| 4553 | -C "mbedtls_ssl_handshake returned" \ |
| 4554 | -c "Read from server: .* bytes read" |
| 4555 | |
| 4556 | run_test "Event-driven I/O: ticket + resume" \ |
| 4557 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4558 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4559 | 0 \ |
| 4560 | -S "mbedtls_ssl_handshake returned" \ |
| 4561 | -C "mbedtls_ssl_handshake returned" \ |
| 4562 | -c "Read from server: .* bytes read" |
| 4563 | |
| 4564 | run_test "Event-driven I/O: session-id resume" \ |
| 4565 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4566 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4567 | 0 \ |
| 4568 | -S "mbedtls_ssl_handshake returned" \ |
| 4569 | -C "mbedtls_ssl_handshake returned" \ |
| 4570 | -c "Read from server: .* bytes read" |
| 4571 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4572 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4573 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4574 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4575 | 0 \ |
| 4576 | -c "Read from server: .* bytes read" |
| 4577 | |
| 4578 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4579 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4580 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4581 | 0 \ |
| 4582 | -c "Read from server: .* bytes read" |
| 4583 | |
| 4584 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4585 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4586 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4587 | 0 \ |
| 4588 | -c "Read from server: .* bytes read" |
| 4589 | |
| 4590 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4591 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4592 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4593 | 0 \ |
| 4594 | -c "Read from server: .* bytes read" |
| 4595 | |
| 4596 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4597 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4598 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4599 | 0 \ |
| 4600 | -c "Read from server: .* bytes read" |
| 4601 | |
| 4602 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4603 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4604 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4605 | 0 \ |
| 4606 | -c "Read from server: .* bytes read" |
| 4607 | |
| 4608 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4609 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4610 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4611 | 0 \ |
| 4612 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4613 | |
| 4614 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4615 | # During session resumption, the client will send its ApplicationData record |
| 4616 | # within the same datagram as the Finished messages. In this situation, the |
| 4617 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4618 | # because the ApplicationData request has already been queued internally. |
| 4619 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4620 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4621 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4622 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4623 | 0 \ |
| 4624 | -c "Read from server: .* bytes read" |
| 4625 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4626 | # Tests for version negotiation |
| 4627 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4628 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4629 | "$P_SRV" \ |
| 4630 | "$P_CLI" \ |
| 4631 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4632 | -S "mbedtls_ssl_handshake returned" \ |
| 4633 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4634 | -s "Protocol is TLSv1.2" \ |
| 4635 | -c "Protocol is TLSv1.2" |
| 4636 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4637 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4638 | "$P_SRV" \ |
| 4639 | "$P_CLI max_version=tls1_1" \ |
| 4640 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4641 | -S "mbedtls_ssl_handshake returned" \ |
| 4642 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4643 | -s "Protocol is TLSv1.1" \ |
| 4644 | -c "Protocol is TLSv1.1" |
| 4645 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4646 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4647 | "$P_SRV max_version=tls1_1" \ |
| 4648 | "$P_CLI" \ |
| 4649 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4650 | -S "mbedtls_ssl_handshake returned" \ |
| 4651 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4652 | -s "Protocol is TLSv1.1" \ |
| 4653 | -c "Protocol is TLSv1.1" |
| 4654 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4655 | 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] | 4656 | "$P_SRV max_version=tls1_1" \ |
| 4657 | "$P_CLI max_version=tls1_1" \ |
| 4658 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4659 | -S "mbedtls_ssl_handshake returned" \ |
| 4660 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4661 | -s "Protocol is TLSv1.1" \ |
| 4662 | -c "Protocol is TLSv1.1" |
| 4663 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4664 | 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] | 4665 | "$P_SRV min_version=tls1_1" \ |
| 4666 | "$P_CLI max_version=tls1_1" \ |
| 4667 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4668 | -S "mbedtls_ssl_handshake returned" \ |
| 4669 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4670 | -s "Protocol is TLSv1.1" \ |
| 4671 | -c "Protocol is TLSv1.1" |
| 4672 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4673 | 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] | 4674 | "$P_SRV max_version=tls1_1" \ |
| 4675 | "$P_CLI min_version=tls1_1" \ |
| 4676 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4677 | -S "mbedtls_ssl_handshake returned" \ |
| 4678 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4679 | -s "Protocol is TLSv1.1" \ |
| 4680 | -c "Protocol is TLSv1.1" |
| 4681 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4682 | 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] | 4683 | "$P_SRV max_version=tls1_1" \ |
| 4684 | "$P_CLI min_version=tls1_2" \ |
| 4685 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4686 | -s "mbedtls_ssl_handshake returned" \ |
| 4687 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4688 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 4689 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4690 | run_test "Version check: srv min 1.2, cli max 1.1 -> fail" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4691 | "$P_SRV min_version=tls1_2" \ |
| 4692 | "$P_CLI max_version=tls1_1" \ |
| 4693 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4694 | -s "mbedtls_ssl_handshake returned" \ |
| 4695 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4696 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 4697 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4698 | # Tests for ALPN extension |
| 4699 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4700 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4701 | "$P_SRV debug_level=3" \ |
| 4702 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4703 | 0 \ |
| 4704 | -C "client hello, adding alpn extension" \ |
| 4705 | -S "found alpn extension" \ |
| 4706 | -C "got an alert message, type: \\[2:120]" \ |
| 4707 | -S "server hello, adding alpn extension" \ |
| 4708 | -C "found alpn extension " \ |
| 4709 | -C "Application Layer Protocol is" \ |
| 4710 | -S "Application Layer Protocol is" |
| 4711 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4712 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4713 | "$P_SRV debug_level=3" \ |
| 4714 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4715 | 0 \ |
| 4716 | -c "client hello, adding alpn extension" \ |
| 4717 | -s "found alpn extension" \ |
| 4718 | -C "got an alert message, type: \\[2:120]" \ |
| 4719 | -S "server hello, adding alpn extension" \ |
| 4720 | -C "found alpn extension " \ |
| 4721 | -c "Application Layer Protocol is (none)" \ |
| 4722 | -S "Application Layer Protocol is" |
| 4723 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4724 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4725 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4726 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4727 | 0 \ |
| 4728 | -C "client hello, adding alpn extension" \ |
| 4729 | -S "found alpn extension" \ |
| 4730 | -C "got an alert message, type: \\[2:120]" \ |
| 4731 | -S "server hello, adding alpn extension" \ |
| 4732 | -C "found alpn extension " \ |
| 4733 | -C "Application Layer Protocol is" \ |
| 4734 | -s "Application Layer Protocol is (none)" |
| 4735 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4736 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4737 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4738 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4739 | 0 \ |
| 4740 | -c "client hello, adding alpn extension" \ |
| 4741 | -s "found alpn extension" \ |
| 4742 | -C "got an alert message, type: \\[2:120]" \ |
| 4743 | -s "server hello, adding alpn extension" \ |
| 4744 | -c "found alpn extension" \ |
| 4745 | -c "Application Layer Protocol is abc" \ |
| 4746 | -s "Application Layer Protocol is abc" |
| 4747 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4748 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4749 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4750 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4751 | 0 \ |
| 4752 | -c "client hello, adding alpn extension" \ |
| 4753 | -s "found alpn extension" \ |
| 4754 | -C "got an alert message, type: \\[2:120]" \ |
| 4755 | -s "server hello, adding alpn extension" \ |
| 4756 | -c "found alpn extension" \ |
| 4757 | -c "Application Layer Protocol is abc" \ |
| 4758 | -s "Application Layer Protocol is abc" |
| 4759 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4760 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4761 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4762 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4763 | 0 \ |
| 4764 | -c "client hello, adding alpn extension" \ |
| 4765 | -s "found alpn extension" \ |
| 4766 | -C "got an alert message, type: \\[2:120]" \ |
| 4767 | -s "server hello, adding alpn extension" \ |
| 4768 | -c "found alpn extension" \ |
| 4769 | -c "Application Layer Protocol is 1234" \ |
| 4770 | -s "Application Layer Protocol is 1234" |
| 4771 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4772 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4773 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4774 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4775 | 1 \ |
| 4776 | -c "client hello, adding alpn extension" \ |
| 4777 | -s "found alpn extension" \ |
| 4778 | -c "got an alert message, type: \\[2:120]" \ |
| 4779 | -S "server hello, adding alpn extension" \ |
| 4780 | -C "found alpn extension" \ |
| 4781 | -C "Application Layer Protocol is 1234" \ |
| 4782 | -S "Application Layer Protocol is 1234" |
| 4783 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4784 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4785 | # Tests for keyUsage in leaf certificates, part 1: |
| 4786 | # server-side certificate/suite selection |
| 4787 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4788 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4789 | "$P_SRV key_file=data_files/server2.key \ |
| 4790 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4791 | "$P_CLI" \ |
| 4792 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4793 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4794 | |
| 4795 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4796 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4797 | "$P_SRV key_file=data_files/server2.key \ |
| 4798 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4799 | "$P_CLI" \ |
| 4800 | 0 \ |
| 4801 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4802 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4803 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4804 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4805 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4806 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4807 | 1 \ |
| 4808 | -C "Ciphersuite is " |
| 4809 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4810 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4811 | "$P_SRV key_file=data_files/server5.key \ |
| 4812 | crt_file=data_files/server5.ku-ds.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4813 | "$P_CLI ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4814 | 0 \ |
| 4815 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4816 | |
| 4817 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4818 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4819 | "$P_SRV key_file=data_files/server5.key \ |
| 4820 | crt_file=data_files/server5.ku-ka.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4821 | "$P_CLI ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4822 | 0 \ |
| 4823 | -c "Ciphersuite is TLS-ECDH-" |
| 4824 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4825 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4826 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4827 | crt_file=data_files/server5.ku-ke.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4828 | "$P_CLI ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4829 | 1 \ |
| 4830 | -C "Ciphersuite is " |
| 4831 | |
| 4832 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4833 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4835 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4836 | "$O_SRV -key data_files/server2.key \ |
| 4837 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4838 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4839 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4840 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4841 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4842 | -C "Processing of the Certificate handshake message failed" \ |
| 4843 | -c "Ciphersuite is TLS-" |
| 4844 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4845 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4846 | "$O_SRV -key data_files/server2.key \ |
| 4847 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4848 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4849 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4850 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4851 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4852 | -C "Processing of the Certificate handshake message failed" \ |
| 4853 | -c "Ciphersuite is TLS-" |
| 4854 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4855 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4856 | "$O_SRV -key data_files/server2.key \ |
| 4857 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4858 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4859 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4860 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4861 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4862 | -C "Processing of the Certificate handshake message failed" \ |
| 4863 | -c "Ciphersuite is TLS-" |
| 4864 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4865 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4866 | "$O_SRV -key data_files/server2.key \ |
| 4867 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4868 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4869 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4870 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4871 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4872 | -c "Processing of the Certificate handshake message failed" \ |
| 4873 | -C "Ciphersuite is TLS-" |
| 4874 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4875 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4876 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4877 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4878 | "$O_SRV -key data_files/server2.key \ |
| 4879 | -cert data_files/server2.ku-ke.crt" \ |
| 4880 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4881 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4882 | 0 \ |
| 4883 | -c "bad certificate (usage extensions)" \ |
| 4884 | -C "Processing of the Certificate handshake message failed" \ |
| 4885 | -c "Ciphersuite is TLS-" \ |
| 4886 | -c "! Usage does not match the keyUsage extension" |
| 4887 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4888 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4889 | "$O_SRV -key data_files/server2.key \ |
| 4890 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4891 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4892 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4893 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4894 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4895 | -C "Processing of the Certificate handshake message failed" \ |
| 4896 | -c "Ciphersuite is TLS-" |
| 4897 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4898 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4899 | "$O_SRV -key data_files/server2.key \ |
| 4900 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4901 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4902 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4903 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4904 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4905 | -c "Processing of the Certificate handshake message failed" \ |
| 4906 | -C "Ciphersuite is TLS-" |
| 4907 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4908 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 4909 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4910 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4911 | "$O_SRV -key data_files/server2.key \ |
| 4912 | -cert data_files/server2.ku-ds.crt" \ |
| 4913 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4914 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4915 | 0 \ |
| 4916 | -c "bad certificate (usage extensions)" \ |
| 4917 | -C "Processing of the Certificate handshake message failed" \ |
| 4918 | -c "Ciphersuite is TLS-" \ |
| 4919 | -c "! Usage does not match the keyUsage extension" |
| 4920 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4921 | # Tests for keyUsage in leaf certificates, part 3: |
| 4922 | # server-side checking of client cert |
| 4923 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4924 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4925 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4926 | "$O_CLI -key data_files/server2.key \ |
| 4927 | -cert data_files/server2.ku-ds.crt" \ |
| 4928 | 0 \ |
| 4929 | -S "bad certificate (usage extensions)" \ |
| 4930 | -S "Processing of the Certificate handshake message failed" |
| 4931 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4932 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4933 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4934 | "$O_CLI -key data_files/server2.key \ |
| 4935 | -cert data_files/server2.ku-ke.crt" \ |
| 4936 | 0 \ |
| 4937 | -s "bad certificate (usage extensions)" \ |
| 4938 | -S "Processing of the Certificate handshake message failed" |
| 4939 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4940 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4941 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4942 | "$O_CLI -key data_files/server2.key \ |
| 4943 | -cert data_files/server2.ku-ke.crt" \ |
| 4944 | 1 \ |
| 4945 | -s "bad certificate (usage extensions)" \ |
| 4946 | -s "Processing of the Certificate handshake message failed" |
| 4947 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4948 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4949 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4950 | "$O_CLI -key data_files/server5.key \ |
| 4951 | -cert data_files/server5.ku-ds.crt" \ |
| 4952 | 0 \ |
| 4953 | -S "bad certificate (usage extensions)" \ |
| 4954 | -S "Processing of the Certificate handshake message failed" |
| 4955 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4956 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4957 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4958 | "$O_CLI -key data_files/server5.key \ |
| 4959 | -cert data_files/server5.ku-ka.crt" \ |
| 4960 | 0 \ |
| 4961 | -s "bad certificate (usage extensions)" \ |
| 4962 | -S "Processing of the Certificate handshake message failed" |
| 4963 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4964 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 4965 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4966 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4967 | "$P_SRV key_file=data_files/server5.key \ |
| 4968 | crt_file=data_files/server5.eku-srv.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4969 | "$P_CLI ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4970 | 0 |
| 4971 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4972 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4973 | "$P_SRV key_file=data_files/server5.key \ |
| 4974 | crt_file=data_files/server5.eku-srv.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4975 | "$P_CLI ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4976 | 0 |
| 4977 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4978 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4979 | "$P_SRV key_file=data_files/server5.key \ |
| 4980 | crt_file=data_files/server5.eku-cs_any.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4981 | "$P_CLI ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4982 | 0 |
| 4983 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4984 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4985 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4986 | crt_file=data_files/server5.eku-cli.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4987 | "$P_CLI ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4988 | 1 |
| 4989 | |
| 4990 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 4991 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4992 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4993 | "$O_SRV -key data_files/server5.key \ |
| 4994 | -cert data_files/server5.eku-srv.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 4995 | "$P_CLI debug_level=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4996 | 0 \ |
| 4997 | -C "bad certificate (usage extensions)" \ |
| 4998 | -C "Processing of the Certificate handshake message failed" \ |
| 4999 | -c "Ciphersuite is TLS-" |
| 5000 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5001 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5002 | "$O_SRV -key data_files/server5.key \ |
| 5003 | -cert data_files/server5.eku-srv_cli.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 5004 | "$P_CLI debug_level=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5005 | 0 \ |
| 5006 | -C "bad certificate (usage extensions)" \ |
| 5007 | -C "Processing of the Certificate handshake message failed" \ |
| 5008 | -c "Ciphersuite is TLS-" |
| 5009 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5010 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5011 | "$O_SRV -key data_files/server5.key \ |
| 5012 | -cert data_files/server5.eku-cs_any.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 5013 | "$P_CLI debug_level=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5014 | 0 \ |
| 5015 | -C "bad certificate (usage extensions)" \ |
| 5016 | -C "Processing of the Certificate handshake message failed" \ |
| 5017 | -c "Ciphersuite is TLS-" |
| 5018 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5019 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5020 | "$O_SRV -key data_files/server5.key \ |
| 5021 | -cert data_files/server5.eku-cs.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 5022 | "$P_CLI debug_level=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5023 | 1 \ |
| 5024 | -c "bad certificate (usage extensions)" \ |
| 5025 | -c "Processing of the Certificate handshake message failed" \ |
| 5026 | -C "Ciphersuite is TLS-" |
| 5027 | |
| 5028 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5029 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5030 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5031 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5032 | "$O_CLI -key data_files/server5.key \ |
| 5033 | -cert data_files/server5.eku-cli.crt" \ |
| 5034 | 0 \ |
| 5035 | -S "bad certificate (usage extensions)" \ |
| 5036 | -S "Processing of the Certificate handshake message failed" |
| 5037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5038 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5039 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5040 | "$O_CLI -key data_files/server5.key \ |
| 5041 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5042 | 0 \ |
| 5043 | -S "bad certificate (usage extensions)" \ |
| 5044 | -S "Processing of the Certificate handshake message failed" |
| 5045 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5046 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5047 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5048 | "$O_CLI -key data_files/server5.key \ |
| 5049 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5050 | 0 \ |
| 5051 | -S "bad certificate (usage extensions)" \ |
| 5052 | -S "Processing of the Certificate handshake message failed" |
| 5053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5054 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5055 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5056 | "$O_CLI -key data_files/server5.key \ |
| 5057 | -cert data_files/server5.eku-cs.crt" \ |
| 5058 | 0 \ |
| 5059 | -s "bad certificate (usage extensions)" \ |
| 5060 | -S "Processing of the Certificate handshake message failed" |
| 5061 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5062 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 5063 | "$P_SRV debug_level=1 auth_mode=required ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5064 | "$O_CLI -key data_files/server5.key \ |
| 5065 | -cert data_files/server5.eku-cs.crt" \ |
| 5066 | 1 \ |
| 5067 | -s "bad certificate (usage extensions)" \ |
| 5068 | -s "Processing of the Certificate handshake message failed" |
| 5069 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5070 | # Tests for DHM parameters loading |
| 5071 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5072 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5073 | "$P_SRV" \ |
| 5074 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5075 | debug_level=3" \ |
| 5076 | 0 \ |
| 5077 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5078 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5079 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5080 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5081 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5082 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5083 | debug_level=3" \ |
| 5084 | 0 \ |
| 5085 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5086 | -c "value of 'DHM: G ' (2 bits)" |
| 5087 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5088 | # Tests for DHM client-side size checking |
| 5089 | |
| 5090 | run_test "DHM size: server default, client default, OK" \ |
| 5091 | "$P_SRV" \ |
| 5092 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5093 | debug_level=1" \ |
| 5094 | 0 \ |
| 5095 | -C "DHM prime too short:" |
| 5096 | |
| 5097 | run_test "DHM size: server default, client 2048, OK" \ |
| 5098 | "$P_SRV" \ |
| 5099 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5100 | debug_level=1 dhmlen=2048" \ |
| 5101 | 0 \ |
| 5102 | -C "DHM prime too short:" |
| 5103 | |
| 5104 | run_test "DHM size: server 1024, client default, OK" \ |
| 5105 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5106 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5107 | debug_level=1" \ |
| 5108 | 0 \ |
| 5109 | -C "DHM prime too short:" |
| 5110 | |
| 5111 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5112 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5113 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5114 | debug_level=1" \ |
| 5115 | 1 \ |
| 5116 | -c "DHM prime too short:" |
| 5117 | |
| 5118 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5119 | "$P_SRV" \ |
| 5120 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5121 | debug_level=1 dhmlen=2049" \ |
| 5122 | 1 \ |
| 5123 | -c "DHM prime too short:" |
| 5124 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5125 | # Tests for PSK callback |
| 5126 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5127 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5128 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5129 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5130 | psk_identity=foo psk=abc123" \ |
| 5131 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5132 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5133 | -S "SSL - Unknown identity received" \ |
| 5134 | -S "SSL - Verification of the message MAC failed" |
| 5135 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5136 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5137 | "$P_SRV" \ |
| 5138 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5139 | psk_identity=foo psk=abc123" \ |
| 5140 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5141 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5142 | -S "SSL - Unknown identity received" \ |
| 5143 | -S "SSL - Verification of the message MAC failed" |
| 5144 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5145 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5146 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5147 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5148 | psk_identity=foo psk=abc123" \ |
| 5149 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5150 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5151 | -s "SSL - Unknown identity received" \ |
| 5152 | -S "SSL - Verification of the message MAC failed" |
| 5153 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5154 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5155 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5156 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5157 | psk_identity=abc psk=dead" \ |
| 5158 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5159 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5160 | -S "SSL - Unknown identity received" \ |
| 5161 | -S "SSL - Verification of the message MAC failed" |
| 5162 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5163 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5164 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5165 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5166 | psk_identity=def psk=beef" \ |
| 5167 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5168 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5169 | -S "SSL - Unknown identity received" \ |
| 5170 | -S "SSL - Verification of the message MAC failed" |
| 5171 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5172 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5173 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5174 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5175 | psk_identity=ghi psk=beef" \ |
| 5176 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5177 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5178 | -s "SSL - Unknown identity received" \ |
| 5179 | -S "SSL - Verification of the message MAC failed" |
| 5180 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5181 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5182 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5183 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5184 | psk_identity=abc psk=beef" \ |
| 5185 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5186 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5187 | -S "SSL - Unknown identity received" \ |
| 5188 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5189 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5190 | # Tests for EC J-PAKE |
| 5191 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5192 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5193 | run_test "ECJPAKE: client not configured" \ |
| 5194 | "$P_SRV debug_level=3" \ |
| 5195 | "$P_CLI debug_level=3" \ |
| 5196 | 0 \ |
| 5197 | -C "add ciphersuite: c0ff" \ |
| 5198 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5199 | -S "found ecjpake kkpp extension" \ |
| 5200 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5201 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5202 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5203 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5204 | -S "None of the common ciphersuites is usable" |
| 5205 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5206 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5207 | run_test "ECJPAKE: server not configured" \ |
| 5208 | "$P_SRV debug_level=3" \ |
| 5209 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5210 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5211 | 1 \ |
| 5212 | -c "add ciphersuite: c0ff" \ |
| 5213 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5214 | -s "found ecjpake kkpp extension" \ |
| 5215 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5216 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5217 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5218 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5219 | -s "None of the common ciphersuites is usable" |
| 5220 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5221 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5222 | run_test "ECJPAKE: working, TLS" \ |
| 5223 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5224 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5225 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5226 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5227 | -c "add ciphersuite: c0ff" \ |
| 5228 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5229 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5230 | -s "found ecjpake kkpp extension" \ |
| 5231 | -S "skip ecjpake kkpp extension" \ |
| 5232 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5233 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5234 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5235 | -S "None of the common ciphersuites is usable" \ |
| 5236 | -S "SSL - Verification of the message MAC failed" |
| 5237 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5238 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5239 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5240 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5241 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5242 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5243 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5244 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5245 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5246 | -s "SSL - Verification of the message MAC failed" |
| 5247 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5248 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5249 | run_test "ECJPAKE: working, DTLS" \ |
| 5250 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5251 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5252 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5253 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5254 | -c "re-using cached ecjpake parameters" \ |
| 5255 | -S "SSL - Verification of the message MAC failed" |
| 5256 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5257 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5258 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5259 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5260 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5261 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5262 | 0 \ |
| 5263 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5264 | -S "SSL - Verification of the message MAC failed" |
| 5265 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5266 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5267 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5268 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5269 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5270 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5271 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5272 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5273 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5274 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5275 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5276 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5277 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5278 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5279 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5280 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5281 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5282 | 0 |
| 5283 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5284 | # Tests for ciphersuites per version |
| 5285 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5286 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5287 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5288 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5289 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5290 | "$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] | 5291 | "$P_CLI force_version=ssl3" \ |
| 5292 | 0 \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5293 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5294 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5296 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5297 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5298 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5299 | "$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] | 5300 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5301 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5302 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5303 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5304 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5305 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5306 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5307 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5308 | "$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] | 5309 | "$P_CLI force_version=tls1_1" \ |
| 5310 | 0 \ |
| 5311 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5312 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5314 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5315 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5316 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5317 | "$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] | 5318 | "$P_CLI force_version=tls1_2" \ |
| 5319 | 0 \ |
| 5320 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5321 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5322 | # Test for ClientHello without extensions |
| 5323 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5324 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5325 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Ron Eldor | b76e765 | 2019-01-16 23:14:41 +0200 | [diff] [blame] | 5326 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5327 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5328 | 0 \ |
| 5329 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5330 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5331 | requires_gnutls |
| 5332 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 5333 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt allow_sha1=0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5334 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5335 | 0 \ |
| 5336 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5337 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5338 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5339 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5340 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5341 | "$P_SRV" \ |
| 5342 | "$P_CLI request_size=100" \ |
| 5343 | 0 \ |
| 5344 | -s "Read from client: 100 bytes read$" |
| 5345 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5346 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5347 | "$P_SRV" \ |
| 5348 | "$P_CLI request_size=500" \ |
| 5349 | 0 \ |
| 5350 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5351 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5352 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5353 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5354 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5355 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5356 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5357 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5358 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5359 | 0 \ |
| 5360 | -s "Read from client: 1 bytes read" |
| 5361 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5362 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5363 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5364 | "$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] | 5365 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5366 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5367 | 0 \ |
| 5368 | -s "Read from client: 1 bytes read" |
| 5369 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5370 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5371 | "$P_SRV" \ |
| 5372 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5373 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5374 | 0 \ |
| 5375 | -s "Read from client: 1 bytes read" |
| 5376 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5377 | 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] | 5378 | "$P_SRV" \ |
| 5379 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5380 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5381 | 0 \ |
| 5382 | -s "Read from client: 1 bytes read" |
| 5383 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5384 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5385 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5386 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5387 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5388 | 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] | 5389 | 0 \ |
| 5390 | -s "Read from client: 1 bytes read" |
| 5391 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5392 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5393 | 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] | 5394 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5395 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5396 | 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] | 5397 | 0 \ |
| 5398 | -s "Read from client: 1 bytes read" |
| 5399 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5400 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5401 | "$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] | 5402 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5403 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5404 | 0 \ |
| 5405 | -s "Read from client: 1 bytes read" |
| 5406 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5407 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5408 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5409 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5410 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5411 | 0 \ |
| 5412 | -s "Read from client: 1 bytes read" |
| 5413 | |
| 5414 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5415 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5416 | "$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] | 5417 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5418 | 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] | 5419 | 0 \ |
| 5420 | -s "Read from client: 1 bytes read" |
| 5421 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5422 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5423 | 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] | 5424 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5425 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5426 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5427 | 0 \ |
| 5428 | -s "Read from client: 1 bytes read" |
| 5429 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5430 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5431 | "$P_SRV" \ |
| 5432 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5433 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5434 | 0 \ |
| 5435 | -s "Read from client: 1 bytes read" |
| 5436 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5437 | 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] | 5438 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5439 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5440 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5441 | 0 \ |
| 5442 | -s "Read from client: 1 bytes read" |
| 5443 | |
| 5444 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5445 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5446 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5447 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5448 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5449 | 0 \ |
| 5450 | -s "Read from client: 1 bytes read" |
| 5451 | |
| 5452 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5453 | 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] | 5454 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5455 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5456 | 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] | 5457 | 0 \ |
| 5458 | -s "Read from client: 1 bytes read" |
| 5459 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5460 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5461 | "$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] | 5462 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5463 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5464 | 0 \ |
| 5465 | -s "Read from client: 1 bytes read" |
| 5466 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5467 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5468 | "$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] | 5469 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5470 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5471 | 0 \ |
| 5472 | -s "Read from client: 1 bytes read" |
| 5473 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5474 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5475 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5476 | "$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] | 5477 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5478 | 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] | 5479 | 0 \ |
| 5480 | -s "Read from client: 1 bytes read" |
| 5481 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5482 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5483 | 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] | 5484 | "$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] | 5485 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5486 | 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] | 5487 | 0 \ |
| 5488 | -s "Read from client: 1 bytes read" |
| 5489 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5490 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5491 | "$P_SRV" \ |
| 5492 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5493 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5494 | 0 \ |
| 5495 | -s "Read from client: 1 bytes read" |
| 5496 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5497 | 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] | 5498 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5499 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5500 | 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] | 5501 | 0 \ |
| 5502 | -s "Read from client: 1 bytes read" |
| 5503 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5504 | 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] | 5505 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5506 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5507 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5508 | 0 \ |
| 5509 | -s "Read from client: 1 bytes read" |
| 5510 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5511 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5512 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5513 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5514 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5515 | 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] | 5516 | 0 \ |
| 5517 | -s "Read from client: 1 bytes read" |
| 5518 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5519 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5520 | 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] | 5521 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5522 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5523 | 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] | 5524 | 0 \ |
| 5525 | -s "Read from client: 1 bytes read" |
| 5526 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5527 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5528 | "$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] | 5529 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5530 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5531 | 0 \ |
| 5532 | -s "Read from client: 1 bytes read" |
| 5533 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5534 | 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] | 5535 | "$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] | 5536 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5537 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5538 | 0 \ |
| 5539 | -s "Read from client: 1 bytes read" |
| 5540 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5541 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5542 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5543 | "$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] | 5544 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5545 | 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] | 5546 | 0 \ |
| 5547 | -s "Read from client: 1 bytes read" |
| 5548 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5549 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5550 | 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] | 5551 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5552 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5553 | 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] | 5554 | 0 \ |
| 5555 | -s "Read from client: 1 bytes read" |
| 5556 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5557 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5558 | "$P_SRV" \ |
| 5559 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5560 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5561 | 0 \ |
| 5562 | -s "Read from client: 1 bytes read" |
| 5563 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5564 | 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] | 5565 | "$P_SRV" \ |
| 5566 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5567 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5568 | 0 \ |
| 5569 | -s "Read from client: 1 bytes read" |
| 5570 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5571 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5572 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5573 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5574 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 5575 | "$P_CLI dtls=1 request_size=1 \ |
| 5576 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5577 | 0 \ |
| 5578 | -s "Read from client: 1 bytes read" |
| 5579 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5580 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5581 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 5582 | "$P_CLI dtls=1 request_size=1 \ |
| 5583 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5584 | 0 \ |
| 5585 | -s "Read from client: 1 bytes read" |
| 5586 | |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5587 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5588 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5589 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 5590 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5591 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5592 | 0 \ |
| 5593 | -s "Read from client: 1 bytes read" |
| 5594 | |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5595 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5596 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5597 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5598 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5599 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5600 | 0 \ |
| 5601 | -s "Read from client: 1 bytes read" |
| 5602 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5603 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5604 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5605 | "$P_CLI dtls=1 request_size=1 \ |
| 5606 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5607 | 0 \ |
| 5608 | -s "Read from client: 1 bytes read" |
| 5609 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5610 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5611 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5612 | "$P_CLI dtls=1 request_size=1 \ |
| 5613 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5614 | 0 \ |
| 5615 | -s "Read from client: 1 bytes read" |
| 5616 | |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5617 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5618 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5619 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5620 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5621 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5622 | 0 \ |
| 5623 | -s "Read from client: 1 bytes read" |
| 5624 | |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5625 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5626 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5627 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5628 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5629 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5630 | 0 \ |
| 5631 | -s "Read from client: 1 bytes read" |
| 5632 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5633 | # Tests for small server packets |
| 5634 | |
| 5635 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5636 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 5637 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 5638 | "$P_CLI force_version=ssl3 \ |
| 5639 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5640 | 0 \ |
| 5641 | -c "Read from server: 1 bytes read" |
| 5642 | |
| 5643 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5644 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 5645 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5646 | "$P_CLI force_version=ssl3 \ |
| 5647 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5648 | 0 \ |
| 5649 | -c "Read from server: 1 bytes read" |
| 5650 | |
| 5651 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 5652 | "$P_SRV response_size=1" \ |
| 5653 | "$P_CLI force_version=tls1 \ |
| 5654 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5655 | 0 \ |
| 5656 | -c "Read from server: 1 bytes read" |
| 5657 | |
| 5658 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5659 | "$P_SRV response_size=1" \ |
| 5660 | "$P_CLI force_version=tls1 etm=0 \ |
| 5661 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5662 | 0 \ |
| 5663 | -c "Read from server: 1 bytes read" |
| 5664 | |
| 5665 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5666 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 5667 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5668 | "$P_CLI force_version=tls1 \ |
| 5669 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5670 | 0 \ |
| 5671 | -c "Read from server: 1 bytes read" |
| 5672 | |
| 5673 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5674 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 5675 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5676 | "$P_CLI force_version=tls1 \ |
| 5677 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5678 | 0 \ |
| 5679 | -c "Read from server: 1 bytes read" |
| 5680 | |
| 5681 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 5682 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5683 | "$P_CLI force_version=tls1 \ |
| 5684 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5685 | 0 \ |
| 5686 | -c "Read from server: 1 bytes read" |
| 5687 | |
| 5688 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5689 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5690 | "$P_CLI force_version=tls1 \ |
| 5691 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5692 | 0 \ |
| 5693 | -c "Read from server: 1 bytes read" |
| 5694 | |
| 5695 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5696 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5697 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5698 | "$P_CLI force_version=tls1 \ |
| 5699 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5700 | 0 \ |
| 5701 | -c "Read from server: 1 bytes read" |
| 5702 | |
| 5703 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5704 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5705 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5706 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5707 | trunc_hmac=1 etm=0" \ |
| 5708 | 0 \ |
| 5709 | -c "Read from server: 1 bytes read" |
| 5710 | |
| 5711 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 5712 | "$P_SRV response_size=1" \ |
| 5713 | "$P_CLI force_version=tls1_1 \ |
| 5714 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5715 | 0 \ |
| 5716 | -c "Read from server: 1 bytes read" |
| 5717 | |
| 5718 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5719 | "$P_SRV response_size=1" \ |
| 5720 | "$P_CLI force_version=tls1_1 \ |
| 5721 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5722 | 0 \ |
| 5723 | -c "Read from server: 1 bytes read" |
| 5724 | |
| 5725 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5726 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 5727 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5728 | "$P_CLI force_version=tls1_1 \ |
| 5729 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5730 | 0 \ |
| 5731 | -c "Read from server: 1 bytes read" |
| 5732 | |
| 5733 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5734 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5735 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5736 | "$P_CLI force_version=tls1_1 \ |
| 5737 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5738 | 0 \ |
| 5739 | -c "Read from server: 1 bytes read" |
| 5740 | |
| 5741 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 5742 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5743 | "$P_CLI force_version=tls1_1 \ |
| 5744 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5745 | 0 \ |
| 5746 | -c "Read from server: 1 bytes read" |
| 5747 | |
| 5748 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5749 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5750 | "$P_CLI force_version=tls1_1 \ |
| 5751 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5752 | 0 \ |
| 5753 | -c "Read from server: 1 bytes read" |
| 5754 | |
| 5755 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5756 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 5757 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5758 | "$P_CLI force_version=tls1_1 \ |
| 5759 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5760 | 0 \ |
| 5761 | -c "Read from server: 1 bytes read" |
| 5762 | |
| 5763 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5764 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5765 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5766 | "$P_CLI force_version=tls1_1 \ |
| 5767 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5768 | 0 \ |
| 5769 | -c "Read from server: 1 bytes read" |
| 5770 | |
| 5771 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5772 | "$P_SRV response_size=1" \ |
| 5773 | "$P_CLI force_version=tls1_2 \ |
| 5774 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5775 | 0 \ |
| 5776 | -c "Read from server: 1 bytes read" |
| 5777 | |
| 5778 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5779 | "$P_SRV response_size=1" \ |
| 5780 | "$P_CLI force_version=tls1_2 \ |
| 5781 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5782 | 0 \ |
| 5783 | -c "Read from server: 1 bytes read" |
| 5784 | |
| 5785 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5786 | "$P_SRV response_size=1" \ |
| 5787 | "$P_CLI force_version=tls1_2 \ |
| 5788 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5789 | 0 \ |
| 5790 | -c "Read from server: 1 bytes read" |
| 5791 | |
| 5792 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5793 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 5794 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5795 | "$P_CLI force_version=tls1_2 \ |
| 5796 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5797 | 0 \ |
| 5798 | -c "Read from server: 1 bytes read" |
| 5799 | |
| 5800 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5801 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5802 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5803 | "$P_CLI force_version=tls1_2 \ |
| 5804 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5805 | 0 \ |
| 5806 | -c "Read from server: 1 bytes read" |
| 5807 | |
| 5808 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 5809 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5810 | "$P_CLI force_version=tls1_2 \ |
| 5811 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5812 | 0 \ |
| 5813 | -c "Read from server: 1 bytes read" |
| 5814 | |
| 5815 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5816 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5817 | "$P_CLI force_version=tls1_2 \ |
| 5818 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5819 | 0 \ |
| 5820 | -c "Read from server: 1 bytes read" |
| 5821 | |
| 5822 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5823 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 5824 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5825 | "$P_CLI force_version=tls1_2 \ |
| 5826 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5827 | 0 \ |
| 5828 | -c "Read from server: 1 bytes read" |
| 5829 | |
| 5830 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5831 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5832 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5833 | "$P_CLI force_version=tls1_2 \ |
| 5834 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5835 | 0 \ |
| 5836 | -c "Read from server: 1 bytes read" |
| 5837 | |
| 5838 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5839 | "$P_SRV response_size=1" \ |
| 5840 | "$P_CLI force_version=tls1_2 \ |
| 5841 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5842 | 0 \ |
| 5843 | -c "Read from server: 1 bytes read" |
| 5844 | |
| 5845 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5846 | "$P_SRV response_size=1" \ |
| 5847 | "$P_CLI force_version=tls1_2 \ |
| 5848 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5849 | 0 \ |
| 5850 | -c "Read from server: 1 bytes read" |
| 5851 | |
| 5852 | # Tests for small server packets in DTLS |
| 5853 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5854 | run_test "Small server packet DTLS 1.0" \ |
| 5855 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 5856 | "$P_CLI dtls=1 \ |
| 5857 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5858 | 0 \ |
| 5859 | -c "Read from server: 1 bytes read" |
| 5860 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5861 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 5862 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 5863 | "$P_CLI dtls=1 \ |
| 5864 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5865 | 0 \ |
| 5866 | -c "Read from server: 1 bytes read" |
| 5867 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5868 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5869 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 5870 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 5871 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 5872 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5873 | 0 \ |
| 5874 | -c "Read from server: 1 bytes read" |
| 5875 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5876 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5877 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 5878 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 5879 | "$P_CLI dtls=1 \ |
| 5880 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 5881 | 0 \ |
| 5882 | -c "Read from server: 1 bytes read" |
| 5883 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5884 | run_test "Small server packet DTLS 1.2" \ |
| 5885 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5886 | "$P_CLI dtls=1 \ |
| 5887 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5888 | 0 \ |
| 5889 | -c "Read from server: 1 bytes read" |
| 5890 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5891 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5892 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5893 | "$P_CLI dtls=1 \ |
| 5894 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5895 | 0 \ |
| 5896 | -c "Read from server: 1 bytes read" |
| 5897 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5898 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5899 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 5900 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 5901 | "$P_CLI dtls=1 \ |
| 5902 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5903 | 0 \ |
| 5904 | -c "Read from server: 1 bytes read" |
| 5905 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5906 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5907 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 5908 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 5909 | "$P_CLI dtls=1 \ |
| 5910 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 5911 | 0 \ |
| 5912 | -c "Read from server: 1 bytes read" |
| 5913 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 5914 | # A test for extensions in SSLv3 |
| 5915 | |
| 5916 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5917 | run_test "SSLv3 with extensions, server side" \ |
| 5918 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 5919 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 5920 | 0 \ |
| 5921 | -S "dumping 'client hello extensions'" \ |
| 5922 | -S "server hello, total extension length:" |
| 5923 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5924 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5925 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5926 | # How many fragments do we expect to write $1 bytes? |
| 5927 | fragments_for_write() { |
| 5928 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5929 | } |
| 5930 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5931 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5932 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5933 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5934 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5935 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5936 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5937 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5938 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5939 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5940 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5941 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5942 | "$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] | 5943 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 5944 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5945 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5946 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5947 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5948 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5949 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5950 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5951 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5952 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5953 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5954 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5955 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5956 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5957 | 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] | 5958 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5959 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 5960 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5961 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5962 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5963 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5964 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5965 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5966 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5967 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5968 | 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] | 5969 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5970 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5971 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5972 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5973 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5974 | 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] | 5975 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5976 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5977 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5978 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5979 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5980 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5981 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5982 | "$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] | 5983 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5984 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5985 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5986 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5987 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5988 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5989 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5990 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5991 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5992 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5993 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5994 | |
| 5995 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5996 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5997 | "$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] | 5998 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5999 | 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] | 6000 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6001 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6002 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6003 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6004 | 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] | 6005 | "$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] | 6006 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6007 | 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] | 6008 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6009 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6010 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6011 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6012 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6013 | "$P_SRV" \ |
| 6014 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6015 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6016 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6017 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6018 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6019 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6020 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6021 | "$P_SRV" \ |
| 6022 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6023 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6024 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6025 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6026 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6027 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6028 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6029 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6030 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6031 | 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] | 6032 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6033 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6034 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6035 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6036 | 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] | 6037 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6038 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6039 | 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] | 6040 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6041 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6042 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6043 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6044 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6045 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6046 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6047 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6048 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6049 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6050 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6051 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6052 | "$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] | 6053 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6054 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6055 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6056 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6057 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6058 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6059 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6060 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6061 | "$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] | 6062 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6063 | 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] | 6064 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6065 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6066 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6067 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6068 | 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] | 6069 | "$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] | 6070 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6071 | 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] | 6072 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6073 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6074 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6075 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6076 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6077 | "$P_SRV" \ |
| 6078 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6079 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6080 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6081 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6082 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6083 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6084 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6085 | "$P_SRV" \ |
| 6086 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6087 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6088 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6089 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6090 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6091 | 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] | 6092 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6093 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6094 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6095 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6096 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6097 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6098 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6099 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6100 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6101 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6102 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6103 | 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] | 6104 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6105 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6106 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6107 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6108 | 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] | 6109 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6110 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6111 | 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] | 6112 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6113 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6114 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6115 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6116 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6117 | "$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] | 6118 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6119 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6120 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6121 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6122 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6123 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6124 | 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] | 6125 | "$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] | 6126 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6127 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6128 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6129 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6130 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6131 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6132 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6133 | "$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] | 6134 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6135 | 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] | 6136 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6137 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6138 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6139 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6140 | 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] | 6141 | "$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] | 6142 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6143 | 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] | 6144 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6145 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6146 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6147 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6148 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6149 | "$P_SRV" \ |
| 6150 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6151 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6152 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6153 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6154 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6155 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6156 | 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] | 6157 | "$P_SRV" \ |
| 6158 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6159 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6160 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6161 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6162 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6163 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6164 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6165 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6166 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 6167 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6168 | "$P_CLI force_version=ssl3 \ |
| 6169 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6170 | 0 \ |
| 6171 | -c "Read from server: 16384 bytes read" |
| 6172 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6173 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 6174 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6175 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 6176 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 6177 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 6178 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6179 | 0 \ |
| 6180 | -c "Read from server: 1 bytes read"\ |
| 6181 | -c "16383 bytes read"\ |
| 6182 | -C "Read from server: 16384 bytes read" |
| 6183 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6184 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6185 | "$P_SRV response_size=16384" \ |
| 6186 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6187 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6188 | 0 \ |
| 6189 | -c "Read from server: 1 bytes read"\ |
| 6190 | -c "16383 bytes read"\ |
| 6191 | -C "Read from server: 16384 bytes read" |
| 6192 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6193 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6194 | "$P_SRV response_size=16384" \ |
| 6195 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6196 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6197 | 0 \ |
| 6198 | -c "Read from server: 1 bytes read"\ |
| 6199 | -c "16383 bytes read"\ |
| 6200 | -C "Read from server: 16384 bytes read" |
| 6201 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6202 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6203 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6204 | "$P_SRV response_size=16384" \ |
| 6205 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6206 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6207 | trunc_hmac=1" \ |
| 6208 | 0 \ |
| 6209 | -c "Read from server: 1 bytes read"\ |
| 6210 | -c "16383 bytes read"\ |
| 6211 | -C "Read from server: 16384 bytes read" |
| 6212 | |
| 6213 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6214 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 6215 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6216 | "$P_CLI force_version=tls1 \ |
| 6217 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6218 | trunc_hmac=1" \ |
| 6219 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6220 | -s "16384 bytes written in 1 fragments" \ |
| 6221 | -c "Read from server: 16384 bytes read" |
| 6222 | |
| 6223 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 6224 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6225 | "$P_CLI force_version=tls1 \ |
| 6226 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6227 | 0 \ |
| 6228 | -s "16384 bytes written in 1 fragments" \ |
| 6229 | -c "Read from server: 16384 bytes read" |
| 6230 | |
| 6231 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6232 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6233 | "$P_CLI force_version=tls1 \ |
| 6234 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6235 | 0 \ |
| 6236 | -s "16384 bytes written in 1 fragments" \ |
| 6237 | -c "Read from server: 16384 bytes read" |
| 6238 | |
| 6239 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6240 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6241 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6242 | "$P_CLI force_version=tls1 \ |
| 6243 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6244 | 0 \ |
| 6245 | -s "16384 bytes written in 1 fragments" \ |
| 6246 | -c "Read from server: 16384 bytes read" |
| 6247 | |
| 6248 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6249 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6250 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6251 | "$P_CLI force_version=tls1 \ |
| 6252 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6253 | 0 \ |
| 6254 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6255 | -c "Read from server: 16384 bytes read" |
| 6256 | |
| 6257 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6258 | "$P_SRV response_size=16384" \ |
| 6259 | "$P_CLI force_version=tls1_1 \ |
| 6260 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6261 | 0 \ |
| 6262 | -c "Read from server: 16384 bytes read" |
| 6263 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6264 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6265 | "$P_SRV response_size=16384" \ |
| 6266 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6267 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6268 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6269 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6270 | -c "Read from server: 16384 bytes read" |
| 6271 | |
| 6272 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6273 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6274 | "$P_SRV response_size=16384" \ |
| 6275 | "$P_CLI force_version=tls1_1 \ |
| 6276 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6277 | trunc_hmac=1" \ |
| 6278 | 0 \ |
| 6279 | -c "Read from server: 16384 bytes read" |
| 6280 | |
| 6281 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6282 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6283 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6284 | "$P_CLI force_version=tls1_1 \ |
| 6285 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6286 | 0 \ |
| 6287 | -s "16384 bytes written in 1 fragments" \ |
| 6288 | -c "Read from server: 16384 bytes read" |
| 6289 | |
| 6290 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 6291 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6292 | "$P_CLI force_version=tls1_1 \ |
| 6293 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6294 | 0 \ |
| 6295 | -c "Read from server: 16384 bytes read" |
| 6296 | |
| 6297 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6298 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6299 | "$P_CLI force_version=tls1_1 \ |
| 6300 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6301 | 0 \ |
| 6302 | -s "16384 bytes written in 1 fragments" \ |
| 6303 | -c "Read from server: 16384 bytes read" |
| 6304 | |
| 6305 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6306 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 6307 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6308 | "$P_CLI force_version=tls1_1 \ |
| 6309 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6310 | trunc_hmac=1" \ |
| 6311 | 0 \ |
| 6312 | -c "Read from server: 16384 bytes read" |
| 6313 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6314 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6315 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6316 | "$P_CLI force_version=tls1_1 \ |
| 6317 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6318 | 0 \ |
| 6319 | -s "16384 bytes written in 1 fragments" \ |
| 6320 | -c "Read from server: 16384 bytes read" |
| 6321 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6322 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6323 | "$P_SRV response_size=16384" \ |
| 6324 | "$P_CLI force_version=tls1_2 \ |
| 6325 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6326 | 0 \ |
| 6327 | -c "Read from server: 16384 bytes read" |
| 6328 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6329 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6330 | "$P_SRV response_size=16384" \ |
| 6331 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6332 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6333 | 0 \ |
| 6334 | -s "16384 bytes written in 1 fragments" \ |
| 6335 | -c "Read from server: 16384 bytes read" |
| 6336 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6337 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6338 | "$P_SRV response_size=16384" \ |
| 6339 | "$P_CLI force_version=tls1_2 \ |
| 6340 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6341 | 0 \ |
| 6342 | -c "Read from server: 16384 bytes read" |
| 6343 | |
| 6344 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6345 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6346 | "$P_SRV response_size=16384" \ |
| 6347 | "$P_CLI force_version=tls1_2 \ |
| 6348 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6349 | trunc_hmac=1" \ |
| 6350 | 0 \ |
| 6351 | -c "Read from server: 16384 bytes read" |
| 6352 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6353 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6354 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6355 | "$P_CLI force_version=tls1_2 \ |
| 6356 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6357 | 0 \ |
| 6358 | -s "16384 bytes written in 1 fragments" \ |
| 6359 | -c "Read from server: 16384 bytes read" |
| 6360 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6361 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 6362 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6363 | "$P_CLI force_version=tls1_2 \ |
| 6364 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6365 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6366 | -s "16384 bytes written in 1 fragments" \ |
| 6367 | -c "Read from server: 16384 bytes read" |
| 6368 | |
| 6369 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6370 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6371 | "$P_CLI force_version=tls1_2 \ |
| 6372 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6373 | 0 \ |
| 6374 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6375 | -c "Read from server: 16384 bytes read" |
| 6376 | |
| 6377 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6378 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 6379 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6380 | "$P_CLI force_version=tls1_2 \ |
| 6381 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6382 | trunc_hmac=1" \ |
| 6383 | 0 \ |
| 6384 | -c "Read from server: 16384 bytes read" |
| 6385 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6386 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6387 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6388 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6389 | "$P_CLI force_version=tls1_2 \ |
| 6390 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6391 | 0 \ |
| 6392 | -s "16384 bytes written in 1 fragments" \ |
| 6393 | -c "Read from server: 16384 bytes read" |
| 6394 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6395 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6396 | "$P_SRV response_size=16384" \ |
| 6397 | "$P_CLI force_version=tls1_2 \ |
| 6398 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6399 | 0 \ |
| 6400 | -c "Read from server: 16384 bytes read" |
| 6401 | |
| 6402 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6403 | "$P_SRV response_size=16384" \ |
| 6404 | "$P_CLI force_version=tls1_2 \ |
| 6405 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6406 | 0 \ |
| 6407 | -c "Read from server: 16384 bytes read" |
| 6408 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6409 | # Tests for restartable ECC |
| 6410 | |
| 6411 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6412 | run_test "EC restart: TLS, default" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6413 | "$P_SRV auth_mode=required ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6414 | "$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] | 6415 | 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] | 6416 | debug_level=1" \ |
| 6417 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6418 | -C "x509_verify_cert.*4b00" \ |
| 6419 | -C "mbedtls_pk_verify.*4b00" \ |
| 6420 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6421 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6422 | |
| 6423 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6424 | run_test "EC restart: TLS, max_ops=0" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6425 | "$P_SRV auth_mode=required ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6426 | "$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] | 6427 | 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] | 6428 | debug_level=1 ec_max_ops=0" \ |
| 6429 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6430 | -C "x509_verify_cert.*4b00" \ |
| 6431 | -C "mbedtls_pk_verify.*4b00" \ |
| 6432 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6433 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6434 | |
| 6435 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6436 | run_test "EC restart: TLS, max_ops=65535" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6437 | "$P_SRV auth_mode=required ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6438 | "$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] | 6439 | 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] | 6440 | debug_level=1 ec_max_ops=65535" \ |
| 6441 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6442 | -C "x509_verify_cert.*4b00" \ |
| 6443 | -C "mbedtls_pk_verify.*4b00" \ |
| 6444 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6445 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6446 | |
| 6447 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6448 | run_test "EC restart: TLS, max_ops=1000" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6449 | "$P_SRV auth_mode=required ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6450 | "$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] | 6451 | 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] | 6452 | debug_level=1 ec_max_ops=1000" \ |
| 6453 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6454 | -c "x509_verify_cert.*4b00" \ |
| 6455 | -c "mbedtls_pk_verify.*4b00" \ |
| 6456 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6457 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6458 | |
| 6459 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 6460 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6461 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6462 | "$P_SRV auth_mode=required ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6463 | crt_file=data_files/server5-badsign.crt \ |
| 6464 | key_file=data_files/server5.key" \ |
| 6465 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 03d7746 | 2019-08-27 16:24:56 +0100 | [diff] [blame] | 6466 | key_file=data_files/server5.key crt_file=data_files/server5.crt ca_file=data_files/test-ca2.crt \ |
| 6467 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6468 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6469 | -c "x509_verify_cert.*4b00" \ |
Hanno Becker | 03d7746 | 2019-08-27 16:24:56 +0100 | [diff] [blame] | 6470 | -c "mbedtls_pk_verify.*4b00" \ |
| 6471 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6472 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6473 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6474 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 6475 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6476 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6477 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6478 | "$P_SRV auth_mode=required ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6479 | crt_file=data_files/server5-badsign.crt \ |
| 6480 | key_file=data_files/server5.key" \ |
| 6481 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6482 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6483 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6484 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6485 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6486 | -c "x509_verify_cert.*4b00" \ |
| 6487 | -c "mbedtls_pk_verify.*4b00" \ |
| 6488 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6489 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6490 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6491 | -C "! mbedtls_ssl_handshake returned" \ |
| 6492 | -C "X509 - Certificate verification failed" |
| 6493 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 6494 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 6495 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6496 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6497 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6498 | "$P_SRV auth_mode=required ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6499 | crt_file=data_files/server5-badsign.crt \ |
| 6500 | key_file=data_files/server5.key" \ |
| 6501 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6502 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6503 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6504 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6505 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6506 | -C "x509_verify_cert.*4b00" \ |
| 6507 | -c "mbedtls_pk_verify.*4b00" \ |
| 6508 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6509 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6510 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6511 | -C "! mbedtls_ssl_handshake returned" \ |
| 6512 | -C "X509 - Certificate verification failed" |
| 6513 | |
| 6514 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6515 | run_test "EC restart: DTLS, max_ops=1000" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6516 | "$P_SRV auth_mode=required dtls=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6517 | "$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] | 6518 | 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] | 6519 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6520 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6521 | -c "x509_verify_cert.*4b00" \ |
| 6522 | -c "mbedtls_pk_verify.*4b00" \ |
| 6523 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6524 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6525 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6526 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6527 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6528 | "$P_SRV" \ |
| 6529 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6530 | debug_level=1 ec_max_ops=1000" \ |
| 6531 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6532 | -c "x509_verify_cert.*4b00" \ |
| 6533 | -c "mbedtls_pk_verify.*4b00" \ |
| 6534 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6535 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6536 | |
| 6537 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6538 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6539 | "$P_SRV psk=abc123" \ |
| 6540 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6541 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6542 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6543 | -C "x509_verify_cert.*4b00" \ |
| 6544 | -C "mbedtls_pk_verify.*4b00" \ |
| 6545 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6546 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6547 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6548 | # Tests of asynchronous private key support in SSL |
| 6549 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6550 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6551 | run_test "SSL async private: sign, delay=0" \ |
| 6552 | "$P_SRV \ |
| 6553 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6554 | "$P_CLI" \ |
| 6555 | 0 \ |
| 6556 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6557 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6558 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6559 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6560 | run_test "SSL async private: sign, delay=1" \ |
| 6561 | "$P_SRV \ |
| 6562 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6563 | "$P_CLI" \ |
| 6564 | 0 \ |
| 6565 | -s "Async sign callback: using key slot " \ |
| 6566 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6567 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6568 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6569 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6570 | run_test "SSL async private: sign, delay=2" \ |
| 6571 | "$P_SRV \ |
| 6572 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6573 | "$P_CLI" \ |
| 6574 | 0 \ |
| 6575 | -s "Async sign callback: using key slot " \ |
| 6576 | -U "Async sign callback: using key slot " \ |
| 6577 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6578 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6579 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6580 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6581 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 6582 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 6583 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6585 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 6586 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 6587 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 6588 | "$P_CLI force_version=tls1_1" \ |
| 6589 | 0 \ |
| 6590 | -s "Async sign callback: using key slot " \ |
| 6591 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6592 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6593 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | b2c6383 | 2019-06-17 08:35:16 +0100 | [diff] [blame] | 6594 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Teppo Järvelin | 4009d8f | 2019-08-19 14:48:09 +0300 | [diff] [blame] | 6595 | requires_config_disabled MBEDTLS_X509_REMOVE_HOSTNAME_VERIFICATION |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 6596 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6597 | run_test "SSL async private: sign, SNI" \ |
| 6598 | "$P_SRV debug_level=3 \ |
| 6599 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6600 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6601 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6602 | "$P_CLI server_name=polarssl.example" \ |
| 6603 | 0 \ |
| 6604 | -s "Async sign callback: using key slot " \ |
| 6605 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6606 | -s "parse ServerName extension" \ |
| 6607 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6608 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6609 | |
| 6610 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6611 | run_test "SSL async private: decrypt, delay=0" \ |
| 6612 | "$P_SRV \ |
| 6613 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6614 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6615 | 0 \ |
| 6616 | -s "Async decrypt callback: using key slot " \ |
| 6617 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6618 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6619 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6620 | run_test "SSL async private: decrypt, delay=1" \ |
| 6621 | "$P_SRV \ |
| 6622 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6623 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6624 | 0 \ |
| 6625 | -s "Async decrypt callback: using key slot " \ |
| 6626 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6627 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6628 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6629 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6630 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6631 | "$P_SRV psk=abc123 \ |
| 6632 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6633 | "$P_CLI psk=abc123 \ |
| 6634 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6635 | 0 \ |
| 6636 | -s "Async decrypt callback: using key slot " \ |
| 6637 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6638 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6639 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6640 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6641 | "$P_SRV psk=abc123 \ |
| 6642 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6643 | "$P_CLI psk=abc123 \ |
| 6644 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6645 | 0 \ |
| 6646 | -s "Async decrypt callback: using key slot " \ |
| 6647 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6648 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6649 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6650 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6651 | run_test "SSL async private: sign callback not present" \ |
| 6652 | "$P_SRV \ |
| 6653 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6654 | "$P_CLI; [ \$? -eq 1 ] && |
| 6655 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6656 | 0 \ |
| 6657 | -S "Async sign callback" \ |
| 6658 | -s "! mbedtls_ssl_handshake returned" \ |
| 6659 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6660 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6661 | -s "Successful connection" |
| 6662 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6663 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6664 | run_test "SSL async private: decrypt callback not present" \ |
| 6665 | "$P_SRV debug_level=1 \ |
| 6666 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6667 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6668 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6669 | 0 \ |
| 6670 | -S "Async decrypt callback" \ |
| 6671 | -s "! mbedtls_ssl_handshake returned" \ |
| 6672 | -s "got no RSA private key" \ |
| 6673 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6674 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6675 | |
| 6676 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6677 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6678 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6679 | "$P_SRV \ |
| 6680 | async_operations=s async_private_delay1=1 \ |
| 6681 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6682 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 6683 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 ca_file=data_files/test-ca2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6684 | 0 \ |
| 6685 | -s "Async sign callback: using key slot 0," \ |
| 6686 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6687 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6688 | |
| 6689 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6690 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6691 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6692 | "$P_SRV \ |
| 6693 | async_operations=s async_private_delay2=1 \ |
| 6694 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6695 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6696 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6697 | 0 \ |
| 6698 | -s "Async sign callback: using key slot 0," \ |
| 6699 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6700 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6701 | |
| 6702 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6703 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6704 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6705 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6706 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6707 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6708 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6709 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6710 | 0 \ |
| 6711 | -s "Async sign callback: using key slot 1," \ |
| 6712 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6713 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6714 | |
| 6715 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6716 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6717 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6718 | "$P_SRV \ |
| 6719 | async_operations=s async_private_delay1=1 \ |
| 6720 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6721 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6722 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6723 | 0 \ |
| 6724 | -s "Async sign callback: no key matches this certificate." |
| 6725 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6726 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6727 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6728 | "$P_SRV \ |
| 6729 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6730 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6731 | "$P_CLI" \ |
| 6732 | 1 \ |
| 6733 | -s "Async sign callback: injected error" \ |
| 6734 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6735 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6736 | -s "! mbedtls_ssl_handshake returned" |
| 6737 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6738 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6739 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6740 | "$P_SRV \ |
| 6741 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6742 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6743 | "$P_CLI" \ |
| 6744 | 1 \ |
| 6745 | -s "Async sign callback: using key slot " \ |
| 6746 | -S "Async resume" \ |
| 6747 | -s "Async cancel" |
| 6748 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6749 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6750 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6751 | "$P_SRV \ |
| 6752 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6753 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6754 | "$P_CLI" \ |
| 6755 | 1 \ |
| 6756 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6757 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6758 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6759 | -s "! mbedtls_ssl_handshake returned" |
| 6760 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6761 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6762 | run_test "SSL async private: decrypt, error in start" \ |
| 6763 | "$P_SRV \ |
| 6764 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6765 | async_private_error=1" \ |
| 6766 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6767 | 1 \ |
| 6768 | -s "Async decrypt callback: injected error" \ |
| 6769 | -S "Async resume" \ |
| 6770 | -S "Async cancel" \ |
| 6771 | -s "! mbedtls_ssl_handshake returned" |
| 6772 | |
| 6773 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6774 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6775 | "$P_SRV \ |
| 6776 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6777 | async_private_error=2" \ |
| 6778 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6779 | 1 \ |
| 6780 | -s "Async decrypt callback: using key slot " \ |
| 6781 | -S "Async resume" \ |
| 6782 | -s "Async cancel" |
| 6783 | |
| 6784 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6785 | run_test "SSL async private: decrypt, error in resume" \ |
| 6786 | "$P_SRV \ |
| 6787 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6788 | async_private_error=3" \ |
| 6789 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6790 | 1 \ |
| 6791 | -s "Async decrypt callback: using key slot " \ |
| 6792 | -s "Async resume callback: decrypt done but injected error" \ |
| 6793 | -S "Async cancel" \ |
| 6794 | -s "! mbedtls_ssl_handshake returned" |
| 6795 | |
| 6796 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6797 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6798 | "$P_SRV \ |
| 6799 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6800 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6801 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6802 | 0 \ |
| 6803 | -s "Async cancel" \ |
| 6804 | -s "! mbedtls_ssl_handshake returned" \ |
| 6805 | -s "Async resume" \ |
| 6806 | -s "Successful connection" |
| 6807 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6808 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6809 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6810 | "$P_SRV \ |
| 6811 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6812 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6813 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6814 | 0 \ |
| 6815 | -s "! mbedtls_ssl_handshake returned" \ |
| 6816 | -s "Async resume" \ |
| 6817 | -s "Successful connection" |
| 6818 | |
| 6819 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6820 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6821 | 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] | 6822 | "$P_SRV \ |
| 6823 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6824 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6825 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6826 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6827 | [ \$? -eq 1 ] && |
| 6828 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6829 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6830 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6831 | -S "Async resume" \ |
| 6832 | -s "Async cancel" \ |
| 6833 | -s "! mbedtls_ssl_handshake returned" \ |
| 6834 | -s "Async sign callback: no key matches this certificate." \ |
| 6835 | -s "Successful connection" |
| 6836 | |
| 6837 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6838 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6839 | 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] | 6840 | "$P_SRV \ |
| 6841 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6842 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6843 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6844 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6845 | [ \$? -eq 1 ] && |
| 6846 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6847 | 0 \ |
| 6848 | -s "Async resume" \ |
| 6849 | -s "! mbedtls_ssl_handshake returned" \ |
| 6850 | -s "Async sign callback: no key matches this certificate." \ |
| 6851 | -s "Successful connection" |
| 6852 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6853 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6854 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6855 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 6856 | "$P_SRV \ |
| 6857 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6858 | exchanges=2 renegotiation=1" \ |
| 6859 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6860 | 0 \ |
| 6861 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6862 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6863 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6864 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6865 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6866 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 6867 | "$P_SRV \ |
| 6868 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6869 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6870 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6871 | 0 \ |
| 6872 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6873 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6874 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6875 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6876 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6877 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 6878 | "$P_SRV \ |
| 6879 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6880 | exchanges=2 renegotiation=1" \ |
| 6881 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6882 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6883 | 0 \ |
| 6884 | -s "Async decrypt callback: using key slot " \ |
| 6885 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6886 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6887 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6888 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6889 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 6890 | "$P_SRV \ |
| 6891 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6892 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6893 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6894 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6895 | 0 \ |
| 6896 | -s "Async decrypt callback: using key slot " \ |
| 6897 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6898 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6899 | # Tests for ECC extensions (rfc 4492) |
| 6900 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6901 | requires_config_enabled MBEDTLS_AES_C |
| 6902 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6903 | requires_config_enabled MBEDTLS_SHA256_C |
| 6904 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6905 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6906 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6907 | "$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] | 6908 | 0 \ |
| 6909 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6910 | -C "client hello, adding supported_point_formats extension" \ |
| 6911 | -S "found supported elliptic curves extension" \ |
| 6912 | -S "found supported point formats extension" |
| 6913 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6914 | requires_config_enabled MBEDTLS_AES_C |
| 6915 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6916 | requires_config_enabled MBEDTLS_SHA256_C |
| 6917 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6918 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6919 | "$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] | 6920 | "$P_CLI debug_level=3" \ |
| 6921 | 0 \ |
| 6922 | -C "found supported_point_formats extension" \ |
| 6923 | -S "server hello, supported_point_formats extension" |
| 6924 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6925 | requires_config_enabled MBEDTLS_AES_C |
| 6926 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6927 | requires_config_enabled MBEDTLS_SHA256_C |
| 6928 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6929 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6930 | "$P_SRV debug_level=3" \ |
| 6931 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6932 | 0 \ |
| 6933 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6934 | -c "client hello, adding supported_point_formats extension" \ |
| 6935 | -s "found supported elliptic curves extension" \ |
| 6936 | -s "found supported point formats extension" |
| 6937 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6938 | requires_config_enabled MBEDTLS_AES_C |
| 6939 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6940 | requires_config_enabled MBEDTLS_SHA256_C |
| 6941 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6942 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6943 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6944 | "$P_CLI debug_level=3" \ |
| 6945 | 0 \ |
| 6946 | -c "found supported_point_formats extension" \ |
| 6947 | -s "server hello, supported_point_formats extension" |
| 6948 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6949 | # Tests for DTLS HelloVerifyRequest |
| 6950 | |
| 6951 | run_test "DTLS cookie: enabled" \ |
| 6952 | "$P_SRV dtls=1 debug_level=2" \ |
| 6953 | "$P_CLI dtls=1 debug_level=2" \ |
| 6954 | 0 \ |
| 6955 | -s "cookie verification failed" \ |
| 6956 | -s "cookie verification passed" \ |
| 6957 | -S "cookie verification skipped" \ |
| 6958 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6959 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6960 | -S "SSL - The requested feature is not available" |
| 6961 | |
| 6962 | run_test "DTLS cookie: disabled" \ |
| 6963 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6964 | "$P_CLI dtls=1 debug_level=2" \ |
| 6965 | 0 \ |
| 6966 | -S "cookie verification failed" \ |
| 6967 | -S "cookie verification passed" \ |
| 6968 | -s "cookie verification skipped" \ |
| 6969 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6970 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6971 | -S "SSL - The requested feature is not available" |
| 6972 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6973 | run_test "DTLS cookie: default (failing)" \ |
| 6974 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6975 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6976 | 1 \ |
| 6977 | -s "cookie verification failed" \ |
| 6978 | -S "cookie verification passed" \ |
| 6979 | -S "cookie verification skipped" \ |
| 6980 | -C "received hello verify request" \ |
| 6981 | -S "hello verification requested" \ |
| 6982 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6983 | |
| 6984 | requires_ipv6 |
| 6985 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6986 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6987 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6988 | 0 \ |
| 6989 | -s "cookie verification failed" \ |
| 6990 | -s "cookie verification passed" \ |
| 6991 | -S "cookie verification skipped" \ |
| 6992 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6993 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6994 | -S "SSL - The requested feature is not available" |
| 6995 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6996 | run_test "DTLS cookie: enabled, nbio" \ |
| 6997 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6998 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6999 | 0 \ |
| 7000 | -s "cookie verification failed" \ |
| 7001 | -s "cookie verification passed" \ |
| 7002 | -S "cookie verification skipped" \ |
| 7003 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7004 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7005 | -S "SSL - The requested feature is not available" |
| 7006 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7007 | # Tests for client reconnecting from the same port with DTLS |
| 7008 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7009 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7010 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7011 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 7012 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7013 | 0 \ |
| 7014 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7015 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7016 | -S "Client initiated reconnection from same port" |
| 7017 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7018 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7019 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7020 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 7021 | "$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] | 7022 | 0 \ |
| 7023 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7024 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7025 | -s "Client initiated reconnection from same port" |
| 7026 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7027 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7028 | 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] | 7029 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7030 | "$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] | 7031 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7032 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7033 | -s "Client initiated reconnection from same port" |
| 7034 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7035 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7036 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7037 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7038 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7039 | 0 \ |
| 7040 | -S "The operation timed out" \ |
| 7041 | -s "Client initiated reconnection from same port" |
| 7042 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7043 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7044 | "$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] | 7045 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7046 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7047 | -s "The operation timed out" \ |
| 7048 | -S "Client initiated reconnection from same port" |
| 7049 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7050 | # Tests for various cases of client authentication with DTLS |
| 7051 | # (focused on handshake flows and message parsing) |
| 7052 | |
| 7053 | run_test "DTLS client auth: required" \ |
| 7054 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7055 | "$P_CLI dtls=1" \ |
| 7056 | 0 \ |
| 7057 | -s "Verifying peer X.509 certificate... ok" |
| 7058 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 7059 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 7060 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7061 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7062 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7063 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7064 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7065 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7066 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 7067 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | 9ec3fe0 | 2019-07-01 17:36:12 +0100 | [diff] [blame] | 7068 | requires_config_disabled MBEDTLS_X509_REMOVE_VERIFY_CALLBACK |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7069 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7070 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7071 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7072 | 0 \ |
| 7073 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7074 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7075 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7076 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7077 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7078 | "$P_CLI dtls=1 psk=abc124" \ |
| 7079 | 1 \ |
| 7080 | -s "SSL - Verification of the message MAC failed" \ |
| 7081 | -c "SSL - A fatal alert message was received from our peer" |
| 7082 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7083 | # Tests for receiving fragmented handshake messages with DTLS |
| 7084 | |
| 7085 | requires_gnutls |
| 7086 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7087 | "$G_SRV -u --mtu 2048 -a" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7088 | "$P_CLI dtls=1 debug_level=2 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7089 | 0 \ |
| 7090 | -C "found fragmented DTLS handshake message" \ |
| 7091 | -C "error" |
| 7092 | |
| 7093 | requires_gnutls |
| 7094 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7095 | "$G_SRV -u --mtu 512" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7096 | "$P_CLI dtls=1 debug_level=2 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7097 | 0 \ |
| 7098 | -c "found fragmented DTLS handshake message" \ |
| 7099 | -C "error" |
| 7100 | |
| 7101 | requires_gnutls |
| 7102 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7103 | "$G_SRV -u --mtu 128" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7104 | "$P_CLI dtls=1 debug_level=2 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7105 | 0 \ |
| 7106 | -c "found fragmented DTLS handshake message" \ |
| 7107 | -C "error" |
| 7108 | |
| 7109 | requires_gnutls |
| 7110 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7111 | "$G_SRV -u --mtu 128" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7112 | "$P_CLI dtls=1 nbio=2 debug_level=2 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7113 | 0 \ |
| 7114 | -c "found fragmented DTLS handshake message" \ |
| 7115 | -C "error" |
| 7116 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7117 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7118 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7119 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7120 | "$G_SRV -u --mtu 256" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7121 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7122 | 0 \ |
| 7123 | -c "found fragmented DTLS handshake message" \ |
| 7124 | -c "client hello, adding renegotiation extension" \ |
| 7125 | -c "found renegotiation extension" \ |
| 7126 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7127 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7128 | -C "error" \ |
| 7129 | -s "Extra-header:" |
| 7130 | |
| 7131 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7132 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7133 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7134 | "$G_SRV -u --mtu 256" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7135 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7136 | 0 \ |
| 7137 | -c "found fragmented DTLS handshake message" \ |
| 7138 | -c "client hello, adding renegotiation extension" \ |
| 7139 | -c "found renegotiation extension" \ |
| 7140 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7141 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7142 | -C "error" \ |
| 7143 | -s "Extra-header:" |
| 7144 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7145 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7146 | "$O_SRV -dtls1 -mtu 2048" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7147 | "$P_CLI dtls=1 debug_level=2 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7148 | 0 \ |
| 7149 | -C "found fragmented DTLS handshake message" \ |
| 7150 | -C "error" |
| 7151 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7152 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7153 | "$O_SRV -dtls1 -mtu 768" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7154 | "$P_CLI dtls=1 debug_level=2 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7155 | 0 \ |
| 7156 | -c "found fragmented DTLS handshake message" \ |
| 7157 | -C "error" |
| 7158 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7159 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7160 | "$O_SRV -dtls1 -mtu 256" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7161 | "$P_CLI dtls=1 debug_level=2 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7162 | 0 \ |
| 7163 | -c "found fragmented DTLS handshake message" \ |
| 7164 | -C "error" |
| 7165 | |
| 7166 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7167 | "$O_SRV -dtls1 -mtu 256" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7168 | "$P_CLI dtls=1 nbio=2 debug_level=2 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7169 | 0 \ |
| 7170 | -c "found fragmented DTLS handshake message" \ |
| 7171 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7172 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7173 | # Tests for sending fragmented handshake messages with DTLS |
| 7174 | # |
| 7175 | # Use client auth when we need the client to send large messages, |
| 7176 | # and use large cert chains on both sides too (the long chains we have all use |
| 7177 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7178 | # Sizes reached (UDP payload): |
| 7179 | # - 2037B for server certificate |
| 7180 | # - 1542B for client certificate |
| 7181 | # - 1013B for newsessionticket |
| 7182 | # - all others below 512B |
| 7183 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7184 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7185 | requires_config_enabled MBEDTLS_RSA_C |
| 7186 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7187 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7188 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7189 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7190 | crt_file=data_files/server7_int-ca.crt \ |
| 7191 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7192 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7193 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7194 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7195 | "$P_CLI dtls=1 debug_level=2 \ |
| 7196 | crt_file=data_files/server8_int-ca2.crt \ |
| 7197 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7198 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7199 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7200 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7201 | 0 \ |
| 7202 | -S "found fragmented DTLS handshake message" \ |
| 7203 | -C "found fragmented DTLS handshake message" \ |
| 7204 | -C "error" |
| 7205 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7206 | requires_config_enabled MBEDTLS_RSA_C |
| 7207 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7208 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7209 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7210 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7211 | crt_file=data_files/server7_int-ca.crt \ |
| 7212 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7213 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7214 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7215 | max_frag_len=1024" \ |
| 7216 | "$P_CLI dtls=1 debug_level=2 \ |
| 7217 | crt_file=data_files/server8_int-ca2.crt \ |
| 7218 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7219 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7220 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7221 | max_frag_len=2048" \ |
| 7222 | 0 \ |
| 7223 | -S "found fragmented DTLS handshake message" \ |
| 7224 | -c "found fragmented DTLS handshake message" \ |
| 7225 | -C "error" |
| 7226 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7227 | # With the MFL extension, the server has no way of forcing |
| 7228 | # the client to not exceed a certain MTU; hence, the following |
| 7229 | # test can't be replicated with an MTU proxy such as the one |
| 7230 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7231 | requires_config_enabled MBEDTLS_RSA_C |
| 7232 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7233 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7234 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7235 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7236 | crt_file=data_files/server7_int-ca.crt \ |
| 7237 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7238 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7239 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7240 | max_frag_len=512" \ |
| 7241 | "$P_CLI dtls=1 debug_level=2 \ |
| 7242 | crt_file=data_files/server8_int-ca2.crt \ |
| 7243 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7244 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7245 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7246 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7247 | 0 \ |
| 7248 | -S "found fragmented DTLS handshake message" \ |
| 7249 | -c "found fragmented DTLS handshake message" \ |
| 7250 | -C "error" |
| 7251 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7252 | requires_config_enabled MBEDTLS_RSA_C |
| 7253 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7254 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7255 | 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] | 7256 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7257 | crt_file=data_files/server7_int-ca.crt \ |
| 7258 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7259 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7260 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7261 | max_frag_len=2048" \ |
| 7262 | "$P_CLI dtls=1 debug_level=2 \ |
| 7263 | crt_file=data_files/server8_int-ca2.crt \ |
| 7264 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7265 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7266 | hs_timeout=2500-60000 \ |
| 7267 | max_frag_len=1024" \ |
| 7268 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7269 | -S "found fragmented DTLS handshake message" \ |
| 7270 | -c "found fragmented DTLS handshake message" \ |
| 7271 | -C "error" |
| 7272 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7273 | # While not required by the standard defining the MFL extension |
| 7274 | # (according to which it only applies to records, not to datagrams), |
| 7275 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7276 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7277 | # to the peer. |
| 7278 | # The next test checks that no datagrams significantly larger than the |
| 7279 | # negotiated MFL are sent. |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7280 | requires_config_enabled MBEDTLS_RSA_C |
| 7281 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7282 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7283 | 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] | 7284 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7285 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7286 | crt_file=data_files/server7_int-ca.crt \ |
| 7287 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7288 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7289 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7290 | max_frag_len=2048" \ |
| 7291 | "$P_CLI dtls=1 debug_level=2 \ |
| 7292 | crt_file=data_files/server8_int-ca2.crt \ |
| 7293 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7294 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7295 | hs_timeout=2500-60000 \ |
| 7296 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7297 | 0 \ |
| 7298 | -S "found fragmented DTLS handshake message" \ |
| 7299 | -c "found fragmented DTLS handshake message" \ |
| 7300 | -C "error" |
| 7301 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7302 | requires_config_enabled MBEDTLS_RSA_C |
| 7303 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7304 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7305 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7306 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7307 | crt_file=data_files/server7_int-ca.crt \ |
| 7308 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7309 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7310 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7311 | max_frag_len=2048" \ |
| 7312 | "$P_CLI dtls=1 debug_level=2 \ |
| 7313 | crt_file=data_files/server8_int-ca2.crt \ |
| 7314 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7315 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7316 | hs_timeout=2500-60000 \ |
| 7317 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7318 | 0 \ |
| 7319 | -s "found fragmented DTLS handshake message" \ |
| 7320 | -c "found fragmented DTLS handshake message" \ |
| 7321 | -C "error" |
| 7322 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7323 | # While not required by the standard defining the MFL extension |
| 7324 | # (according to which it only applies to records, not to datagrams), |
| 7325 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7326 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7327 | # to the peer. |
| 7328 | # The next test checks that no datagrams significantly larger than the |
| 7329 | # negotiated MFL are sent. |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7330 | requires_config_enabled MBEDTLS_RSA_C |
| 7331 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7332 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7333 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7334 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7335 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7336 | crt_file=data_files/server7_int-ca.crt \ |
| 7337 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7338 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7339 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7340 | max_frag_len=2048" \ |
| 7341 | "$P_CLI dtls=1 debug_level=2 \ |
| 7342 | crt_file=data_files/server8_int-ca2.crt \ |
| 7343 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7344 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7345 | hs_timeout=2500-60000 \ |
| 7346 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7347 | 0 \ |
| 7348 | -s "found fragmented DTLS handshake message" \ |
| 7349 | -c "found fragmented DTLS handshake message" \ |
| 7350 | -C "error" |
| 7351 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7352 | requires_config_enabled MBEDTLS_RSA_C |
| 7353 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7354 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7355 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7356 | crt_file=data_files/server7_int-ca.crt \ |
| 7357 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7358 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7359 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7360 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7361 | "$P_CLI dtls=1 debug_level=2 \ |
| 7362 | crt_file=data_files/server8_int-ca2.crt \ |
| 7363 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7364 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7365 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7366 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7367 | 0 \ |
| 7368 | -S "found fragmented DTLS handshake message" \ |
| 7369 | -C "found fragmented DTLS handshake message" \ |
| 7370 | -C "error" |
| 7371 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7372 | requires_config_enabled MBEDTLS_RSA_C |
| 7373 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7374 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7375 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7376 | crt_file=data_files/server7_int-ca.crt \ |
| 7377 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7378 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7379 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7380 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7381 | "$P_CLI dtls=1 debug_level=2 \ |
| 7382 | crt_file=data_files/server8_int-ca2.crt \ |
| 7383 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7384 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7385 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7386 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7387 | 0 \ |
| 7388 | -s "found fragmented DTLS handshake message" \ |
| 7389 | -C "found fragmented DTLS handshake message" \ |
| 7390 | -C "error" |
| 7391 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7392 | requires_config_enabled MBEDTLS_RSA_C |
| 7393 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7394 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7395 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7396 | crt_file=data_files/server7_int-ca.crt \ |
| 7397 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7398 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7399 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7400 | mtu=512" \ |
| 7401 | "$P_CLI dtls=1 debug_level=2 \ |
| 7402 | crt_file=data_files/server8_int-ca2.crt \ |
| 7403 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7404 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7405 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7406 | mtu=2048" \ |
| 7407 | 0 \ |
| 7408 | -S "found fragmented DTLS handshake message" \ |
| 7409 | -c "found fragmented DTLS handshake message" \ |
| 7410 | -C "error" |
| 7411 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7412 | requires_config_enabled MBEDTLS_RSA_C |
| 7413 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7414 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7415 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7416 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7417 | crt_file=data_files/server7_int-ca.crt \ |
| 7418 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7419 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7420 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7421 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7422 | "$P_CLI dtls=1 debug_level=2 \ |
| 7423 | crt_file=data_files/server8_int-ca2.crt \ |
| 7424 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7425 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7426 | hs_timeout=2500-60000 \ |
| 7427 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7428 | 0 \ |
| 7429 | -s "found fragmented DTLS handshake message" \ |
| 7430 | -c "found fragmented DTLS handshake message" \ |
| 7431 | -C "error" |
| 7432 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7433 | # 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] | 7434 | requires_config_enabled MBEDTLS_RSA_C |
| 7435 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7436 | requires_config_enabled MBEDTLS_SHA256_C |
| 7437 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7438 | requires_config_enabled MBEDTLS_AES_C |
| 7439 | requires_config_enabled MBEDTLS_GCM_C |
| 7440 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7441 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7442 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7443 | crt_file=data_files/server7_int-ca.crt \ |
| 7444 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7445 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7446 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7447 | mtu=512" \ |
| 7448 | "$P_CLI dtls=1 debug_level=2 \ |
| 7449 | crt_file=data_files/server8_int-ca2.crt \ |
| 7450 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7451 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7452 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7453 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7454 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7455 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7456 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7457 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7458 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7459 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7460 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7461 | # 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] | 7462 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7463 | # retransmissions, but in some cases (like both the server and client using |
| 7464 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7465 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7466 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7467 | requires_config_enabled MBEDTLS_RSA_C |
| 7468 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7469 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7470 | requires_config_enabled MBEDTLS_AES_C |
| 7471 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7472 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 7473 | -p "$P_PXY mtu=508" \ |
| 7474 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7475 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7476 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7477 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7478 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7479 | "$P_CLI dtls=1 debug_level=2 \ |
| 7480 | crt_file=data_files/server8_int-ca2.crt \ |
| 7481 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7482 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7483 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7484 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7485 | 0 \ |
| 7486 | -s "found fragmented DTLS handshake message" \ |
| 7487 | -c "found fragmented DTLS handshake message" \ |
| 7488 | -C "error" |
| 7489 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7490 | # 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] | 7491 | only_with_valgrind |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7492 | requires_config_enabled MBEDTLS_RSA_C |
| 7493 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7494 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7495 | requires_config_enabled MBEDTLS_AES_C |
| 7496 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7497 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 7498 | -p "$P_PXY mtu=508" \ |
| 7499 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7500 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7501 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7502 | ca_file=data_files/test-ca.crt \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7503 | hs_timeout=250-10000" \ |
| 7504 | "$P_CLI dtls=1 debug_level=2 \ |
| 7505 | crt_file=data_files/server8_int-ca2.crt \ |
| 7506 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7507 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7508 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7509 | hs_timeout=250-10000" \ |
| 7510 | 0 \ |
| 7511 | -s "found fragmented DTLS handshake message" \ |
| 7512 | -c "found fragmented DTLS handshake message" \ |
| 7513 | -C "error" |
| 7514 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7515 | # 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] | 7516 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7517 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7518 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7519 | requires_config_enabled MBEDTLS_RSA_C |
| 7520 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7521 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7522 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7523 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7524 | crt_file=data_files/server7_int-ca.crt \ |
| 7525 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7526 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7527 | hs_timeout=10000-60000 \ |
| 7528 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7529 | "$P_CLI dtls=1 debug_level=2 \ |
| 7530 | crt_file=data_files/server8_int-ca2.crt \ |
| 7531 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7532 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7533 | hs_timeout=10000-60000 \ |
| 7534 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7535 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7536 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7537 | -s "found fragmented DTLS handshake message" \ |
| 7538 | -c "found fragmented DTLS handshake message" \ |
| 7539 | -C "error" |
| 7540 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7541 | # 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] | 7542 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7543 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7544 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7545 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7546 | requires_config_enabled MBEDTLS_RSA_C |
| 7547 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7548 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7549 | requires_config_enabled MBEDTLS_AES_C |
| 7550 | requires_config_enabled MBEDTLS_GCM_C |
| 7551 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7552 | -p "$P_PXY mtu=512" \ |
| 7553 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7554 | crt_file=data_files/server7_int-ca.crt \ |
| 7555 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7556 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7557 | hs_timeout=10000-60000 \ |
| 7558 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7559 | "$P_CLI dtls=1 debug_level=2 \ |
| 7560 | crt_file=data_files/server8_int-ca2.crt \ |
| 7561 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7562 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7563 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7564 | hs_timeout=10000-60000 \ |
| 7565 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7566 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7567 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7568 | -s "found fragmented DTLS handshake message" \ |
| 7569 | -c "found fragmented DTLS handshake message" \ |
| 7570 | -C "error" |
| 7571 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7572 | not_with_valgrind # spurious autoreduction due to timeout |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7573 | requires_config_enabled MBEDTLS_RSA_C |
| 7574 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7575 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7576 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7577 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7578 | crt_file=data_files/server7_int-ca.crt \ |
| 7579 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7580 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7581 | hs_timeout=10000-60000 \ |
| 7582 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7583 | "$P_CLI dtls=1 debug_level=2 \ |
| 7584 | crt_file=data_files/server8_int-ca2.crt \ |
| 7585 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7586 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7587 | hs_timeout=10000-60000 \ |
| 7588 | mtu=1024 nbio=2" \ |
| 7589 | 0 \ |
| 7590 | -S "autoreduction" \ |
| 7591 | -s "found fragmented DTLS handshake message" \ |
| 7592 | -c "found fragmented DTLS handshake message" \ |
| 7593 | -C "error" |
| 7594 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7595 | # 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] | 7596 | not_with_valgrind # spurious autoreduction due to timeout |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7597 | requires_config_enabled MBEDTLS_RSA_C |
| 7598 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7599 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7600 | requires_config_enabled MBEDTLS_AES_C |
| 7601 | requires_config_enabled MBEDTLS_GCM_C |
| 7602 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7603 | -p "$P_PXY mtu=512" \ |
| 7604 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7605 | crt_file=data_files/server7_int-ca.crt \ |
| 7606 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7607 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7608 | hs_timeout=10000-60000 \ |
| 7609 | mtu=512 nbio=2" \ |
| 7610 | "$P_CLI dtls=1 debug_level=2 \ |
| 7611 | crt_file=data_files/server8_int-ca2.crt \ |
| 7612 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7613 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7614 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7615 | hs_timeout=10000-60000 \ |
| 7616 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7617 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7618 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7619 | -s "found fragmented DTLS handshake message" \ |
| 7620 | -c "found fragmented DTLS handshake message" \ |
| 7621 | -C "error" |
| 7622 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7623 | # 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] | 7624 | # This ensures things still work after session_reset(). |
| 7625 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7626 | # Since we don't support reading fragmented ClientHello yet, |
| 7627 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7628 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7629 | # An autoreduction on the client-side might happen if the server is |
| 7630 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7631 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7632 | # resumed listening, which would result in a spurious autoreduction. |
| 7633 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7634 | requires_config_enabled MBEDTLS_RSA_C |
| 7635 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7636 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7637 | requires_config_enabled MBEDTLS_AES_C |
| 7638 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7639 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7640 | -p "$P_PXY mtu=1450" \ |
| 7641 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7642 | crt_file=data_files/server7_int-ca.crt \ |
| 7643 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7644 | ca_file=data_files/test-ca.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7645 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7646 | mtu=1450" \ |
| 7647 | "$P_CLI dtls=1 debug_level=2 \ |
| 7648 | crt_file=data_files/server8_int-ca2.crt \ |
| 7649 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7650 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7651 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7652 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7653 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7654 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7655 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7656 | -s "found fragmented DTLS handshake message" \ |
| 7657 | -c "found fragmented DTLS handshake message" \ |
| 7658 | -C "error" |
| 7659 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7660 | # An autoreduction on the client-side might happen if the server is |
| 7661 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7662 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7663 | requires_config_enabled MBEDTLS_RSA_C |
| 7664 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7665 | requires_config_enabled MBEDTLS_SHA256_C |
| 7666 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7667 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7668 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7669 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7670 | -p "$P_PXY mtu=512" \ |
| 7671 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7672 | crt_file=data_files/server7_int-ca.crt \ |
| 7673 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7674 | ca_file=data_files/test-ca.crt \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7675 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7676 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7677 | mtu=512" \ |
| 7678 | "$P_CLI dtls=1 debug_level=2 \ |
| 7679 | crt_file=data_files/server8_int-ca2.crt \ |
| 7680 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7681 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7682 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7683 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7684 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7685 | mtu=512" \ |
| 7686 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7687 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7688 | -s "found fragmented DTLS handshake message" \ |
| 7689 | -c "found fragmented DTLS handshake message" \ |
| 7690 | -C "error" |
| 7691 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7692 | # An autoreduction on the client-side might happen if the server is |
| 7693 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7694 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7695 | requires_config_enabled MBEDTLS_RSA_C |
| 7696 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7697 | requires_config_enabled MBEDTLS_SHA256_C |
| 7698 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7699 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7700 | requires_config_enabled MBEDTLS_AES_C |
| 7701 | requires_config_enabled MBEDTLS_GCM_C |
| 7702 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7703 | -p "$P_PXY mtu=512" \ |
| 7704 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7705 | crt_file=data_files/server7_int-ca.crt \ |
| 7706 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7707 | ca_file=data_files/test-ca.crt \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7708 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7709 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7710 | mtu=512" \ |
| 7711 | "$P_CLI dtls=1 debug_level=2 \ |
| 7712 | crt_file=data_files/server8_int-ca2.crt \ |
| 7713 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7714 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7715 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7716 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7717 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7718 | mtu=512" \ |
| 7719 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7720 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7721 | -s "found fragmented DTLS handshake message" \ |
| 7722 | -c "found fragmented DTLS handshake message" \ |
| 7723 | -C "error" |
| 7724 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7725 | # An autoreduction on the client-side might happen if the server is |
| 7726 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7727 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7728 | requires_config_enabled MBEDTLS_RSA_C |
| 7729 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7730 | requires_config_enabled MBEDTLS_SHA256_C |
| 7731 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7732 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7733 | requires_config_enabled MBEDTLS_AES_C |
| 7734 | requires_config_enabled MBEDTLS_CCM_C |
| 7735 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7736 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7737 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7738 | crt_file=data_files/server7_int-ca.crt \ |
| 7739 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7740 | ca_file=data_files/test-ca.crt \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7741 | exchanges=2 renegotiation=1 \ |
| 7742 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7743 | hs_timeout=10000-60000 \ |
| 7744 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7745 | "$P_CLI dtls=1 debug_level=2 \ |
| 7746 | crt_file=data_files/server8_int-ca2.crt \ |
| 7747 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7748 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7749 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7750 | hs_timeout=10000-60000 \ |
| 7751 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7752 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7753 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7754 | -s "found fragmented DTLS handshake message" \ |
| 7755 | -c "found fragmented DTLS handshake message" \ |
| 7756 | -C "error" |
| 7757 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7758 | # An autoreduction on the client-side might happen if the server is |
| 7759 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7760 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7761 | requires_config_enabled MBEDTLS_RSA_C |
| 7762 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7763 | requires_config_enabled MBEDTLS_SHA256_C |
| 7764 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7765 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7766 | requires_config_enabled MBEDTLS_AES_C |
| 7767 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7768 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7769 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7770 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7771 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7772 | crt_file=data_files/server7_int-ca.crt \ |
| 7773 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7774 | ca_file=data_files/test-ca.crt \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7775 | exchanges=2 renegotiation=1 \ |
| 7776 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7777 | hs_timeout=10000-60000 \ |
| 7778 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7779 | "$P_CLI dtls=1 debug_level=2 \ |
| 7780 | crt_file=data_files/server8_int-ca2.crt \ |
| 7781 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7782 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7783 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7784 | hs_timeout=10000-60000 \ |
| 7785 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7786 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7787 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7788 | -s "found fragmented DTLS handshake message" \ |
| 7789 | -c "found fragmented DTLS handshake message" \ |
| 7790 | -C "error" |
| 7791 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7792 | # An autoreduction on the client-side might happen if the server is |
| 7793 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7794 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7795 | requires_config_enabled MBEDTLS_RSA_C |
| 7796 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7797 | requires_config_enabled MBEDTLS_SHA256_C |
| 7798 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7799 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7800 | requires_config_enabled MBEDTLS_AES_C |
| 7801 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7802 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7803 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7804 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7805 | crt_file=data_files/server7_int-ca.crt \ |
| 7806 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7807 | ca_file=data_files/test-ca.crt \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7808 | exchanges=2 renegotiation=1 \ |
| 7809 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7810 | hs_timeout=10000-60000 \ |
| 7811 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7812 | "$P_CLI dtls=1 debug_level=2 \ |
| 7813 | crt_file=data_files/server8_int-ca2.crt \ |
| 7814 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7815 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7816 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7817 | hs_timeout=10000-60000 \ |
| 7818 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7819 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7820 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7821 | -s "found fragmented DTLS handshake message" \ |
| 7822 | -c "found fragmented DTLS handshake message" \ |
| 7823 | -C "error" |
| 7824 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7825 | # 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] | 7826 | requires_config_enabled MBEDTLS_RSA_C |
| 7827 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7828 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7829 | requires_config_enabled MBEDTLS_AES_C |
| 7830 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7831 | client_needs_more_time 2 |
| 7832 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7833 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7834 | "$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] | 7835 | crt_file=data_files/server7_int-ca.crt \ |
| 7836 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7837 | ca_file=data_files/test-ca.crt \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7838 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7839 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7840 | crt_file=data_files/server8_int-ca2.crt \ |
| 7841 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7842 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7843 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7844 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7845 | 0 \ |
| 7846 | -s "found fragmented DTLS handshake message" \ |
| 7847 | -c "found fragmented DTLS handshake message" \ |
| 7848 | -C "error" |
| 7849 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7850 | # 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] | 7851 | requires_config_enabled MBEDTLS_RSA_C |
| 7852 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7853 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7854 | requires_config_enabled MBEDTLS_AES_C |
| 7855 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7856 | client_needs_more_time 2 |
| 7857 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7858 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7859 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7860 | crt_file=data_files/server7_int-ca.crt \ |
| 7861 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7862 | ca_file=data_files/test-ca.crt \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7863 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7864 | "$P_CLI dtls=1 debug_level=2 \ |
| 7865 | crt_file=data_files/server8_int-ca2.crt \ |
| 7866 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7867 | ca_file=data_files/test-ca2.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7868 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7869 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7870 | 0 \ |
| 7871 | -s "found fragmented DTLS handshake message" \ |
| 7872 | -c "found fragmented DTLS handshake message" \ |
| 7873 | -C "error" |
| 7874 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7875 | # interop tests for DTLS fragmentating with reliable connection |
| 7876 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7877 | # here and below we just want to test that the we fragment in a way that |
| 7878 | # pleases other implementations, so we don't need the peer to fragment |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7879 | requires_config_enabled MBEDTLS_RSA_C |
| 7880 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7882 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7883 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7884 | "$G_SRV -u" \ |
| 7885 | "$P_CLI dtls=1 debug_level=2 \ |
| 7886 | crt_file=data_files/server8_int-ca2.crt \ |
| 7887 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7888 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7889 | mtu=512 force_version=dtls1_2" \ |
| 7890 | 0 \ |
| 7891 | -c "fragmenting handshake message" \ |
| 7892 | -C "error" |
| 7893 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7894 | requires_config_enabled MBEDTLS_RSA_C |
| 7895 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7897 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7898 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 7899 | "$G_SRV -u" \ |
| 7900 | "$P_CLI dtls=1 debug_level=2 \ |
| 7901 | crt_file=data_files/server8_int-ca2.crt \ |
| 7902 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7903 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7904 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7905 | 0 \ |
| 7906 | -c "fragmenting handshake message" \ |
| 7907 | -C "error" |
| 7908 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7909 | # We use --insecure for the GnuTLS client because it expects |
| 7910 | # the hostname / IP it connects to to be the name used in the |
| 7911 | # certificate obtained from the server. Here, however, it |
| 7912 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7913 | # as the server name in the certificate. This will make the |
| 7914 | # certifiate validation fail, but passing --insecure makes |
| 7915 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7916 | requires_config_enabled MBEDTLS_RSA_C |
| 7917 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7919 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7920 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7921 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7922 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7923 | crt_file=data_files/server7_int-ca.crt \ |
| 7924 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7925 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7926 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7927 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7928 | 0 \ |
| 7929 | -s "fragmenting handshake message" |
| 7930 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7931 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7932 | requires_config_enabled MBEDTLS_RSA_C |
| 7933 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7935 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7936 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7937 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7938 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7939 | crt_file=data_files/server7_int-ca.crt \ |
| 7940 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7941 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7942 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7943 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7944 | 0 \ |
| 7945 | -s "fragmenting handshake message" |
| 7946 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7947 | requires_config_enabled MBEDTLS_RSA_C |
| 7948 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7950 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7951 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7952 | "$P_CLI dtls=1 debug_level=2 \ |
| 7953 | crt_file=data_files/server8_int-ca2.crt \ |
| 7954 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7955 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7956 | mtu=512 force_version=dtls1_2" \ |
| 7957 | 0 \ |
| 7958 | -c "fragmenting handshake message" \ |
| 7959 | -C "error" |
| 7960 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7961 | requires_config_enabled MBEDTLS_RSA_C |
| 7962 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7964 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 7965 | "$O_SRV -dtls1 -verify 10" \ |
| 7966 | "$P_CLI dtls=1 debug_level=2 \ |
| 7967 | crt_file=data_files/server8_int-ca2.crt \ |
| 7968 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7969 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7970 | mtu=512 force_version=dtls1" \ |
| 7971 | 0 \ |
| 7972 | -c "fragmenting handshake message" \ |
| 7973 | -C "error" |
| 7974 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7975 | requires_config_enabled MBEDTLS_RSA_C |
| 7976 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7977 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7978 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7979 | "$P_SRV dtls=1 debug_level=2 \ |
| 7980 | crt_file=data_files/server7_int-ca.crt \ |
| 7981 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7982 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7983 | mtu=512 force_version=dtls1_2" \ |
| 7984 | "$O_CLI -dtls1_2" \ |
| 7985 | 0 \ |
| 7986 | -s "fragmenting handshake message" |
| 7987 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7988 | requires_config_enabled MBEDTLS_RSA_C |
| 7989 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7991 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 7992 | "$P_SRV dtls=1 debug_level=2 \ |
| 7993 | crt_file=data_files/server7_int-ca.crt \ |
| 7994 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 7995 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7996 | mtu=512 force_version=dtls1" \ |
| 7997 | "$O_CLI -dtls1" \ |
| 7998 | 0 \ |
| 7999 | -s "fragmenting handshake message" |
| 8000 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8001 | # interop tests for DTLS fragmentating with unreliable connection |
| 8002 | # |
| 8003 | # again we just want to test that the we fragment in a way that |
| 8004 | # pleases other implementations, so we don't need the peer to fragment |
| 8005 | requires_gnutls_next |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8006 | requires_config_enabled MBEDTLS_RSA_C |
| 8007 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8009 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8010 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8011 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8012 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8013 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8014 | crt_file=data_files/server8_int-ca2.crt \ |
| 8015 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8016 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8017 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8018 | 0 \ |
| 8019 | -c "fragmenting handshake message" \ |
| 8020 | -C "error" |
| 8021 | |
| 8022 | requires_gnutls_next |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8023 | requires_config_enabled MBEDTLS_RSA_C |
| 8024 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8026 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8027 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8028 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8029 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8030 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8031 | crt_file=data_files/server8_int-ca2.crt \ |
| 8032 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8033 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8034 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8035 | 0 \ |
| 8036 | -c "fragmenting handshake message" \ |
| 8037 | -C "error" |
| 8038 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8039 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8040 | requires_config_enabled MBEDTLS_RSA_C |
| 8041 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8043 | client_needs_more_time 4 |
| 8044 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8045 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8046 | "$P_SRV dtls=1 debug_level=2 \ |
| 8047 | crt_file=data_files/server7_int-ca.crt \ |
| 8048 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8049 | ca_file=data_files/test-ca2.crt \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8050 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8051 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8052 | 0 \ |
| 8053 | -s "fragmenting handshake message" |
| 8054 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8055 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8056 | requires_config_enabled MBEDTLS_RSA_C |
| 8057 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8059 | client_needs_more_time 4 |
| 8060 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8061 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8062 | "$P_SRV dtls=1 debug_level=2 \ |
| 8063 | crt_file=data_files/server7_int-ca.crt \ |
| 8064 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8065 | ca_file=data_files/test-ca2.crt \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8066 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8067 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8068 | 0 \ |
| 8069 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8070 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8071 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8072 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8073 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8074 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8075 | ## (this should happen in some 1.1.1_ release according to the ticket). |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8076 | skip_next_test |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8077 | requires_config_enabled MBEDTLS_RSA_C |
| 8078 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8079 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8080 | client_needs_more_time 4 |
| 8081 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8082 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8083 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8084 | "$P_CLI dtls=1 debug_level=2 \ |
| 8085 | crt_file=data_files/server8_int-ca2.crt \ |
| 8086 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8087 | ca_file=data_files/test-ca2.crt \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8088 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8089 | 0 \ |
| 8090 | -c "fragmenting handshake message" \ |
| 8091 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8092 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8093 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8094 | requires_config_enabled MBEDTLS_RSA_C |
| 8095 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8097 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8098 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8099 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8100 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8101 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8102 | crt_file=data_files/server8_int-ca2.crt \ |
| 8103 | key_file=data_files/server8.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8104 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8105 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8106 | 0 \ |
| 8107 | -c "fragmenting handshake message" \ |
| 8108 | -C "error" |
| 8109 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8110 | skip_next_test |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8111 | requires_config_enabled MBEDTLS_RSA_C |
| 8112 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8113 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8114 | client_needs_more_time 4 |
| 8115 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8116 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8117 | "$P_SRV dtls=1 debug_level=2 \ |
| 8118 | crt_file=data_files/server7_int-ca.crt \ |
| 8119 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8120 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8121 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8122 | "$O_CLI -dtls1_2" \ |
| 8123 | 0 \ |
| 8124 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8125 | |
| 8126 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8127 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8128 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8129 | requires_config_enabled MBEDTLS_RSA_C |
| 8130 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8132 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8133 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8134 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8135 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8136 | crt_file=data_files/server7_int-ca.crt \ |
| 8137 | key_file=data_files/server7.key \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8138 | ca_file=data_files/test-ca2.crt \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8139 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8140 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8141 | 0 \ |
| 8142 | -s "fragmenting handshake message" |
| 8143 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8144 | # Tests for specific things with "unreliable" UDP connection |
| 8145 | |
| 8146 | not_with_valgrind # spurious resend due to timeout |
| 8147 | run_test "DTLS proxy: reference" \ |
| 8148 | -p "$P_PXY" \ |
| 8149 | "$P_SRV dtls=1 debug_level=2" \ |
| 8150 | "$P_CLI dtls=1 debug_level=2" \ |
| 8151 | 0 \ |
| 8152 | -C "replayed record" \ |
| 8153 | -S "replayed record" \ |
Hanno Becker | e03eb7b | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8154 | -C "Buffer record from epoch" \ |
| 8155 | -S "Buffer record from epoch" \ |
| 8156 | -C "ssl_buffer_message" \ |
| 8157 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8158 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8159 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8160 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8161 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8162 | -c "HTTP/1.0 200 OK" |
| 8163 | |
| 8164 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8165 | run_test "DTLS proxy: duplicate every packet" \ |
| 8166 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 7f376f4 | 2019-06-12 16:20:48 +0100 | [diff] [blame] | 8167 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8168 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8169 | 0 \ |
| 8170 | -c "replayed record" \ |
| 8171 | -s "replayed record" \ |
| 8172 | -c "record from another epoch" \ |
| 8173 | -s "record from another epoch" \ |
| 8174 | -S "resend" \ |
| 8175 | -s "Extra-header:" \ |
| 8176 | -c "HTTP/1.0 200 OK" |
| 8177 | |
| 8178 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8179 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8180 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8181 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8182 | 0 \ |
| 8183 | -c "replayed record" \ |
| 8184 | -S "replayed record" \ |
| 8185 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8186 | -s "record from another epoch" \ |
| 8187 | -c "resend" \ |
| 8188 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8189 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8190 | -c "HTTP/1.0 200 OK" |
| 8191 | |
| 8192 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8193 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8194 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8195 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8196 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8197 | -c "next record in same datagram" \ |
| 8198 | -s "next record in same datagram" |
| 8199 | |
| 8200 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8201 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8202 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8203 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8204 | 0 \ |
| 8205 | -c "next record in same datagram" \ |
| 8206 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8207 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8208 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8209 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8210 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8211 | "$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] | 8212 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8213 | -c "discarding invalid record (mac)" \ |
| 8214 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8215 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8216 | -c "HTTP/1.0 200 OK" \ |
| 8217 | -S "too many records with bad MAC" \ |
| 8218 | -S "Verification of the message MAC failed" |
| 8219 | |
| 8220 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8221 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8222 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8223 | "$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] | 8224 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8225 | -C "discarding invalid record (mac)" \ |
| 8226 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8227 | -S "Extra-header:" \ |
| 8228 | -C "HTTP/1.0 200 OK" \ |
| 8229 | -s "too many records with bad MAC" \ |
| 8230 | -s "Verification of the message MAC failed" |
| 8231 | |
| 8232 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8233 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8234 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8235 | "$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] | 8236 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8237 | -c "discarding invalid record (mac)" \ |
| 8238 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8239 | -s "Extra-header:" \ |
| 8240 | -c "HTTP/1.0 200 OK" \ |
| 8241 | -S "too many records with bad MAC" \ |
| 8242 | -S "Verification of the message MAC failed" |
| 8243 | |
| 8244 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8245 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8246 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8247 | "$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] | 8248 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8249 | -c "discarding invalid record (mac)" \ |
| 8250 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8251 | -s "Extra-header:" \ |
| 8252 | -c "HTTP/1.0 200 OK" \ |
| 8253 | -s "too many records with bad MAC" \ |
| 8254 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8255 | |
| 8256 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8257 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8258 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8259 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8260 | 0 \ |
| 8261 | -c "record from another epoch" \ |
| 8262 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8263 | -s "Extra-header:" \ |
| 8264 | -c "HTTP/1.0 200 OK" |
| 8265 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8266 | # Tests for reordering support with DTLS |
| 8267 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8268 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8269 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8270 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8271 | hs_timeout=2500-60000" \ |
| 8272 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8273 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8274 | 0 \ |
| 8275 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8276 | -c "Next handshake message has been buffered - load"\ |
| 8277 | -S "Buffering HS message" \ |
| 8278 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8279 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8280 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8281 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8282 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8283 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8284 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8285 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8286 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8287 | hs_timeout=2500-60000" \ |
| 8288 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8289 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8290 | 0 \ |
| 8291 | -c "Buffering HS message" \ |
| 8292 | -c "found fragmented DTLS handshake message"\ |
| 8293 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8294 | -c "Next handshake message has been buffered - load"\ |
| 8295 | -S "Buffering HS message" \ |
| 8296 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8297 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8298 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8299 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8300 | -S "Remember CCS message" |
| 8301 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8302 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8303 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8304 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8305 | # while keeping the ServerKeyExchange. |
| 8306 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8307 | 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] | 8308 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8309 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8310 | hs_timeout=2500-60000" \ |
| 8311 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8312 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8313 | 0 \ |
| 8314 | -c "Buffering HS message" \ |
| 8315 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8316 | -C "attempt to make space by freeing buffered messages" \ |
| 8317 | -S "Buffering HS message" \ |
| 8318 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8319 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8320 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8321 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8322 | -S "Remember CCS message" |
| 8323 | |
| 8324 | # The size constraints ensure that the delayed certificate message can't |
| 8325 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8326 | # when dropping it first. |
| 8327 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8328 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8329 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8330 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8331 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8332 | hs_timeout=2500-60000" \ |
| 8333 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8334 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8335 | 0 \ |
| 8336 | -c "Buffering HS message" \ |
| 8337 | -c "attempt to make space by freeing buffered future messages" \ |
| 8338 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8339 | -S "Buffering HS message" \ |
| 8340 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8341 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8342 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8343 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8344 | -S "Remember CCS message" |
| 8345 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8346 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8347 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8348 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8349 | hs_timeout=2500-60000" \ |
| 8350 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8351 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8352 | 0 \ |
| 8353 | -C "Buffering HS message" \ |
| 8354 | -C "Next handshake message has been buffered - load"\ |
| 8355 | -s "Buffering HS message" \ |
| 8356 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8357 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8358 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8359 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8360 | -S "Remember CCS message" |
| 8361 | |
Manuel Pégourié-Gonnard | f1c6ad4 | 2019-07-01 10:13:04 +0200 | [diff] [blame] | 8362 | # This needs session tickets; otherwise CCS is the first message in its flight |
| 8363 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8364 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8365 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8366 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8367 | hs_timeout=2500-60000" \ |
| 8368 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8369 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8370 | 0 \ |
| 8371 | -C "Buffering HS message" \ |
| 8372 | -C "Next handshake message has been buffered - load"\ |
| 8373 | -S "Buffering HS message" \ |
| 8374 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8375 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8376 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8377 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8378 | -S "Remember CCS message" |
| 8379 | |
| 8380 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8381 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8382 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8383 | hs_timeout=2500-60000" \ |
| 8384 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8385 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8386 | 0 \ |
| 8387 | -C "Buffering HS message" \ |
| 8388 | -C "Next handshake message has been buffered - load"\ |
| 8389 | -S "Buffering HS message" \ |
| 8390 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8391 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8392 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8393 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8394 | -s "Remember CCS message" |
| 8395 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8396 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8397 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8398 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8399 | hs_timeout=2500-60000" \ |
| 8400 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8401 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8402 | 0 \ |
| 8403 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8404 | -s "Found buffered record from current epoch - load" \ |
| 8405 | -c "Buffer record from epoch 1" \ |
| 8406 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8407 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8408 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8409 | # from the server are delayed, so that the encrypted Finished message |
| 8410 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8411 | # in afterwards, the encrypted Finished message must be freed in order |
| 8412 | # to make space for the NewSessionTicket to be reassembled. |
| 8413 | # This works only in very particular circumstances: |
| 8414 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8415 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8416 | # the encrypted Finished message. |
| 8417 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8418 | # needs to be fragmented. |
| 8419 | # - All messages sent by the server must be small enough to be either sent |
| 8420 | # without fragmentation or be reassembled within the bounds of |
| 8421 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8422 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | f8c355a | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8423 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8424 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8425 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8426 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Manuel Pégourié-Gonnard | f8c355a | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8427 | "$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] | 8428 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8429 | 0 \ |
| 8430 | -s "Buffer record from epoch 1" \ |
| 8431 | -s "Found buffered record from current epoch - load" \ |
| 8432 | -c "Buffer record from epoch 1" \ |
| 8433 | -C "Found buffered record from current epoch - load" \ |
| 8434 | -c "Enough space available after freeing future epoch record" |
| 8435 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8436 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8437 | |
| 8438 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8439 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8440 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8441 | "$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] | 8442 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8443 | "$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] | 8444 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8445 | 0 \ |
| 8446 | -s "Extra-header:" \ |
| 8447 | -c "HTTP/1.0 200 OK" |
| 8448 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8449 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8450 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8451 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8452 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8453 | "$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] | 8454 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8455 | 0 \ |
| 8456 | -s "Extra-header:" \ |
| 8457 | -c "HTTP/1.0 200 OK" |
| 8458 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8459 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8460 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8461 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8462 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8463 | "$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] | 8464 | 0 \ |
| 8465 | -s "Extra-header:" \ |
| 8466 | -c "HTTP/1.0 200 OK" |
| 8467 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8468 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8469 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8470 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8471 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8472 | "$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] | 8473 | 0 \ |
| 8474 | -s "Extra-header:" \ |
| 8475 | -c "HTTP/1.0 200 OK" |
| 8476 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8477 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8478 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8479 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8480 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8481 | "$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] | 8482 | 0 \ |
| 8483 | -s "Extra-header:" \ |
| 8484 | -c "HTTP/1.0 200 OK" |
| 8485 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8486 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8487 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8488 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8489 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8490 | "$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] | 8491 | 0 \ |
| 8492 | -s "Extra-header:" \ |
| 8493 | -c "HTTP/1.0 200 OK" |
| 8494 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8495 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8496 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8497 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8498 | "$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] | 8499 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8500 | "$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] | 8501 | 0 \ |
| 8502 | -s "Extra-header:" \ |
| 8503 | -c "HTTP/1.0 200 OK" |
| 8504 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8505 | client_needs_more_time 4 |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 8506 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 8507 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 8508 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8509 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8510 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8511 | "$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] | 8512 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8513 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8514 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8515 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8516 | 0 \ |
| 8517 | -s "a session has been resumed" \ |
| 8518 | -c "a session has been resumed" \ |
| 8519 | -s "Extra-header:" \ |
| 8520 | -c "HTTP/1.0 200 OK" |
| 8521 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8522 | client_needs_more_time 4 |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 8523 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_RESUMPTION |
Jarno Lamsa | 5b52b27 | 2019-06-19 10:21:37 +0300 | [diff] [blame] | 8524 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Jarno Lamsa | 29f2dd0 | 2019-06-20 15:31:52 +0300 | [diff] [blame] | 8525 | requires_config_disabled MBEDTLS_SSL_NO_SESSION_CACHE |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8526 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8527 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8528 | "$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] | 8529 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8530 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8531 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8532 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8533 | 0 \ |
| 8534 | -s "a session has been resumed" \ |
| 8535 | -c "a session has been resumed" \ |
| 8536 | -s "Extra-header:" \ |
| 8537 | -c "HTTP/1.0 200 OK" |
| 8538 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8539 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8540 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8541 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8542 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8543 | "$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] | 8544 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8545 | "$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] | 8546 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8547 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8548 | 0 \ |
| 8549 | -c "=> renegotiate" \ |
| 8550 | -s "=> renegotiate" \ |
| 8551 | -s "Extra-header:" \ |
| 8552 | -c "HTTP/1.0 200 OK" |
| 8553 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8554 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8555 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8556 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8557 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8558 | "$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] | 8559 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8560 | "$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] | 8561 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8562 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8563 | 0 \ |
| 8564 | -c "=> renegotiate" \ |
| 8565 | -s "=> renegotiate" \ |
| 8566 | -s "Extra-header:" \ |
| 8567 | -c "HTTP/1.0 200 OK" |
| 8568 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8569 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8570 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8571 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8572 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8573 | "$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] | 8574 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8575 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8576 | "$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] | 8577 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8578 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8579 | 0 \ |
| 8580 | -c "=> renegotiate" \ |
| 8581 | -s "=> renegotiate" \ |
| 8582 | -s "Extra-header:" \ |
| 8583 | -c "HTTP/1.0 200 OK" |
| 8584 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8585 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8586 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8587 | 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] | 8588 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8589 | "$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] | 8590 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8591 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8592 | "$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] | 8593 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8594 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8595 | 0 \ |
| 8596 | -c "=> renegotiate" \ |
| 8597 | -s "=> renegotiate" \ |
| 8598 | -s "Extra-header:" \ |
| 8599 | -c "HTTP/1.0 200 OK" |
| 8600 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8601 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8602 | ## all versions installed on the CI machines), reported here: |
| 8603 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8604 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8605 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8606 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8607 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8608 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8609 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8610 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8611 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8612 | "$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] | 8613 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8614 | -c "HTTP/1.0 200 OK" |
| 8615 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8616 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8617 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8618 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8619 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8620 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8621 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8622 | "$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] | 8623 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8624 | -c "HTTP/1.0 200 OK" |
| 8625 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8626 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8627 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8628 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8629 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8630 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8631 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8632 | "$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] | 8633 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8634 | -c "HTTP/1.0 200 OK" |
| 8635 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8636 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8637 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8638 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8639 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8640 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8641 | "$G_SRV -u --mtu 2048 -a" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8642 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8643 | 0 \ |
| 8644 | -s "Extra-header:" \ |
| 8645 | -c "Extra-header:" |
| 8646 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8647 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8648 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8649 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8650 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8651 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8652 | "$G_NEXT_SRV -u --mtu 512" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8653 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8654 | 0 \ |
| 8655 | -s "Extra-header:" \ |
| 8656 | -c "Extra-header:" |
| 8657 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8658 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8659 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8660 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8661 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8662 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8663 | "$G_NEXT_SRV -u --mtu 512" \ |
Hanno Becker | 843f5bb | 2019-08-23 17:17:09 +0100 | [diff] [blame] | 8664 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2 ca_file=data_files/test-ca2.crt" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8665 | 0 \ |
| 8666 | -s "Extra-header:" \ |
| 8667 | -c "Extra-header:" |
| 8668 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8669 | # Final report |
| 8670 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8671 | echo "------------------------------------------------------------------------" |
| 8672 | |
| 8673 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8674 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8675 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8676 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8677 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8678 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8679 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8680 | |
| 8681 | exit $FAILS |