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 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 24 | if cd $( dirname $0 ); then :; else |
| 25 | echo "cd $( dirname $0 ) failed" >&2 |
| 26 | exit 1 |
| 27 | fi |
| 28 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 29 | # default values, can be overriden by the environment |
| 30 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 31 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 32 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 33 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 34 | : ${GNUTLS_CLI:=gnutls-cli} |
| 35 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 36 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 37 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 38 | 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] | 39 | 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] | 40 | 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] | 41 | 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] | 42 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 43 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 44 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 45 | |
| 46 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 47 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 48 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 49 | else |
| 50 | O_LEGACY_SRV=false |
| 51 | O_LEGACY_CLI=false |
| 52 | fi |
| 53 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 54 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 55 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 56 | else |
| 57 | G_NEXT_SRV=false |
| 58 | fi |
| 59 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 60 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 61 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 62 | else |
| 63 | G_NEXT_CLI=false |
| 64 | fi |
| 65 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 66 | TESTS=0 |
| 67 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 68 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 69 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 70 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 71 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 72 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 73 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 74 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 75 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 76 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 77 | RUN_TEST_NUMBER='' |
| 78 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 79 | PRESERVE_LOGS=0 |
| 80 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 81 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 82 | # port which is this plus 10000. Each port number may be independently |
| 83 | # overridden by a command line option. |
| 84 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 85 | PXY_PORT=$((SRV_PORT + 10000)) |
| 86 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 87 | print_usage() { |
| 88 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 89 | printf " -h|--help\tPrint this help.\n" |
| 90 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 91 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 92 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 93 | 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] | 94 | 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] | 95 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 96 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 97 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 98 | 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] | 99 | } |
| 100 | |
| 101 | get_options() { |
| 102 | while [ $# -gt 0 ]; do |
| 103 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 104 | -f|--filter) |
| 105 | shift; FILTER=$1 |
| 106 | ;; |
| 107 | -e|--exclude) |
| 108 | shift; EXCLUDE=$1 |
| 109 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 110 | -m|--memcheck) |
| 111 | MEMCHECK=1 |
| 112 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 113 | -n|--number) |
| 114 | shift; RUN_TEST_NUMBER=$1 |
| 115 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 116 | -s|--show-numbers) |
| 117 | SHOW_TEST_NUMBER=1 |
| 118 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 119 | -p|--preserve-logs) |
| 120 | PRESERVE_LOGS=1 |
| 121 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 122 | --port) |
| 123 | shift; SRV_PORT=$1 |
| 124 | ;; |
| 125 | --proxy-port) |
| 126 | shift; PXY_PORT=$1 |
| 127 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 128 | --seed) |
| 129 | shift; SEED="$1" |
| 130 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 131 | -h|--help) |
| 132 | print_usage |
| 133 | exit 0 |
| 134 | ;; |
| 135 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 136 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 137 | print_usage |
| 138 | exit 1 |
| 139 | ;; |
| 140 | esac |
| 141 | shift |
| 142 | done |
| 143 | } |
| 144 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 145 | # Skip next test; use this macro to skip tests which are legitimate |
| 146 | # in theory and expected to be re-introduced at some point, but |
| 147 | # aren't expected to succeed at the moment due to problems outside |
| 148 | # our control (such as bugs in other TLS implementations). |
| 149 | skip_next_test() { |
| 150 | SKIP_NEXT="YES" |
| 151 | } |
| 152 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 153 | # skip next test if the flag is not enabled in config.h |
| 154 | requires_config_enabled() { |
| 155 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 156 | SKIP_NEXT="YES" |
| 157 | fi |
| 158 | } |
| 159 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 160 | # skip next test if the flag is enabled in config.h |
| 161 | requires_config_disabled() { |
| 162 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 163 | SKIP_NEXT="YES" |
| 164 | fi |
| 165 | } |
| 166 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 167 | get_config_value_or_default() { |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 168 | NAME="$1" |
Hanno Becker | e604556 | 2018-08-28 11:24:55 +0100 | [diff] [blame] | 169 | DEF_VAL=$( grep ".*#define.*${NAME}" ../include/mbedtls/config.h | |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 170 | sed 's/^.*\s\([0-9]*\)$/\1/' ) |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 171 | ../scripts/config.pl get $NAME || echo "$DEF_VAL" |
| 172 | } |
| 173 | |
| 174 | requires_config_value_at_least() { |
| 175 | VAL=$( get_config_value_or_default "$1" ) |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 176 | if [ "$VAL" -lt "$2" ]; then |
| 177 | SKIP_NEXT="YES" |
| 178 | fi |
| 179 | } |
| 180 | |
| 181 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 182 | VAL=$( get_config_value_or_default "$1" ) |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 183 | if [ "$VAL" -gt "$2" ]; then |
| 184 | SKIP_NEXT="YES" |
| 185 | fi |
| 186 | } |
| 187 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 188 | requires_ciphersuite_enabled() { |
Hanno Becker | a0dc9cf | 2018-11-20 11:31:17 +0000 | [diff] [blame] | 189 | if [ -z "$($P_CLI --help | grep $1)" ]; then |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 190 | SKIP_NEXT="YES" |
| 191 | fi |
| 192 | } |
| 193 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 194 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 195 | requires_openssl_with_fallback_scsv() { |
| 196 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 197 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 198 | then |
| 199 | OPENSSL_HAS_FBSCSV="YES" |
| 200 | else |
| 201 | OPENSSL_HAS_FBSCSV="NO" |
| 202 | fi |
| 203 | fi |
| 204 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 205 | SKIP_NEXT="YES" |
| 206 | fi |
| 207 | } |
| 208 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 209 | # skip next test if GnuTLS isn't available |
| 210 | requires_gnutls() { |
| 211 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 212 | 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] | 213 | GNUTLS_AVAILABLE="YES" |
| 214 | else |
| 215 | GNUTLS_AVAILABLE="NO" |
| 216 | fi |
| 217 | fi |
| 218 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 219 | SKIP_NEXT="YES" |
| 220 | fi |
| 221 | } |
| 222 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 223 | # skip next test if GnuTLS-next isn't available |
| 224 | requires_gnutls_next() { |
| 225 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 226 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 227 | GNUTLS_NEXT_AVAILABLE="YES" |
| 228 | else |
| 229 | GNUTLS_NEXT_AVAILABLE="NO" |
| 230 | fi |
| 231 | fi |
| 232 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 233 | SKIP_NEXT="YES" |
| 234 | fi |
| 235 | } |
| 236 | |
| 237 | # skip next test if OpenSSL-legacy isn't available |
| 238 | requires_openssl_legacy() { |
| 239 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 240 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 241 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 242 | else |
| 243 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 244 | fi |
| 245 | fi |
| 246 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 247 | SKIP_NEXT="YES" |
| 248 | fi |
| 249 | } |
| 250 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 251 | # skip next test if IPv6 isn't available on this host |
| 252 | requires_ipv6() { |
| 253 | if [ -z "${HAS_IPV6:-}" ]; then |
| 254 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 255 | SRV_PID=$! |
| 256 | sleep 1 |
| 257 | kill $SRV_PID >/dev/null 2>&1 |
| 258 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 259 | HAS_IPV6="NO" |
| 260 | else |
| 261 | HAS_IPV6="YES" |
| 262 | fi |
| 263 | rm -r $SRV_OUT |
| 264 | fi |
| 265 | |
| 266 | if [ "$HAS_IPV6" = "NO" ]; then |
| 267 | SKIP_NEXT="YES" |
| 268 | fi |
| 269 | } |
| 270 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 271 | # skip next test if it's i686 or uname is not available |
| 272 | requires_not_i686() { |
| 273 | if [ -z "${IS_I686:-}" ]; then |
| 274 | IS_I686="YES" |
| 275 | if which "uname" >/dev/null 2>&1; then |
| 276 | if [ -z "$(uname -a | grep i686)" ]; then |
| 277 | IS_I686="NO" |
| 278 | fi |
| 279 | fi |
| 280 | fi |
| 281 | if [ "$IS_I686" = "YES" ]; then |
| 282 | SKIP_NEXT="YES" |
| 283 | fi |
| 284 | } |
| 285 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 286 | # Calculate the input & output maximum content lengths set in the config |
| 287 | MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 288 | MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 289 | MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 290 | |
| 291 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 292 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 293 | fi |
| 294 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 295 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 296 | fi |
| 297 | |
| 298 | # skip the next test if the SSL output buffer is less than 16KB |
| 299 | requires_full_size_output_buffer() { |
| 300 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 301 | SKIP_NEXT="YES" |
| 302 | fi |
| 303 | } |
| 304 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 305 | # skip the next test if valgrind is in use |
| 306 | not_with_valgrind() { |
| 307 | if [ "$MEMCHECK" -gt 0 ]; then |
| 308 | SKIP_NEXT="YES" |
| 309 | fi |
| 310 | } |
| 311 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 312 | # skip the next test if valgrind is NOT in use |
| 313 | only_with_valgrind() { |
| 314 | if [ "$MEMCHECK" -eq 0 ]; then |
| 315 | SKIP_NEXT="YES" |
| 316 | fi |
| 317 | } |
| 318 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 319 | # 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] | 320 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 321 | CLI_DELAY_FACTOR=$1 |
| 322 | } |
| 323 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 324 | # wait for the given seconds after the client finished in the next test |
| 325 | server_needs_more_time() { |
| 326 | SRV_DELAY_SECONDS=$1 |
| 327 | } |
| 328 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 329 | # print_name <name> |
| 330 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 331 | TESTS=$(( $TESTS + 1 )) |
| 332 | LINE="" |
| 333 | |
| 334 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 335 | LINE="$TESTS " |
| 336 | fi |
| 337 | |
| 338 | LINE="$LINE$1" |
| 339 | printf "$LINE " |
| 340 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 341 | for i in `seq 1 $LEN`; do printf '.'; done |
| 342 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 343 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | # fail <message> |
| 347 | fail() { |
| 348 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 349 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 350 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 351 | mv $SRV_OUT o-srv-${TESTS}.log |
| 352 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 353 | if [ -n "$PXY_CMD" ]; then |
| 354 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 355 | fi |
| 356 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 357 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 358 | 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] | 359 | echo " ! server output:" |
| 360 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 361 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 362 | echo " ! client output:" |
| 363 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 364 | if [ -n "$PXY_CMD" ]; then |
| 365 | echo " ! ========================================================" |
| 366 | echo " ! proxy output:" |
| 367 | cat o-pxy-${TESTS}.log |
| 368 | fi |
| 369 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 370 | fi |
| 371 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 372 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 373 | } |
| 374 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 375 | # is_polar <cmd_line> |
| 376 | is_polar() { |
| 377 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 378 | } |
| 379 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 380 | # openssl s_server doesn't have -www with DTLS |
| 381 | check_osrv_dtls() { |
| 382 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 383 | NEEDS_INPUT=1 |
| 384 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 385 | else |
| 386 | NEEDS_INPUT=0 |
| 387 | fi |
| 388 | } |
| 389 | |
| 390 | # provide input to commands that need it |
| 391 | provide_input() { |
| 392 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 393 | return |
| 394 | fi |
| 395 | |
| 396 | while true; do |
| 397 | echo "HTTP/1.0 200 OK" |
| 398 | sleep 1 |
| 399 | done |
| 400 | } |
| 401 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 402 | # has_mem_err <log_file_name> |
| 403 | has_mem_err() { |
| 404 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 405 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 406 | then |
| 407 | return 1 # false: does not have errors |
| 408 | else |
| 409 | return 0 # true: has errors |
| 410 | fi |
| 411 | } |
| 412 | |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 413 | # Wait for process $2 to be listening on port $1 |
| 414 | if type lsof >/dev/null 2>/dev/null; then |
| 415 | wait_server_start() { |
| 416 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 417 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 418 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 419 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 420 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 421 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 422 | # Make a tight loop, server normally takes less than 1s to start. |
| 423 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 424 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 425 | echo "SERVERSTART TIMEOUT" |
| 426 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 427 | break |
| 428 | fi |
| 429 | # Linux and *BSD support decimal arguments to sleep. On other |
| 430 | # OSes this may be a tight loop. |
| 431 | sleep 0.1 2>/dev/null || true |
| 432 | done |
| 433 | } |
| 434 | else |
Gilles Peskine | a931265 | 2018-06-29 15:48:13 +0200 | [diff] [blame] | 435 | echo "Warning: lsof not available, wait_server_start = sleep" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 436 | wait_server_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 437 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 438 | } |
| 439 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 440 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 441 | # 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] | 442 | # 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] | 443 | # acceptable bounds |
| 444 | check_server_hello_time() { |
| 445 | # 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] | 446 | 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] | 447 | # Get the Unix timestamp for now |
| 448 | CUR_TIME=$(date +'%s') |
| 449 | THRESHOLD_IN_SECS=300 |
| 450 | |
| 451 | # Check if the ServerHello time was printed |
| 452 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 453 | return 1 |
| 454 | fi |
| 455 | |
| 456 | # Check the time in ServerHello is within acceptable bounds |
| 457 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 458 | # The time in ServerHello is at least 5 minutes before now |
| 459 | return 1 |
| 460 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 461 | # 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] | 462 | return 1 |
| 463 | else |
| 464 | return 0 |
| 465 | fi |
| 466 | } |
| 467 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 468 | # wait for client to terminate and set CLI_EXIT |
| 469 | # must be called right after starting the client |
| 470 | wait_client_done() { |
| 471 | CLI_PID=$! |
| 472 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 473 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 474 | CLI_DELAY_FACTOR=1 |
| 475 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 476 | ( 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] | 477 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 478 | |
| 479 | wait $CLI_PID |
| 480 | CLI_EXIT=$? |
| 481 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 482 | kill $DOG_PID >/dev/null 2>&1 |
| 483 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 484 | |
| 485 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 486 | |
| 487 | sleep $SRV_DELAY_SECONDS |
| 488 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 489 | } |
| 490 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 491 | # check if the given command uses dtls and sets global variable DTLS |
| 492 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 493 | 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] | 494 | DTLS=1 |
| 495 | else |
| 496 | DTLS=0 |
| 497 | fi |
| 498 | } |
| 499 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 500 | # 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] | 501 | # Options: -s pattern pattern that must be present in server output |
| 502 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 503 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 504 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 505 | # -S pattern pattern that must be absent in server output |
| 506 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 507 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 508 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 509 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 510 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 511 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 512 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 513 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 514 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 515 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 516 | return |
| 517 | fi |
| 518 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 519 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 520 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 521 | # Do we only run numbered tests? |
| 522 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 523 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 524 | else |
| 525 | SKIP_NEXT="YES" |
| 526 | fi |
| 527 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 528 | # does this test use a proxy? |
| 529 | if [ "X$1" = "X-p" ]; then |
| 530 | PXY_CMD="$2" |
| 531 | shift 2 |
| 532 | else |
| 533 | PXY_CMD="" |
| 534 | fi |
| 535 | |
| 536 | # get commands and client output |
| 537 | SRV_CMD="$1" |
| 538 | CLI_CMD="$2" |
| 539 | CLI_EXPECT="$3" |
| 540 | shift 3 |
| 541 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 542 | # Check if server forces ciphersuite |
| 543 | FORCE_CIPHERSUITE=$(echo "$SRV_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 544 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 545 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 546 | fi |
| 547 | |
| 548 | # Check if client forces ciphersuite |
| 549 | FORCE_CIPHERSUITE=$(echo "$CLI_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 550 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 551 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 552 | fi |
| 553 | |
| 554 | # should we skip? |
| 555 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 556 | SKIP_NEXT="NO" |
| 557 | echo "SKIP" |
| 558 | SKIPS=$(( $SKIPS + 1 )) |
| 559 | return |
| 560 | fi |
| 561 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 562 | # fix client port |
| 563 | if [ -n "$PXY_CMD" ]; then |
| 564 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 565 | else |
| 566 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 567 | fi |
| 568 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 569 | # update DTLS variable |
| 570 | detect_dtls "$SRV_CMD" |
| 571 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 572 | # prepend valgrind to our commands if active |
| 573 | if [ "$MEMCHECK" -gt 0 ]; then |
| 574 | if is_polar "$SRV_CMD"; then |
| 575 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 576 | fi |
| 577 | if is_polar "$CLI_CMD"; then |
| 578 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 579 | fi |
| 580 | fi |
| 581 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 582 | TIMES_LEFT=2 |
| 583 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 584 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 585 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 586 | # run the commands |
| 587 | if [ -n "$PXY_CMD" ]; then |
| 588 | echo "$PXY_CMD" > $PXY_OUT |
| 589 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 590 | PXY_PID=$! |
| 591 | # assume proxy starts faster than server |
| 592 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 593 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 594 | check_osrv_dtls |
| 595 | echo "$SRV_CMD" > $SRV_OUT |
| 596 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 597 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 598 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 599 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 600 | echo "$CLI_CMD" > $CLI_OUT |
| 601 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 602 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 603 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 604 | sleep 0.05 |
| 605 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 606 | # terminate the server (and the proxy) |
| 607 | kill $SRV_PID |
| 608 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 609 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 610 | if [ -n "$PXY_CMD" ]; then |
| 611 | kill $PXY_PID >/dev/null 2>&1 |
| 612 | wait $PXY_PID |
| 613 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 614 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 615 | # retry only on timeouts |
| 616 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 617 | printf "RETRY " |
| 618 | else |
| 619 | TIMES_LEFT=0 |
| 620 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 621 | done |
| 622 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 623 | # 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] | 624 | # (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] | 625 | # expected client exit to incorrectly succeed in case of catastrophic |
| 626 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 627 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 628 | 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] | 629 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 630 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 631 | return |
| 632 | fi |
| 633 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 634 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 635 | 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] | 636 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 637 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 638 | return |
| 639 | fi |
| 640 | fi |
| 641 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 642 | # check server exit code |
| 643 | if [ $? != 0 ]; then |
| 644 | fail "server fail" |
| 645 | return |
| 646 | fi |
| 647 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 648 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 649 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 650 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 651 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 652 | 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] | 653 | return |
| 654 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 655 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 656 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 657 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 658 | # 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] | 659 | while [ $# -gt 0 ] |
| 660 | do |
| 661 | case $1 in |
| 662 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 663 | 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] | 664 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 665 | return |
| 666 | fi |
| 667 | ;; |
| 668 | |
| 669 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 670 | 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] | 671 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 672 | return |
| 673 | fi |
| 674 | ;; |
| 675 | |
| 676 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 677 | 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] | 678 | 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] | 679 | return |
| 680 | fi |
| 681 | ;; |
| 682 | |
| 683 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 684 | 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] | 685 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 686 | return |
| 687 | fi |
| 688 | ;; |
| 689 | |
| 690 | # The filtering in the following two options (-u and -U) do the following |
| 691 | # - ignore valgrind output |
| 692 | # - filter out everything but lines right after the pattern occurances |
| 693 | # - keep one of each non-unique line |
| 694 | # - count how many lines remain |
| 695 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 696 | # if there were no duplicates. |
| 697 | "-U") |
| 698 | 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 |
| 699 | fail "lines following pattern '$2' must be unique in Server output" |
| 700 | return |
| 701 | fi |
| 702 | ;; |
| 703 | |
| 704 | "-u") |
| 705 | 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 |
| 706 | 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] | 707 | return |
| 708 | fi |
| 709 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 710 | "-F") |
| 711 | if ! $2 "$SRV_OUT"; then |
| 712 | fail "function call to '$2' failed on Server output" |
| 713 | return |
| 714 | fi |
| 715 | ;; |
| 716 | "-f") |
| 717 | if ! $2 "$CLI_OUT"; then |
| 718 | fail "function call to '$2' failed on Client output" |
| 719 | return |
| 720 | fi |
| 721 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 722 | |
| 723 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 724 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 725 | exit 1 |
| 726 | esac |
| 727 | shift 2 |
| 728 | done |
| 729 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 730 | # check valgrind's results |
| 731 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 732 | 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] | 733 | fail "Server has memory errors" |
| 734 | return |
| 735 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 736 | 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] | 737 | fail "Client has memory errors" |
| 738 | return |
| 739 | fi |
| 740 | fi |
| 741 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 742 | # if we're here, everything is ok |
| 743 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 744 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 745 | mv $SRV_OUT o-srv-${TESTS}.log |
| 746 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 747 | if [ -n "$PXY_CMD" ]; then |
| 748 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 749 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 750 | fi |
| 751 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 752 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 753 | } |
| 754 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 755 | run_test_psa() { |
| 756 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 757 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 758 | "$P_SRV debug_level=1 force_version=tls1_2" \ |
| 759 | "$P_CLI debug_level=1 force_version=tls1_2 force_ciphersuite=$1" \ |
| 760 | 0 \ |
| 761 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 762 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 763 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 764 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 765 | -C "Failed to setup PSA-based cipher context"\ |
| 766 | -S "Failed to setup PSA-based cipher context"\ |
| 767 | -s "Protocol is TLSv1.2" \ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame^] | 768 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 769 | -S "error" \ |
| 770 | -C "error" |
| 771 | } |
| 772 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 773 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 774 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 775 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 776 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 777 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 778 | 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] | 779 | exit 1 |
| 780 | } |
| 781 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 782 | # |
| 783 | # MAIN |
| 784 | # |
| 785 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 786 | get_options "$@" |
| 787 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 788 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 789 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 790 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 791 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 792 | if [ ! -x "$P_SRV_BIN" ]; then |
| 793 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 794 | exit 1 |
| 795 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 796 | if [ ! -x "$P_CLI_BIN" ]; then |
| 797 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 798 | exit 1 |
| 799 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 800 | if [ ! -x "$P_PXY_BIN" ]; then |
| 801 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 802 | exit 1 |
| 803 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 804 | if [ "$MEMCHECK" -gt 0 ]; then |
| 805 | if which valgrind >/dev/null 2>&1; then :; else |
| 806 | echo "Memcheck not possible. Valgrind not found" |
| 807 | exit 1 |
| 808 | fi |
| 809 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 810 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 811 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 812 | exit 1 |
| 813 | fi |
| 814 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 815 | # used by watchdog |
| 816 | MAIN_PID="$$" |
| 817 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 818 | # We use somewhat arbitrary delays for tests: |
| 819 | # - how long do we wait for the server to start (when lsof not available)? |
| 820 | # - how long do we allow for the client to finish? |
| 821 | # (not to check performance, just to avoid waiting indefinitely) |
| 822 | # Things are slower with valgrind, so give extra time here. |
| 823 | # |
| 824 | # Note: without lsof, there is a trade-off between the running time of this |
| 825 | # script and the risk of spurious errors because we didn't wait long enough. |
| 826 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 827 | # 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] | 828 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 829 | START_DELAY=6 |
| 830 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 831 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 832 | START_DELAY=2 |
| 833 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 834 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 835 | |
| 836 | # some particular tests need more time: |
| 837 | # - for the client, we multiply the usual watchdog limit by a factor |
| 838 | # - for the server, we sleep for a number of seconds after the client exits |
| 839 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 840 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 841 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 842 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 843 | # 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] | 844 | # +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] | 845 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 846 | 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] | 847 | 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] | 848 | 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] | 849 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 850 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 851 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 852 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 853 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 854 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 855 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 856 | fi |
| 857 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 858 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 859 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 860 | fi |
| 861 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 862 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 863 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 864 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 865 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 866 | # Allow SHA-1, because many of our test certificates use it |
| 867 | P_SRV="$P_SRV allow_sha1=1" |
| 868 | P_CLI="$P_CLI allow_sha1=1" |
| 869 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 870 | # Also pick a unique name for intermediate files |
| 871 | SRV_OUT="srv_out.$$" |
| 872 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 873 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 874 | SESSION="session.$$" |
| 875 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 876 | SKIP_NEXT="NO" |
| 877 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 878 | trap cleanup INT TERM HUP |
| 879 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 880 | # Basic test |
| 881 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 882 | # Checks that: |
| 883 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 884 | # - the expected (highest security) parameters are selected |
| 885 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 886 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 887 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 888 | "$P_CLI" \ |
| 889 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 890 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 891 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 892 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 893 | -s "ECDHE curve: secp521r1" \ |
| 894 | -S "error" \ |
| 895 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 896 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 897 | run_test "Default, DTLS" \ |
| 898 | "$P_SRV dtls=1" \ |
| 899 | "$P_CLI dtls=1" \ |
| 900 | 0 \ |
| 901 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 902 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 903 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 904 | # Test using an opaque private key for client authentication |
| 905 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 906 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 907 | requires_config_enabled MBEDTLS_ECDSA_C |
| 908 | requires_config_enabled MBEDTLS_SHA256_C |
| 909 | run_test "Opaque key for client authentication" \ |
| 910 | "$P_SRV auth_mode=required" \ |
| 911 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 912 | key_file=data_files/server5.key" \ |
| 913 | 0 \ |
| 914 | -c "key type: Opaque" \ |
| 915 | -s "Verifying peer X.509 certificate... ok" \ |
| 916 | -S "error" \ |
| 917 | -C "error" |
| 918 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 919 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 920 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 921 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 922 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 923 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 924 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 925 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 926 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 927 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 928 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 929 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 930 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 931 | # Test current time in ServerHello |
| 932 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 933 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 934 | "$P_SRV debug_level=3" \ |
| 935 | "$P_CLI debug_level=3" \ |
| 936 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 937 | -f "check_server_hello_time" \ |
| 938 | -F "check_server_hello_time" |
| 939 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 940 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 941 | run_test "Unique IV in GCM" \ |
| 942 | "$P_SRV exchanges=20 debug_level=4" \ |
| 943 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 944 | 0 \ |
| 945 | -u "IV used" \ |
| 946 | -U "IV used" |
| 947 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 948 | # Tests for rc4 option |
| 949 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 950 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 951 | run_test "RC4: server disabled, client enabled" \ |
| 952 | "$P_SRV" \ |
| 953 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 954 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 955 | -s "SSL - The server has no ciphersuites in common" |
| 956 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 957 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 958 | run_test "RC4: server half, client enabled" \ |
| 959 | "$P_SRV arc4=1" \ |
| 960 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 961 | 1 \ |
| 962 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 963 | |
| 964 | run_test "RC4: server enabled, client disabled" \ |
| 965 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 966 | "$P_CLI" \ |
| 967 | 1 \ |
| 968 | -s "SSL - The server has no ciphersuites in common" |
| 969 | |
| 970 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 971 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 972 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 973 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 974 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 975 | -S "SSL - The server has no ciphersuites in common" |
| 976 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 977 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 978 | |
| 979 | requires_gnutls |
| 980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 981 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 982 | "$G_SRV"\ |
| 983 | "$P_CLI force_version=tls1_1" \ |
| 984 | 0 |
| 985 | |
| 986 | requires_gnutls |
| 987 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 988 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 989 | "$G_SRV"\ |
| 990 | "$P_CLI force_version=tls1" \ |
| 991 | 0 |
| 992 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 993 | # Tests for SHA-1 support |
| 994 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 995 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 996 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 997 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 998 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 999 | 1 \ |
| 1000 | -c "The certificate is signed with an unacceptable hash" |
| 1001 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1002 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1003 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1004 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1005 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1006 | 0 |
| 1007 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1008 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1009 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1010 | "$P_CLI allow_sha1=1" \ |
| 1011 | 0 |
| 1012 | |
| 1013 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1014 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1015 | "$P_CLI allow_sha1=0" \ |
| 1016 | 0 |
| 1017 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1018 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1019 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1020 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1021 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1022 | 1 \ |
| 1023 | -s "The certificate is signed with an unacceptable hash" |
| 1024 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1025 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1026 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1027 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1028 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1029 | 0 |
| 1030 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1031 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1032 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1033 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1034 | 0 |
| 1035 | |
| 1036 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1037 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1038 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1039 | 0 |
| 1040 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1041 | # Tests for datagram packing |
| 1042 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1043 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1044 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1045 | 0 \ |
| 1046 | -c "next record in same datagram" \ |
| 1047 | -s "next record in same datagram" |
| 1048 | |
| 1049 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1050 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1051 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1052 | 0 \ |
| 1053 | -s "next record in same datagram" \ |
| 1054 | -C "next record in same datagram" |
| 1055 | |
| 1056 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1057 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1058 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1059 | 0 \ |
| 1060 | -S "next record in same datagram" \ |
| 1061 | -c "next record in same datagram" |
| 1062 | |
| 1063 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1064 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1065 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1066 | 0 \ |
| 1067 | -S "next record in same datagram" \ |
| 1068 | -C "next record in same datagram" |
| 1069 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1070 | # Tests for Truncated HMAC extension |
| 1071 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1072 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1073 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1074 | "$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] | 1075 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1076 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1077 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1078 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1079 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1080 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1081 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1082 | "$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] | 1083 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1084 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1085 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1086 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1087 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1088 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1089 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1090 | "$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] | 1091 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1092 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1093 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1094 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1095 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1096 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1097 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1098 | "$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] | 1099 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1100 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1101 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1102 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1103 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1104 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1105 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1106 | "$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] | 1107 | 0 \ |
| 1108 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1109 | -S "dumping 'expected mac' (10 bytes)" |
| 1110 | |
| 1111 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1112 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1113 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1114 | "$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] | 1115 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1116 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1117 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1118 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1119 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1120 | "$P_SRV dtls=1 debug_level=4" \ |
| 1121 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1122 | 0 \ |
| 1123 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1124 | -S "dumping 'expected mac' (10 bytes)" |
| 1125 | |
| 1126 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1127 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1128 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1129 | "$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] | 1130 | 0 \ |
| 1131 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1132 | -S "dumping 'expected mac' (10 bytes)" |
| 1133 | |
| 1134 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1135 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1136 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1137 | "$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] | 1138 | 0 \ |
| 1139 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1140 | -S "dumping 'expected mac' (10 bytes)" |
| 1141 | |
| 1142 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1143 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1144 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1145 | "$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] | 1146 | 0 \ |
| 1147 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1148 | -S "dumping 'expected mac' (10 bytes)" |
| 1149 | |
| 1150 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1151 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1152 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1153 | "$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] | 1154 | 0 \ |
| 1155 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1156 | -S "dumping 'expected mac' (10 bytes)" |
| 1157 | |
| 1158 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1159 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1160 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1161 | "$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] | 1162 | 0 \ |
| 1163 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1164 | -s "dumping 'expected mac' (10 bytes)" |
| 1165 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1166 | # Tests for Encrypt-then-MAC extension |
| 1167 | |
| 1168 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1169 | "$P_SRV debug_level=3 \ |
| 1170 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1171 | "$P_CLI debug_level=3" \ |
| 1172 | 0 \ |
| 1173 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1174 | -s "found encrypt then mac extension" \ |
| 1175 | -s "server hello, adding encrypt then mac extension" \ |
| 1176 | -c "found encrypt_then_mac extension" \ |
| 1177 | -c "using encrypt then mac" \ |
| 1178 | -s "using encrypt then mac" |
| 1179 | |
| 1180 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1181 | "$P_SRV debug_level=3 etm=0 \ |
| 1182 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1183 | "$P_CLI debug_level=3 etm=1" \ |
| 1184 | 0 \ |
| 1185 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1186 | -s "found encrypt then mac extension" \ |
| 1187 | -S "server hello, adding encrypt then mac extension" \ |
| 1188 | -C "found encrypt_then_mac extension" \ |
| 1189 | -C "using encrypt then mac" \ |
| 1190 | -S "using encrypt then mac" |
| 1191 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1192 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1193 | "$P_SRV debug_level=3 etm=1 \ |
| 1194 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1195 | "$P_CLI debug_level=3 etm=1" \ |
| 1196 | 0 \ |
| 1197 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1198 | -s "found encrypt then mac extension" \ |
| 1199 | -S "server hello, adding encrypt then mac extension" \ |
| 1200 | -C "found encrypt_then_mac extension" \ |
| 1201 | -C "using encrypt then mac" \ |
| 1202 | -S "using encrypt then mac" |
| 1203 | |
| 1204 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1205 | "$P_SRV debug_level=3 etm=1 \ |
| 1206 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1207 | "$P_CLI debug_level=3 etm=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1208 | 0 \ |
| 1209 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1210 | -s "found encrypt then mac extension" \ |
| 1211 | -S "server hello, adding encrypt then mac extension" \ |
| 1212 | -C "found encrypt_then_mac extension" \ |
| 1213 | -C "using encrypt then mac" \ |
| 1214 | -S "using encrypt then mac" |
| 1215 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1216 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1217 | "$P_SRV debug_level=3 etm=1 \ |
| 1218 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1219 | "$P_CLI debug_level=3 etm=0" \ |
| 1220 | 0 \ |
| 1221 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1222 | -S "found encrypt then mac extension" \ |
| 1223 | -S "server hello, adding encrypt then mac extension" \ |
| 1224 | -C "found encrypt_then_mac extension" \ |
| 1225 | -C "using encrypt then mac" \ |
| 1226 | -S "using encrypt then mac" |
| 1227 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1228 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1229 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1230 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1231 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1232 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1233 | 0 \ |
| 1234 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1235 | -S "found encrypt then mac extension" \ |
| 1236 | -S "server hello, adding encrypt then mac extension" \ |
| 1237 | -C "found encrypt_then_mac extension" \ |
| 1238 | -C "using encrypt then mac" \ |
| 1239 | -S "using encrypt then mac" |
| 1240 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1241 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1242 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1243 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1244 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1245 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1246 | 0 \ |
| 1247 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1248 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1249 | -S "server hello, adding encrypt then mac extension" \ |
| 1250 | -C "found encrypt_then_mac extension" \ |
| 1251 | -C "using encrypt then mac" \ |
| 1252 | -S "using encrypt then mac" |
| 1253 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1254 | # Tests for Extended Master Secret extension |
| 1255 | |
| 1256 | run_test "Extended Master Secret: default" \ |
| 1257 | "$P_SRV debug_level=3" \ |
| 1258 | "$P_CLI debug_level=3" \ |
| 1259 | 0 \ |
| 1260 | -c "client hello, adding extended_master_secret extension" \ |
| 1261 | -s "found extended master secret extension" \ |
| 1262 | -s "server hello, adding extended master secret extension" \ |
| 1263 | -c "found extended_master_secret extension" \ |
| 1264 | -c "using extended master secret" \ |
| 1265 | -s "using extended master secret" |
| 1266 | |
| 1267 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1268 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1269 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1270 | 0 \ |
| 1271 | -c "client hello, adding extended_master_secret extension" \ |
| 1272 | -s "found extended master secret extension" \ |
| 1273 | -S "server hello, adding extended master secret extension" \ |
| 1274 | -C "found extended_master_secret extension" \ |
| 1275 | -C "using extended master secret" \ |
| 1276 | -S "using extended master secret" |
| 1277 | |
| 1278 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1279 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1280 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1281 | 0 \ |
| 1282 | -C "client hello, adding extended_master_secret extension" \ |
| 1283 | -S "found extended master secret extension" \ |
| 1284 | -S "server hello, adding extended master secret extension" \ |
| 1285 | -C "found extended_master_secret extension" \ |
| 1286 | -C "using extended master secret" \ |
| 1287 | -S "using extended master secret" |
| 1288 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1289 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1290 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1291 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1292 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1293 | 0 \ |
| 1294 | -C "client hello, adding extended_master_secret extension" \ |
| 1295 | -S "found extended master secret extension" \ |
| 1296 | -S "server hello, adding extended master secret extension" \ |
| 1297 | -C "found extended_master_secret extension" \ |
| 1298 | -C "using extended master secret" \ |
| 1299 | -S "using extended master secret" |
| 1300 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1301 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1302 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1303 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1304 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1305 | 0 \ |
| 1306 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1307 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1308 | -S "server hello, adding extended master secret extension" \ |
| 1309 | -C "found extended_master_secret extension" \ |
| 1310 | -C "using extended master secret" \ |
| 1311 | -S "using extended master secret" |
| 1312 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1313 | # Tests for FALLBACK_SCSV |
| 1314 | |
| 1315 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1316 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1317 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1318 | 0 \ |
| 1319 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1320 | -S "received FALLBACK_SCSV" \ |
| 1321 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1322 | -C "is a fatal alert message (msg 86)" |
| 1323 | |
| 1324 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1325 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1326 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1327 | 0 \ |
| 1328 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1329 | -S "received FALLBACK_SCSV" \ |
| 1330 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1331 | -C "is a fatal alert message (msg 86)" |
| 1332 | |
| 1333 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1334 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1335 | "$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] | 1336 | 1 \ |
| 1337 | -c "adding FALLBACK_SCSV" \ |
| 1338 | -s "received FALLBACK_SCSV" \ |
| 1339 | -s "inapropriate fallback" \ |
| 1340 | -c "is a fatal alert message (msg 86)" |
| 1341 | |
| 1342 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1343 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1344 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1345 | 0 \ |
| 1346 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1347 | -s "received FALLBACK_SCSV" \ |
| 1348 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1349 | -C "is a fatal alert message (msg 86)" |
| 1350 | |
| 1351 | requires_openssl_with_fallback_scsv |
| 1352 | run_test "Fallback SCSV: default, openssl server" \ |
| 1353 | "$O_SRV" \ |
| 1354 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1355 | 0 \ |
| 1356 | -C "adding FALLBACK_SCSV" \ |
| 1357 | -C "is a fatal alert message (msg 86)" |
| 1358 | |
| 1359 | requires_openssl_with_fallback_scsv |
| 1360 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1361 | "$O_SRV" \ |
| 1362 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1363 | 1 \ |
| 1364 | -c "adding FALLBACK_SCSV" \ |
| 1365 | -c "is a fatal alert message (msg 86)" |
| 1366 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1367 | requires_openssl_with_fallback_scsv |
| 1368 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1369 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1370 | "$O_CLI -tls1_1" \ |
| 1371 | 0 \ |
| 1372 | -S "received FALLBACK_SCSV" \ |
| 1373 | -S "inapropriate fallback" |
| 1374 | |
| 1375 | requires_openssl_with_fallback_scsv |
| 1376 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1377 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1378 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1379 | 1 \ |
| 1380 | -s "received FALLBACK_SCSV" \ |
| 1381 | -s "inapropriate fallback" |
| 1382 | |
| 1383 | requires_openssl_with_fallback_scsv |
| 1384 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1385 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1386 | "$O_CLI -fallback_scsv" \ |
| 1387 | 0 \ |
| 1388 | -s "received FALLBACK_SCSV" \ |
| 1389 | -S "inapropriate fallback" |
| 1390 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1391 | # Test sending and receiving empty application data records |
| 1392 | |
| 1393 | run_test "Encrypt then MAC: empty application data record" \ |
| 1394 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1395 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1396 | 0 \ |
| 1397 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1398 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1399 | -c "0 bytes written in 1 fragments" |
| 1400 | |
| 1401 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 1402 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1403 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1404 | 0 \ |
| 1405 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1406 | -c "0 bytes written in 1 fragments" |
| 1407 | |
| 1408 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1409 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1410 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1411 | 0 \ |
| 1412 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1413 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1414 | -c "0 bytes written in 1 fragments" |
| 1415 | |
| 1416 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 1417 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1418 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1419 | 0 \ |
| 1420 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1421 | -c "0 bytes written in 1 fragments" |
| 1422 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1423 | ## ClientHello generated with |
| 1424 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1425 | ## then manually twiddling the ciphersuite list. |
| 1426 | ## The ClientHello content is spelled out below as a hex string as |
| 1427 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1428 | ## The expected response is an inappropriate_fallback alert. |
| 1429 | requires_openssl_with_fallback_scsv |
| 1430 | run_test "Fallback SCSV: beginning of list" \ |
| 1431 | "$P_SRV debug_level=2" \ |
| 1432 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1433 | 0 \ |
| 1434 | -s "received FALLBACK_SCSV" \ |
| 1435 | -s "inapropriate fallback" |
| 1436 | |
| 1437 | requires_openssl_with_fallback_scsv |
| 1438 | run_test "Fallback SCSV: end of list" \ |
| 1439 | "$P_SRV debug_level=2" \ |
| 1440 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1441 | 0 \ |
| 1442 | -s "received FALLBACK_SCSV" \ |
| 1443 | -s "inapropriate fallback" |
| 1444 | |
| 1445 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1446 | requires_openssl_with_fallback_scsv |
| 1447 | run_test "Fallback SCSV: not in list" \ |
| 1448 | "$P_SRV debug_level=2" \ |
| 1449 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1450 | 0 \ |
| 1451 | -S "received FALLBACK_SCSV" \ |
| 1452 | -S "inapropriate fallback" |
| 1453 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1454 | # Tests for CBC 1/n-1 record splitting |
| 1455 | |
| 1456 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1457 | "$P_SRV" \ |
| 1458 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1459 | request_size=123 force_version=tls1_2" \ |
| 1460 | 0 \ |
| 1461 | -s "Read from client: 123 bytes read" \ |
| 1462 | -S "Read from client: 1 bytes read" \ |
| 1463 | -S "122 bytes read" |
| 1464 | |
| 1465 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1466 | "$P_SRV" \ |
| 1467 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1468 | request_size=123 force_version=tls1_1" \ |
| 1469 | 0 \ |
| 1470 | -s "Read from client: 123 bytes read" \ |
| 1471 | -S "Read from client: 1 bytes read" \ |
| 1472 | -S "122 bytes read" |
| 1473 | |
| 1474 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1475 | "$P_SRV" \ |
| 1476 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1477 | request_size=123 force_version=tls1" \ |
| 1478 | 0 \ |
| 1479 | -S "Read from client: 123 bytes read" \ |
| 1480 | -s "Read from client: 1 bytes read" \ |
| 1481 | -s "122 bytes read" |
| 1482 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1483 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1484 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1485 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1486 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1487 | request_size=123 force_version=ssl3" \ |
| 1488 | 0 \ |
| 1489 | -S "Read from client: 123 bytes read" \ |
| 1490 | -s "Read from client: 1 bytes read" \ |
| 1491 | -s "122 bytes read" |
| 1492 | |
| 1493 | 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] | 1494 | "$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] | 1495 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1496 | request_size=123 force_version=tls1" \ |
| 1497 | 0 \ |
| 1498 | -s "Read from client: 123 bytes read" \ |
| 1499 | -S "Read from client: 1 bytes read" \ |
| 1500 | -S "122 bytes read" |
| 1501 | |
| 1502 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1503 | "$P_SRV" \ |
| 1504 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1505 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1506 | 0 \ |
| 1507 | -s "Read from client: 123 bytes read" \ |
| 1508 | -S "Read from client: 1 bytes read" \ |
| 1509 | -S "122 bytes read" |
| 1510 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1511 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1512 | "$P_SRV nbio=2" \ |
| 1513 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1514 | request_size=123 force_version=tls1" \ |
| 1515 | 0 \ |
| 1516 | -S "Read from client: 123 bytes read" \ |
| 1517 | -s "Read from client: 1 bytes read" \ |
| 1518 | -s "122 bytes read" |
| 1519 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1520 | # Tests for Session Tickets |
| 1521 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1522 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1523 | "$P_SRV debug_level=3 tickets=1" \ |
| 1524 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1525 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1526 | -c "client hello, adding session ticket extension" \ |
| 1527 | -s "found session ticket extension" \ |
| 1528 | -s "server hello, adding session ticket extension" \ |
| 1529 | -c "found session_ticket extension" \ |
| 1530 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1531 | -S "session successfully restored from cache" \ |
| 1532 | -s "session successfully restored from ticket" \ |
| 1533 | -s "a session has been resumed" \ |
| 1534 | -c "a session has been resumed" |
| 1535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1536 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1537 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1538 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1539 | 0 \ |
| 1540 | -c "client hello, adding session ticket extension" \ |
| 1541 | -s "found session ticket extension" \ |
| 1542 | -s "server hello, adding session ticket extension" \ |
| 1543 | -c "found session_ticket extension" \ |
| 1544 | -c "parse new session ticket" \ |
| 1545 | -S "session successfully restored from cache" \ |
| 1546 | -s "session successfully restored from ticket" \ |
| 1547 | -s "a session has been resumed" \ |
| 1548 | -c "a session has been resumed" |
| 1549 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1550 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1551 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1552 | "$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] | 1553 | 0 \ |
| 1554 | -c "client hello, adding session ticket extension" \ |
| 1555 | -s "found session ticket extension" \ |
| 1556 | -s "server hello, adding session ticket extension" \ |
| 1557 | -c "found session_ticket extension" \ |
| 1558 | -c "parse new session ticket" \ |
| 1559 | -S "session successfully restored from cache" \ |
| 1560 | -S "session successfully restored from ticket" \ |
| 1561 | -S "a session has been resumed" \ |
| 1562 | -C "a session has been resumed" |
| 1563 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1564 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1565 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1566 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1567 | 0 \ |
| 1568 | -c "client hello, adding session ticket extension" \ |
| 1569 | -c "found session_ticket extension" \ |
| 1570 | -c "parse new session ticket" \ |
| 1571 | -c "a session has been resumed" |
| 1572 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1573 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1574 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1575 | "( $O_CLI -sess_out $SESSION; \ |
| 1576 | $O_CLI -sess_in $SESSION; \ |
| 1577 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1578 | 0 \ |
| 1579 | -s "found session ticket extension" \ |
| 1580 | -s "server hello, adding session ticket extension" \ |
| 1581 | -S "session successfully restored from cache" \ |
| 1582 | -s "session successfully restored from ticket" \ |
| 1583 | -s "a session has been resumed" |
| 1584 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1585 | # Tests for Session Tickets with DTLS |
| 1586 | |
| 1587 | run_test "Session resume using tickets, DTLS: basic" \ |
| 1588 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 1589 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1590 | 0 \ |
| 1591 | -c "client hello, adding session ticket extension" \ |
| 1592 | -s "found session ticket extension" \ |
| 1593 | -s "server hello, adding session ticket extension" \ |
| 1594 | -c "found session_ticket extension" \ |
| 1595 | -c "parse new session ticket" \ |
| 1596 | -S "session successfully restored from cache" \ |
| 1597 | -s "session successfully restored from ticket" \ |
| 1598 | -s "a session has been resumed" \ |
| 1599 | -c "a session has been resumed" |
| 1600 | |
| 1601 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 1602 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 1603 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1604 | 0 \ |
| 1605 | -c "client hello, adding session ticket extension" \ |
| 1606 | -s "found session ticket extension" \ |
| 1607 | -s "server hello, adding session ticket extension" \ |
| 1608 | -c "found session_ticket extension" \ |
| 1609 | -c "parse new session ticket" \ |
| 1610 | -S "session successfully restored from cache" \ |
| 1611 | -s "session successfully restored from ticket" \ |
| 1612 | -s "a session has been resumed" \ |
| 1613 | -c "a session has been resumed" |
| 1614 | |
| 1615 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 1616 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1617 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 1618 | 0 \ |
| 1619 | -c "client hello, adding session ticket extension" \ |
| 1620 | -s "found session ticket extension" \ |
| 1621 | -s "server hello, adding session ticket extension" \ |
| 1622 | -c "found session_ticket extension" \ |
| 1623 | -c "parse new session ticket" \ |
| 1624 | -S "session successfully restored from cache" \ |
| 1625 | -S "session successfully restored from ticket" \ |
| 1626 | -S "a session has been resumed" \ |
| 1627 | -C "a session has been resumed" |
| 1628 | |
| 1629 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 1630 | "$O_SRV -dtls1" \ |
| 1631 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1632 | 0 \ |
| 1633 | -c "client hello, adding session ticket extension" \ |
| 1634 | -c "found session_ticket extension" \ |
| 1635 | -c "parse new session ticket" \ |
| 1636 | -c "a session has been resumed" |
| 1637 | |
| 1638 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 1639 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1640 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1641 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1642 | rm -f $SESSION )" \ |
| 1643 | 0 \ |
| 1644 | -s "found session ticket extension" \ |
| 1645 | -s "server hello, adding session ticket extension" \ |
| 1646 | -S "session successfully restored from cache" \ |
| 1647 | -s "session successfully restored from ticket" \ |
| 1648 | -s "a session has been resumed" |
| 1649 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1650 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1651 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1652 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1653 | "$P_SRV debug_level=3 tickets=0" \ |
| 1654 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1655 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1656 | -c "client hello, adding session ticket extension" \ |
| 1657 | -s "found session ticket extension" \ |
| 1658 | -S "server hello, adding session ticket extension" \ |
| 1659 | -C "found session_ticket extension" \ |
| 1660 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1661 | -s "session successfully restored from cache" \ |
| 1662 | -S "session successfully restored from ticket" \ |
| 1663 | -s "a session has been resumed" \ |
| 1664 | -c "a session has been resumed" |
| 1665 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1666 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1667 | "$P_SRV debug_level=3 tickets=1" \ |
| 1668 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1669 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1670 | -C "client hello, adding session ticket extension" \ |
| 1671 | -S "found session ticket extension" \ |
| 1672 | -S "server hello, adding session ticket extension" \ |
| 1673 | -C "found session_ticket extension" \ |
| 1674 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1675 | -s "session successfully restored from cache" \ |
| 1676 | -S "session successfully restored from ticket" \ |
| 1677 | -s "a session has been resumed" \ |
| 1678 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1679 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1680 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1681 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1682 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1683 | 0 \ |
| 1684 | -S "session successfully restored from cache" \ |
| 1685 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1686 | -S "a session has been resumed" \ |
| 1687 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1688 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1689 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1690 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1691 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1692 | 0 \ |
| 1693 | -s "session successfully restored from cache" \ |
| 1694 | -S "session successfully restored from ticket" \ |
| 1695 | -s "a session has been resumed" \ |
| 1696 | -c "a session has been resumed" |
| 1697 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1698 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1699 | "$P_SRV debug_level=3 tickets=0" \ |
| 1700 | "$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] | 1701 | 0 \ |
| 1702 | -s "session successfully restored from cache" \ |
| 1703 | -S "session successfully restored from ticket" \ |
| 1704 | -s "a session has been resumed" \ |
| 1705 | -c "a session has been resumed" |
| 1706 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1707 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1708 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1709 | "$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] | 1710 | 0 \ |
| 1711 | -S "session successfully restored from cache" \ |
| 1712 | -S "session successfully restored from ticket" \ |
| 1713 | -S "a session has been resumed" \ |
| 1714 | -C "a session has been resumed" |
| 1715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1716 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1717 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1718 | "$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] | 1719 | 0 \ |
| 1720 | -s "session successfully restored from cache" \ |
| 1721 | -S "session successfully restored from ticket" \ |
| 1722 | -s "a session has been resumed" \ |
| 1723 | -c "a session has been resumed" |
| 1724 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1725 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1726 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1727 | "( $O_CLI -sess_out $SESSION; \ |
| 1728 | $O_CLI -sess_in $SESSION; \ |
| 1729 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1730 | 0 \ |
| 1731 | -s "found session ticket extension" \ |
| 1732 | -S "server hello, adding session ticket extension" \ |
| 1733 | -s "session successfully restored from cache" \ |
| 1734 | -S "session successfully restored from ticket" \ |
| 1735 | -s "a session has been resumed" |
| 1736 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1737 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1738 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1739 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1740 | 0 \ |
| 1741 | -C "found session_ticket extension" \ |
| 1742 | -C "parse new session ticket" \ |
| 1743 | -c "a session has been resumed" |
| 1744 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1745 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 1746 | |
| 1747 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 1748 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1749 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1750 | 0 \ |
| 1751 | -c "client hello, adding session ticket extension" \ |
| 1752 | -s "found session ticket extension" \ |
| 1753 | -S "server hello, adding session ticket extension" \ |
| 1754 | -C "found session_ticket extension" \ |
| 1755 | -C "parse new session ticket" \ |
| 1756 | -s "session successfully restored from cache" \ |
| 1757 | -S "session successfully restored from ticket" \ |
| 1758 | -s "a session has been resumed" \ |
| 1759 | -c "a session has been resumed" |
| 1760 | |
| 1761 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 1762 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1763 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1764 | 0 \ |
| 1765 | -C "client hello, adding session ticket extension" \ |
| 1766 | -S "found session ticket extension" \ |
| 1767 | -S "server hello, adding session ticket extension" \ |
| 1768 | -C "found session_ticket extension" \ |
| 1769 | -C "parse new session ticket" \ |
| 1770 | -s "session successfully restored from cache" \ |
| 1771 | -S "session successfully restored from ticket" \ |
| 1772 | -s "a session has been resumed" \ |
| 1773 | -c "a session has been resumed" |
| 1774 | |
| 1775 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 1776 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 1777 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1778 | 0 \ |
| 1779 | -S "session successfully restored from cache" \ |
| 1780 | -S "session successfully restored from ticket" \ |
| 1781 | -S "a session has been resumed" \ |
| 1782 | -C "a session has been resumed" |
| 1783 | |
| 1784 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 1785 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 1786 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1787 | 0 \ |
| 1788 | -s "session successfully restored from cache" \ |
| 1789 | -S "session successfully restored from ticket" \ |
| 1790 | -s "a session has been resumed" \ |
| 1791 | -c "a session has been resumed" |
| 1792 | |
| 1793 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 1794 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1795 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 1796 | 0 \ |
| 1797 | -s "session successfully restored from cache" \ |
| 1798 | -S "session successfully restored from ticket" \ |
| 1799 | -s "a session has been resumed" \ |
| 1800 | -c "a session has been resumed" |
| 1801 | |
| 1802 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 1803 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 1804 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 1805 | 0 \ |
| 1806 | -S "session successfully restored from cache" \ |
| 1807 | -S "session successfully restored from ticket" \ |
| 1808 | -S "a session has been resumed" \ |
| 1809 | -C "a session has been resumed" |
| 1810 | |
| 1811 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 1812 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 1813 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 1814 | 0 \ |
| 1815 | -s "session successfully restored from cache" \ |
| 1816 | -S "session successfully restored from ticket" \ |
| 1817 | -s "a session has been resumed" \ |
| 1818 | -c "a session has been resumed" |
| 1819 | |
| 1820 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 1821 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1822 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1823 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1824 | rm -f $SESSION )" \ |
| 1825 | 0 \ |
| 1826 | -s "found session ticket extension" \ |
| 1827 | -S "server hello, adding session ticket extension" \ |
| 1828 | -s "session successfully restored from cache" \ |
| 1829 | -S "session successfully restored from ticket" \ |
| 1830 | -s "a session has been resumed" |
| 1831 | |
| 1832 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 1833 | "$O_SRV -dtls1" \ |
| 1834 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1835 | 0 \ |
| 1836 | -C "found session_ticket extension" \ |
| 1837 | -C "parse new session ticket" \ |
| 1838 | -c "a session has been resumed" |
| 1839 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1840 | # Tests for Max Fragment Length extension |
| 1841 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1842 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 1843 | printf "${CONFIG_H} defines MBEDTLS_SSL_MAX_CONTENT_LEN to be less than 4096. Fragment length tests will fail.\n" |
Hanno Becker | 6428f8d | 2017-09-22 16:58:50 +0100 | [diff] [blame] | 1844 | exit 1 |
| 1845 | fi |
| 1846 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1847 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 1848 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 1849 | fi |
| 1850 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1851 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1852 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1853 | "$P_SRV debug_level=3" \ |
| 1854 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1855 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1856 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1857 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1858 | -C "client hello, adding max_fragment_length extension" \ |
| 1859 | -S "found max fragment length extension" \ |
| 1860 | -S "server hello, max_fragment_length extension" \ |
| 1861 | -C "found max_fragment_length extension" |
| 1862 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1863 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1864 | run_test "Max fragment length: enabled, default, larger message" \ |
| 1865 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1866 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1867 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1868 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1869 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1870 | -C "client hello, adding max_fragment_length extension" \ |
| 1871 | -S "found max fragment length extension" \ |
| 1872 | -S "server hello, max_fragment_length extension" \ |
| 1873 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1874 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1875 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1876 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1877 | |
| 1878 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1879 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 1880 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1881 | "$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] | 1882 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1883 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1884 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1885 | -C "client hello, adding max_fragment_length extension" \ |
| 1886 | -S "found max fragment length extension" \ |
| 1887 | -S "server hello, max_fragment_length extension" \ |
| 1888 | -C "found max_fragment_length extension" \ |
| 1889 | -c "fragment larger than.*maximum " |
| 1890 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1891 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 1892 | # (session fragment length will be 16384 regardless of mbedtls |
| 1893 | # content length configuration.) |
| 1894 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1895 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1896 | run_test "Max fragment length: disabled, larger message" \ |
| 1897 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1898 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1899 | 0 \ |
| 1900 | -C "Maximum fragment length is 16384" \ |
| 1901 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1902 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1903 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1904 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1905 | |
| 1906 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1907 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 1908 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1909 | "$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] | 1910 | 1 \ |
| 1911 | -C "Maximum fragment length is 16384" \ |
| 1912 | -S "Maximum fragment length is 16384" \ |
| 1913 | -c "fragment larger than.*maximum " |
| 1914 | |
| 1915 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1916 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1917 | "$P_SRV debug_level=3" \ |
| 1918 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1919 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1920 | -c "Maximum fragment length is 4096" \ |
| 1921 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1922 | -c "client hello, adding max_fragment_length extension" \ |
| 1923 | -s "found max fragment length extension" \ |
| 1924 | -s "server hello, max_fragment_length extension" \ |
| 1925 | -c "found max_fragment_length extension" |
| 1926 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1927 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1928 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1929 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1930 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1931 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1932 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1933 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1934 | -C "client hello, adding max_fragment_length extension" \ |
| 1935 | -S "found max fragment length extension" \ |
| 1936 | -S "server hello, max_fragment_length extension" \ |
| 1937 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1938 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1939 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1940 | requires_gnutls |
| 1941 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1942 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1943 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1944 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1945 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1946 | -c "client hello, adding max_fragment_length extension" \ |
| 1947 | -c "found max_fragment_length extension" |
| 1948 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1949 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1950 | run_test "Max fragment length: client, message just fits" \ |
| 1951 | "$P_SRV debug_level=3" \ |
| 1952 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1953 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1954 | -c "Maximum fragment length is 2048" \ |
| 1955 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1956 | -c "client hello, adding max_fragment_length extension" \ |
| 1957 | -s "found max fragment length extension" \ |
| 1958 | -s "server hello, max_fragment_length extension" \ |
| 1959 | -c "found max_fragment_length extension" \ |
| 1960 | -c "2048 bytes written in 1 fragments" \ |
| 1961 | -s "2048 bytes read" |
| 1962 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1963 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1964 | run_test "Max fragment length: client, larger message" \ |
| 1965 | "$P_SRV debug_level=3" \ |
| 1966 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1967 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1968 | -c "Maximum fragment length is 2048" \ |
| 1969 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1970 | -c "client hello, adding max_fragment_length extension" \ |
| 1971 | -s "found max fragment length extension" \ |
| 1972 | -s "server hello, max_fragment_length extension" \ |
| 1973 | -c "found max_fragment_length extension" \ |
| 1974 | -c "2345 bytes written in 2 fragments" \ |
| 1975 | -s "2048 bytes read" \ |
| 1976 | -s "297 bytes read" |
| 1977 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1978 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1979 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1980 | "$P_SRV debug_level=3 dtls=1" \ |
| 1981 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1982 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1983 | -c "Maximum fragment length is 2048" \ |
| 1984 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1985 | -c "client hello, adding max_fragment_length extension" \ |
| 1986 | -s "found max fragment length extension" \ |
| 1987 | -s "server hello, max_fragment_length extension" \ |
| 1988 | -c "found max_fragment_length extension" \ |
| 1989 | -c "fragment larger than.*maximum" |
| 1990 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1991 | # Tests for renegotiation |
| 1992 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1993 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1994 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1995 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1996 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1997 | 0 \ |
| 1998 | -C "client hello, adding renegotiation extension" \ |
| 1999 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2000 | -S "found renegotiation extension" \ |
| 2001 | -s "server hello, secure renegotiation extension" \ |
| 2002 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2003 | -C "=> renegotiate" \ |
| 2004 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2005 | -S "write hello request" |
| 2006 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2007 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2008 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2009 | "$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] | 2010 | "$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] | 2011 | 0 \ |
| 2012 | -c "client hello, adding renegotiation extension" \ |
| 2013 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2014 | -s "found renegotiation extension" \ |
| 2015 | -s "server hello, secure renegotiation extension" \ |
| 2016 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2017 | -c "=> renegotiate" \ |
| 2018 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2019 | -S "write hello request" |
| 2020 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2021 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2022 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2023 | "$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] | 2024 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2025 | 0 \ |
| 2026 | -c "client hello, adding renegotiation extension" \ |
| 2027 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2028 | -s "found renegotiation extension" \ |
| 2029 | -s "server hello, secure renegotiation extension" \ |
| 2030 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2031 | -c "=> renegotiate" \ |
| 2032 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2033 | -s "write hello request" |
| 2034 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2035 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2036 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2037 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2038 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2039 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2040 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2041 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2042 | 0 \ |
| 2043 | -c "client hello, adding renegotiation extension" \ |
| 2044 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2045 | -s "found renegotiation extension" \ |
| 2046 | -s "server hello, secure renegotiation extension" \ |
| 2047 | -c "found renegotiation extension" \ |
| 2048 | -c "=> renegotiate" \ |
| 2049 | -s "=> renegotiate" \ |
| 2050 | -S "write hello request" \ |
| 2051 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2052 | |
| 2053 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2054 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2055 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2056 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2057 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2058 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2059 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2060 | 0 \ |
| 2061 | -c "client hello, adding renegotiation extension" \ |
| 2062 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2063 | -s "found renegotiation extension" \ |
| 2064 | -s "server hello, secure renegotiation extension" \ |
| 2065 | -c "found renegotiation extension" \ |
| 2066 | -c "=> renegotiate" \ |
| 2067 | -s "=> renegotiate" \ |
| 2068 | -s "write hello request" \ |
| 2069 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2070 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2071 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2072 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2073 | "$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] | 2074 | "$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] | 2075 | 0 \ |
| 2076 | -c "client hello, adding renegotiation extension" \ |
| 2077 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2078 | -s "found renegotiation extension" \ |
| 2079 | -s "server hello, secure renegotiation extension" \ |
| 2080 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2081 | -c "=> renegotiate" \ |
| 2082 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2083 | -s "write hello request" |
| 2084 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2085 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2086 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2087 | "$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] | 2088 | "$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] | 2089 | 1 \ |
| 2090 | -c "client hello, adding renegotiation extension" \ |
| 2091 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2092 | -S "found renegotiation extension" \ |
| 2093 | -s "server hello, secure renegotiation extension" \ |
| 2094 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2095 | -c "=> renegotiate" \ |
| 2096 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2097 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 2098 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2099 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2100 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2101 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2102 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2103 | "$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] | 2104 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2105 | 0 \ |
| 2106 | -C "client hello, adding renegotiation extension" \ |
| 2107 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2108 | -S "found renegotiation extension" \ |
| 2109 | -s "server hello, secure renegotiation extension" \ |
| 2110 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2111 | -C "=> renegotiate" \ |
| 2112 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2113 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 2114 | -S "SSL - An unexpected message was received from our peer" \ |
| 2115 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2116 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2117 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2118 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2119 | "$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] | 2120 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2121 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2122 | 0 \ |
| 2123 | -C "client hello, adding renegotiation extension" \ |
| 2124 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2125 | -S "found renegotiation extension" \ |
| 2126 | -s "server hello, secure renegotiation extension" \ |
| 2127 | -c "found renegotiation extension" \ |
| 2128 | -C "=> renegotiate" \ |
| 2129 | -S "=> renegotiate" \ |
| 2130 | -s "write hello request" \ |
| 2131 | -S "SSL - An unexpected message was received from our peer" \ |
| 2132 | -S "failed" |
| 2133 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2134 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2135 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2136 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2137 | "$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] | 2138 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2139 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2140 | 0 \ |
| 2141 | -C "client hello, adding renegotiation extension" \ |
| 2142 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2143 | -S "found renegotiation extension" \ |
| 2144 | -s "server hello, secure renegotiation extension" \ |
| 2145 | -c "found renegotiation extension" \ |
| 2146 | -C "=> renegotiate" \ |
| 2147 | -S "=> renegotiate" \ |
| 2148 | -s "write hello request" \ |
| 2149 | -S "SSL - An unexpected message was received from our peer" \ |
| 2150 | -S "failed" |
| 2151 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2152 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2153 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2154 | "$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] | 2155 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2156 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2157 | 0 \ |
| 2158 | -C "client hello, adding renegotiation extension" \ |
| 2159 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2160 | -S "found renegotiation extension" \ |
| 2161 | -s "server hello, secure renegotiation extension" \ |
| 2162 | -c "found renegotiation extension" \ |
| 2163 | -C "=> renegotiate" \ |
| 2164 | -S "=> renegotiate" \ |
| 2165 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2166 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2167 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2168 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2169 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2170 | "$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] | 2171 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2172 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2173 | 0 \ |
| 2174 | -c "client hello, adding renegotiation extension" \ |
| 2175 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2176 | -s "found renegotiation extension" \ |
| 2177 | -s "server hello, secure renegotiation extension" \ |
| 2178 | -c "found renegotiation extension" \ |
| 2179 | -c "=> renegotiate" \ |
| 2180 | -s "=> renegotiate" \ |
| 2181 | -s "write hello request" \ |
| 2182 | -S "SSL - An unexpected message was received from our peer" \ |
| 2183 | -S "failed" |
| 2184 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2185 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2186 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2187 | "$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] | 2188 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2189 | 0 \ |
| 2190 | -C "client hello, adding renegotiation extension" \ |
| 2191 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2192 | -S "found renegotiation extension" \ |
| 2193 | -s "server hello, secure renegotiation extension" \ |
| 2194 | -c "found renegotiation extension" \ |
| 2195 | -S "record counter limit reached: renegotiate" \ |
| 2196 | -C "=> renegotiate" \ |
| 2197 | -S "=> renegotiate" \ |
| 2198 | -S "write hello request" \ |
| 2199 | -S "SSL - An unexpected message was received from our peer" \ |
| 2200 | -S "failed" |
| 2201 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 2202 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2203 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2204 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2205 | "$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] | 2206 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2207 | 0 \ |
| 2208 | -c "client hello, adding renegotiation extension" \ |
| 2209 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2210 | -s "found renegotiation extension" \ |
| 2211 | -s "server hello, secure renegotiation extension" \ |
| 2212 | -c "found renegotiation extension" \ |
| 2213 | -s "record counter limit reached: renegotiate" \ |
| 2214 | -c "=> renegotiate" \ |
| 2215 | -s "=> renegotiate" \ |
| 2216 | -s "write hello request" \ |
| 2217 | -S "SSL - An unexpected message was received from our peer" \ |
| 2218 | -S "failed" |
| 2219 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2221 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2222 | "$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] | 2223 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2224 | 0 \ |
| 2225 | -c "client hello, adding renegotiation extension" \ |
| 2226 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2227 | -s "found renegotiation extension" \ |
| 2228 | -s "server hello, secure renegotiation extension" \ |
| 2229 | -c "found renegotiation extension" \ |
| 2230 | -s "record counter limit reached: renegotiate" \ |
| 2231 | -c "=> renegotiate" \ |
| 2232 | -s "=> renegotiate" \ |
| 2233 | -s "write hello request" \ |
| 2234 | -S "SSL - An unexpected message was received from our peer" \ |
| 2235 | -S "failed" |
| 2236 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2237 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2238 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2239 | "$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] | 2240 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 2241 | 0 \ |
| 2242 | -C "client hello, adding renegotiation extension" \ |
| 2243 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2244 | -S "found renegotiation extension" \ |
| 2245 | -s "server hello, secure renegotiation extension" \ |
| 2246 | -c "found renegotiation extension" \ |
| 2247 | -S "record counter limit reached: renegotiate" \ |
| 2248 | -C "=> renegotiate" \ |
| 2249 | -S "=> renegotiate" \ |
| 2250 | -S "write hello request" \ |
| 2251 | -S "SSL - An unexpected message was received from our peer" \ |
| 2252 | -S "failed" |
| 2253 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2254 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2255 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2256 | "$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] | 2257 | "$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] | 2258 | 0 \ |
| 2259 | -c "client hello, adding renegotiation extension" \ |
| 2260 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2261 | -s "found renegotiation extension" \ |
| 2262 | -s "server hello, secure renegotiation extension" \ |
| 2263 | -c "found renegotiation extension" \ |
| 2264 | -c "=> renegotiate" \ |
| 2265 | -s "=> renegotiate" \ |
| 2266 | -S "write hello request" |
| 2267 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2268 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2269 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2270 | "$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] | 2271 | "$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] | 2272 | 0 \ |
| 2273 | -c "client hello, adding renegotiation extension" \ |
| 2274 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2275 | -s "found renegotiation extension" \ |
| 2276 | -s "server hello, secure renegotiation extension" \ |
| 2277 | -c "found renegotiation extension" \ |
| 2278 | -c "=> renegotiate" \ |
| 2279 | -s "=> renegotiate" \ |
| 2280 | -s "write hello request" |
| 2281 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2282 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2283 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2284 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2285 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2286 | 0 \ |
| 2287 | -c "client hello, adding renegotiation extension" \ |
| 2288 | -c "found renegotiation extension" \ |
| 2289 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2290 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2291 | -C "error" \ |
| 2292 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2293 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2294 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2296 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2297 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2298 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2299 | 0 \ |
| 2300 | -c "client hello, adding renegotiation extension" \ |
| 2301 | -c "found renegotiation extension" \ |
| 2302 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2303 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2304 | -C "error" \ |
| 2305 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2306 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2307 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2308 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2309 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2310 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2311 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2312 | 1 \ |
| 2313 | -c "client hello, adding renegotiation extension" \ |
| 2314 | -C "found renegotiation extension" \ |
| 2315 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2316 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2317 | -c "error" \ |
| 2318 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2319 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2320 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2321 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2322 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2323 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2324 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2325 | allow_legacy=0" \ |
| 2326 | 1 \ |
| 2327 | -c "client hello, adding renegotiation extension" \ |
| 2328 | -C "found renegotiation extension" \ |
| 2329 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2330 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2331 | -c "error" \ |
| 2332 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2333 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2334 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2335 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2336 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 2337 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2338 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2339 | allow_legacy=1" \ |
| 2340 | 0 \ |
| 2341 | -c "client hello, adding renegotiation extension" \ |
| 2342 | -C "found renegotiation extension" \ |
| 2343 | -c "=> renegotiate" \ |
| 2344 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2345 | -C "error" \ |
| 2346 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2347 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2348 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2349 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2350 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2351 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2352 | 0 \ |
| 2353 | -c "client hello, adding renegotiation extension" \ |
| 2354 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2355 | -s "found renegotiation extension" \ |
| 2356 | -s "server hello, secure renegotiation extension" \ |
| 2357 | -c "found renegotiation extension" \ |
| 2358 | -c "=> renegotiate" \ |
| 2359 | -s "=> renegotiate" \ |
| 2360 | -S "write hello request" |
| 2361 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2362 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2363 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2364 | "$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] | 2365 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2366 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2367 | 0 \ |
| 2368 | -c "client hello, adding renegotiation extension" \ |
| 2369 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2370 | -s "found renegotiation extension" \ |
| 2371 | -s "server hello, secure renegotiation extension" \ |
| 2372 | -c "found renegotiation extension" \ |
| 2373 | -c "=> renegotiate" \ |
| 2374 | -s "=> renegotiate" \ |
| 2375 | -s "write hello request" |
| 2376 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2377 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2378 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2379 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2380 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2381 | 0 \ |
| 2382 | -c "client hello, adding renegotiation extension" \ |
| 2383 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2384 | -s "found renegotiation extension" \ |
| 2385 | -s "server hello, secure renegotiation extension" \ |
| 2386 | -s "record counter limit reached: renegotiate" \ |
| 2387 | -c "=> renegotiate" \ |
| 2388 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2389 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2390 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2391 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2392 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2393 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2394 | "$G_SRV -u --mtu 4096" \ |
| 2395 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2396 | 0 \ |
| 2397 | -c "client hello, adding renegotiation extension" \ |
| 2398 | -c "found renegotiation extension" \ |
| 2399 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2400 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2401 | -C "error" \ |
| 2402 | -s "Extra-header:" |
| 2403 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2404 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2405 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2406 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2407 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2408 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2409 | "$P_CLI debug_level=3" \ |
| 2410 | 0 \ |
| 2411 | -c "found renegotiation extension" \ |
| 2412 | -C "error" \ |
| 2413 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2414 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2415 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2416 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2417 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2418 | "$P_CLI debug_level=3" \ |
| 2419 | 0 \ |
| 2420 | -C "found renegotiation extension" \ |
| 2421 | -C "error" \ |
| 2422 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2423 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2424 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2425 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2426 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2427 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2428 | 1 \ |
| 2429 | -C "found renegotiation extension" \ |
| 2430 | -c "error" \ |
| 2431 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2432 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2433 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2434 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2435 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2436 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2437 | 0 \ |
| 2438 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2439 | -s "server hello, secure renegotiation extension" |
| 2440 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2441 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2442 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2443 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2444 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2445 | 0 \ |
| 2446 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2447 | -S "server hello, secure renegotiation extension" |
| 2448 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2449 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2450 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2451 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2452 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2453 | 1 \ |
| 2454 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2455 | -S "server hello, secure renegotiation extension" |
| 2456 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2457 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2458 | |
| 2459 | requires_gnutls |
| 2460 | run_test "DER format: no trailing bytes" \ |
| 2461 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2462 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2463 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2464 | 0 \ |
| 2465 | -c "Handshake was completed" \ |
| 2466 | |
| 2467 | requires_gnutls |
| 2468 | run_test "DER format: with a trailing zero byte" \ |
| 2469 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2470 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2471 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2472 | 0 \ |
| 2473 | -c "Handshake was completed" \ |
| 2474 | |
| 2475 | requires_gnutls |
| 2476 | run_test "DER format: with a trailing random byte" \ |
| 2477 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2478 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2479 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2480 | 0 \ |
| 2481 | -c "Handshake was completed" \ |
| 2482 | |
| 2483 | requires_gnutls |
| 2484 | run_test "DER format: with 2 trailing random bytes" \ |
| 2485 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2486 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2487 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2488 | 0 \ |
| 2489 | -c "Handshake was completed" \ |
| 2490 | |
| 2491 | requires_gnutls |
| 2492 | run_test "DER format: with 4 trailing random bytes" \ |
| 2493 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2494 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2495 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2496 | 0 \ |
| 2497 | -c "Handshake was completed" \ |
| 2498 | |
| 2499 | requires_gnutls |
| 2500 | run_test "DER format: with 8 trailing random bytes" \ |
| 2501 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2502 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2503 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2504 | 0 \ |
| 2505 | -c "Handshake was completed" \ |
| 2506 | |
| 2507 | requires_gnutls |
| 2508 | run_test "DER format: with 9 trailing random bytes" \ |
| 2509 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2510 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2511 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2512 | 0 \ |
| 2513 | -c "Handshake was completed" \ |
| 2514 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2515 | # Tests for auth_mode |
| 2516 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2517 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2518 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2519 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2520 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2521 | 1 \ |
| 2522 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2523 | -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] | 2524 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2525 | -c "X509 - Certificate verification failed" |
| 2526 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2527 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2528 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2529 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2530 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2531 | 0 \ |
| 2532 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2533 | -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] | 2534 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2535 | -C "X509 - Certificate verification failed" |
| 2536 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2537 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2538 | "$P_SRV" \ |
| 2539 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2540 | 0 \ |
| 2541 | -c "x509_verify_cert() returned" \ |
| 2542 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2543 | -c "! Certificate verification flags"\ |
| 2544 | -C "! mbedtls_ssl_handshake returned" \ |
| 2545 | -C "X509 - Certificate verification failed" \ |
| 2546 | -C "SSL - No CA Chain is set, but required to operate" |
| 2547 | |
| 2548 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2549 | "$P_SRV" \ |
| 2550 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2551 | 1 \ |
| 2552 | -c "x509_verify_cert() returned" \ |
| 2553 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2554 | -c "! Certificate verification flags"\ |
| 2555 | -c "! mbedtls_ssl_handshake returned" \ |
| 2556 | -c "SSL - No CA Chain is set, but required to operate" |
| 2557 | |
| 2558 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2559 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2560 | # the client informs the server about the supported curves - it does, though, in the |
| 2561 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2562 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2563 | # different means to have the server ignoring the client's supported curve list. |
| 2564 | |
| 2565 | requires_config_enabled MBEDTLS_ECP_C |
| 2566 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2567 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2568 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2569 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2570 | 1 \ |
| 2571 | -c "bad certificate (EC key curve)"\ |
| 2572 | -c "! Certificate verification flags"\ |
| 2573 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2574 | |
| 2575 | requires_config_enabled MBEDTLS_ECP_C |
| 2576 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2577 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2578 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2579 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2580 | 1 \ |
| 2581 | -c "bad certificate (EC key curve)"\ |
| 2582 | -c "! Certificate verification flags"\ |
| 2583 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2584 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2585 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2586 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2587 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2588 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2589 | 0 \ |
| 2590 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2591 | -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] | 2592 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2593 | -C "X509 - Certificate verification failed" |
| 2594 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2595 | run_test "Authentication: client SHA256, server required" \ |
| 2596 | "$P_SRV auth_mode=required" \ |
| 2597 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2598 | key_file=data_files/server6.key \ |
| 2599 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2600 | 0 \ |
| 2601 | -c "Supported Signature Algorithm found: 4," \ |
| 2602 | -c "Supported Signature Algorithm found: 5," |
| 2603 | |
| 2604 | run_test "Authentication: client SHA384, server required" \ |
| 2605 | "$P_SRV auth_mode=required" \ |
| 2606 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2607 | key_file=data_files/server6.key \ |
| 2608 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2609 | 0 \ |
| 2610 | -c "Supported Signature Algorithm found: 4," \ |
| 2611 | -c "Supported Signature Algorithm found: 5," |
| 2612 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2613 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2614 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2615 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2616 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2617 | key_file=data_files/server5.key" \ |
| 2618 | 1 \ |
| 2619 | -S "skip write certificate request" \ |
| 2620 | -C "skip parse certificate request" \ |
| 2621 | -c "got a certificate request" \ |
| 2622 | -c "got no certificate to send" \ |
| 2623 | -S "x509_verify_cert() returned" \ |
| 2624 | -s "client has no certificate" \ |
| 2625 | -s "! mbedtls_ssl_handshake returned" \ |
| 2626 | -c "! mbedtls_ssl_handshake returned" \ |
| 2627 | -s "No client certification received from the client, but required by the authentication mode" |
| 2628 | |
| 2629 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2630 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2631 | "$P_CLI debug_level=3 crt_file=none \ |
| 2632 | key_file=data_files/server5.key" \ |
| 2633 | 1 \ |
| 2634 | -S "skip write certificate request" \ |
| 2635 | -C "skip parse certificate request" \ |
| 2636 | -c "got a certificate request" \ |
| 2637 | -c "= write certificate$" \ |
| 2638 | -C "skip write certificate$" \ |
| 2639 | -S "x509_verify_cert() returned" \ |
| 2640 | -s "client has no certificate" \ |
| 2641 | -s "! mbedtls_ssl_handshake returned" \ |
| 2642 | -c "! mbedtls_ssl_handshake returned" \ |
| 2643 | -s "No client certification received from the client, but required by the authentication mode" |
| 2644 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2645 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2646 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2647 | "$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] | 2648 | key_file=data_files/server5.key" \ |
| 2649 | 1 \ |
| 2650 | -S "skip write certificate request" \ |
| 2651 | -C "skip parse certificate request" \ |
| 2652 | -c "got a certificate request" \ |
| 2653 | -C "skip write certificate" \ |
| 2654 | -C "skip write certificate verify" \ |
| 2655 | -S "skip parse certificate verify" \ |
| 2656 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2657 | -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] | 2658 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2659 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2660 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2661 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2662 | # We don't check that the client receives the alert because it might |
| 2663 | # detect that its write end of the connection is closed and abort |
| 2664 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2665 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2666 | run_test "Authentication: client cert not trusted, server required" \ |
| 2667 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2668 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2669 | key_file=data_files/server5.key" \ |
| 2670 | 1 \ |
| 2671 | -S "skip write certificate request" \ |
| 2672 | -C "skip parse certificate request" \ |
| 2673 | -c "got a certificate request" \ |
| 2674 | -C "skip write certificate" \ |
| 2675 | -C "skip write certificate verify" \ |
| 2676 | -S "skip parse certificate verify" \ |
| 2677 | -s "x509_verify_cert() returned" \ |
| 2678 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2679 | -s "! mbedtls_ssl_handshake returned" \ |
| 2680 | -c "! mbedtls_ssl_handshake returned" \ |
| 2681 | -s "X509 - Certificate verification failed" |
| 2682 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2683 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2684 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2685 | "$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] | 2686 | key_file=data_files/server5.key" \ |
| 2687 | 0 \ |
| 2688 | -S "skip write certificate request" \ |
| 2689 | -C "skip parse certificate request" \ |
| 2690 | -c "got a certificate request" \ |
| 2691 | -C "skip write certificate" \ |
| 2692 | -C "skip write certificate verify" \ |
| 2693 | -S "skip parse certificate verify" \ |
| 2694 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2695 | -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] | 2696 | -S "! mbedtls_ssl_handshake returned" \ |
| 2697 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2698 | -S "X509 - Certificate verification failed" |
| 2699 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2700 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2701 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2702 | "$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] | 2703 | key_file=data_files/server5.key" \ |
| 2704 | 0 \ |
| 2705 | -s "skip write certificate request" \ |
| 2706 | -C "skip parse certificate request" \ |
| 2707 | -c "got no certificate request" \ |
| 2708 | -c "skip write certificate" \ |
| 2709 | -c "skip write certificate verify" \ |
| 2710 | -s "skip parse certificate verify" \ |
| 2711 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2712 | -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] | 2713 | -S "! mbedtls_ssl_handshake returned" \ |
| 2714 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2715 | -S "X509 - Certificate verification failed" |
| 2716 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2717 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2718 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2719 | "$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] | 2720 | 0 \ |
| 2721 | -S "skip write certificate request" \ |
| 2722 | -C "skip parse certificate request" \ |
| 2723 | -c "got a certificate request" \ |
| 2724 | -C "skip write certificate$" \ |
| 2725 | -C "got no certificate to send" \ |
| 2726 | -S "SSLv3 client has no certificate" \ |
| 2727 | -c "skip write certificate verify" \ |
| 2728 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2729 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2730 | -S "! mbedtls_ssl_handshake returned" \ |
| 2731 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2732 | -S "X509 - Certificate verification failed" |
| 2733 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2734 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2735 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2736 | "$O_CLI" \ |
| 2737 | 0 \ |
| 2738 | -S "skip write certificate request" \ |
| 2739 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2740 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2741 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2742 | -S "X509 - Certificate verification failed" |
| 2743 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2744 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2745 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2746 | "$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] | 2747 | 0 \ |
| 2748 | -C "skip parse certificate request" \ |
| 2749 | -c "got a certificate request" \ |
| 2750 | -C "skip write certificate$" \ |
| 2751 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2752 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2753 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2754 | run_test "Authentication: client no cert, openssl server required" \ |
| 2755 | "$O_SRV -Verify 10" \ |
| 2756 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2757 | 1 \ |
| 2758 | -C "skip parse certificate request" \ |
| 2759 | -c "got a certificate request" \ |
| 2760 | -C "skip write certificate$" \ |
| 2761 | -c "skip write certificate verify" \ |
| 2762 | -c "! mbedtls_ssl_handshake returned" |
| 2763 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2764 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2765 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2766 | "$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] | 2767 | "$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] | 2768 | 0 \ |
| 2769 | -S "skip write certificate request" \ |
| 2770 | -C "skip parse certificate request" \ |
| 2771 | -c "got a certificate request" \ |
| 2772 | -C "skip write certificate$" \ |
| 2773 | -c "skip write certificate verify" \ |
| 2774 | -c "got no certificate to send" \ |
| 2775 | -s "SSLv3 client has no certificate" \ |
| 2776 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2777 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2778 | -S "! mbedtls_ssl_handshake returned" \ |
| 2779 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2780 | -S "X509 - Certificate verification failed" |
| 2781 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2782 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 2783 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2784 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2785 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2786 | MAX_IM_CA_CONFIG=$( ../scripts/config.pl get MBEDTLS_X509_MAX_INTERMEDIATE_CA) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2787 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2788 | if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2789 | printf "The ${CONFIG_H} file contains a value for the configuration of\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2790 | 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] | 2791 | printf "test value of ${MAX_IM_CA}. \n" |
| 2792 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2793 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 2794 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2795 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2796 | |
| 2797 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2798 | fi |
| 2799 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2800 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2801 | run_test "Authentication: server max_int chain, client default" \ |
| 2802 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2803 | key_file=data_files/dir-maxpath/09.key" \ |
| 2804 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2805 | 0 \ |
| 2806 | -C "X509 - A fatal error occured" |
| 2807 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2808 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2809 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2810 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2811 | key_file=data_files/dir-maxpath/10.key" \ |
| 2812 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2813 | 1 \ |
| 2814 | -c "X509 - A fatal error occured" |
| 2815 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2816 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2817 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2818 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2819 | key_file=data_files/dir-maxpath/10.key" \ |
| 2820 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2821 | auth_mode=optional" \ |
| 2822 | 1 \ |
| 2823 | -c "X509 - A fatal error occured" |
| 2824 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2825 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2826 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2827 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2828 | key_file=data_files/dir-maxpath/10.key" \ |
| 2829 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2830 | auth_mode=none" \ |
| 2831 | 0 \ |
| 2832 | -C "X509 - A fatal error occured" |
| 2833 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2834 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2835 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2836 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2837 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2838 | key_file=data_files/dir-maxpath/10.key" \ |
| 2839 | 0 \ |
| 2840 | -S "X509 - A fatal error occured" |
| 2841 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2842 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2843 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2844 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2845 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2846 | key_file=data_files/dir-maxpath/10.key" \ |
| 2847 | 1 \ |
| 2848 | -s "X509 - A fatal error occured" |
| 2849 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2850 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2851 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2852 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2853 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2854 | key_file=data_files/dir-maxpath/10.key" \ |
| 2855 | 1 \ |
| 2856 | -s "X509 - A fatal error occured" |
| 2857 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2858 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2859 | run_test "Authentication: client max_int chain, server required" \ |
| 2860 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2861 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2862 | key_file=data_files/dir-maxpath/09.key" \ |
| 2863 | 0 \ |
| 2864 | -S "X509 - A fatal error occured" |
| 2865 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2866 | # Tests for CA list in CertificateRequest messages |
| 2867 | |
| 2868 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 2869 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2870 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2871 | key_file=data_files/server6.key" \ |
| 2872 | 0 \ |
| 2873 | -s "requested DN" |
| 2874 | |
| 2875 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 2876 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2877 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2878 | key_file=data_files/server6.key" \ |
| 2879 | 0 \ |
| 2880 | -S "requested DN" |
| 2881 | |
| 2882 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 2883 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2884 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2885 | key_file=data_files/server5.key" \ |
| 2886 | 1 \ |
| 2887 | -S "requested DN" \ |
| 2888 | -s "x509_verify_cert() returned" \ |
| 2889 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2890 | -s "! mbedtls_ssl_handshake returned" \ |
| 2891 | -c "! mbedtls_ssl_handshake returned" \ |
| 2892 | -s "X509 - Certificate verification failed" |
| 2893 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2894 | # Tests for certificate selection based on SHA verson |
| 2895 | |
| 2896 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 2897 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2898 | key_file=data_files/server5.key \ |
| 2899 | crt_file2=data_files/server5-sha1.crt \ |
| 2900 | key_file2=data_files/server5.key" \ |
| 2901 | "$P_CLI force_version=tls1_2" \ |
| 2902 | 0 \ |
| 2903 | -c "signed using.*ECDSA with SHA256" \ |
| 2904 | -C "signed using.*ECDSA with SHA1" |
| 2905 | |
| 2906 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 2907 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2908 | key_file=data_files/server5.key \ |
| 2909 | crt_file2=data_files/server5-sha1.crt \ |
| 2910 | key_file2=data_files/server5.key" \ |
| 2911 | "$P_CLI force_version=tls1_1" \ |
| 2912 | 0 \ |
| 2913 | -C "signed using.*ECDSA with SHA256" \ |
| 2914 | -c "signed using.*ECDSA with SHA1" |
| 2915 | |
| 2916 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 2917 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2918 | key_file=data_files/server5.key \ |
| 2919 | crt_file2=data_files/server5-sha1.crt \ |
| 2920 | key_file2=data_files/server5.key" \ |
| 2921 | "$P_CLI force_version=tls1" \ |
| 2922 | 0 \ |
| 2923 | -C "signed using.*ECDSA with SHA256" \ |
| 2924 | -c "signed using.*ECDSA with SHA1" |
| 2925 | |
| 2926 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 2927 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2928 | key_file=data_files/server5.key \ |
| 2929 | crt_file2=data_files/server6.crt \ |
| 2930 | key_file2=data_files/server6.key" \ |
| 2931 | "$P_CLI force_version=tls1_1" \ |
| 2932 | 0 \ |
| 2933 | -c "serial number.*09" \ |
| 2934 | -c "signed using.*ECDSA with SHA256" \ |
| 2935 | -C "signed using.*ECDSA with SHA1" |
| 2936 | |
| 2937 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 2938 | "$P_SRV crt_file=data_files/server6.crt \ |
| 2939 | key_file=data_files/server6.key \ |
| 2940 | crt_file2=data_files/server5.crt \ |
| 2941 | key_file2=data_files/server5.key" \ |
| 2942 | "$P_CLI force_version=tls1_1" \ |
| 2943 | 0 \ |
| 2944 | -c "serial number.*0A" \ |
| 2945 | -c "signed using.*ECDSA with SHA256" \ |
| 2946 | -C "signed using.*ECDSA with SHA1" |
| 2947 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2948 | # tests for SNI |
| 2949 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2950 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2951 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2952 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2953 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2954 | 0 \ |
| 2955 | -S "parse ServerName extension" \ |
| 2956 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2957 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2958 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2959 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2960 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2961 | 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] | 2962 | 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] | 2963 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2964 | 0 \ |
| 2965 | -s "parse ServerName extension" \ |
| 2966 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2967 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2968 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2969 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2970 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2971 | 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] | 2972 | 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] | 2973 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2974 | 0 \ |
| 2975 | -s "parse ServerName extension" \ |
| 2976 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2977 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2978 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2979 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2980 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2981 | 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] | 2982 | 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] | 2983 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2984 | 1 \ |
| 2985 | -s "parse ServerName extension" \ |
| 2986 | -s "ssl_sni_wrapper() returned" \ |
| 2987 | -s "mbedtls_ssl_handshake returned" \ |
| 2988 | -c "mbedtls_ssl_handshake returned" \ |
| 2989 | -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] | 2990 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2991 | run_test "SNI: client auth no override: optional" \ |
| 2992 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2993 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2994 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2995 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2996 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2997 | -S "skip write certificate request" \ |
| 2998 | -C "skip parse certificate request" \ |
| 2999 | -c "got a certificate request" \ |
| 3000 | -C "skip write certificate" \ |
| 3001 | -C "skip write certificate verify" \ |
| 3002 | -S "skip parse certificate verify" |
| 3003 | |
| 3004 | run_test "SNI: client auth override: none -> optional" \ |
| 3005 | "$P_SRV debug_level=3 auth_mode=none \ |
| 3006 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3007 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3008 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3009 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3010 | -S "skip write certificate request" \ |
| 3011 | -C "skip parse certificate request" \ |
| 3012 | -c "got a certificate request" \ |
| 3013 | -C "skip write certificate" \ |
| 3014 | -C "skip write certificate verify" \ |
| 3015 | -S "skip parse certificate verify" |
| 3016 | |
| 3017 | run_test "SNI: client auth override: optional -> none" \ |
| 3018 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3019 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3020 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3021 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3022 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3023 | -s "skip write certificate request" \ |
| 3024 | -C "skip parse certificate request" \ |
| 3025 | -c "got no certificate request" \ |
| 3026 | -c "skip write certificate" \ |
| 3027 | -c "skip write certificate verify" \ |
| 3028 | -s "skip parse certificate verify" |
| 3029 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3030 | run_test "SNI: CA no override" \ |
| 3031 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3032 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3033 | ca_file=data_files/test-ca.crt \ |
| 3034 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3035 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3036 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3037 | 1 \ |
| 3038 | -S "skip write certificate request" \ |
| 3039 | -C "skip parse certificate request" \ |
| 3040 | -c "got a certificate request" \ |
| 3041 | -C "skip write certificate" \ |
| 3042 | -C "skip write certificate verify" \ |
| 3043 | -S "skip parse certificate verify" \ |
| 3044 | -s "x509_verify_cert() returned" \ |
| 3045 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3046 | -S "The certificate has been revoked (is on a CRL)" |
| 3047 | |
| 3048 | run_test "SNI: CA override" \ |
| 3049 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3050 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3051 | ca_file=data_files/test-ca.crt \ |
| 3052 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3053 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3054 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3055 | 0 \ |
| 3056 | -S "skip write certificate request" \ |
| 3057 | -C "skip parse certificate request" \ |
| 3058 | -c "got a certificate request" \ |
| 3059 | -C "skip write certificate" \ |
| 3060 | -C "skip write certificate verify" \ |
| 3061 | -S "skip parse certificate verify" \ |
| 3062 | -S "x509_verify_cert() returned" \ |
| 3063 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3064 | -S "The certificate has been revoked (is on a CRL)" |
| 3065 | |
| 3066 | run_test "SNI: CA override with CRL" \ |
| 3067 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3068 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3069 | ca_file=data_files/test-ca.crt \ |
| 3070 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3071 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3072 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3073 | 1 \ |
| 3074 | -S "skip write certificate request" \ |
| 3075 | -C "skip parse certificate request" \ |
| 3076 | -c "got a certificate request" \ |
| 3077 | -C "skip write certificate" \ |
| 3078 | -C "skip write certificate verify" \ |
| 3079 | -S "skip parse certificate verify" \ |
| 3080 | -s "x509_verify_cert() returned" \ |
| 3081 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3082 | -s "The certificate has been revoked (is on a CRL)" |
| 3083 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3084 | # Tests for SNI and DTLS |
| 3085 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3086 | run_test "SNI: DTLS, no SNI callback" \ |
| 3087 | "$P_SRV debug_level=3 dtls=1 \ |
| 3088 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 3089 | "$P_CLI server_name=localhost dtls=1" \ |
| 3090 | 0 \ |
| 3091 | -S "parse ServerName extension" \ |
| 3092 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3093 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3094 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3095 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3096 | "$P_SRV debug_level=3 dtls=1 \ |
| 3097 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3098 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3099 | "$P_CLI server_name=localhost dtls=1" \ |
| 3100 | 0 \ |
| 3101 | -s "parse ServerName extension" \ |
| 3102 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3103 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3104 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3105 | run_test "SNI: DTLS, matching cert 2" \ |
| 3106 | "$P_SRV debug_level=3 dtls=1 \ |
| 3107 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3108 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3109 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 3110 | 0 \ |
| 3111 | -s "parse ServerName extension" \ |
| 3112 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3113 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 3114 | |
| 3115 | run_test "SNI: DTLS, no matching cert" \ |
| 3116 | "$P_SRV debug_level=3 dtls=1 \ |
| 3117 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3118 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3119 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 3120 | 1 \ |
| 3121 | -s "parse ServerName extension" \ |
| 3122 | -s "ssl_sni_wrapper() returned" \ |
| 3123 | -s "mbedtls_ssl_handshake returned" \ |
| 3124 | -c "mbedtls_ssl_handshake returned" \ |
| 3125 | -c "SSL - A fatal alert message was received from our peer" |
| 3126 | |
| 3127 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 3128 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3129 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3130 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3131 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3132 | 0 \ |
| 3133 | -S "skip write certificate request" \ |
| 3134 | -C "skip parse certificate request" \ |
| 3135 | -c "got a certificate request" \ |
| 3136 | -C "skip write certificate" \ |
| 3137 | -C "skip write certificate verify" \ |
| 3138 | -S "skip parse certificate verify" |
| 3139 | |
| 3140 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 3141 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 3142 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3143 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3144 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3145 | 0 \ |
| 3146 | -S "skip write certificate request" \ |
| 3147 | -C "skip parse certificate request" \ |
| 3148 | -c "got a certificate request" \ |
| 3149 | -C "skip write certificate" \ |
| 3150 | -C "skip write certificate verify" \ |
| 3151 | -S "skip parse certificate verify" |
| 3152 | |
| 3153 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 3154 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3155 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3156 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3157 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3158 | 0 \ |
| 3159 | -s "skip write certificate request" \ |
| 3160 | -C "skip parse certificate request" \ |
| 3161 | -c "got no certificate request" \ |
| 3162 | -c "skip write certificate" \ |
| 3163 | -c "skip write certificate verify" \ |
| 3164 | -s "skip parse certificate verify" |
| 3165 | |
| 3166 | run_test "SNI: DTLS, CA no override" \ |
| 3167 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3168 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3169 | ca_file=data_files/test-ca.crt \ |
| 3170 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3171 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3172 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3173 | 1 \ |
| 3174 | -S "skip write certificate request" \ |
| 3175 | -C "skip parse certificate request" \ |
| 3176 | -c "got a certificate request" \ |
| 3177 | -C "skip write certificate" \ |
| 3178 | -C "skip write certificate verify" \ |
| 3179 | -S "skip parse certificate verify" \ |
| 3180 | -s "x509_verify_cert() returned" \ |
| 3181 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3182 | -S "The certificate has been revoked (is on a CRL)" |
| 3183 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3184 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3185 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3186 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3187 | ca_file=data_files/test-ca.crt \ |
| 3188 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3189 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3190 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3191 | 0 \ |
| 3192 | -S "skip write certificate request" \ |
| 3193 | -C "skip parse certificate request" \ |
| 3194 | -c "got a certificate request" \ |
| 3195 | -C "skip write certificate" \ |
| 3196 | -C "skip write certificate verify" \ |
| 3197 | -S "skip parse certificate verify" \ |
| 3198 | -S "x509_verify_cert() returned" \ |
| 3199 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3200 | -S "The certificate has been revoked (is on a CRL)" |
| 3201 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3202 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3203 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3204 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 3205 | ca_file=data_files/test-ca.crt \ |
| 3206 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3207 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3208 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3209 | 1 \ |
| 3210 | -S "skip write certificate request" \ |
| 3211 | -C "skip parse certificate request" \ |
| 3212 | -c "got a certificate request" \ |
| 3213 | -C "skip write certificate" \ |
| 3214 | -C "skip write certificate verify" \ |
| 3215 | -S "skip parse certificate verify" \ |
| 3216 | -s "x509_verify_cert() returned" \ |
| 3217 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3218 | -s "The certificate has been revoked (is on a CRL)" |
| 3219 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3220 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 3221 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3222 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3223 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3224 | "$P_CLI nbio=2 tickets=0" \ |
| 3225 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3226 | -S "mbedtls_ssl_handshake returned" \ |
| 3227 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3228 | -c "Read from server: .* bytes read" |
| 3229 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3230 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3231 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 3232 | "$P_CLI nbio=2 tickets=0" \ |
| 3233 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3234 | -S "mbedtls_ssl_handshake returned" \ |
| 3235 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3236 | -c "Read from server: .* bytes read" |
| 3237 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3238 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3239 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3240 | "$P_CLI nbio=2 tickets=1" \ |
| 3241 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3242 | -S "mbedtls_ssl_handshake returned" \ |
| 3243 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3244 | -c "Read from server: .* bytes read" |
| 3245 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3246 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3247 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3248 | "$P_CLI nbio=2 tickets=1" \ |
| 3249 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3250 | -S "mbedtls_ssl_handshake returned" \ |
| 3251 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3252 | -c "Read from server: .* bytes read" |
| 3253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3254 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3255 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3256 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3257 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3258 | -S "mbedtls_ssl_handshake returned" \ |
| 3259 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3260 | -c "Read from server: .* bytes read" |
| 3261 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3262 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3263 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3264 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3265 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3266 | -S "mbedtls_ssl_handshake returned" \ |
| 3267 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3268 | -c "Read from server: .* bytes read" |
| 3269 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3270 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3271 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3272 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 3273 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3274 | -S "mbedtls_ssl_handshake returned" \ |
| 3275 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3276 | -c "Read from server: .* bytes read" |
| 3277 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3278 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 3279 | |
| 3280 | run_test "Event-driven I/O: basic handshake" \ |
| 3281 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3282 | "$P_CLI event=1 tickets=0" \ |
| 3283 | 0 \ |
| 3284 | -S "mbedtls_ssl_handshake returned" \ |
| 3285 | -C "mbedtls_ssl_handshake returned" \ |
| 3286 | -c "Read from server: .* bytes read" |
| 3287 | |
| 3288 | run_test "Event-driven I/O: client auth" \ |
| 3289 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 3290 | "$P_CLI event=1 tickets=0" \ |
| 3291 | 0 \ |
| 3292 | -S "mbedtls_ssl_handshake returned" \ |
| 3293 | -C "mbedtls_ssl_handshake returned" \ |
| 3294 | -c "Read from server: .* bytes read" |
| 3295 | |
| 3296 | run_test "Event-driven I/O: ticket" \ |
| 3297 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3298 | "$P_CLI event=1 tickets=1" \ |
| 3299 | 0 \ |
| 3300 | -S "mbedtls_ssl_handshake returned" \ |
| 3301 | -C "mbedtls_ssl_handshake returned" \ |
| 3302 | -c "Read from server: .* bytes read" |
| 3303 | |
| 3304 | run_test "Event-driven I/O: ticket + client auth" \ |
| 3305 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3306 | "$P_CLI event=1 tickets=1" \ |
| 3307 | 0 \ |
| 3308 | -S "mbedtls_ssl_handshake returned" \ |
| 3309 | -C "mbedtls_ssl_handshake returned" \ |
| 3310 | -c "Read from server: .* bytes read" |
| 3311 | |
| 3312 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 3313 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3314 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3315 | 0 \ |
| 3316 | -S "mbedtls_ssl_handshake returned" \ |
| 3317 | -C "mbedtls_ssl_handshake returned" \ |
| 3318 | -c "Read from server: .* bytes read" |
| 3319 | |
| 3320 | run_test "Event-driven I/O: ticket + resume" \ |
| 3321 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3322 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3323 | 0 \ |
| 3324 | -S "mbedtls_ssl_handshake returned" \ |
| 3325 | -C "mbedtls_ssl_handshake returned" \ |
| 3326 | -c "Read from server: .* bytes read" |
| 3327 | |
| 3328 | run_test "Event-driven I/O: session-id resume" \ |
| 3329 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3330 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 3331 | 0 \ |
| 3332 | -S "mbedtls_ssl_handshake returned" \ |
| 3333 | -C "mbedtls_ssl_handshake returned" \ |
| 3334 | -c "Read from server: .* bytes read" |
| 3335 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3336 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 3337 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3338 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3339 | 0 \ |
| 3340 | -c "Read from server: .* bytes read" |
| 3341 | |
| 3342 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 3343 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3344 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3345 | 0 \ |
| 3346 | -c "Read from server: .* bytes read" |
| 3347 | |
| 3348 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 3349 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3350 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3351 | 0 \ |
| 3352 | -c "Read from server: .* bytes read" |
| 3353 | |
| 3354 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 3355 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3356 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3357 | 0 \ |
| 3358 | -c "Read from server: .* bytes read" |
| 3359 | |
| 3360 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 3361 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3362 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3363 | 0 \ |
| 3364 | -c "Read from server: .* bytes read" |
| 3365 | |
| 3366 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 3367 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3368 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3369 | 0 \ |
| 3370 | -c "Read from server: .* bytes read" |
| 3371 | |
| 3372 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 3373 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3374 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3375 | 0 \ |
| 3376 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3377 | |
| 3378 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3379 | # During session resumption, the client will send its ApplicationData record |
| 3380 | # within the same datagram as the Finished messages. In this situation, the |
| 3381 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3382 | # because the ApplicationData request has already been queued internally. |
| 3383 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3384 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3385 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3386 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3387 | 0 \ |
| 3388 | -c "Read from server: .* bytes read" |
| 3389 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3390 | # Tests for version negotiation |
| 3391 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3392 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3393 | "$P_SRV" \ |
| 3394 | "$P_CLI" \ |
| 3395 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3396 | -S "mbedtls_ssl_handshake returned" \ |
| 3397 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3398 | -s "Protocol is TLSv1.2" \ |
| 3399 | -c "Protocol is TLSv1.2" |
| 3400 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3401 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3402 | "$P_SRV" \ |
| 3403 | "$P_CLI max_version=tls1_1" \ |
| 3404 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3405 | -S "mbedtls_ssl_handshake returned" \ |
| 3406 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3407 | -s "Protocol is TLSv1.1" \ |
| 3408 | -c "Protocol is TLSv1.1" |
| 3409 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3410 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3411 | "$P_SRV max_version=tls1_1" \ |
| 3412 | "$P_CLI" \ |
| 3413 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3414 | -S "mbedtls_ssl_handshake returned" \ |
| 3415 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3416 | -s "Protocol is TLSv1.1" \ |
| 3417 | -c "Protocol is TLSv1.1" |
| 3418 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3419 | 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] | 3420 | "$P_SRV max_version=tls1_1" \ |
| 3421 | "$P_CLI max_version=tls1_1" \ |
| 3422 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3423 | -S "mbedtls_ssl_handshake returned" \ |
| 3424 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3425 | -s "Protocol is TLSv1.1" \ |
| 3426 | -c "Protocol is TLSv1.1" |
| 3427 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3428 | 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] | 3429 | "$P_SRV min_version=tls1_1" \ |
| 3430 | "$P_CLI max_version=tls1_1" \ |
| 3431 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3432 | -S "mbedtls_ssl_handshake returned" \ |
| 3433 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3434 | -s "Protocol is TLSv1.1" \ |
| 3435 | -c "Protocol is TLSv1.1" |
| 3436 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3437 | 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] | 3438 | "$P_SRV max_version=tls1_1" \ |
| 3439 | "$P_CLI min_version=tls1_1" \ |
| 3440 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3441 | -S "mbedtls_ssl_handshake returned" \ |
| 3442 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3443 | -s "Protocol is TLSv1.1" \ |
| 3444 | -c "Protocol is TLSv1.1" |
| 3445 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3446 | 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] | 3447 | "$P_SRV max_version=tls1_1" \ |
| 3448 | "$P_CLI min_version=tls1_2" \ |
| 3449 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3450 | -s "mbedtls_ssl_handshake returned" \ |
| 3451 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3452 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3453 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3454 | 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] | 3455 | "$P_SRV min_version=tls1_2" \ |
| 3456 | "$P_CLI max_version=tls1_1" \ |
| 3457 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3458 | -s "mbedtls_ssl_handshake returned" \ |
| 3459 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3460 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3461 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3462 | # Tests for ALPN extension |
| 3463 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3464 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3465 | "$P_SRV debug_level=3" \ |
| 3466 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3467 | 0 \ |
| 3468 | -C "client hello, adding alpn extension" \ |
| 3469 | -S "found alpn extension" \ |
| 3470 | -C "got an alert message, type: \\[2:120]" \ |
| 3471 | -S "server hello, adding alpn extension" \ |
| 3472 | -C "found alpn extension " \ |
| 3473 | -C "Application Layer Protocol is" \ |
| 3474 | -S "Application Layer Protocol is" |
| 3475 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3476 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3477 | "$P_SRV debug_level=3" \ |
| 3478 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3479 | 0 \ |
| 3480 | -c "client hello, adding alpn extension" \ |
| 3481 | -s "found alpn extension" \ |
| 3482 | -C "got an alert message, type: \\[2:120]" \ |
| 3483 | -S "server hello, adding alpn extension" \ |
| 3484 | -C "found alpn extension " \ |
| 3485 | -c "Application Layer Protocol is (none)" \ |
| 3486 | -S "Application Layer Protocol is" |
| 3487 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3488 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3489 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3490 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3491 | 0 \ |
| 3492 | -C "client hello, adding alpn extension" \ |
| 3493 | -S "found alpn extension" \ |
| 3494 | -C "got an alert message, type: \\[2:120]" \ |
| 3495 | -S "server hello, adding alpn extension" \ |
| 3496 | -C "found alpn extension " \ |
| 3497 | -C "Application Layer Protocol is" \ |
| 3498 | -s "Application Layer Protocol is (none)" |
| 3499 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3500 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3501 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3502 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3503 | 0 \ |
| 3504 | -c "client hello, adding alpn extension" \ |
| 3505 | -s "found alpn extension" \ |
| 3506 | -C "got an alert message, type: \\[2:120]" \ |
| 3507 | -s "server hello, adding alpn extension" \ |
| 3508 | -c "found alpn extension" \ |
| 3509 | -c "Application Layer Protocol is abc" \ |
| 3510 | -s "Application Layer Protocol is abc" |
| 3511 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3512 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3513 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3514 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3515 | 0 \ |
| 3516 | -c "client hello, adding alpn extension" \ |
| 3517 | -s "found alpn extension" \ |
| 3518 | -C "got an alert message, type: \\[2:120]" \ |
| 3519 | -s "server hello, adding alpn extension" \ |
| 3520 | -c "found alpn extension" \ |
| 3521 | -c "Application Layer Protocol is abc" \ |
| 3522 | -s "Application Layer Protocol is abc" |
| 3523 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3524 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3525 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3526 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3527 | 0 \ |
| 3528 | -c "client hello, adding alpn extension" \ |
| 3529 | -s "found alpn extension" \ |
| 3530 | -C "got an alert message, type: \\[2:120]" \ |
| 3531 | -s "server hello, adding alpn extension" \ |
| 3532 | -c "found alpn extension" \ |
| 3533 | -c "Application Layer Protocol is 1234" \ |
| 3534 | -s "Application Layer Protocol is 1234" |
| 3535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3536 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3537 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3538 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3539 | 1 \ |
| 3540 | -c "client hello, adding alpn extension" \ |
| 3541 | -s "found alpn extension" \ |
| 3542 | -c "got an alert message, type: \\[2:120]" \ |
| 3543 | -S "server hello, adding alpn extension" \ |
| 3544 | -C "found alpn extension" \ |
| 3545 | -C "Application Layer Protocol is 1234" \ |
| 3546 | -S "Application Layer Protocol is 1234" |
| 3547 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3548 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3549 | # Tests for keyUsage in leaf certificates, part 1: |
| 3550 | # server-side certificate/suite selection |
| 3551 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3552 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3553 | "$P_SRV key_file=data_files/server2.key \ |
| 3554 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3555 | "$P_CLI" \ |
| 3556 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3557 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3558 | |
| 3559 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3560 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3561 | "$P_SRV key_file=data_files/server2.key \ |
| 3562 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3563 | "$P_CLI" \ |
| 3564 | 0 \ |
| 3565 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3566 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3567 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3568 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3569 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3570 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3571 | 1 \ |
| 3572 | -C "Ciphersuite is " |
| 3573 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3574 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3575 | "$P_SRV key_file=data_files/server5.key \ |
| 3576 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3577 | "$P_CLI" \ |
| 3578 | 0 \ |
| 3579 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3580 | |
| 3581 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3582 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3583 | "$P_SRV key_file=data_files/server5.key \ |
| 3584 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3585 | "$P_CLI" \ |
| 3586 | 0 \ |
| 3587 | -c "Ciphersuite is TLS-ECDH-" |
| 3588 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3589 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3590 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3591 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3592 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3593 | 1 \ |
| 3594 | -C "Ciphersuite is " |
| 3595 | |
| 3596 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3597 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3598 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3599 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3600 | "$O_SRV -key data_files/server2.key \ |
| 3601 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3602 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3603 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3604 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3605 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3606 | -C "Processing of the Certificate handshake message failed" \ |
| 3607 | -c "Ciphersuite is TLS-" |
| 3608 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3609 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3610 | "$O_SRV -key data_files/server2.key \ |
| 3611 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3612 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3613 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3614 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3615 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3616 | -C "Processing of the Certificate handshake message failed" \ |
| 3617 | -c "Ciphersuite is TLS-" |
| 3618 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3619 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3620 | "$O_SRV -key data_files/server2.key \ |
| 3621 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3622 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3623 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3624 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3625 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3626 | -C "Processing of the Certificate handshake message failed" \ |
| 3627 | -c "Ciphersuite is TLS-" |
| 3628 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3629 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3630 | "$O_SRV -key data_files/server2.key \ |
| 3631 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3632 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3633 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3634 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3635 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3636 | -c "Processing of the Certificate handshake message failed" \ |
| 3637 | -C "Ciphersuite is TLS-" |
| 3638 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3639 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3640 | "$O_SRV -key data_files/server2.key \ |
| 3641 | -cert data_files/server2.ku-ke.crt" \ |
| 3642 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3643 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3644 | 0 \ |
| 3645 | -c "bad certificate (usage extensions)" \ |
| 3646 | -C "Processing of the Certificate handshake message failed" \ |
| 3647 | -c "Ciphersuite is TLS-" \ |
| 3648 | -c "! Usage does not match the keyUsage extension" |
| 3649 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3650 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3651 | "$O_SRV -key data_files/server2.key \ |
| 3652 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3653 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3654 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3655 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3656 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3657 | -C "Processing of the Certificate handshake message failed" \ |
| 3658 | -c "Ciphersuite is TLS-" |
| 3659 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3660 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3661 | "$O_SRV -key data_files/server2.key \ |
| 3662 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3663 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3664 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3665 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3666 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3667 | -c "Processing of the Certificate handshake message failed" \ |
| 3668 | -C "Ciphersuite is TLS-" |
| 3669 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3670 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3671 | "$O_SRV -key data_files/server2.key \ |
| 3672 | -cert data_files/server2.ku-ds.crt" \ |
| 3673 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3674 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3675 | 0 \ |
| 3676 | -c "bad certificate (usage extensions)" \ |
| 3677 | -C "Processing of the Certificate handshake message failed" \ |
| 3678 | -c "Ciphersuite is TLS-" \ |
| 3679 | -c "! Usage does not match the keyUsage extension" |
| 3680 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3681 | # Tests for keyUsage in leaf certificates, part 3: |
| 3682 | # server-side checking of client cert |
| 3683 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3684 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3685 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3686 | "$O_CLI -key data_files/server2.key \ |
| 3687 | -cert data_files/server2.ku-ds.crt" \ |
| 3688 | 0 \ |
| 3689 | -S "bad certificate (usage extensions)" \ |
| 3690 | -S "Processing of the Certificate handshake message failed" |
| 3691 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3692 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3693 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3694 | "$O_CLI -key data_files/server2.key \ |
| 3695 | -cert data_files/server2.ku-ke.crt" \ |
| 3696 | 0 \ |
| 3697 | -s "bad certificate (usage extensions)" \ |
| 3698 | -S "Processing of the Certificate handshake message failed" |
| 3699 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3700 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3701 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3702 | "$O_CLI -key data_files/server2.key \ |
| 3703 | -cert data_files/server2.ku-ke.crt" \ |
| 3704 | 1 \ |
| 3705 | -s "bad certificate (usage extensions)" \ |
| 3706 | -s "Processing of the Certificate handshake message failed" |
| 3707 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3708 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3709 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3710 | "$O_CLI -key data_files/server5.key \ |
| 3711 | -cert data_files/server5.ku-ds.crt" \ |
| 3712 | 0 \ |
| 3713 | -S "bad certificate (usage extensions)" \ |
| 3714 | -S "Processing of the Certificate handshake message failed" |
| 3715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3716 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3717 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3718 | "$O_CLI -key data_files/server5.key \ |
| 3719 | -cert data_files/server5.ku-ka.crt" \ |
| 3720 | 0 \ |
| 3721 | -s "bad certificate (usage extensions)" \ |
| 3722 | -S "Processing of the Certificate handshake message failed" |
| 3723 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3724 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3725 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3726 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3727 | "$P_SRV key_file=data_files/server5.key \ |
| 3728 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3729 | "$P_CLI" \ |
| 3730 | 0 |
| 3731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3732 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3733 | "$P_SRV key_file=data_files/server5.key \ |
| 3734 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3735 | "$P_CLI" \ |
| 3736 | 0 |
| 3737 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3738 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3739 | "$P_SRV key_file=data_files/server5.key \ |
| 3740 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3741 | "$P_CLI" \ |
| 3742 | 0 |
| 3743 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3744 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3745 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3746 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3747 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3748 | 1 |
| 3749 | |
| 3750 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3751 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3752 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3753 | "$O_SRV -key data_files/server5.key \ |
| 3754 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3755 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3756 | 0 \ |
| 3757 | -C "bad certificate (usage extensions)" \ |
| 3758 | -C "Processing of the Certificate handshake message failed" \ |
| 3759 | -c "Ciphersuite is TLS-" |
| 3760 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3761 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3762 | "$O_SRV -key data_files/server5.key \ |
| 3763 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3764 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3765 | 0 \ |
| 3766 | -C "bad certificate (usage extensions)" \ |
| 3767 | -C "Processing of the Certificate handshake message failed" \ |
| 3768 | -c "Ciphersuite is TLS-" |
| 3769 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3770 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3771 | "$O_SRV -key data_files/server5.key \ |
| 3772 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3773 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3774 | 0 \ |
| 3775 | -C "bad certificate (usage extensions)" \ |
| 3776 | -C "Processing of the Certificate handshake message failed" \ |
| 3777 | -c "Ciphersuite is TLS-" |
| 3778 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3779 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3780 | "$O_SRV -key data_files/server5.key \ |
| 3781 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3782 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3783 | 1 \ |
| 3784 | -c "bad certificate (usage extensions)" \ |
| 3785 | -c "Processing of the Certificate handshake message failed" \ |
| 3786 | -C "Ciphersuite is TLS-" |
| 3787 | |
| 3788 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3790 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3791 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3792 | "$O_CLI -key data_files/server5.key \ |
| 3793 | -cert data_files/server5.eku-cli.crt" \ |
| 3794 | 0 \ |
| 3795 | -S "bad certificate (usage extensions)" \ |
| 3796 | -S "Processing of the Certificate handshake message failed" |
| 3797 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3798 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3799 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3800 | "$O_CLI -key data_files/server5.key \ |
| 3801 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3802 | 0 \ |
| 3803 | -S "bad certificate (usage extensions)" \ |
| 3804 | -S "Processing of the Certificate handshake message failed" |
| 3805 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3806 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3807 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3808 | "$O_CLI -key data_files/server5.key \ |
| 3809 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3810 | 0 \ |
| 3811 | -S "bad certificate (usage extensions)" \ |
| 3812 | -S "Processing of the Certificate handshake message failed" |
| 3813 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3814 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3815 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3816 | "$O_CLI -key data_files/server5.key \ |
| 3817 | -cert data_files/server5.eku-cs.crt" \ |
| 3818 | 0 \ |
| 3819 | -s "bad certificate (usage extensions)" \ |
| 3820 | -S "Processing of the Certificate handshake message failed" |
| 3821 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3822 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3823 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3824 | "$O_CLI -key data_files/server5.key \ |
| 3825 | -cert data_files/server5.eku-cs.crt" \ |
| 3826 | 1 \ |
| 3827 | -s "bad certificate (usage extensions)" \ |
| 3828 | -s "Processing of the Certificate handshake message failed" |
| 3829 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3830 | # Tests for DHM parameters loading |
| 3831 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3832 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3833 | "$P_SRV" \ |
| 3834 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3835 | debug_level=3" \ |
| 3836 | 0 \ |
| 3837 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3838 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3839 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3840 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3841 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3842 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3843 | debug_level=3" \ |
| 3844 | 0 \ |
| 3845 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3846 | -c "value of 'DHM: G ' (2 bits)" |
| 3847 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3848 | # Tests for DHM client-side size checking |
| 3849 | |
| 3850 | run_test "DHM size: server default, client default, OK" \ |
| 3851 | "$P_SRV" \ |
| 3852 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3853 | debug_level=1" \ |
| 3854 | 0 \ |
| 3855 | -C "DHM prime too short:" |
| 3856 | |
| 3857 | run_test "DHM size: server default, client 2048, OK" \ |
| 3858 | "$P_SRV" \ |
| 3859 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3860 | debug_level=1 dhmlen=2048" \ |
| 3861 | 0 \ |
| 3862 | -C "DHM prime too short:" |
| 3863 | |
| 3864 | run_test "DHM size: server 1024, client default, OK" \ |
| 3865 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3866 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3867 | debug_level=1" \ |
| 3868 | 0 \ |
| 3869 | -C "DHM prime too short:" |
| 3870 | |
| 3871 | run_test "DHM size: server 1000, client default, rejected" \ |
| 3872 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3873 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3874 | debug_level=1" \ |
| 3875 | 1 \ |
| 3876 | -c "DHM prime too short:" |
| 3877 | |
| 3878 | run_test "DHM size: server default, client 2049, rejected" \ |
| 3879 | "$P_SRV" \ |
| 3880 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3881 | debug_level=1 dhmlen=2049" \ |
| 3882 | 1 \ |
| 3883 | -c "DHM prime too short:" |
| 3884 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3885 | # Tests for PSK callback |
| 3886 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3887 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3888 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 3889 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3890 | psk_identity=foo psk=abc123" \ |
| 3891 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3892 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3893 | -S "SSL - Unknown identity received" \ |
| 3894 | -S "SSL - Verification of the message MAC failed" |
| 3895 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 3896 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 3897 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 3898 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 3899 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 3900 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 3901 | 0 \ |
| 3902 | -c "skip PMS generation for opaque PSK"\ |
| 3903 | -S "skip PMS generation for opaque PSK"\ |
| 3904 | -C "using extended master secret"\ |
| 3905 | -S "using extended master secret"\ |
| 3906 | -S "SSL - None of the common ciphersuites is usable" \ |
| 3907 | -S "SSL - Unknown identity received" \ |
| 3908 | -S "SSL - Verification of the message MAC failed" |
| 3909 | |
| 3910 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 3911 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 3912 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 3913 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 3914 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 3915 | 0 \ |
| 3916 | -c "skip PMS generation for opaque PSK"\ |
| 3917 | -S "skip PMS generation for opaque PSK"\ |
| 3918 | -C "using extended master secret"\ |
| 3919 | -S "using extended master secret"\ |
| 3920 | -S "SSL - None of the common ciphersuites is usable" \ |
| 3921 | -S "SSL - Unknown identity received" \ |
| 3922 | -S "SSL - Verification of the message MAC failed" |
| 3923 | |
| 3924 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 3925 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 3926 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 3927 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 3928 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 3929 | 0 \ |
| 3930 | -c "skip PMS generation for opaque PSK"\ |
| 3931 | -S "skip PMS generation for opaque PSK"\ |
| 3932 | -c "using extended master secret"\ |
| 3933 | -s "using extended master secret"\ |
| 3934 | -S "SSL - None of the common ciphersuites is usable" \ |
| 3935 | -S "SSL - Unknown identity received" \ |
| 3936 | -S "SSL - Verification of the message MAC failed" |
| 3937 | |
| 3938 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 3939 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 3940 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 3941 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 3942 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 3943 | 0 \ |
| 3944 | -c "skip PMS generation for opaque PSK"\ |
| 3945 | -S "skip PMS generation for opaque PSK"\ |
| 3946 | -c "using extended master secret"\ |
| 3947 | -s "using extended master secret"\ |
| 3948 | -S "SSL - None of the common ciphersuites is usable" \ |
| 3949 | -S "SSL - Unknown identity received" \ |
| 3950 | -S "SSL - Verification of the message MAC failed" |
| 3951 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 3952 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 3953 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 3954 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 3955 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3956 | psk_identity=foo psk=abc123" \ |
| 3957 | 0 \ |
| 3958 | -C "skip PMS generation for opaque PSK"\ |
| 3959 | -s "skip PMS generation for opaque PSK"\ |
| 3960 | -C "using extended master secret"\ |
| 3961 | -S "using extended master secret"\ |
| 3962 | -S "SSL - None of the common ciphersuites is usable" \ |
| 3963 | -S "SSL - Unknown identity received" \ |
| 3964 | -S "SSL - Verification of the message MAC failed" |
| 3965 | |
| 3966 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 3967 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 3968 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 3969 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 3970 | psk_identity=foo psk=abc123" \ |
| 3971 | 0 \ |
| 3972 | -C "skip PMS generation for opaque PSK"\ |
| 3973 | -s "skip PMS generation for opaque PSK"\ |
| 3974 | -C "using extended master secret"\ |
| 3975 | -S "using extended master secret"\ |
| 3976 | -S "SSL - None of the common ciphersuites is usable" \ |
| 3977 | -S "SSL - Unknown identity received" \ |
| 3978 | -S "SSL - Verification of the message MAC failed" |
| 3979 | |
| 3980 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 3981 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 3982 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 3983 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 3984 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3985 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 3986 | 0 \ |
| 3987 | -c "using extended master secret"\ |
| 3988 | -s "using extended master secret"\ |
| 3989 | -C "skip PMS generation for opaque PSK"\ |
| 3990 | -s "skip PMS generation for opaque PSK"\ |
| 3991 | -S "SSL - None of the common ciphersuites is usable" \ |
| 3992 | -S "SSL - Unknown identity received" \ |
| 3993 | -S "SSL - Verification of the message MAC failed" |
| 3994 | |
| 3995 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 3996 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 3997 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 3998 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 3999 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4000 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 4001 | 0 \ |
| 4002 | -c "using extended master secret"\ |
| 4003 | -s "using extended master secret"\ |
| 4004 | -C "skip PMS generation for opaque PSK"\ |
| 4005 | -s "skip PMS generation for opaque PSK"\ |
| 4006 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4007 | -S "SSL - Unknown identity received" \ |
| 4008 | -S "SSL - Verification of the message MAC failed" |
| 4009 | |
| 4010 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4011 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4012 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4013 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4014 | psk_identity=def psk=beef" \ |
| 4015 | 0 \ |
| 4016 | -C "skip PMS generation for opaque PSK"\ |
| 4017 | -s "skip PMS generation for opaque PSK"\ |
| 4018 | -C "using extended master secret"\ |
| 4019 | -S "using extended master secret"\ |
| 4020 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4021 | -S "SSL - Unknown identity received" \ |
| 4022 | -S "SSL - Verification of the message MAC failed" |
| 4023 | |
| 4024 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4025 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4026 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4027 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4028 | psk_identity=def psk=beef" \ |
| 4029 | 0 \ |
| 4030 | -C "skip PMS generation for opaque PSK"\ |
| 4031 | -s "skip PMS generation for opaque PSK"\ |
| 4032 | -C "using extended master secret"\ |
| 4033 | -S "using extended master secret"\ |
| 4034 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4035 | -S "SSL - Unknown identity received" \ |
| 4036 | -S "SSL - Verification of the message MAC failed" |
| 4037 | |
| 4038 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4039 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4040 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4041 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 4042 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4043 | psk_identity=abc psk=dead extended_ms=1" \ |
| 4044 | 0 \ |
| 4045 | -c "using extended master secret"\ |
| 4046 | -s "using extended master secret"\ |
| 4047 | -C "skip PMS generation for opaque PSK"\ |
| 4048 | -s "skip PMS generation for opaque PSK"\ |
| 4049 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4050 | -S "SSL - Unknown identity received" \ |
| 4051 | -S "SSL - Verification of the message MAC failed" |
| 4052 | |
| 4053 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4054 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4055 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4056 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 4057 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4058 | psk_identity=abc psk=dead extended_ms=1" \ |
| 4059 | 0 \ |
| 4060 | -c "using extended master secret"\ |
| 4061 | -s "using extended master secret"\ |
| 4062 | -C "skip PMS generation for opaque PSK"\ |
| 4063 | -s "skip PMS generation for opaque PSK"\ |
| 4064 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4065 | -S "SSL - Unknown identity received" \ |
| 4066 | -S "SSL - Verification of the message MAC failed" |
| 4067 | |
| 4068 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4069 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4070 | "$P_SRV extended_ms=0 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4071 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4072 | psk_identity=def psk=beef" \ |
| 4073 | 0 \ |
| 4074 | -C "skip PMS generation for opaque PSK"\ |
| 4075 | -s "skip PMS generation for opaque PSK"\ |
| 4076 | -C "using extended master secret"\ |
| 4077 | -S "using extended master secret"\ |
| 4078 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4079 | -S "SSL - Unknown identity received" \ |
| 4080 | -S "SSL - Verification of the message MAC failed" |
| 4081 | |
| 4082 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4083 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4084 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4085 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4086 | psk_identity=def psk=beef" \ |
| 4087 | 0 \ |
| 4088 | -C "skip PMS generation for opaque PSK"\ |
| 4089 | -s "skip PMS generation for opaque PSK"\ |
| 4090 | -C "using extended master secret"\ |
| 4091 | -S "using extended master secret"\ |
| 4092 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4093 | -S "SSL - Unknown identity received" \ |
| 4094 | -S "SSL - Verification of the message MAC failed" |
| 4095 | |
| 4096 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4097 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4098 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4099 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4100 | psk_identity=def psk=beef" \ |
| 4101 | 0 \ |
| 4102 | -C "skip PMS generation for opaque PSK"\ |
| 4103 | -C "using extended master secret"\ |
| 4104 | -S "using extended master secret"\ |
| 4105 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4106 | -S "SSL - Unknown identity received" \ |
| 4107 | -S "SSL - Verification of the message MAC failed" |
| 4108 | |
| 4109 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4110 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4111 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4112 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4113 | psk_identity=def psk=beef" \ |
| 4114 | 0 \ |
| 4115 | -C "skip PMS generation for opaque PSK"\ |
| 4116 | -C "using extended master secret"\ |
| 4117 | -S "using extended master secret"\ |
| 4118 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4119 | -S "SSL - Unknown identity received" \ |
| 4120 | -S "SSL - Verification of the message MAC failed" |
| 4121 | |
| 4122 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4123 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4124 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4125 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4126 | psk_identity=def psk=beef" \ |
| 4127 | 1 \ |
| 4128 | -s "SSL - Verification of the message MAC failed" |
| 4129 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4130 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4131 | "$P_SRV" \ |
| 4132 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4133 | psk_identity=foo psk=abc123" \ |
| 4134 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4135 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4136 | -S "SSL - Unknown identity received" \ |
| 4137 | -S "SSL - Verification of the message MAC failed" |
| 4138 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4139 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4140 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 4141 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4142 | psk_identity=foo psk=abc123" \ |
| 4143 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4144 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4145 | -s "SSL - Unknown identity received" \ |
| 4146 | -S "SSL - Verification of the message MAC failed" |
| 4147 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4148 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4149 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4150 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4151 | psk_identity=abc psk=dead" \ |
| 4152 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4153 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4154 | -S "SSL - Unknown identity received" \ |
| 4155 | -S "SSL - Verification of the message MAC failed" |
| 4156 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4157 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4158 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4159 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4160 | psk_identity=def psk=beef" \ |
| 4161 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4162 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4163 | -S "SSL - Unknown identity received" \ |
| 4164 | -S "SSL - Verification of the message MAC failed" |
| 4165 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4166 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4167 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4168 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4169 | psk_identity=ghi psk=beef" \ |
| 4170 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4171 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4172 | -s "SSL - Unknown identity received" \ |
| 4173 | -S "SSL - Verification of the message MAC failed" |
| 4174 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4175 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4176 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4177 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4178 | psk_identity=abc psk=beef" \ |
| 4179 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4180 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4181 | -S "SSL - Unknown identity received" \ |
| 4182 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4183 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4184 | # Tests for EC J-PAKE |
| 4185 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4186 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4187 | run_test "ECJPAKE: client not configured" \ |
| 4188 | "$P_SRV debug_level=3" \ |
| 4189 | "$P_CLI debug_level=3" \ |
| 4190 | 0 \ |
| 4191 | -C "add ciphersuite: c0ff" \ |
| 4192 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4193 | -S "found ecjpake kkpp extension" \ |
| 4194 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4195 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4196 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4197 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4198 | -S "None of the common ciphersuites is usable" |
| 4199 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4200 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4201 | run_test "ECJPAKE: server not configured" \ |
| 4202 | "$P_SRV debug_level=3" \ |
| 4203 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4204 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4205 | 1 \ |
| 4206 | -c "add ciphersuite: c0ff" \ |
| 4207 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4208 | -s "found ecjpake kkpp extension" \ |
| 4209 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4210 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4211 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4212 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4213 | -s "None of the common ciphersuites is usable" |
| 4214 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4215 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4216 | run_test "ECJPAKE: working, TLS" \ |
| 4217 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4218 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4219 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 4220 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4221 | -c "add ciphersuite: c0ff" \ |
| 4222 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4223 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4224 | -s "found ecjpake kkpp extension" \ |
| 4225 | -S "skip ecjpake kkpp extension" \ |
| 4226 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4227 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4228 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4229 | -S "None of the common ciphersuites is usable" \ |
| 4230 | -S "SSL - Verification of the message MAC failed" |
| 4231 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4232 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4233 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4234 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 4235 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4236 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 4237 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4238 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4239 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4240 | -s "SSL - Verification of the message MAC failed" |
| 4241 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4242 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4243 | run_test "ECJPAKE: working, DTLS" \ |
| 4244 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4245 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4246 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4247 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4248 | -c "re-using cached ecjpake parameters" \ |
| 4249 | -S "SSL - Verification of the message MAC failed" |
| 4250 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4251 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4252 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 4253 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 4254 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4255 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4256 | 0 \ |
| 4257 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4258 | -S "SSL - Verification of the message MAC failed" |
| 4259 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4260 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4261 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4262 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 4263 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4264 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 4265 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4266 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4267 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4268 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4269 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4270 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4271 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4272 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 4273 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 4274 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 4275 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4276 | 0 |
| 4277 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4278 | # Tests for ciphersuites per version |
| 4279 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4280 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4281 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4282 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-3DES-EDE-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] | 4283 | "$P_CLI force_version=ssl3" \ |
| 4284 | 0 \ |
| 4285 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 4286 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4287 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4288 | "$P_SRV arc4=1 version_suites=TLS-RSA-WITH-3DES-EDE-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] | 4289 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4290 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4291 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4292 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4293 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4294 | "$P_SRV version_suites=TLS-RSA-WITH-3DES-EDE-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] | 4295 | "$P_CLI force_version=tls1_1" \ |
| 4296 | 0 \ |
| 4297 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 4298 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4299 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4300 | "$P_SRV version_suites=TLS-RSA-WITH-3DES-EDE-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] | 4301 | "$P_CLI force_version=tls1_2" \ |
| 4302 | 0 \ |
| 4303 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 4304 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4305 | # Test for ClientHello without extensions |
| 4306 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 4307 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4308 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4309 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4310 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4311 | 0 \ |
| 4312 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4313 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4314 | requires_gnutls |
| 4315 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 4316 | "$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] | 4317 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4318 | 0 \ |
| 4319 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4320 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4321 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4322 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4323 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4324 | "$P_SRV" \ |
| 4325 | "$P_CLI request_size=100" \ |
| 4326 | 0 \ |
| 4327 | -s "Read from client: 100 bytes read$" |
| 4328 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4329 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4330 | "$P_SRV" \ |
| 4331 | "$P_CLI request_size=500" \ |
| 4332 | 0 \ |
| 4333 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4334 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4335 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4336 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4337 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4338 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4339 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4340 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4341 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4342 | 0 \ |
| 4343 | -s "Read from client: 1 bytes read" |
| 4344 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4345 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4346 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4347 | "$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] | 4348 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4349 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4350 | 0 \ |
| 4351 | -s "Read from client: 1 bytes read" |
| 4352 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4353 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4354 | "$P_SRV" \ |
| 4355 | "$P_CLI request_size=1 force_version=tls1 \ |
| 4356 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4357 | 0 \ |
| 4358 | -s "Read from client: 1 bytes read" |
| 4359 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4360 | 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] | 4361 | "$P_SRV" \ |
| 4362 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 4363 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4364 | 0 \ |
| 4365 | -s "Read from client: 1 bytes read" |
| 4366 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4367 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4368 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4369 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4370 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4371 | 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] | 4372 | 0 \ |
| 4373 | -s "Read from client: 1 bytes read" |
| 4374 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4375 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4376 | 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] | 4377 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4378 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4379 | 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] | 4380 | 0 \ |
| 4381 | -s "Read from client: 1 bytes read" |
| 4382 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4383 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4384 | "$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] | 4385 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4386 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4387 | 0 \ |
| 4388 | -s "Read from client: 1 bytes read" |
| 4389 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4390 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4391 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4392 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4393 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4394 | 0 \ |
| 4395 | -s "Read from client: 1 bytes read" |
| 4396 | |
| 4397 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4398 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4399 | "$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] | 4400 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4401 | 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] | 4402 | 0 \ |
| 4403 | -s "Read from client: 1 bytes read" |
| 4404 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4405 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4406 | 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] | 4407 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4408 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4409 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4410 | 0 \ |
| 4411 | -s "Read from client: 1 bytes read" |
| 4412 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4413 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4414 | "$P_SRV" \ |
| 4415 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4416 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4417 | 0 \ |
| 4418 | -s "Read from client: 1 bytes read" |
| 4419 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4420 | 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] | 4421 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4422 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4423 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4424 | 0 \ |
| 4425 | -s "Read from client: 1 bytes read" |
| 4426 | |
| 4427 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4428 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4429 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4430 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4431 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4432 | 0 \ |
| 4433 | -s "Read from client: 1 bytes read" |
| 4434 | |
| 4435 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4436 | 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] | 4437 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4438 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4439 | 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] | 4440 | 0 \ |
| 4441 | -s "Read from client: 1 bytes read" |
| 4442 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4443 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4444 | "$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] | 4445 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4446 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4447 | 0 \ |
| 4448 | -s "Read from client: 1 bytes read" |
| 4449 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4450 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4451 | "$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] | 4452 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4453 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4454 | 0 \ |
| 4455 | -s "Read from client: 1 bytes read" |
| 4456 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4457 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4458 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4459 | "$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] | 4460 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4461 | 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] | 4462 | 0 \ |
| 4463 | -s "Read from client: 1 bytes read" |
| 4464 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4465 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4466 | 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] | 4467 | "$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] | 4468 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4469 | 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] | 4470 | 0 \ |
| 4471 | -s "Read from client: 1 bytes read" |
| 4472 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4473 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4474 | "$P_SRV" \ |
| 4475 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4476 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4477 | 0 \ |
| 4478 | -s "Read from client: 1 bytes read" |
| 4479 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4480 | 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] | 4481 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4482 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4483 | 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] | 4484 | 0 \ |
| 4485 | -s "Read from client: 1 bytes read" |
| 4486 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4487 | 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] | 4488 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4489 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4490 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4491 | 0 \ |
| 4492 | -s "Read from client: 1 bytes read" |
| 4493 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4494 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4495 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4496 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4497 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4498 | 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] | 4499 | 0 \ |
| 4500 | -s "Read from client: 1 bytes read" |
| 4501 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4502 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4503 | 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] | 4504 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4505 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4506 | 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] | 4507 | 0 \ |
| 4508 | -s "Read from client: 1 bytes read" |
| 4509 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4510 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4511 | "$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] | 4512 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4513 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4514 | 0 \ |
| 4515 | -s "Read from client: 1 bytes read" |
| 4516 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4517 | 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] | 4518 | "$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] | 4519 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4520 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4521 | 0 \ |
| 4522 | -s "Read from client: 1 bytes read" |
| 4523 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4524 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4525 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4526 | "$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] | 4527 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4528 | 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] | 4529 | 0 \ |
| 4530 | -s "Read from client: 1 bytes read" |
| 4531 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4532 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4533 | 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] | 4534 | "$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] | 4535 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4536 | 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] | 4537 | 0 \ |
| 4538 | -s "Read from client: 1 bytes read" |
| 4539 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4540 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4541 | "$P_SRV" \ |
| 4542 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4543 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4544 | 0 \ |
| 4545 | -s "Read from client: 1 bytes read" |
| 4546 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4547 | 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] | 4548 | "$P_SRV" \ |
| 4549 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4550 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4551 | 0 \ |
| 4552 | -s "Read from client: 1 bytes read" |
| 4553 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4554 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4555 | |
| 4556 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4557 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4558 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 4559 | "$P_CLI dtls=1 request_size=1 \ |
| 4560 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4561 | 0 \ |
| 4562 | -s "Read from client: 1 bytes read" |
| 4563 | |
| 4564 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4565 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4566 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 4567 | "$P_CLI dtls=1 request_size=1 \ |
| 4568 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4569 | 0 \ |
| 4570 | -s "Read from client: 1 bytes read" |
| 4571 | |
| 4572 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4573 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4574 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4575 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 4576 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4577 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4578 | 0 \ |
| 4579 | -s "Read from client: 1 bytes read" |
| 4580 | |
| 4581 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4582 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4583 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4584 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4585 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4586 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4587 | 0 \ |
| 4588 | -s "Read from client: 1 bytes read" |
| 4589 | |
| 4590 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4591 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4592 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 4593 | "$P_CLI dtls=1 request_size=1 \ |
| 4594 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4595 | 0 \ |
| 4596 | -s "Read from client: 1 bytes read" |
| 4597 | |
| 4598 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4599 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4600 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4601 | "$P_CLI dtls=1 request_size=1 \ |
| 4602 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4603 | 0 \ |
| 4604 | -s "Read from client: 1 bytes read" |
| 4605 | |
| 4606 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4607 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4608 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4609 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4610 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4611 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4612 | 0 \ |
| 4613 | -s "Read from client: 1 bytes read" |
| 4614 | |
| 4615 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4616 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4617 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4618 | "$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] | 4619 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4620 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4621 | 0 \ |
| 4622 | -s "Read from client: 1 bytes read" |
| 4623 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4624 | # Tests for small server packets |
| 4625 | |
| 4626 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4627 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 4628 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 4629 | "$P_CLI force_version=ssl3 \ |
| 4630 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4631 | 0 \ |
| 4632 | -c "Read from server: 1 bytes read" |
| 4633 | |
| 4634 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4635 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 4636 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4637 | "$P_CLI force_version=ssl3 \ |
| 4638 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4639 | 0 \ |
| 4640 | -c "Read from server: 1 bytes read" |
| 4641 | |
| 4642 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 4643 | "$P_SRV response_size=1" \ |
| 4644 | "$P_CLI force_version=tls1 \ |
| 4645 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4646 | 0 \ |
| 4647 | -c "Read from server: 1 bytes read" |
| 4648 | |
| 4649 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 4650 | "$P_SRV response_size=1" \ |
| 4651 | "$P_CLI force_version=tls1 etm=0 \ |
| 4652 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4653 | 0 \ |
| 4654 | -c "Read from server: 1 bytes read" |
| 4655 | |
| 4656 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4657 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 4658 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4659 | "$P_CLI force_version=tls1 \ |
| 4660 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4661 | 0 \ |
| 4662 | -c "Read from server: 1 bytes read" |
| 4663 | |
| 4664 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4665 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 4666 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4667 | "$P_CLI force_version=tls1 \ |
| 4668 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4669 | 0 \ |
| 4670 | -c "Read from server: 1 bytes read" |
| 4671 | |
| 4672 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 4673 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4674 | "$P_CLI force_version=tls1 \ |
| 4675 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4676 | 0 \ |
| 4677 | -c "Read from server: 1 bytes read" |
| 4678 | |
| 4679 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 4680 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4681 | "$P_CLI force_version=tls1 \ |
| 4682 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4683 | 0 \ |
| 4684 | -c "Read from server: 1 bytes read" |
| 4685 | |
| 4686 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4687 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 4688 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4689 | "$P_CLI force_version=tls1 \ |
| 4690 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4691 | 0 \ |
| 4692 | -c "Read from server: 1 bytes read" |
| 4693 | |
| 4694 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4695 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 4696 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4697 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4698 | trunc_hmac=1 etm=0" \ |
| 4699 | 0 \ |
| 4700 | -c "Read from server: 1 bytes read" |
| 4701 | |
| 4702 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 4703 | "$P_SRV response_size=1" \ |
| 4704 | "$P_CLI force_version=tls1_1 \ |
| 4705 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4706 | 0 \ |
| 4707 | -c "Read from server: 1 bytes read" |
| 4708 | |
| 4709 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 4710 | "$P_SRV response_size=1" \ |
| 4711 | "$P_CLI force_version=tls1_1 \ |
| 4712 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4713 | 0 \ |
| 4714 | -c "Read from server: 1 bytes read" |
| 4715 | |
| 4716 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4717 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 4718 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4719 | "$P_CLI force_version=tls1_1 \ |
| 4720 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4721 | 0 \ |
| 4722 | -c "Read from server: 1 bytes read" |
| 4723 | |
| 4724 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4725 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 4726 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4727 | "$P_CLI force_version=tls1_1 \ |
| 4728 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4729 | 0 \ |
| 4730 | -c "Read from server: 1 bytes read" |
| 4731 | |
| 4732 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 4733 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4734 | "$P_CLI force_version=tls1_1 \ |
| 4735 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4736 | 0 \ |
| 4737 | -c "Read from server: 1 bytes read" |
| 4738 | |
| 4739 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 4740 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4741 | "$P_CLI force_version=tls1_1 \ |
| 4742 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4743 | 0 \ |
| 4744 | -c "Read from server: 1 bytes read" |
| 4745 | |
| 4746 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4747 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 4748 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4749 | "$P_CLI force_version=tls1_1 \ |
| 4750 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4751 | 0 \ |
| 4752 | -c "Read from server: 1 bytes read" |
| 4753 | |
| 4754 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4755 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 4756 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4757 | "$P_CLI force_version=tls1_1 \ |
| 4758 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4759 | 0 \ |
| 4760 | -c "Read from server: 1 bytes read" |
| 4761 | |
| 4762 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 4763 | "$P_SRV response_size=1" \ |
| 4764 | "$P_CLI force_version=tls1_2 \ |
| 4765 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4766 | 0 \ |
| 4767 | -c "Read from server: 1 bytes read" |
| 4768 | |
| 4769 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 4770 | "$P_SRV response_size=1" \ |
| 4771 | "$P_CLI force_version=tls1_2 \ |
| 4772 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4773 | 0 \ |
| 4774 | -c "Read from server: 1 bytes read" |
| 4775 | |
| 4776 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 4777 | "$P_SRV response_size=1" \ |
| 4778 | "$P_CLI force_version=tls1_2 \ |
| 4779 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 4780 | 0 \ |
| 4781 | -c "Read from server: 1 bytes read" |
| 4782 | |
| 4783 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4784 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 4785 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4786 | "$P_CLI force_version=tls1_2 \ |
| 4787 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4788 | 0 \ |
| 4789 | -c "Read from server: 1 bytes read" |
| 4790 | |
| 4791 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4792 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 4793 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4794 | "$P_CLI force_version=tls1_2 \ |
| 4795 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4796 | 0 \ |
| 4797 | -c "Read from server: 1 bytes read" |
| 4798 | |
| 4799 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 4800 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4801 | "$P_CLI force_version=tls1_2 \ |
| 4802 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4803 | 0 \ |
| 4804 | -c "Read from server: 1 bytes read" |
| 4805 | |
| 4806 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 4807 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4808 | "$P_CLI force_version=tls1_2 \ |
| 4809 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4810 | 0 \ |
| 4811 | -c "Read from server: 1 bytes read" |
| 4812 | |
| 4813 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4814 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 4815 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4816 | "$P_CLI force_version=tls1_2 \ |
| 4817 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4818 | 0 \ |
| 4819 | -c "Read from server: 1 bytes read" |
| 4820 | |
| 4821 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4822 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 4823 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4824 | "$P_CLI force_version=tls1_2 \ |
| 4825 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4826 | 0 \ |
| 4827 | -c "Read from server: 1 bytes read" |
| 4828 | |
| 4829 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 4830 | "$P_SRV response_size=1" \ |
| 4831 | "$P_CLI force_version=tls1_2 \ |
| 4832 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4833 | 0 \ |
| 4834 | -c "Read from server: 1 bytes read" |
| 4835 | |
| 4836 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 4837 | "$P_SRV response_size=1" \ |
| 4838 | "$P_CLI force_version=tls1_2 \ |
| 4839 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4840 | 0 \ |
| 4841 | -c "Read from server: 1 bytes read" |
| 4842 | |
| 4843 | # Tests for small server packets in DTLS |
| 4844 | |
| 4845 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4846 | run_test "Small server packet DTLS 1.0" \ |
| 4847 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 4848 | "$P_CLI dtls=1 \ |
| 4849 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4850 | 0 \ |
| 4851 | -c "Read from server: 1 bytes read" |
| 4852 | |
| 4853 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4854 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 4855 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 4856 | "$P_CLI dtls=1 \ |
| 4857 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4858 | 0 \ |
| 4859 | -c "Read from server: 1 bytes read" |
| 4860 | |
| 4861 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4862 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4863 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 4864 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 4865 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 4866 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4867 | 0 \ |
| 4868 | -c "Read from server: 1 bytes read" |
| 4869 | |
| 4870 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4871 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4872 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 4873 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 4874 | "$P_CLI dtls=1 \ |
| 4875 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4876 | 0 \ |
| 4877 | -c "Read from server: 1 bytes read" |
| 4878 | |
| 4879 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4880 | run_test "Small server packet DTLS 1.2" \ |
| 4881 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 4882 | "$P_CLI dtls=1 \ |
| 4883 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4884 | 0 \ |
| 4885 | -c "Read from server: 1 bytes read" |
| 4886 | |
| 4887 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4888 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 4889 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 4890 | "$P_CLI dtls=1 \ |
| 4891 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4892 | 0 \ |
| 4893 | -c "Read from server: 1 bytes read" |
| 4894 | |
| 4895 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4896 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4897 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 4898 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 4899 | "$P_CLI dtls=1 \ |
| 4900 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4901 | 0 \ |
| 4902 | -c "Read from server: 1 bytes read" |
| 4903 | |
| 4904 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4905 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4906 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 4907 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 4908 | "$P_CLI dtls=1 \ |
| 4909 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4910 | 0 \ |
| 4911 | -c "Read from server: 1 bytes read" |
| 4912 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4913 | # A test for extensions in SSLv3 |
| 4914 | |
| 4915 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4916 | run_test "SSLv3 with extensions, server side" \ |
| 4917 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 4918 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4919 | 0 \ |
| 4920 | -S "dumping 'client hello extensions'" \ |
| 4921 | -S "server hello, total extension length:" |
| 4922 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4923 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4924 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4925 | # How many fragments do we expect to write $1 bytes? |
| 4926 | fragments_for_write() { |
| 4927 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4928 | } |
| 4929 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4930 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4931 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4932 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4933 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4934 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4935 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4936 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4937 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4938 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4939 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4940 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4941 | "$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] | 4942 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4943 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4944 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4945 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4946 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4947 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4948 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4949 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4950 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4951 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4952 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4953 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4954 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4955 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4956 | 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] | 4957 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4958 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4959 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4960 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4961 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4962 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4963 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4964 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4965 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4966 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4967 | 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] | 4968 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4969 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4970 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4971 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4972 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4973 | 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] | 4974 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4975 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4976 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4977 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4978 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4979 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4980 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4981 | "$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] | 4982 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4983 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4984 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4985 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4986 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4987 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4988 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4989 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4990 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4991 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4992 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4993 | |
| 4994 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4995 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4996 | "$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] | 4997 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4998 | 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] | 4999 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5000 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5001 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5002 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5003 | 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] | 5004 | "$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] | 5005 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5006 | 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] | 5007 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5008 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5009 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5010 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5011 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5012 | "$P_SRV" \ |
| 5013 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5014 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5015 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5016 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5017 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5018 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5019 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5020 | "$P_SRV" \ |
| 5021 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 5022 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5023 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5024 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5025 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5026 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5027 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5028 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5029 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5030 | 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] | 5031 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5032 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5033 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5034 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5035 | 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] | 5036 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5037 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5038 | 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] | 5039 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5040 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5041 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5042 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5043 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5044 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5045 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5046 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5047 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5048 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5049 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5050 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5051 | "$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] | 5052 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5053 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5054 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5055 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5056 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5057 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5058 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5059 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5060 | "$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] | 5061 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5062 | 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] | 5063 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5064 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5065 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5066 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5067 | 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] | 5068 | "$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] | 5069 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5070 | 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] | 5071 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5072 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5073 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5074 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5075 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5076 | "$P_SRV" \ |
| 5077 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5078 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5079 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5080 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5081 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5082 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5083 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5084 | "$P_SRV" \ |
| 5085 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5086 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5087 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5088 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5089 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5090 | 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] | 5091 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5092 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5093 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5094 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5095 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5096 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5097 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5098 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5099 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5100 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5101 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5102 | 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] | 5103 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5104 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5105 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5106 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5107 | 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] | 5108 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5109 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5110 | 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] | 5111 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5112 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5113 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5114 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5115 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5116 | "$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] | 5117 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5118 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5119 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5120 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5121 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5122 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5123 | 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] | 5124 | "$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] | 5125 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5126 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5127 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5128 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5129 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5130 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5131 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5132 | "$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] | 5133 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5134 | 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] | 5135 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5136 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5137 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5138 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5139 | 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] | 5140 | "$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] | 5141 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5142 | 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] | 5143 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5144 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5145 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5146 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5147 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5148 | "$P_SRV" \ |
| 5149 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5150 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5151 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5152 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5153 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5154 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5155 | 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] | 5156 | "$P_SRV" \ |
| 5157 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5158 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5159 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5160 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5161 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5162 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5163 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5164 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5165 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 5166 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5167 | "$P_CLI force_version=ssl3 \ |
| 5168 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5169 | 0 \ |
| 5170 | -c "Read from server: 16384 bytes read" |
| 5171 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 5172 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 5173 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5174 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 5175 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 5176 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 5177 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5178 | 0 \ |
| 5179 | -c "Read from server: 1 bytes read"\ |
| 5180 | -c "16383 bytes read"\ |
| 5181 | -C "Read from server: 16384 bytes read" |
| 5182 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5183 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 5184 | "$P_SRV response_size=16384" \ |
| 5185 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5186 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5187 | 0 \ |
| 5188 | -c "Read from server: 1 bytes read"\ |
| 5189 | -c "16383 bytes read"\ |
| 5190 | -C "Read from server: 16384 bytes read" |
| 5191 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5192 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5193 | "$P_SRV response_size=16384" \ |
| 5194 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 5195 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5196 | 0 \ |
| 5197 | -c "Read from server: 1 bytes read"\ |
| 5198 | -c "16383 bytes read"\ |
| 5199 | -C "Read from server: 16384 bytes read" |
| 5200 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5201 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5202 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 5203 | "$P_SRV response_size=16384" \ |
| 5204 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5205 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5206 | trunc_hmac=1" \ |
| 5207 | 0 \ |
| 5208 | -c "Read from server: 1 bytes read"\ |
| 5209 | -c "16383 bytes read"\ |
| 5210 | -C "Read from server: 16384 bytes read" |
| 5211 | |
| 5212 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5213 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 5214 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5215 | "$P_CLI force_version=tls1 \ |
| 5216 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5217 | trunc_hmac=1" \ |
| 5218 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5219 | -s "16384 bytes written in 1 fragments" \ |
| 5220 | -c "Read from server: 16384 bytes read" |
| 5221 | |
| 5222 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 5223 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5224 | "$P_CLI force_version=tls1 \ |
| 5225 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5226 | 0 \ |
| 5227 | -s "16384 bytes written in 1 fragments" \ |
| 5228 | -c "Read from server: 16384 bytes read" |
| 5229 | |
| 5230 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5231 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5232 | "$P_CLI force_version=tls1 \ |
| 5233 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5234 | 0 \ |
| 5235 | -s "16384 bytes written in 1 fragments" \ |
| 5236 | -c "Read from server: 16384 bytes read" |
| 5237 | |
| 5238 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5239 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5240 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5241 | "$P_CLI force_version=tls1 \ |
| 5242 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5243 | 0 \ |
| 5244 | -s "16384 bytes written in 1 fragments" \ |
| 5245 | -c "Read from server: 16384 bytes read" |
| 5246 | |
| 5247 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5248 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5249 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5250 | "$P_CLI force_version=tls1 \ |
| 5251 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5252 | 0 \ |
| 5253 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5254 | -c "Read from server: 16384 bytes read" |
| 5255 | |
| 5256 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 5257 | "$P_SRV response_size=16384" \ |
| 5258 | "$P_CLI force_version=tls1_1 \ |
| 5259 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5260 | 0 \ |
| 5261 | -c "Read from server: 16384 bytes read" |
| 5262 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5263 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5264 | "$P_SRV response_size=16384" \ |
| 5265 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 5266 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5267 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5268 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5269 | -c "Read from server: 16384 bytes read" |
| 5270 | |
| 5271 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5272 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 5273 | "$P_SRV response_size=16384" \ |
| 5274 | "$P_CLI force_version=tls1_1 \ |
| 5275 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5276 | trunc_hmac=1" \ |
| 5277 | 0 \ |
| 5278 | -c "Read from server: 16384 bytes read" |
| 5279 | |
| 5280 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5281 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5282 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5283 | "$P_CLI force_version=tls1_1 \ |
| 5284 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5285 | 0 \ |
| 5286 | -s "16384 bytes written in 1 fragments" \ |
| 5287 | -c "Read from server: 16384 bytes read" |
| 5288 | |
| 5289 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 5290 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5291 | "$P_CLI force_version=tls1_1 \ |
| 5292 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5293 | 0 \ |
| 5294 | -c "Read from server: 16384 bytes read" |
| 5295 | |
| 5296 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5297 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5298 | "$P_CLI force_version=tls1_1 \ |
| 5299 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5300 | 0 \ |
| 5301 | -s "16384 bytes written in 1 fragments" \ |
| 5302 | -c "Read from server: 16384 bytes read" |
| 5303 | |
| 5304 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5305 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 5306 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5307 | "$P_CLI force_version=tls1_1 \ |
| 5308 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5309 | trunc_hmac=1" \ |
| 5310 | 0 \ |
| 5311 | -c "Read from server: 16384 bytes read" |
| 5312 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5313 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5314 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5315 | "$P_CLI force_version=tls1_1 \ |
| 5316 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5317 | 0 \ |
| 5318 | -s "16384 bytes written in 1 fragments" \ |
| 5319 | -c "Read from server: 16384 bytes read" |
| 5320 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5321 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5322 | "$P_SRV response_size=16384" \ |
| 5323 | "$P_CLI force_version=tls1_2 \ |
| 5324 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5325 | 0 \ |
| 5326 | -c "Read from server: 16384 bytes read" |
| 5327 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5328 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5329 | "$P_SRV response_size=16384" \ |
| 5330 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5331 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5332 | 0 \ |
| 5333 | -s "16384 bytes written in 1 fragments" \ |
| 5334 | -c "Read from server: 16384 bytes read" |
| 5335 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5336 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5337 | "$P_SRV response_size=16384" \ |
| 5338 | "$P_CLI force_version=tls1_2 \ |
| 5339 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5340 | 0 \ |
| 5341 | -c "Read from server: 16384 bytes read" |
| 5342 | |
| 5343 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5344 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 5345 | "$P_SRV response_size=16384" \ |
| 5346 | "$P_CLI force_version=tls1_2 \ |
| 5347 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5348 | trunc_hmac=1" \ |
| 5349 | 0 \ |
| 5350 | -c "Read from server: 16384 bytes read" |
| 5351 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5352 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5353 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5354 | "$P_CLI force_version=tls1_2 \ |
| 5355 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5356 | 0 \ |
| 5357 | -s "16384 bytes written in 1 fragments" \ |
| 5358 | -c "Read from server: 16384 bytes read" |
| 5359 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5360 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 5361 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5362 | "$P_CLI force_version=tls1_2 \ |
| 5363 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5364 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5365 | -s "16384 bytes written in 1 fragments" \ |
| 5366 | -c "Read from server: 16384 bytes read" |
| 5367 | |
| 5368 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5369 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5370 | "$P_CLI force_version=tls1_2 \ |
| 5371 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5372 | 0 \ |
| 5373 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5374 | -c "Read from server: 16384 bytes read" |
| 5375 | |
| 5376 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5377 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 5378 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5379 | "$P_CLI force_version=tls1_2 \ |
| 5380 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5381 | trunc_hmac=1" \ |
| 5382 | 0 \ |
| 5383 | -c "Read from server: 16384 bytes read" |
| 5384 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5385 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5386 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5387 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5388 | "$P_CLI force_version=tls1_2 \ |
| 5389 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5390 | 0 \ |
| 5391 | -s "16384 bytes written in 1 fragments" \ |
| 5392 | -c "Read from server: 16384 bytes read" |
| 5393 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5394 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5395 | "$P_SRV response_size=16384" \ |
| 5396 | "$P_CLI force_version=tls1_2 \ |
| 5397 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5398 | 0 \ |
| 5399 | -c "Read from server: 16384 bytes read" |
| 5400 | |
| 5401 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5402 | "$P_SRV response_size=16384" \ |
| 5403 | "$P_CLI force_version=tls1_2 \ |
| 5404 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5405 | 0 \ |
| 5406 | -c "Read from server: 16384 bytes read" |
| 5407 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5408 | # Tests for restartable ECC |
| 5409 | |
| 5410 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5411 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5412 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5413 | "$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] | 5414 | 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] | 5415 | debug_level=1" \ |
| 5416 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5417 | -C "x509_verify_cert.*4b00" \ |
| 5418 | -C "mbedtls_pk_verify.*4b00" \ |
| 5419 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5420 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5421 | |
| 5422 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5423 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5424 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5425 | "$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] | 5426 | 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] | 5427 | debug_level=1 ec_max_ops=0" \ |
| 5428 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5429 | -C "x509_verify_cert.*4b00" \ |
| 5430 | -C "mbedtls_pk_verify.*4b00" \ |
| 5431 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5432 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5433 | |
| 5434 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5435 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5436 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5437 | "$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] | 5438 | 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] | 5439 | debug_level=1 ec_max_ops=65535" \ |
| 5440 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5441 | -C "x509_verify_cert.*4b00" \ |
| 5442 | -C "mbedtls_pk_verify.*4b00" \ |
| 5443 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5444 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5445 | |
| 5446 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5447 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5448 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5449 | "$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] | 5450 | 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] | 5451 | debug_level=1 ec_max_ops=1000" \ |
| 5452 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5453 | -c "x509_verify_cert.*4b00" \ |
| 5454 | -c "mbedtls_pk_verify.*4b00" \ |
| 5455 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5456 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5457 | |
| 5458 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5459 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 5460 | "$P_SRV auth_mode=required \ |
| 5461 | crt_file=data_files/server5-badsign.crt \ |
| 5462 | key_file=data_files/server5.key" \ |
| 5463 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5464 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5465 | debug_level=1 ec_max_ops=1000" \ |
| 5466 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5467 | -c "x509_verify_cert.*4b00" \ |
| 5468 | -C "mbedtls_pk_verify.*4b00" \ |
| 5469 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5470 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5471 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5472 | -c "! mbedtls_ssl_handshake returned" \ |
| 5473 | -c "X509 - Certificate verification failed" |
| 5474 | |
| 5475 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5476 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 5477 | "$P_SRV auth_mode=required \ |
| 5478 | crt_file=data_files/server5-badsign.crt \ |
| 5479 | key_file=data_files/server5.key" \ |
| 5480 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5481 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5482 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5483 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5484 | -c "x509_verify_cert.*4b00" \ |
| 5485 | -c "mbedtls_pk_verify.*4b00" \ |
| 5486 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5487 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5488 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5489 | -C "! mbedtls_ssl_handshake returned" \ |
| 5490 | -C "X509 - Certificate verification failed" |
| 5491 | |
| 5492 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5493 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 5494 | "$P_SRV auth_mode=required \ |
| 5495 | crt_file=data_files/server5-badsign.crt \ |
| 5496 | key_file=data_files/server5.key" \ |
| 5497 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5498 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5499 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 5500 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5501 | -C "x509_verify_cert.*4b00" \ |
| 5502 | -c "mbedtls_pk_verify.*4b00" \ |
| 5503 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5504 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5505 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5506 | -C "! mbedtls_ssl_handshake returned" \ |
| 5507 | -C "X509 - Certificate verification failed" |
| 5508 | |
| 5509 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5510 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5511 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5512 | "$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] | 5513 | 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] | 5514 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 5515 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5516 | -c "x509_verify_cert.*4b00" \ |
| 5517 | -c "mbedtls_pk_verify.*4b00" \ |
| 5518 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5519 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5520 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5521 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5522 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 5523 | "$P_SRV" \ |
| 5524 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5525 | debug_level=1 ec_max_ops=1000" \ |
| 5526 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5527 | -c "x509_verify_cert.*4b00" \ |
| 5528 | -c "mbedtls_pk_verify.*4b00" \ |
| 5529 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5530 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5531 | |
| 5532 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5533 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 5534 | "$P_SRV psk=abc123" \ |
| 5535 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 5536 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 5537 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5538 | -C "x509_verify_cert.*4b00" \ |
| 5539 | -C "mbedtls_pk_verify.*4b00" \ |
| 5540 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5541 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5542 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5543 | # Tests of asynchronous private key support in SSL |
| 5544 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5545 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5546 | run_test "SSL async private: sign, delay=0" \ |
| 5547 | "$P_SRV \ |
| 5548 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5549 | "$P_CLI" \ |
| 5550 | 0 \ |
| 5551 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5552 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5553 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5554 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5555 | run_test "SSL async private: sign, delay=1" \ |
| 5556 | "$P_SRV \ |
| 5557 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5558 | "$P_CLI" \ |
| 5559 | 0 \ |
| 5560 | -s "Async sign callback: using key slot " \ |
| 5561 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5562 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5563 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 5564 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5565 | run_test "SSL async private: sign, delay=2" \ |
| 5566 | "$P_SRV \ |
| 5567 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 5568 | "$P_CLI" \ |
| 5569 | 0 \ |
| 5570 | -s "Async sign callback: using key slot " \ |
| 5571 | -U "Async sign callback: using key slot " \ |
| 5572 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 5573 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5574 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5575 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 5576 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 5577 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 5578 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5580 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 5581 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 5582 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 5583 | "$P_CLI force_version=tls1_1" \ |
| 5584 | 0 \ |
| 5585 | -s "Async sign callback: using key slot " \ |
| 5586 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5587 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5588 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 5589 | run_test "SSL async private: sign, SNI" \ |
| 5590 | "$P_SRV debug_level=3 \ |
| 5591 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 5592 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5593 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5594 | "$P_CLI server_name=polarssl.example" \ |
| 5595 | 0 \ |
| 5596 | -s "Async sign callback: using key slot " \ |
| 5597 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5598 | -s "parse ServerName extension" \ |
| 5599 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5600 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5601 | |
| 5602 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5603 | run_test "SSL async private: decrypt, delay=0" \ |
| 5604 | "$P_SRV \ |
| 5605 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5606 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5607 | 0 \ |
| 5608 | -s "Async decrypt callback: using key slot " \ |
| 5609 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5610 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5611 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5612 | run_test "SSL async private: decrypt, delay=1" \ |
| 5613 | "$P_SRV \ |
| 5614 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5615 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5616 | 0 \ |
| 5617 | -s "Async decrypt callback: using key slot " \ |
| 5618 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5619 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5620 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5621 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5622 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 5623 | "$P_SRV psk=abc123 \ |
| 5624 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5625 | "$P_CLI psk=abc123 \ |
| 5626 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5627 | 0 \ |
| 5628 | -s "Async decrypt callback: using key slot " \ |
| 5629 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5630 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5631 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5632 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 5633 | "$P_SRV psk=abc123 \ |
| 5634 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5635 | "$P_CLI psk=abc123 \ |
| 5636 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5637 | 0 \ |
| 5638 | -s "Async decrypt callback: using key slot " \ |
| 5639 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5640 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5641 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5642 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5643 | run_test "SSL async private: sign callback not present" \ |
| 5644 | "$P_SRV \ |
| 5645 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5646 | "$P_CLI; [ \$? -eq 1 ] && |
| 5647 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5648 | 0 \ |
| 5649 | -S "Async sign callback" \ |
| 5650 | -s "! mbedtls_ssl_handshake returned" \ |
| 5651 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 5652 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 5653 | -s "Successful connection" |
| 5654 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5655 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5656 | run_test "SSL async private: decrypt callback not present" \ |
| 5657 | "$P_SRV debug_level=1 \ |
| 5658 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 5659 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 5660 | [ \$? -eq 1 ] && $P_CLI" \ |
| 5661 | 0 \ |
| 5662 | -S "Async decrypt callback" \ |
| 5663 | -s "! mbedtls_ssl_handshake returned" \ |
| 5664 | -s "got no RSA private key" \ |
| 5665 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5666 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5667 | |
| 5668 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5669 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5670 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5671 | "$P_SRV \ |
| 5672 | async_operations=s async_private_delay1=1 \ |
| 5673 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5674 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5675 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5676 | 0 \ |
| 5677 | -s "Async sign callback: using key slot 0," \ |
| 5678 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5679 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5680 | |
| 5681 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5682 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5683 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5684 | "$P_SRV \ |
| 5685 | async_operations=s async_private_delay2=1 \ |
| 5686 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5687 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5688 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5689 | 0 \ |
| 5690 | -s "Async sign callback: using key slot 0," \ |
| 5691 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5692 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5693 | |
| 5694 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5695 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 5696 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5697 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 5698 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5699 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5700 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5701 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5702 | 0 \ |
| 5703 | -s "Async sign callback: using key slot 1," \ |
| 5704 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5705 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5706 | |
| 5707 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5708 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5709 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5710 | "$P_SRV \ |
| 5711 | async_operations=s async_private_delay1=1 \ |
| 5712 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5713 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5714 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5715 | 0 \ |
| 5716 | -s "Async sign callback: no key matches this certificate." |
| 5717 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5718 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5719 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5720 | "$P_SRV \ |
| 5721 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5722 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5723 | "$P_CLI" \ |
| 5724 | 1 \ |
| 5725 | -s "Async sign callback: injected error" \ |
| 5726 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5727 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5728 | -s "! mbedtls_ssl_handshake returned" |
| 5729 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5730 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5731 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5732 | "$P_SRV \ |
| 5733 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5734 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5735 | "$P_CLI" \ |
| 5736 | 1 \ |
| 5737 | -s "Async sign callback: using key slot " \ |
| 5738 | -S "Async resume" \ |
| 5739 | -s "Async cancel" |
| 5740 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5741 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5742 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5743 | "$P_SRV \ |
| 5744 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5745 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5746 | "$P_CLI" \ |
| 5747 | 1 \ |
| 5748 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5749 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5750 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5751 | -s "! mbedtls_ssl_handshake returned" |
| 5752 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5753 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5754 | run_test "SSL async private: decrypt, error in start" \ |
| 5755 | "$P_SRV \ |
| 5756 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5757 | async_private_error=1" \ |
| 5758 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5759 | 1 \ |
| 5760 | -s "Async decrypt callback: injected error" \ |
| 5761 | -S "Async resume" \ |
| 5762 | -S "Async cancel" \ |
| 5763 | -s "! mbedtls_ssl_handshake returned" |
| 5764 | |
| 5765 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5766 | run_test "SSL async private: decrypt, cancel after start" \ |
| 5767 | "$P_SRV \ |
| 5768 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5769 | async_private_error=2" \ |
| 5770 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5771 | 1 \ |
| 5772 | -s "Async decrypt callback: using key slot " \ |
| 5773 | -S "Async resume" \ |
| 5774 | -s "Async cancel" |
| 5775 | |
| 5776 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5777 | run_test "SSL async private: decrypt, error in resume" \ |
| 5778 | "$P_SRV \ |
| 5779 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5780 | async_private_error=3" \ |
| 5781 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5782 | 1 \ |
| 5783 | -s "Async decrypt callback: using key slot " \ |
| 5784 | -s "Async resume callback: decrypt done but injected error" \ |
| 5785 | -S "Async cancel" \ |
| 5786 | -s "! mbedtls_ssl_handshake returned" |
| 5787 | |
| 5788 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5789 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5790 | "$P_SRV \ |
| 5791 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5792 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5793 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5794 | 0 \ |
| 5795 | -s "Async cancel" \ |
| 5796 | -s "! mbedtls_ssl_handshake returned" \ |
| 5797 | -s "Async resume" \ |
| 5798 | -s "Successful connection" |
| 5799 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5800 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5801 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5802 | "$P_SRV \ |
| 5803 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5804 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5805 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5806 | 0 \ |
| 5807 | -s "! mbedtls_ssl_handshake returned" \ |
| 5808 | -s "Async resume" \ |
| 5809 | -s "Successful connection" |
| 5810 | |
| 5811 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5812 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5813 | 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] | 5814 | "$P_SRV \ |
| 5815 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 5816 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5817 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5818 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5819 | [ \$? -eq 1 ] && |
| 5820 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5821 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 5822 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5823 | -S "Async resume" \ |
| 5824 | -s "Async cancel" \ |
| 5825 | -s "! mbedtls_ssl_handshake returned" \ |
| 5826 | -s "Async sign callback: no key matches this certificate." \ |
| 5827 | -s "Successful connection" |
| 5828 | |
| 5829 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5830 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5831 | 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] | 5832 | "$P_SRV \ |
| 5833 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 5834 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5835 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5836 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5837 | [ \$? -eq 1 ] && |
| 5838 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5839 | 0 \ |
| 5840 | -s "Async resume" \ |
| 5841 | -s "! mbedtls_ssl_handshake returned" \ |
| 5842 | -s "Async sign callback: no key matches this certificate." \ |
| 5843 | -s "Successful connection" |
| 5844 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5845 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5846 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5847 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 5848 | "$P_SRV \ |
| 5849 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5850 | exchanges=2 renegotiation=1" \ |
| 5851 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5852 | 0 \ |
| 5853 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5854 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5855 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5856 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5857 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5858 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 5859 | "$P_SRV \ |
| 5860 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5861 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5862 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 5863 | 0 \ |
| 5864 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5865 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5866 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5867 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5868 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5869 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 5870 | "$P_SRV \ |
| 5871 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5872 | exchanges=2 renegotiation=1" \ |
| 5873 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5874 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5875 | 0 \ |
| 5876 | -s "Async decrypt callback: using key slot " \ |
| 5877 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5878 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5879 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5880 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5881 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 5882 | "$P_SRV \ |
| 5883 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5884 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5885 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 5886 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5887 | 0 \ |
| 5888 | -s "Async decrypt callback: using key slot " \ |
| 5889 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5890 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5891 | # Tests for ECC extensions (rfc 4492) |
| 5892 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5893 | requires_config_enabled MBEDTLS_AES_C |
| 5894 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5895 | requires_config_enabled MBEDTLS_SHA256_C |
| 5896 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5897 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 5898 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5899 | "$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] | 5900 | 0 \ |
| 5901 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 5902 | -C "client hello, adding supported_point_formats extension" \ |
| 5903 | -S "found supported elliptic curves extension" \ |
| 5904 | -S "found supported point formats extension" |
| 5905 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5906 | requires_config_enabled MBEDTLS_AES_C |
| 5907 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5908 | requires_config_enabled MBEDTLS_SHA256_C |
| 5909 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5910 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5911 | "$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] | 5912 | "$P_CLI debug_level=3" \ |
| 5913 | 0 \ |
| 5914 | -C "found supported_point_formats extension" \ |
| 5915 | -S "server hello, supported_point_formats extension" |
| 5916 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5917 | requires_config_enabled MBEDTLS_AES_C |
| 5918 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5919 | requires_config_enabled MBEDTLS_SHA256_C |
| 5920 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5921 | run_test "Force an ECC ciphersuite in the client side" \ |
| 5922 | "$P_SRV debug_level=3" \ |
| 5923 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5924 | 0 \ |
| 5925 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 5926 | -c "client hello, adding supported_point_formats extension" \ |
| 5927 | -s "found supported elliptic curves extension" \ |
| 5928 | -s "found supported point formats extension" |
| 5929 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5930 | requires_config_enabled MBEDTLS_AES_C |
| 5931 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5932 | requires_config_enabled MBEDTLS_SHA256_C |
| 5933 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5934 | run_test "Force an ECC ciphersuite in the server side" \ |
| 5935 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5936 | "$P_CLI debug_level=3" \ |
| 5937 | 0 \ |
| 5938 | -c "found supported_point_formats extension" \ |
| 5939 | -s "server hello, supported_point_formats extension" |
| 5940 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5941 | # Tests for DTLS HelloVerifyRequest |
| 5942 | |
| 5943 | run_test "DTLS cookie: enabled" \ |
| 5944 | "$P_SRV dtls=1 debug_level=2" \ |
| 5945 | "$P_CLI dtls=1 debug_level=2" \ |
| 5946 | 0 \ |
| 5947 | -s "cookie verification failed" \ |
| 5948 | -s "cookie verification passed" \ |
| 5949 | -S "cookie verification skipped" \ |
| 5950 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5951 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5952 | -S "SSL - The requested feature is not available" |
| 5953 | |
| 5954 | run_test "DTLS cookie: disabled" \ |
| 5955 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 5956 | "$P_CLI dtls=1 debug_level=2" \ |
| 5957 | 0 \ |
| 5958 | -S "cookie verification failed" \ |
| 5959 | -S "cookie verification passed" \ |
| 5960 | -s "cookie verification skipped" \ |
| 5961 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5962 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5963 | -S "SSL - The requested feature is not available" |
| 5964 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5965 | run_test "DTLS cookie: default (failing)" \ |
| 5966 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 5967 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 5968 | 1 \ |
| 5969 | -s "cookie verification failed" \ |
| 5970 | -S "cookie verification passed" \ |
| 5971 | -S "cookie verification skipped" \ |
| 5972 | -C "received hello verify request" \ |
| 5973 | -S "hello verification requested" \ |
| 5974 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5975 | |
| 5976 | requires_ipv6 |
| 5977 | run_test "DTLS cookie: enabled, IPv6" \ |
| 5978 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 5979 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 5980 | 0 \ |
| 5981 | -s "cookie verification failed" \ |
| 5982 | -s "cookie verification passed" \ |
| 5983 | -S "cookie verification skipped" \ |
| 5984 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5985 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5986 | -S "SSL - The requested feature is not available" |
| 5987 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5988 | run_test "DTLS cookie: enabled, nbio" \ |
| 5989 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 5990 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5991 | 0 \ |
| 5992 | -s "cookie verification failed" \ |
| 5993 | -s "cookie verification passed" \ |
| 5994 | -S "cookie verification skipped" \ |
| 5995 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5996 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5997 | -S "SSL - The requested feature is not available" |
| 5998 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5999 | # Tests for client reconnecting from the same port with DTLS |
| 6000 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6001 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6002 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6003 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 6004 | "$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] | 6005 | 0 \ |
| 6006 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6007 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6008 | -S "Client initiated reconnection from same port" |
| 6009 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6010 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6011 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6012 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 6013 | "$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] | 6014 | 0 \ |
| 6015 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6016 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6017 | -s "Client initiated reconnection from same port" |
| 6018 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6019 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6020 | 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] | 6021 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6022 | "$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] | 6023 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6024 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6025 | -s "Client initiated reconnection from same port" |
| 6026 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6027 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6028 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6029 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6030 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6031 | 0 \ |
| 6032 | -S "The operation timed out" \ |
| 6033 | -s "Client initiated reconnection from same port" |
| 6034 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6035 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6036 | "$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] | 6037 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6038 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6039 | -s "The operation timed out" \ |
| 6040 | -S "Client initiated reconnection from same port" |
| 6041 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6042 | # Tests for various cases of client authentication with DTLS |
| 6043 | # (focused on handshake flows and message parsing) |
| 6044 | |
| 6045 | run_test "DTLS client auth: required" \ |
| 6046 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6047 | "$P_CLI dtls=1" \ |
| 6048 | 0 \ |
| 6049 | -s "Verifying peer X.509 certificate... ok" |
| 6050 | |
| 6051 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6052 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6053 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6054 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6055 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6056 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6057 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6058 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6059 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6060 | 0 \ |
| 6061 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6062 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6063 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6064 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6065 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6066 | "$P_CLI dtls=1 psk=abc124" \ |
| 6067 | 1 \ |
| 6068 | -s "SSL - Verification of the message MAC failed" \ |
| 6069 | -c "SSL - A fatal alert message was received from our peer" |
| 6070 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6071 | # Tests for receiving fragmented handshake messages with DTLS |
| 6072 | |
| 6073 | requires_gnutls |
| 6074 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6075 | "$G_SRV -u --mtu 2048 -a" \ |
| 6076 | "$P_CLI dtls=1 debug_level=2" \ |
| 6077 | 0 \ |
| 6078 | -C "found fragmented DTLS handshake message" \ |
| 6079 | -C "error" |
| 6080 | |
| 6081 | requires_gnutls |
| 6082 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6083 | "$G_SRV -u --mtu 512" \ |
| 6084 | "$P_CLI dtls=1 debug_level=2" \ |
| 6085 | 0 \ |
| 6086 | -c "found fragmented DTLS handshake message" \ |
| 6087 | -C "error" |
| 6088 | |
| 6089 | requires_gnutls |
| 6090 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6091 | "$G_SRV -u --mtu 128" \ |
| 6092 | "$P_CLI dtls=1 debug_level=2" \ |
| 6093 | 0 \ |
| 6094 | -c "found fragmented DTLS handshake message" \ |
| 6095 | -C "error" |
| 6096 | |
| 6097 | requires_gnutls |
| 6098 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6099 | "$G_SRV -u --mtu 128" \ |
| 6100 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6101 | 0 \ |
| 6102 | -c "found fragmented DTLS handshake message" \ |
| 6103 | -C "error" |
| 6104 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6105 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6106 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6107 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6108 | "$G_SRV -u --mtu 256" \ |
| 6109 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6110 | 0 \ |
| 6111 | -c "found fragmented DTLS handshake message" \ |
| 6112 | -c "client hello, adding renegotiation extension" \ |
| 6113 | -c "found renegotiation extension" \ |
| 6114 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6115 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6116 | -C "error" \ |
| 6117 | -s "Extra-header:" |
| 6118 | |
| 6119 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6120 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6121 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6122 | "$G_SRV -u --mtu 256" \ |
| 6123 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6124 | 0 \ |
| 6125 | -c "found fragmented DTLS handshake message" \ |
| 6126 | -c "client hello, adding renegotiation extension" \ |
| 6127 | -c "found renegotiation extension" \ |
| 6128 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6129 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6130 | -C "error" \ |
| 6131 | -s "Extra-header:" |
| 6132 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6133 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6134 | "$O_SRV -dtls1 -mtu 2048" \ |
| 6135 | "$P_CLI dtls=1 debug_level=2" \ |
| 6136 | 0 \ |
| 6137 | -C "found fragmented DTLS handshake message" \ |
| 6138 | -C "error" |
| 6139 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6140 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6141 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6142 | "$P_CLI dtls=1 debug_level=2" \ |
| 6143 | 0 \ |
| 6144 | -c "found fragmented DTLS handshake message" \ |
| 6145 | -C "error" |
| 6146 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6147 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6148 | "$O_SRV -dtls1 -mtu 256" \ |
| 6149 | "$P_CLI dtls=1 debug_level=2" \ |
| 6150 | 0 \ |
| 6151 | -c "found fragmented DTLS handshake message" \ |
| 6152 | -C "error" |
| 6153 | |
| 6154 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6155 | "$O_SRV -dtls1 -mtu 256" \ |
| 6156 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6157 | 0 \ |
| 6158 | -c "found fragmented DTLS handshake message" \ |
| 6159 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6160 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6161 | # Tests for sending fragmented handshake messages with DTLS |
| 6162 | # |
| 6163 | # Use client auth when we need the client to send large messages, |
| 6164 | # and use large cert chains on both sides too (the long chains we have all use |
| 6165 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6166 | # Sizes reached (UDP payload): |
| 6167 | # - 2037B for server certificate |
| 6168 | # - 1542B for client certificate |
| 6169 | # - 1013B for newsessionticket |
| 6170 | # - all others below 512B |
| 6171 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6172 | |
| 6173 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6174 | requires_config_enabled MBEDTLS_RSA_C |
| 6175 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6176 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6177 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6178 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6179 | crt_file=data_files/server7_int-ca.crt \ |
| 6180 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6181 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6182 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6183 | "$P_CLI dtls=1 debug_level=2 \ |
| 6184 | crt_file=data_files/server8_int-ca2.crt \ |
| 6185 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6186 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6187 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6188 | 0 \ |
| 6189 | -S "found fragmented DTLS handshake message" \ |
| 6190 | -C "found fragmented DTLS handshake message" \ |
| 6191 | -C "error" |
| 6192 | |
| 6193 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6194 | requires_config_enabled MBEDTLS_RSA_C |
| 6195 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6196 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6197 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6198 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6199 | crt_file=data_files/server7_int-ca.crt \ |
| 6200 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6201 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6202 | max_frag_len=1024" \ |
| 6203 | "$P_CLI dtls=1 debug_level=2 \ |
| 6204 | crt_file=data_files/server8_int-ca2.crt \ |
| 6205 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6206 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6207 | max_frag_len=2048" \ |
| 6208 | 0 \ |
| 6209 | -S "found fragmented DTLS handshake message" \ |
| 6210 | -c "found fragmented DTLS handshake message" \ |
| 6211 | -C "error" |
| 6212 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6213 | # With the MFL extension, the server has no way of forcing |
| 6214 | # the client to not exceed a certain MTU; hence, the following |
| 6215 | # test can't be replicated with an MTU proxy such as the one |
| 6216 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6217 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6218 | requires_config_enabled MBEDTLS_RSA_C |
| 6219 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6220 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6221 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6222 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6223 | crt_file=data_files/server7_int-ca.crt \ |
| 6224 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6225 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6226 | max_frag_len=512" \ |
| 6227 | "$P_CLI dtls=1 debug_level=2 \ |
| 6228 | crt_file=data_files/server8_int-ca2.crt \ |
| 6229 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6230 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6231 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6232 | 0 \ |
| 6233 | -S "found fragmented DTLS handshake message" \ |
| 6234 | -c "found fragmented DTLS handshake message" \ |
| 6235 | -C "error" |
| 6236 | |
| 6237 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6238 | requires_config_enabled MBEDTLS_RSA_C |
| 6239 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6240 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6241 | 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] | 6242 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6243 | crt_file=data_files/server7_int-ca.crt \ |
| 6244 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6245 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6246 | max_frag_len=2048" \ |
| 6247 | "$P_CLI dtls=1 debug_level=2 \ |
| 6248 | crt_file=data_files/server8_int-ca2.crt \ |
| 6249 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6250 | hs_timeout=2500-60000 \ |
| 6251 | max_frag_len=1024" \ |
| 6252 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6253 | -S "found fragmented DTLS handshake message" \ |
| 6254 | -c "found fragmented DTLS handshake message" \ |
| 6255 | -C "error" |
| 6256 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6257 | # While not required by the standard defining the MFL extension |
| 6258 | # (according to which it only applies to records, not to datagrams), |
| 6259 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6260 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6261 | # to the peer. |
| 6262 | # The next test checks that no datagrams significantly larger than the |
| 6263 | # negotiated MFL are sent. |
| 6264 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6265 | requires_config_enabled MBEDTLS_RSA_C |
| 6266 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6267 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6268 | 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] | 6269 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6270 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6271 | crt_file=data_files/server7_int-ca.crt \ |
| 6272 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6273 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6274 | max_frag_len=2048" \ |
| 6275 | "$P_CLI dtls=1 debug_level=2 \ |
| 6276 | crt_file=data_files/server8_int-ca2.crt \ |
| 6277 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6278 | hs_timeout=2500-60000 \ |
| 6279 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6280 | 0 \ |
| 6281 | -S "found fragmented DTLS handshake message" \ |
| 6282 | -c "found fragmented DTLS handshake message" \ |
| 6283 | -C "error" |
| 6284 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6285 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6286 | requires_config_enabled MBEDTLS_RSA_C |
| 6287 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6288 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6289 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6290 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6291 | crt_file=data_files/server7_int-ca.crt \ |
| 6292 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6293 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6294 | max_frag_len=2048" \ |
| 6295 | "$P_CLI dtls=1 debug_level=2 \ |
| 6296 | crt_file=data_files/server8_int-ca2.crt \ |
| 6297 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6298 | hs_timeout=2500-60000 \ |
| 6299 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6300 | 0 \ |
| 6301 | -s "found fragmented DTLS handshake message" \ |
| 6302 | -c "found fragmented DTLS handshake message" \ |
| 6303 | -C "error" |
| 6304 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6305 | # While not required by the standard defining the MFL extension |
| 6306 | # (according to which it only applies to records, not to datagrams), |
| 6307 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6308 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6309 | # to the peer. |
| 6310 | # The next test checks that no datagrams significantly larger than the |
| 6311 | # negotiated MFL are sent. |
| 6312 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6313 | requires_config_enabled MBEDTLS_RSA_C |
| 6314 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6315 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6316 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6317 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6318 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6319 | crt_file=data_files/server7_int-ca.crt \ |
| 6320 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6321 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6322 | max_frag_len=2048" \ |
| 6323 | "$P_CLI dtls=1 debug_level=2 \ |
| 6324 | crt_file=data_files/server8_int-ca2.crt \ |
| 6325 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6326 | hs_timeout=2500-60000 \ |
| 6327 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6328 | 0 \ |
| 6329 | -s "found fragmented DTLS handshake message" \ |
| 6330 | -c "found fragmented DTLS handshake message" \ |
| 6331 | -C "error" |
| 6332 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6333 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6334 | requires_config_enabled MBEDTLS_RSA_C |
| 6335 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6336 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6337 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6338 | crt_file=data_files/server7_int-ca.crt \ |
| 6339 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6340 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6341 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6342 | "$P_CLI dtls=1 debug_level=2 \ |
| 6343 | crt_file=data_files/server8_int-ca2.crt \ |
| 6344 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6345 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6346 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6347 | 0 \ |
| 6348 | -S "found fragmented DTLS handshake message" \ |
| 6349 | -C "found fragmented DTLS handshake message" \ |
| 6350 | -C "error" |
| 6351 | |
| 6352 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6353 | requires_config_enabled MBEDTLS_RSA_C |
| 6354 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6355 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6356 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6357 | crt_file=data_files/server7_int-ca.crt \ |
| 6358 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6359 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6360 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6361 | "$P_CLI dtls=1 debug_level=2 \ |
| 6362 | crt_file=data_files/server8_int-ca2.crt \ |
| 6363 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6364 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6365 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6366 | 0 \ |
| 6367 | -s "found fragmented DTLS handshake message" \ |
| 6368 | -C "found fragmented DTLS handshake message" \ |
| 6369 | -C "error" |
| 6370 | |
| 6371 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6372 | requires_config_enabled MBEDTLS_RSA_C |
| 6373 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6374 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6375 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6376 | crt_file=data_files/server7_int-ca.crt \ |
| 6377 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6378 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6379 | mtu=512" \ |
| 6380 | "$P_CLI dtls=1 debug_level=2 \ |
| 6381 | crt_file=data_files/server8_int-ca2.crt \ |
| 6382 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6383 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6384 | mtu=2048" \ |
| 6385 | 0 \ |
| 6386 | -S "found fragmented DTLS handshake message" \ |
| 6387 | -c "found fragmented DTLS handshake message" \ |
| 6388 | -C "error" |
| 6389 | |
| 6390 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6391 | requires_config_enabled MBEDTLS_RSA_C |
| 6392 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6393 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6394 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6395 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6396 | crt_file=data_files/server7_int-ca.crt \ |
| 6397 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6398 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6399 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6400 | "$P_CLI dtls=1 debug_level=2 \ |
| 6401 | crt_file=data_files/server8_int-ca2.crt \ |
| 6402 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6403 | hs_timeout=2500-60000 \ |
| 6404 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6405 | 0 \ |
| 6406 | -s "found fragmented DTLS handshake message" \ |
| 6407 | -c "found fragmented DTLS handshake message" \ |
| 6408 | -C "error" |
| 6409 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6410 | # 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] | 6411 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6412 | requires_config_enabled MBEDTLS_RSA_C |
| 6413 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6414 | requires_config_enabled MBEDTLS_SHA256_C |
| 6415 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6416 | requires_config_enabled MBEDTLS_AES_C |
| 6417 | requires_config_enabled MBEDTLS_GCM_C |
| 6418 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6419 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6420 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6421 | crt_file=data_files/server7_int-ca.crt \ |
| 6422 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6423 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6424 | mtu=512" \ |
| 6425 | "$P_CLI dtls=1 debug_level=2 \ |
| 6426 | crt_file=data_files/server8_int-ca2.crt \ |
| 6427 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6428 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6429 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6430 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6431 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6432 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6433 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6434 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6435 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6436 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6437 | # 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] | 6438 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6439 | # retransmissions, but in some cases (like both the server and client using |
| 6440 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6441 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6442 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6443 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6444 | requires_config_enabled MBEDTLS_RSA_C |
| 6445 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6446 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6447 | requires_config_enabled MBEDTLS_AES_C |
| 6448 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6449 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6450 | -p "$P_PXY mtu=508" \ |
| 6451 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6452 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6453 | key_file=data_files/server7.key \ |
| 6454 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6455 | "$P_CLI dtls=1 debug_level=2 \ |
| 6456 | crt_file=data_files/server8_int-ca2.crt \ |
| 6457 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6458 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6459 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6460 | 0 \ |
| 6461 | -s "found fragmented DTLS handshake message" \ |
| 6462 | -c "found fragmented DTLS handshake message" \ |
| 6463 | -C "error" |
| 6464 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6465 | # 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] | 6466 | only_with_valgrind |
| 6467 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6468 | requires_config_enabled MBEDTLS_RSA_C |
| 6469 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6470 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6471 | requires_config_enabled MBEDTLS_AES_C |
| 6472 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6473 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6474 | -p "$P_PXY mtu=508" \ |
| 6475 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6476 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6477 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6478 | hs_timeout=250-10000" \ |
| 6479 | "$P_CLI dtls=1 debug_level=2 \ |
| 6480 | crt_file=data_files/server8_int-ca2.crt \ |
| 6481 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6482 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6483 | hs_timeout=250-10000" \ |
| 6484 | 0 \ |
| 6485 | -s "found fragmented DTLS handshake message" \ |
| 6486 | -c "found fragmented DTLS handshake message" \ |
| 6487 | -C "error" |
| 6488 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6489 | # 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] | 6490 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6491 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6492 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6493 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6494 | requires_config_enabled MBEDTLS_RSA_C |
| 6495 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6496 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6497 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6498 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6499 | crt_file=data_files/server7_int-ca.crt \ |
| 6500 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6501 | hs_timeout=10000-60000 \ |
| 6502 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6503 | "$P_CLI dtls=1 debug_level=2 \ |
| 6504 | crt_file=data_files/server8_int-ca2.crt \ |
| 6505 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6506 | hs_timeout=10000-60000 \ |
| 6507 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6508 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6509 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6510 | -s "found fragmented DTLS handshake message" \ |
| 6511 | -c "found fragmented DTLS handshake message" \ |
| 6512 | -C "error" |
| 6513 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6514 | # 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] | 6515 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 6516 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6517 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6518 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6519 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6520 | requires_config_enabled MBEDTLS_RSA_C |
| 6521 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6522 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6523 | requires_config_enabled MBEDTLS_AES_C |
| 6524 | requires_config_enabled MBEDTLS_GCM_C |
| 6525 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6526 | -p "$P_PXY mtu=512" \ |
| 6527 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6528 | crt_file=data_files/server7_int-ca.crt \ |
| 6529 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6530 | hs_timeout=10000-60000 \ |
| 6531 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6532 | "$P_CLI dtls=1 debug_level=2 \ |
| 6533 | crt_file=data_files/server8_int-ca2.crt \ |
| 6534 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6535 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6536 | hs_timeout=10000-60000 \ |
| 6537 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6538 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6539 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6540 | -s "found fragmented DTLS handshake message" \ |
| 6541 | -c "found fragmented DTLS handshake message" \ |
| 6542 | -C "error" |
| 6543 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6544 | not_with_valgrind # spurious autoreduction due to timeout |
| 6545 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6546 | requires_config_enabled MBEDTLS_RSA_C |
| 6547 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6548 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6549 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6550 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6551 | crt_file=data_files/server7_int-ca.crt \ |
| 6552 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6553 | hs_timeout=10000-60000 \ |
| 6554 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6555 | "$P_CLI dtls=1 debug_level=2 \ |
| 6556 | crt_file=data_files/server8_int-ca2.crt \ |
| 6557 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6558 | hs_timeout=10000-60000 \ |
| 6559 | mtu=1024 nbio=2" \ |
| 6560 | 0 \ |
| 6561 | -S "autoreduction" \ |
| 6562 | -s "found fragmented DTLS handshake message" \ |
| 6563 | -c "found fragmented DTLS handshake message" \ |
| 6564 | -C "error" |
| 6565 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6566 | # 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] | 6567 | not_with_valgrind # spurious autoreduction due to timeout |
| 6568 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6569 | requires_config_enabled MBEDTLS_RSA_C |
| 6570 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6571 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6572 | requires_config_enabled MBEDTLS_AES_C |
| 6573 | requires_config_enabled MBEDTLS_GCM_C |
| 6574 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 6575 | -p "$P_PXY mtu=512" \ |
| 6576 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6577 | crt_file=data_files/server7_int-ca.crt \ |
| 6578 | key_file=data_files/server7.key \ |
| 6579 | hs_timeout=10000-60000 \ |
| 6580 | mtu=512 nbio=2" \ |
| 6581 | "$P_CLI dtls=1 debug_level=2 \ |
| 6582 | crt_file=data_files/server8_int-ca2.crt \ |
| 6583 | key_file=data_files/server8.key \ |
| 6584 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6585 | hs_timeout=10000-60000 \ |
| 6586 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6587 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6588 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6589 | -s "found fragmented DTLS handshake message" \ |
| 6590 | -c "found fragmented DTLS handshake message" \ |
| 6591 | -C "error" |
| 6592 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6593 | # 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] | 6594 | # This ensures things still work after session_reset(). |
| 6595 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6596 | # Since we don't support reading fragmented ClientHello yet, |
| 6597 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 6598 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6599 | # An autoreduction on the client-side might happen if the server is |
| 6600 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6601 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6602 | # resumed listening, which would result in a spurious autoreduction. |
| 6603 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6604 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6605 | requires_config_enabled MBEDTLS_RSA_C |
| 6606 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6607 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6608 | requires_config_enabled MBEDTLS_AES_C |
| 6609 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6610 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 6611 | -p "$P_PXY mtu=1450" \ |
| 6612 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6613 | crt_file=data_files/server7_int-ca.crt \ |
| 6614 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6615 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6616 | mtu=1450" \ |
| 6617 | "$P_CLI dtls=1 debug_level=2 \ |
| 6618 | crt_file=data_files/server8_int-ca2.crt \ |
| 6619 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6620 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6621 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6622 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6623 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6624 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6625 | -s "found fragmented DTLS handshake message" \ |
| 6626 | -c "found fragmented DTLS handshake message" \ |
| 6627 | -C "error" |
| 6628 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6629 | # An autoreduction on the client-side might happen if the server is |
| 6630 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6631 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6632 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6633 | requires_config_enabled MBEDTLS_RSA_C |
| 6634 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6635 | requires_config_enabled MBEDTLS_SHA256_C |
| 6636 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6637 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6638 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 6639 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 6640 | -p "$P_PXY mtu=512" \ |
| 6641 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6642 | crt_file=data_files/server7_int-ca.crt \ |
| 6643 | key_file=data_files/server7.key \ |
| 6644 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6645 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6646 | mtu=512" \ |
| 6647 | "$P_CLI dtls=1 debug_level=2 \ |
| 6648 | crt_file=data_files/server8_int-ca2.crt \ |
| 6649 | key_file=data_files/server8.key \ |
| 6650 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6651 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6652 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6653 | mtu=512" \ |
| 6654 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6655 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6656 | -s "found fragmented DTLS handshake message" \ |
| 6657 | -c "found fragmented DTLS handshake message" \ |
| 6658 | -C "error" |
| 6659 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6660 | # An autoreduction on the client-side might happen if the server is |
| 6661 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6662 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6663 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6664 | requires_config_enabled MBEDTLS_RSA_C |
| 6665 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6666 | requires_config_enabled MBEDTLS_SHA256_C |
| 6667 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6668 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6669 | requires_config_enabled MBEDTLS_AES_C |
| 6670 | requires_config_enabled MBEDTLS_GCM_C |
| 6671 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 6672 | -p "$P_PXY mtu=512" \ |
| 6673 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6674 | crt_file=data_files/server7_int-ca.crt \ |
| 6675 | key_file=data_files/server7.key \ |
| 6676 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6677 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6678 | mtu=512" \ |
| 6679 | "$P_CLI dtls=1 debug_level=2 \ |
| 6680 | crt_file=data_files/server8_int-ca2.crt \ |
| 6681 | key_file=data_files/server8.key \ |
| 6682 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6683 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6684 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6685 | mtu=512" \ |
| 6686 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6687 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6688 | -s "found fragmented DTLS handshake message" \ |
| 6689 | -c "found fragmented DTLS handshake message" \ |
| 6690 | -C "error" |
| 6691 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6692 | # An autoreduction on the client-side might happen if the server is |
| 6693 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6694 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6695 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6696 | requires_config_enabled MBEDTLS_RSA_C |
| 6697 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6698 | requires_config_enabled MBEDTLS_SHA256_C |
| 6699 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6700 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6701 | requires_config_enabled MBEDTLS_AES_C |
| 6702 | requires_config_enabled MBEDTLS_CCM_C |
| 6703 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6704 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6705 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6706 | crt_file=data_files/server7_int-ca.crt \ |
| 6707 | key_file=data_files/server7.key \ |
| 6708 | exchanges=2 renegotiation=1 \ |
| 6709 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6710 | hs_timeout=10000-60000 \ |
| 6711 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6712 | "$P_CLI dtls=1 debug_level=2 \ |
| 6713 | crt_file=data_files/server8_int-ca2.crt \ |
| 6714 | key_file=data_files/server8.key \ |
| 6715 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6716 | hs_timeout=10000-60000 \ |
| 6717 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6718 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6719 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6720 | -s "found fragmented DTLS handshake message" \ |
| 6721 | -c "found fragmented DTLS handshake message" \ |
| 6722 | -C "error" |
| 6723 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6724 | # An autoreduction on the client-side might happen if the server is |
| 6725 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6726 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6727 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6728 | requires_config_enabled MBEDTLS_RSA_C |
| 6729 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6730 | requires_config_enabled MBEDTLS_SHA256_C |
| 6731 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6732 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6733 | requires_config_enabled MBEDTLS_AES_C |
| 6734 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6735 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 6736 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6737 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6738 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6739 | crt_file=data_files/server7_int-ca.crt \ |
| 6740 | key_file=data_files/server7.key \ |
| 6741 | exchanges=2 renegotiation=1 \ |
| 6742 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6743 | hs_timeout=10000-60000 \ |
| 6744 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6745 | "$P_CLI dtls=1 debug_level=2 \ |
| 6746 | crt_file=data_files/server8_int-ca2.crt \ |
| 6747 | key_file=data_files/server8.key \ |
| 6748 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6749 | hs_timeout=10000-60000 \ |
| 6750 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6751 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6752 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6753 | -s "found fragmented DTLS handshake message" \ |
| 6754 | -c "found fragmented DTLS handshake message" \ |
| 6755 | -C "error" |
| 6756 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6757 | # An autoreduction on the client-side might happen if the server is |
| 6758 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6759 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6760 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6761 | requires_config_enabled MBEDTLS_RSA_C |
| 6762 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6763 | requires_config_enabled MBEDTLS_SHA256_C |
| 6764 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6765 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6766 | requires_config_enabled MBEDTLS_AES_C |
| 6767 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6768 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6769 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6770 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6771 | crt_file=data_files/server7_int-ca.crt \ |
| 6772 | key_file=data_files/server7.key \ |
| 6773 | exchanges=2 renegotiation=1 \ |
| 6774 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6775 | hs_timeout=10000-60000 \ |
| 6776 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6777 | "$P_CLI dtls=1 debug_level=2 \ |
| 6778 | crt_file=data_files/server8_int-ca2.crt \ |
| 6779 | key_file=data_files/server8.key \ |
| 6780 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6781 | hs_timeout=10000-60000 \ |
| 6782 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6783 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6784 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6785 | -s "found fragmented DTLS handshake message" \ |
| 6786 | -c "found fragmented DTLS handshake message" \ |
| 6787 | -C "error" |
| 6788 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6789 | # 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] | 6790 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6791 | requires_config_enabled MBEDTLS_RSA_C |
| 6792 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6793 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6794 | requires_config_enabled MBEDTLS_AES_C |
| 6795 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6796 | client_needs_more_time 2 |
| 6797 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 6798 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6799 | "$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] | 6800 | crt_file=data_files/server7_int-ca.crt \ |
| 6801 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6802 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6803 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6804 | crt_file=data_files/server8_int-ca2.crt \ |
| 6805 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6806 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6807 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6808 | 0 \ |
| 6809 | -s "found fragmented DTLS handshake message" \ |
| 6810 | -c "found fragmented DTLS handshake message" \ |
| 6811 | -C "error" |
| 6812 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6813 | # 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] | 6814 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6815 | requires_config_enabled MBEDTLS_RSA_C |
| 6816 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6817 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6818 | requires_config_enabled MBEDTLS_AES_C |
| 6819 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6820 | client_needs_more_time 2 |
| 6821 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 6822 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 6823 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6824 | crt_file=data_files/server7_int-ca.crt \ |
| 6825 | key_file=data_files/server7.key \ |
| 6826 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6827 | "$P_CLI dtls=1 debug_level=2 \ |
| 6828 | crt_file=data_files/server8_int-ca2.crt \ |
| 6829 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6830 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6831 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6832 | 0 \ |
| 6833 | -s "found fragmented DTLS handshake message" \ |
| 6834 | -c "found fragmented DTLS handshake message" \ |
| 6835 | -C "error" |
| 6836 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6837 | # interop tests for DTLS fragmentating with reliable connection |
| 6838 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6839 | # here and below we just want to test that the we fragment in a way that |
| 6840 | # pleases other implementations, so we don't need the peer to fragment |
| 6841 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6842 | requires_config_enabled MBEDTLS_RSA_C |
| 6843 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6845 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6846 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 6847 | "$G_SRV -u" \ |
| 6848 | "$P_CLI dtls=1 debug_level=2 \ |
| 6849 | crt_file=data_files/server8_int-ca2.crt \ |
| 6850 | key_file=data_files/server8.key \ |
| 6851 | mtu=512 force_version=dtls1_2" \ |
| 6852 | 0 \ |
| 6853 | -c "fragmenting handshake message" \ |
| 6854 | -C "error" |
| 6855 | |
| 6856 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6857 | requires_config_enabled MBEDTLS_RSA_C |
| 6858 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6860 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6861 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 6862 | "$G_SRV -u" \ |
| 6863 | "$P_CLI dtls=1 debug_level=2 \ |
| 6864 | crt_file=data_files/server8_int-ca2.crt \ |
| 6865 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6866 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6867 | 0 \ |
| 6868 | -c "fragmenting handshake message" \ |
| 6869 | -C "error" |
| 6870 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6871 | # We use --insecure for the GnuTLS client because it expects |
| 6872 | # the hostname / IP it connects to to be the name used in the |
| 6873 | # certificate obtained from the server. Here, however, it |
| 6874 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 6875 | # as the server name in the certificate. This will make the |
| 6876 | # certifiate validation fail, but passing --insecure makes |
| 6877 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6878 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6879 | requires_config_enabled MBEDTLS_RSA_C |
| 6880 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6882 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6883 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6884 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6885 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6886 | crt_file=data_files/server7_int-ca.crt \ |
| 6887 | key_file=data_files/server7.key \ |
| 6888 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6889 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6890 | 0 \ |
| 6891 | -s "fragmenting handshake message" |
| 6892 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6893 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6894 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6895 | requires_config_enabled MBEDTLS_RSA_C |
| 6896 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6898 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6899 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6900 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6901 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6902 | crt_file=data_files/server7_int-ca.crt \ |
| 6903 | key_file=data_files/server7.key \ |
| 6904 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6905 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6906 | 0 \ |
| 6907 | -s "fragmenting handshake message" |
| 6908 | |
| 6909 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6910 | requires_config_enabled MBEDTLS_RSA_C |
| 6911 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6912 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6913 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 6914 | "$O_SRV -dtls1_2 -verify 10" \ |
| 6915 | "$P_CLI dtls=1 debug_level=2 \ |
| 6916 | crt_file=data_files/server8_int-ca2.crt \ |
| 6917 | key_file=data_files/server8.key \ |
| 6918 | mtu=512 force_version=dtls1_2" \ |
| 6919 | 0 \ |
| 6920 | -c "fragmenting handshake message" \ |
| 6921 | -C "error" |
| 6922 | |
| 6923 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6924 | requires_config_enabled MBEDTLS_RSA_C |
| 6925 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6927 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 6928 | "$O_SRV -dtls1 -verify 10" \ |
| 6929 | "$P_CLI dtls=1 debug_level=2 \ |
| 6930 | crt_file=data_files/server8_int-ca2.crt \ |
| 6931 | key_file=data_files/server8.key \ |
| 6932 | mtu=512 force_version=dtls1" \ |
| 6933 | 0 \ |
| 6934 | -c "fragmenting handshake message" \ |
| 6935 | -C "error" |
| 6936 | |
| 6937 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6938 | requires_config_enabled MBEDTLS_RSA_C |
| 6939 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6941 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 6942 | "$P_SRV dtls=1 debug_level=2 \ |
| 6943 | crt_file=data_files/server7_int-ca.crt \ |
| 6944 | key_file=data_files/server7.key \ |
| 6945 | mtu=512 force_version=dtls1_2" \ |
| 6946 | "$O_CLI -dtls1_2" \ |
| 6947 | 0 \ |
| 6948 | -s "fragmenting handshake message" |
| 6949 | |
| 6950 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6951 | requires_config_enabled MBEDTLS_RSA_C |
| 6952 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6953 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6954 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 6955 | "$P_SRV dtls=1 debug_level=2 \ |
| 6956 | crt_file=data_files/server7_int-ca.crt \ |
| 6957 | key_file=data_files/server7.key \ |
| 6958 | mtu=512 force_version=dtls1" \ |
| 6959 | "$O_CLI -dtls1" \ |
| 6960 | 0 \ |
| 6961 | -s "fragmenting handshake message" |
| 6962 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6963 | # interop tests for DTLS fragmentating with unreliable connection |
| 6964 | # |
| 6965 | # again we just want to test that the we fragment in a way that |
| 6966 | # pleases other implementations, so we don't need the peer to fragment |
| 6967 | requires_gnutls_next |
| 6968 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6969 | requires_config_enabled MBEDTLS_RSA_C |
| 6970 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6971 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6972 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6973 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 6974 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6975 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6976 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6977 | crt_file=data_files/server8_int-ca2.crt \ |
| 6978 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6979 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6980 | 0 \ |
| 6981 | -c "fragmenting handshake message" \ |
| 6982 | -C "error" |
| 6983 | |
| 6984 | requires_gnutls_next |
| 6985 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6986 | requires_config_enabled MBEDTLS_RSA_C |
| 6987 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6989 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6990 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 6991 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6992 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6993 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6994 | crt_file=data_files/server8_int-ca2.crt \ |
| 6995 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6996 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6997 | 0 \ |
| 6998 | -c "fragmenting handshake message" \ |
| 6999 | -C "error" |
| 7000 | |
| 7001 | ## The two tests below are disabled due to a bug in GnuTLS client that causes |
| 7002 | ## handshake failures when the NewSessionTicket message is lost, see |
| 7003 | ## https://gitlab.com/gnutls/gnutls/issues/543 |
| 7004 | ## We can re-enable them when a fixed version fo GnuTLS is available |
| 7005 | ## and installed in our CI system. |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7006 | skip_next_test |
| 7007 | requires_gnutls |
| 7008 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7009 | requires_config_enabled MBEDTLS_RSA_C |
| 7010 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7012 | client_needs_more_time 4 |
| 7013 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7014 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7015 | "$P_SRV dtls=1 debug_level=2 \ |
| 7016 | crt_file=data_files/server7_int-ca.crt \ |
| 7017 | key_file=data_files/server7.key \ |
| 7018 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7019 | "$G_CLI -u --insecure 127.0.0.1" \ |
| 7020 | 0 \ |
| 7021 | -s "fragmenting handshake message" |
| 7022 | |
| 7023 | skip_next_test |
| 7024 | requires_gnutls |
| 7025 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7026 | requires_config_enabled MBEDTLS_RSA_C |
| 7027 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7029 | client_needs_more_time 4 |
| 7030 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 7031 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7032 | "$P_SRV dtls=1 debug_level=2 \ |
| 7033 | crt_file=data_files/server7_int-ca.crt \ |
| 7034 | key_file=data_files/server7.key \ |
| 7035 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
| 7036 | "$G_CLI -u --insecure 127.0.0.1" \ |
| 7037 | 0 \ |
| 7038 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7039 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7040 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7041 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7042 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7043 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7044 | ## (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] | 7045 | skip_next_test |
| 7046 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7047 | requires_config_enabled MBEDTLS_RSA_C |
| 7048 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7050 | client_needs_more_time 4 |
| 7051 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7052 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7053 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7054 | "$P_CLI dtls=1 debug_level=2 \ |
| 7055 | crt_file=data_files/server8_int-ca2.crt \ |
| 7056 | key_file=data_files/server8.key \ |
| 7057 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7058 | 0 \ |
| 7059 | -c "fragmenting handshake message" \ |
| 7060 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7061 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7062 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7063 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7064 | requires_config_enabled MBEDTLS_RSA_C |
| 7065 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7066 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7067 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7068 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 7069 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7070 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7071 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7072 | crt_file=data_files/server8_int-ca2.crt \ |
| 7073 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7074 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7075 | 0 \ |
| 7076 | -c "fragmenting handshake message" \ |
| 7077 | -C "error" |
| 7078 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7079 | skip_next_test |
| 7080 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7081 | requires_config_enabled MBEDTLS_RSA_C |
| 7082 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7084 | client_needs_more_time 4 |
| 7085 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7086 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7087 | "$P_SRV dtls=1 debug_level=2 \ |
| 7088 | crt_file=data_files/server7_int-ca.crt \ |
| 7089 | key_file=data_files/server7.key \ |
| 7090 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7091 | "$O_CLI -dtls1_2" \ |
| 7092 | 0 \ |
| 7093 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7094 | |
| 7095 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 7096 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7097 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7098 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7099 | requires_config_enabled MBEDTLS_RSA_C |
| 7100 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7102 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7103 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 7104 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7105 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7106 | crt_file=data_files/server7_int-ca.crt \ |
| 7107 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7108 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7109 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7110 | 0 \ |
| 7111 | -s "fragmenting handshake message" |
| 7112 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7113 | # Tests for specific things with "unreliable" UDP connection |
| 7114 | |
| 7115 | not_with_valgrind # spurious resend due to timeout |
| 7116 | run_test "DTLS proxy: reference" \ |
| 7117 | -p "$P_PXY" \ |
| 7118 | "$P_SRV dtls=1 debug_level=2" \ |
| 7119 | "$P_CLI dtls=1 debug_level=2" \ |
| 7120 | 0 \ |
| 7121 | -C "replayed record" \ |
| 7122 | -S "replayed record" \ |
| 7123 | -C "record from another epoch" \ |
| 7124 | -S "record from another epoch" \ |
| 7125 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7126 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7127 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7128 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7129 | -c "HTTP/1.0 200 OK" |
| 7130 | |
| 7131 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7132 | run_test "DTLS proxy: duplicate every packet" \ |
| 7133 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7134 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7135 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7136 | 0 \ |
| 7137 | -c "replayed record" \ |
| 7138 | -s "replayed record" \ |
| 7139 | -c "record from another epoch" \ |
| 7140 | -s "record from another epoch" \ |
| 7141 | -S "resend" \ |
| 7142 | -s "Extra-header:" \ |
| 7143 | -c "HTTP/1.0 200 OK" |
| 7144 | |
| 7145 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 7146 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7147 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 7148 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7149 | 0 \ |
| 7150 | -c "replayed record" \ |
| 7151 | -S "replayed record" \ |
| 7152 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7153 | -s "record from another epoch" \ |
| 7154 | -c "resend" \ |
| 7155 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7156 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7157 | -c "HTTP/1.0 200 OK" |
| 7158 | |
| 7159 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 7160 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7161 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7162 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7163 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7164 | -c "next record in same datagram" \ |
| 7165 | -s "next record in same datagram" |
| 7166 | |
| 7167 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 7168 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7169 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7170 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7171 | 0 \ |
| 7172 | -c "next record in same datagram" \ |
| 7173 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7174 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7175 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 7176 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7177 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 7178 | "$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] | 7179 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7180 | -c "discarding invalid record (mac)" \ |
| 7181 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7182 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7183 | -c "HTTP/1.0 200 OK" \ |
| 7184 | -S "too many records with bad MAC" \ |
| 7185 | -S "Verification of the message MAC failed" |
| 7186 | |
| 7187 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 7188 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7189 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 7190 | "$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] | 7191 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7192 | -C "discarding invalid record (mac)" \ |
| 7193 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7194 | -S "Extra-header:" \ |
| 7195 | -C "HTTP/1.0 200 OK" \ |
| 7196 | -s "too many records with bad MAC" \ |
| 7197 | -s "Verification of the message MAC failed" |
| 7198 | |
| 7199 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 7200 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7201 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 7202 | "$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] | 7203 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7204 | -c "discarding invalid record (mac)" \ |
| 7205 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7206 | -s "Extra-header:" \ |
| 7207 | -c "HTTP/1.0 200 OK" \ |
| 7208 | -S "too many records with bad MAC" \ |
| 7209 | -S "Verification of the message MAC failed" |
| 7210 | |
| 7211 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 7212 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7213 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 7214 | "$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] | 7215 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7216 | -c "discarding invalid record (mac)" \ |
| 7217 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7218 | -s "Extra-header:" \ |
| 7219 | -c "HTTP/1.0 200 OK" \ |
| 7220 | -s "too many records with bad MAC" \ |
| 7221 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7222 | |
| 7223 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 7224 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 7225 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 7226 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7227 | 0 \ |
| 7228 | -c "record from another epoch" \ |
| 7229 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7230 | -s "Extra-header:" \ |
| 7231 | -c "HTTP/1.0 200 OK" |
| 7232 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7233 | # Tests for reordering support with DTLS |
| 7234 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7235 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 7236 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7237 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7238 | hs_timeout=2500-60000" \ |
| 7239 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7240 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7241 | 0 \ |
| 7242 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7243 | -c "Next handshake message has been buffered - load"\ |
| 7244 | -S "Buffering HS message" \ |
| 7245 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7246 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7247 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7248 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7249 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7250 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7251 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 7252 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7253 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7254 | hs_timeout=2500-60000" \ |
| 7255 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7256 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7257 | 0 \ |
| 7258 | -c "Buffering HS message" \ |
| 7259 | -c "found fragmented DTLS handshake message"\ |
| 7260 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 7261 | -c "Next handshake message has been buffered - load"\ |
| 7262 | -S "Buffering HS message" \ |
| 7263 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7264 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7265 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7266 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7267 | -S "Remember CCS message" |
| 7268 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7269 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 7270 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 7271 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 7272 | # while keeping the ServerKeyExchange. |
| 7273 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 7274 | 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] | 7275 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7276 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7277 | hs_timeout=2500-60000" \ |
| 7278 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7279 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7280 | 0 \ |
| 7281 | -c "Buffering HS message" \ |
| 7282 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7283 | -C "attempt to make space by freeing buffered messages" \ |
| 7284 | -S "Buffering HS message" \ |
| 7285 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7286 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7287 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7288 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7289 | -S "Remember CCS message" |
| 7290 | |
| 7291 | # The size constraints ensure that the delayed certificate message can't |
| 7292 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 7293 | # when dropping it first. |
| 7294 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 7295 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 7296 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 7297 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7298 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7299 | hs_timeout=2500-60000" \ |
| 7300 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7301 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7302 | 0 \ |
| 7303 | -c "Buffering HS message" \ |
| 7304 | -c "attempt to make space by freeing buffered future messages" \ |
| 7305 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7306 | -S "Buffering HS message" \ |
| 7307 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7308 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7309 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7310 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7311 | -S "Remember CCS message" |
| 7312 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7313 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 7314 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7315 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 7316 | hs_timeout=2500-60000" \ |
| 7317 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7318 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7319 | 0 \ |
| 7320 | -C "Buffering HS message" \ |
| 7321 | -C "Next handshake message has been buffered - load"\ |
| 7322 | -s "Buffering HS message" \ |
| 7323 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7324 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7325 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7326 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7327 | -S "Remember CCS message" |
| 7328 | |
| 7329 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 7330 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7331 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7332 | hs_timeout=2500-60000" \ |
| 7333 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7334 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7335 | 0 \ |
| 7336 | -C "Buffering HS message" \ |
| 7337 | -C "Next handshake message has been buffered - load"\ |
| 7338 | -S "Buffering HS message" \ |
| 7339 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7340 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7341 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7342 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7343 | -S "Remember CCS message" |
| 7344 | |
| 7345 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 7346 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7347 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7348 | hs_timeout=2500-60000" \ |
| 7349 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7350 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7351 | 0 \ |
| 7352 | -C "Buffering HS message" \ |
| 7353 | -C "Next handshake message has been buffered - load"\ |
| 7354 | -S "Buffering HS message" \ |
| 7355 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7356 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7357 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7358 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7359 | -s "Remember CCS message" |
| 7360 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7361 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7362 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7363 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7364 | hs_timeout=2500-60000" \ |
| 7365 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7366 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 7367 | 0 \ |
| 7368 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7369 | -s "Found buffered record from current epoch - load" \ |
| 7370 | -c "Buffer record from epoch 1" \ |
| 7371 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7372 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7373 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 7374 | # from the server are delayed, so that the encrypted Finished message |
| 7375 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 7376 | # in afterwards, the encrypted Finished message must be freed in order |
| 7377 | # to make space for the NewSessionTicket to be reassembled. |
| 7378 | # This works only in very particular circumstances: |
| 7379 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 7380 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 7381 | # the encrypted Finished message. |
| 7382 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 7383 | # needs to be fragmented. |
| 7384 | # - All messages sent by the server must be small enough to be either sent |
| 7385 | # without fragmentation or be reassembled within the bounds of |
| 7386 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 7387 | # handshake, omitting CRTs. |
| 7388 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 7389 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 7390 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 7391 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 7392 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 7393 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 7394 | 0 \ |
| 7395 | -s "Buffer record from epoch 1" \ |
| 7396 | -s "Found buffered record from current epoch - load" \ |
| 7397 | -c "Buffer record from epoch 1" \ |
| 7398 | -C "Found buffered record from current epoch - load" \ |
| 7399 | -c "Enough space available after freeing future epoch record" |
| 7400 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 7401 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 7402 | |
| 7403 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7404 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 7405 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7406 | "$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] | 7407 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7408 | "$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] | 7409 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7410 | 0 \ |
| 7411 | -s "Extra-header:" \ |
| 7412 | -c "HTTP/1.0 200 OK" |
| 7413 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7414 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7415 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 7416 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7417 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7418 | "$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] | 7419 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7420 | 0 \ |
| 7421 | -s "Extra-header:" \ |
| 7422 | -c "HTTP/1.0 200 OK" |
| 7423 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7424 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7425 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 7426 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7427 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7428 | "$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] | 7429 | 0 \ |
| 7430 | -s "Extra-header:" \ |
| 7431 | -c "HTTP/1.0 200 OK" |
| 7432 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7433 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7434 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 7435 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7436 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 7437 | "$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] | 7438 | 0 \ |
| 7439 | -s "Extra-header:" \ |
| 7440 | -c "HTTP/1.0 200 OK" |
| 7441 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7442 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7443 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 7444 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7445 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 7446 | "$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] | 7447 | 0 \ |
| 7448 | -s "Extra-header:" \ |
| 7449 | -c "HTTP/1.0 200 OK" |
| 7450 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7451 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7452 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 7453 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7454 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 7455 | "$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] | 7456 | 0 \ |
| 7457 | -s "Extra-header:" \ |
| 7458 | -c "HTTP/1.0 200 OK" |
| 7459 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7460 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7461 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 7462 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7463 | "$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] | 7464 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7465 | "$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] | 7466 | 0 \ |
| 7467 | -s "Extra-header:" \ |
| 7468 | -c "HTTP/1.0 200 OK" |
| 7469 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7470 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7471 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 7472 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7473 | "$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] | 7474 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7475 | "$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] | 7476 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 7477 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7478 | 0 \ |
| 7479 | -s "a session has been resumed" \ |
| 7480 | -c "a session has been resumed" \ |
| 7481 | -s "Extra-header:" \ |
| 7482 | -c "HTTP/1.0 200 OK" |
| 7483 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7484 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7485 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 7486 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7487 | "$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] | 7488 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7489 | "$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] | 7490 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 7491 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 7492 | 0 \ |
| 7493 | -s "a session has been resumed" \ |
| 7494 | -c "a session has been resumed" \ |
| 7495 | -s "Extra-header:" \ |
| 7496 | -c "HTTP/1.0 200 OK" |
| 7497 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7498 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7499 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7500 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7501 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7502 | "$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] | 7503 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7504 | "$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] | 7505 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7506 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7507 | 0 \ |
| 7508 | -c "=> renegotiate" \ |
| 7509 | -s "=> renegotiate" \ |
| 7510 | -s "Extra-header:" \ |
| 7511 | -c "HTTP/1.0 200 OK" |
| 7512 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7513 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7514 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7515 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 7516 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7517 | "$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] | 7518 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7519 | "$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] | 7520 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7521 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7522 | 0 \ |
| 7523 | -c "=> renegotiate" \ |
| 7524 | -s "=> renegotiate" \ |
| 7525 | -s "Extra-header:" \ |
| 7526 | -c "HTTP/1.0 200 OK" |
| 7527 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7528 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7529 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7530 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 7531 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7532 | "$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] | 7533 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7534 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7535 | "$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] | 7536 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7537 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7538 | 0 \ |
| 7539 | -c "=> renegotiate" \ |
| 7540 | -s "=> renegotiate" \ |
| 7541 | -s "Extra-header:" \ |
| 7542 | -c "HTTP/1.0 200 OK" |
| 7543 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7544 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7545 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7546 | 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] | 7547 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7548 | "$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] | 7549 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7550 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7551 | "$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] | 7552 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7553 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7554 | 0 \ |
| 7555 | -c "=> renegotiate" \ |
| 7556 | -s "=> renegotiate" \ |
| 7557 | -s "Extra-header:" \ |
| 7558 | -c "HTTP/1.0 200 OK" |
| 7559 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7560 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 7561 | ## all versions installed on the CI machines), reported here: |
| 7562 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 7563 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7564 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 7565 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7566 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7567 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7568 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7569 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7570 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7571 | "$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] | 7572 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7573 | -c "HTTP/1.0 200 OK" |
| 7574 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7575 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7576 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7577 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7578 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 7579 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7580 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7581 | "$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] | 7582 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7583 | -c "HTTP/1.0 200 OK" |
| 7584 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7585 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7586 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7587 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7588 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 7589 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7590 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7591 | "$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] | 7592 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7593 | -c "HTTP/1.0 200 OK" |
| 7594 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 7595 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7596 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7597 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7598 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 7599 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 7600 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7601 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7602 | 0 \ |
| 7603 | -s "Extra-header:" \ |
| 7604 | -c "Extra-header:" |
| 7605 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 7606 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7607 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7608 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7609 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 7610 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 7611 | "$G_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7612 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7613 | 0 \ |
| 7614 | -s "Extra-header:" \ |
| 7615 | -c "Extra-header:" |
| 7616 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 7617 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7618 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7619 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7620 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 7621 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 7622 | "$G_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7623 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7624 | 0 \ |
| 7625 | -s "Extra-header:" \ |
| 7626 | -c "Extra-header:" |
| 7627 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 7628 | # Final report |
| 7629 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7630 | echo "------------------------------------------------------------------------" |
| 7631 | |
| 7632 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7633 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7634 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7635 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7636 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 7637 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 7638 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7639 | |
| 7640 | exit $FAILS |