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 | bc73e4a | 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 | bc73e4a | 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 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 145 | # skip next test if the flag is not enabled in config.h |
| 146 | requires_config_enabled() { |
| 147 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 148 | SKIP_NEXT="YES" |
| 149 | fi |
| 150 | } |
| 151 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 152 | # skip next test if the flag is enabled in config.h |
| 153 | requires_config_disabled() { |
| 154 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 155 | SKIP_NEXT="YES" |
| 156 | fi |
| 157 | } |
| 158 | |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 159 | requires_config_value_at_least() { |
| 160 | NAME="$1" |
| 161 | DEF_VAL=$( grep ".*#define.*MBEDTLS_SSL_DTLS_MAX_BUFFERING" ../include/mbedtls/config.h | |
| 162 | sed 's/^.*\s\([0-9]*\)$/\1/' ) |
| 163 | VAL=$( ../scripts/config.pl get $NAME || echo "$DEF_VAL" ) |
| 164 | if [ "$VAL" -lt "$2" ]; then |
| 165 | SKIP_NEXT="YES" |
| 166 | fi |
| 167 | } |
| 168 | |
| 169 | requires_config_value_at_most() { |
| 170 | NAME="$1" |
| 171 | DEF_VAL=$( grep ".*#define.*MBEDTLS_SSL_DTLS_MAX_BUFFERING" ../include/mbedtls/config.h | |
| 172 | sed 's/^.*\s\([0-9]*\)$/\1/' ) |
| 173 | VAL=$( ../scripts/config.pl get $NAME || echo "$DEF_VAL" ) |
| 174 | if [ "$VAL" -gt "$2" ]; then |
| 175 | SKIP_NEXT="YES" |
| 176 | fi |
| 177 | } |
| 178 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 179 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 180 | requires_openssl_with_fallback_scsv() { |
| 181 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 182 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 183 | then |
| 184 | OPENSSL_HAS_FBSCSV="YES" |
| 185 | else |
| 186 | OPENSSL_HAS_FBSCSV="NO" |
| 187 | fi |
| 188 | fi |
| 189 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 190 | SKIP_NEXT="YES" |
| 191 | fi |
| 192 | } |
| 193 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 194 | # skip next test if GnuTLS isn't available |
| 195 | requires_gnutls() { |
| 196 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 197 | 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] | 198 | GNUTLS_AVAILABLE="YES" |
| 199 | else |
| 200 | GNUTLS_AVAILABLE="NO" |
| 201 | fi |
| 202 | fi |
| 203 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 204 | SKIP_NEXT="YES" |
| 205 | fi |
| 206 | } |
| 207 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 208 | # skip next test if GnuTLS-next isn't available |
| 209 | requires_gnutls_next() { |
| 210 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 211 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 212 | GNUTLS_NEXT_AVAILABLE="YES" |
| 213 | else |
| 214 | GNUTLS_NEXT_AVAILABLE="NO" |
| 215 | fi |
| 216 | fi |
| 217 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 218 | SKIP_NEXT="YES" |
| 219 | fi |
| 220 | } |
| 221 | |
| 222 | # skip next test if OpenSSL-legacy isn't available |
| 223 | requires_openssl_legacy() { |
| 224 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 225 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 226 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 227 | else |
| 228 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 229 | fi |
| 230 | fi |
| 231 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 232 | SKIP_NEXT="YES" |
| 233 | fi |
| 234 | } |
| 235 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 236 | # skip next test if IPv6 isn't available on this host |
| 237 | requires_ipv6() { |
| 238 | if [ -z "${HAS_IPV6:-}" ]; then |
| 239 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 240 | SRV_PID=$! |
| 241 | sleep 1 |
| 242 | kill $SRV_PID >/dev/null 2>&1 |
| 243 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 244 | HAS_IPV6="NO" |
| 245 | else |
| 246 | HAS_IPV6="YES" |
| 247 | fi |
| 248 | rm -r $SRV_OUT |
| 249 | fi |
| 250 | |
| 251 | if [ "$HAS_IPV6" = "NO" ]; then |
| 252 | SKIP_NEXT="YES" |
| 253 | fi |
| 254 | } |
| 255 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 256 | # Calculate the input & output maximum content lengths set in the config |
| 257 | MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 258 | MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 259 | MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 260 | |
| 261 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 262 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 263 | fi |
| 264 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 265 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 266 | fi |
| 267 | |
| 268 | # skip the next test if the SSL output buffer is less than 16KB |
| 269 | requires_full_size_output_buffer() { |
| 270 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 271 | SKIP_NEXT="YES" |
| 272 | fi |
| 273 | } |
| 274 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 275 | # skip the next test if valgrind is in use |
| 276 | not_with_valgrind() { |
| 277 | if [ "$MEMCHECK" -gt 0 ]; then |
| 278 | SKIP_NEXT="YES" |
| 279 | fi |
| 280 | } |
| 281 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 282 | # skip the next test if valgrind is NOT in use |
| 283 | only_with_valgrind() { |
| 284 | if [ "$MEMCHECK" -eq 0 ]; then |
| 285 | SKIP_NEXT="YES" |
| 286 | fi |
| 287 | } |
| 288 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 289 | # 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] | 290 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 291 | CLI_DELAY_FACTOR=$1 |
| 292 | } |
| 293 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 294 | # wait for the given seconds after the client finished in the next test |
| 295 | server_needs_more_time() { |
| 296 | SRV_DELAY_SECONDS=$1 |
| 297 | } |
| 298 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 299 | # print_name <name> |
| 300 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 301 | TESTS=$(( $TESTS + 1 )) |
| 302 | LINE="" |
| 303 | |
| 304 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 305 | LINE="$TESTS " |
| 306 | fi |
| 307 | |
| 308 | LINE="$LINE$1" |
| 309 | printf "$LINE " |
| 310 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 311 | for i in `seq 1 $LEN`; do printf '.'; done |
| 312 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 313 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 314 | } |
| 315 | |
| 316 | # fail <message> |
| 317 | fail() { |
| 318 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 319 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 320 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 321 | mv $SRV_OUT o-srv-${TESTS}.log |
| 322 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 323 | if [ -n "$PXY_CMD" ]; then |
| 324 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 325 | fi |
| 326 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 327 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 328 | 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] | 329 | echo " ! server output:" |
| 330 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 331 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 332 | echo " ! client output:" |
| 333 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 334 | if [ -n "$PXY_CMD" ]; then |
| 335 | echo " ! ========================================================" |
| 336 | echo " ! proxy output:" |
| 337 | cat o-pxy-${TESTS}.log |
| 338 | fi |
| 339 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 340 | fi |
| 341 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 342 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 343 | } |
| 344 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 345 | # is_polar <cmd_line> |
| 346 | is_polar() { |
| 347 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 348 | } |
| 349 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 350 | # openssl s_server doesn't have -www with DTLS |
| 351 | check_osrv_dtls() { |
| 352 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 353 | NEEDS_INPUT=1 |
| 354 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 355 | else |
| 356 | NEEDS_INPUT=0 |
| 357 | fi |
| 358 | } |
| 359 | |
| 360 | # provide input to commands that need it |
| 361 | provide_input() { |
| 362 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 363 | return |
| 364 | fi |
| 365 | |
| 366 | while true; do |
| 367 | echo "HTTP/1.0 200 OK" |
| 368 | sleep 1 |
| 369 | done |
| 370 | } |
| 371 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 372 | # has_mem_err <log_file_name> |
| 373 | has_mem_err() { |
| 374 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 375 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 376 | then |
| 377 | return 1 # false: does not have errors |
| 378 | else |
| 379 | return 0 # true: has errors |
| 380 | fi |
| 381 | } |
| 382 | |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 383 | # Wait for process $2 to be listening on port $1 |
| 384 | if type lsof >/dev/null 2>/dev/null; then |
| 385 | wait_server_start() { |
| 386 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 387 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 388 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 389 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 390 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 391 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 392 | # Make a tight loop, server normally takes less than 1s to start. |
| 393 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 394 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 395 | echo "SERVERSTART TIMEOUT" |
| 396 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 397 | break |
| 398 | fi |
| 399 | # Linux and *BSD support decimal arguments to sleep. On other |
| 400 | # OSes this may be a tight loop. |
| 401 | sleep 0.1 2>/dev/null || true |
| 402 | done |
| 403 | } |
| 404 | else |
Gilles Peskine | a931265 | 2018-06-29 15:48:13 +0200 | [diff] [blame] | 405 | echo "Warning: lsof not available, wait_server_start = sleep" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 406 | wait_server_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 407 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 408 | } |
| 409 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 410 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 411 | # 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] | 412 | # 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] | 413 | # acceptable bounds |
| 414 | check_server_hello_time() { |
| 415 | # 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] | 416 | 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] | 417 | # Get the Unix timestamp for now |
| 418 | CUR_TIME=$(date +'%s') |
| 419 | THRESHOLD_IN_SECS=300 |
| 420 | |
| 421 | # Check if the ServerHello time was printed |
| 422 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 423 | return 1 |
| 424 | fi |
| 425 | |
| 426 | # Check the time in ServerHello is within acceptable bounds |
| 427 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 428 | # The time in ServerHello is at least 5 minutes before now |
| 429 | return 1 |
| 430 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 431 | # 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] | 432 | return 1 |
| 433 | else |
| 434 | return 0 |
| 435 | fi |
| 436 | } |
| 437 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 438 | # wait for client to terminate and set CLI_EXIT |
| 439 | # must be called right after starting the client |
| 440 | wait_client_done() { |
| 441 | CLI_PID=$! |
| 442 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 443 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 444 | CLI_DELAY_FACTOR=1 |
| 445 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 446 | ( 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] | 447 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 448 | |
| 449 | wait $CLI_PID |
| 450 | CLI_EXIT=$? |
| 451 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 452 | kill $DOG_PID >/dev/null 2>&1 |
| 453 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 454 | |
| 455 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 456 | |
| 457 | sleep $SRV_DELAY_SECONDS |
| 458 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 459 | } |
| 460 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 461 | # check if the given command uses dtls and sets global variable DTLS |
| 462 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 463 | 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] | 464 | DTLS=1 |
| 465 | else |
| 466 | DTLS=0 |
| 467 | fi |
| 468 | } |
| 469 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 470 | # 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] | 471 | # Options: -s pattern pattern that must be present in server output |
| 472 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 473 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 474 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 475 | # -S pattern pattern that must be absent in server output |
| 476 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 477 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 478 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 479 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 480 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 481 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 482 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 483 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 484 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 485 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 486 | return |
| 487 | fi |
| 488 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 489 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 490 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 491 | # Do we only run numbered tests? |
| 492 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 493 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 494 | else |
| 495 | SKIP_NEXT="YES" |
| 496 | fi |
| 497 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 498 | # should we skip? |
| 499 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 500 | SKIP_NEXT="NO" |
| 501 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 502 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 503 | return |
| 504 | fi |
| 505 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 506 | # does this test use a proxy? |
| 507 | if [ "X$1" = "X-p" ]; then |
| 508 | PXY_CMD="$2" |
| 509 | shift 2 |
| 510 | else |
| 511 | PXY_CMD="" |
| 512 | fi |
| 513 | |
| 514 | # get commands and client output |
| 515 | SRV_CMD="$1" |
| 516 | CLI_CMD="$2" |
| 517 | CLI_EXPECT="$3" |
| 518 | shift 3 |
| 519 | |
| 520 | # fix client port |
| 521 | if [ -n "$PXY_CMD" ]; then |
| 522 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 523 | else |
| 524 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 525 | fi |
| 526 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 527 | # update DTLS variable |
| 528 | detect_dtls "$SRV_CMD" |
| 529 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 530 | # prepend valgrind to our commands if active |
| 531 | if [ "$MEMCHECK" -gt 0 ]; then |
| 532 | if is_polar "$SRV_CMD"; then |
| 533 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 534 | fi |
| 535 | if is_polar "$CLI_CMD"; then |
| 536 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 537 | fi |
| 538 | fi |
| 539 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 540 | TIMES_LEFT=2 |
| 541 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 542 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 543 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 544 | # run the commands |
| 545 | if [ -n "$PXY_CMD" ]; then |
| 546 | echo "$PXY_CMD" > $PXY_OUT |
| 547 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 548 | PXY_PID=$! |
| 549 | # assume proxy starts faster than server |
| 550 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 551 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 552 | check_osrv_dtls |
| 553 | echo "$SRV_CMD" > $SRV_OUT |
| 554 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 555 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 556 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 557 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 558 | echo "$CLI_CMD" > $CLI_OUT |
| 559 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 560 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 561 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 562 | sleep 0.05 |
| 563 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 564 | # terminate the server (and the proxy) |
| 565 | kill $SRV_PID |
| 566 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 567 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 568 | if [ -n "$PXY_CMD" ]; then |
| 569 | kill $PXY_PID >/dev/null 2>&1 |
| 570 | wait $PXY_PID |
| 571 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 572 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 573 | # retry only on timeouts |
| 574 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 575 | printf "RETRY " |
| 576 | else |
| 577 | TIMES_LEFT=0 |
| 578 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 579 | done |
| 580 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 581 | # 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] | 582 | # (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] | 583 | # expected client exit to incorrectly succeed in case of catastrophic |
| 584 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 585 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 586 | 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] | 587 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 588 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 589 | return |
| 590 | fi |
| 591 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 592 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 593 | 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] | 594 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 595 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 596 | return |
| 597 | fi |
| 598 | fi |
| 599 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 600 | # check server exit code |
| 601 | if [ $? != 0 ]; then |
| 602 | fail "server fail" |
| 603 | return |
| 604 | fi |
| 605 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 606 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 607 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 608 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 609 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 610 | 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] | 611 | return |
| 612 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 613 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 614 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 615 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 616 | # 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] | 617 | while [ $# -gt 0 ] |
| 618 | do |
| 619 | case $1 in |
| 620 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 621 | 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] | 622 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 623 | return |
| 624 | fi |
| 625 | ;; |
| 626 | |
| 627 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 628 | 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] | 629 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 630 | return |
| 631 | fi |
| 632 | ;; |
| 633 | |
| 634 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 635 | 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] | 636 | 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] | 637 | return |
| 638 | fi |
| 639 | ;; |
| 640 | |
| 641 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 642 | 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] | 643 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 644 | return |
| 645 | fi |
| 646 | ;; |
| 647 | |
| 648 | # The filtering in the following two options (-u and -U) do the following |
| 649 | # - ignore valgrind output |
| 650 | # - filter out everything but lines right after the pattern occurances |
| 651 | # - keep one of each non-unique line |
| 652 | # - count how many lines remain |
| 653 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 654 | # if there were no duplicates. |
| 655 | "-U") |
| 656 | 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 |
| 657 | fail "lines following pattern '$2' must be unique in Server output" |
| 658 | return |
| 659 | fi |
| 660 | ;; |
| 661 | |
| 662 | "-u") |
| 663 | 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 |
| 664 | 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] | 665 | return |
| 666 | fi |
| 667 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 668 | "-F") |
| 669 | if ! $2 "$SRV_OUT"; then |
| 670 | fail "function call to '$2' failed on Server output" |
| 671 | return |
| 672 | fi |
| 673 | ;; |
| 674 | "-f") |
| 675 | if ! $2 "$CLI_OUT"; then |
| 676 | fail "function call to '$2' failed on Client output" |
| 677 | return |
| 678 | fi |
| 679 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 680 | |
| 681 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 682 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 683 | exit 1 |
| 684 | esac |
| 685 | shift 2 |
| 686 | done |
| 687 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 688 | # check valgrind's results |
| 689 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 690 | 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] | 691 | fail "Server has memory errors" |
| 692 | return |
| 693 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 694 | 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] | 695 | fail "Client has memory errors" |
| 696 | return |
| 697 | fi |
| 698 | fi |
| 699 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 700 | # if we're here, everything is ok |
| 701 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 702 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 703 | mv $SRV_OUT o-srv-${TESTS}.log |
| 704 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 4e1a9c1 | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 705 | if [ -n "$PXY_CMD" ]; then |
| 706 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 707 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 708 | fi |
| 709 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 710 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 711 | } |
| 712 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 713 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 714 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 715 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 716 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 717 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 718 | 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] | 719 | exit 1 |
| 720 | } |
| 721 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 722 | # |
| 723 | # MAIN |
| 724 | # |
| 725 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 726 | get_options "$@" |
| 727 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 728 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 729 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 730 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 731 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 732 | if [ ! -x "$P_SRV_BIN" ]; then |
| 733 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 734 | exit 1 |
| 735 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 736 | if [ ! -x "$P_CLI_BIN" ]; then |
| 737 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 738 | exit 1 |
| 739 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 740 | if [ ! -x "$P_PXY_BIN" ]; then |
| 741 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 742 | exit 1 |
| 743 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 744 | if [ "$MEMCHECK" -gt 0 ]; then |
| 745 | if which valgrind >/dev/null 2>&1; then :; else |
| 746 | echo "Memcheck not possible. Valgrind not found" |
| 747 | exit 1 |
| 748 | fi |
| 749 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 750 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 751 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 752 | exit 1 |
| 753 | fi |
| 754 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 755 | # used by watchdog |
| 756 | MAIN_PID="$$" |
| 757 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 758 | # We use somewhat arbitrary delays for tests: |
| 759 | # - how long do we wait for the server to start (when lsof not available)? |
| 760 | # - how long do we allow for the client to finish? |
| 761 | # (not to check performance, just to avoid waiting indefinitely) |
| 762 | # Things are slower with valgrind, so give extra time here. |
| 763 | # |
| 764 | # Note: without lsof, there is a trade-off between the running time of this |
| 765 | # script and the risk of spurious errors because we didn't wait long enough. |
| 766 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 767 | # 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] | 768 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 769 | START_DELAY=6 |
| 770 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 771 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 772 | START_DELAY=2 |
| 773 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 774 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 775 | |
| 776 | # some particular tests need more time: |
| 777 | # - for the client, we multiply the usual watchdog limit by a factor |
| 778 | # - for the server, we sleep for a number of seconds after the client exits |
| 779 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 780 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 781 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 782 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 783 | # 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] | 784 | # +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] | 785 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 786 | 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] | 787 | 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] | 788 | 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] | 789 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 790 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 791 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 792 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 793 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 794 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 795 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 796 | fi |
| 797 | |
Hanno Becker | bc73e4a | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 798 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 799 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 800 | fi |
| 801 | |
Hanno Becker | bc73e4a | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 802 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 803 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 804 | fi |
| 805 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 806 | # Allow SHA-1, because many of our test certificates use it |
| 807 | P_SRV="$P_SRV allow_sha1=1" |
| 808 | P_CLI="$P_CLI allow_sha1=1" |
| 809 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 810 | # Also pick a unique name for intermediate files |
| 811 | SRV_OUT="srv_out.$$" |
| 812 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 813 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 814 | SESSION="session.$$" |
| 815 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 816 | SKIP_NEXT="NO" |
| 817 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 818 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 819 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 820 | # Basic test |
| 821 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 822 | # Checks that: |
| 823 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 824 | # - the expected (highest security) parameters are selected |
| 825 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 826 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 827 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 828 | "$P_CLI" \ |
| 829 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 830 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 831 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 832 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 833 | -s "ECDHE curve: secp521r1" \ |
| 834 | -S "error" \ |
| 835 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 836 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 837 | run_test "Default, DTLS" \ |
| 838 | "$P_SRV dtls=1" \ |
| 839 | "$P_CLI dtls=1" \ |
| 840 | 0 \ |
| 841 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 842 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 843 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 844 | # Test current time in ServerHello |
| 845 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 846 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 847 | "$P_SRV debug_level=3" \ |
| 848 | "$P_CLI debug_level=3" \ |
| 849 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 850 | -f "check_server_hello_time" \ |
| 851 | -F "check_server_hello_time" |
| 852 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 853 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 854 | run_test "Unique IV in GCM" \ |
| 855 | "$P_SRV exchanges=20 debug_level=4" \ |
| 856 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 857 | 0 \ |
| 858 | -u "IV used" \ |
| 859 | -U "IV used" |
| 860 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 861 | # Tests for rc4 option |
| 862 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 863 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 864 | run_test "RC4: server disabled, client enabled" \ |
| 865 | "$P_SRV" \ |
| 866 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 867 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 868 | -s "SSL - The server has no ciphersuites in common" |
| 869 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 870 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 871 | run_test "RC4: server half, client enabled" \ |
| 872 | "$P_SRV arc4=1" \ |
| 873 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 874 | 1 \ |
| 875 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 876 | |
| 877 | run_test "RC4: server enabled, client disabled" \ |
| 878 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 879 | "$P_CLI" \ |
| 880 | 1 \ |
| 881 | -s "SSL - The server has no ciphersuites in common" |
| 882 | |
| 883 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 884 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 885 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 886 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 887 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 888 | -S "SSL - The server has no ciphersuites in common" |
| 889 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 890 | # Tests for SHA-1 support |
| 891 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 892 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 893 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 894 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 895 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 896 | 1 \ |
| 897 | -c "The certificate is signed with an unacceptable hash" |
| 898 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 899 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 900 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 901 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 902 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 903 | 0 |
| 904 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 905 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 906 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 907 | "$P_CLI allow_sha1=1" \ |
| 908 | 0 |
| 909 | |
| 910 | run_test "SHA-256 allowed by default in server certificate" \ |
| 911 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 912 | "$P_CLI allow_sha1=0" \ |
| 913 | 0 |
| 914 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 915 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 916 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 917 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 918 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 919 | 1 \ |
| 920 | -s "The certificate is signed with an unacceptable hash" |
| 921 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 922 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 923 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 924 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 925 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 926 | 0 |
| 927 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 928 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 929 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 930 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 931 | 0 |
| 932 | |
| 933 | run_test "SHA-256 allowed by default in client certificate" \ |
| 934 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 935 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 936 | 0 |
| 937 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 938 | # Tests for datagram packing |
| 939 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 940 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 941 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 942 | 0 \ |
| 943 | -c "next record in same datagram" \ |
| 944 | -s "next record in same datagram" |
| 945 | |
| 946 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 947 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 948 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 949 | 0 \ |
| 950 | -s "next record in same datagram" \ |
| 951 | -C "next record in same datagram" |
| 952 | |
| 953 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 954 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 955 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 956 | 0 \ |
| 957 | -S "next record in same datagram" \ |
| 958 | -c "next record in same datagram" |
| 959 | |
| 960 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 961 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 962 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 963 | 0 \ |
| 964 | -S "next record in same datagram" \ |
| 965 | -C "next record in same datagram" |
| 966 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 967 | # Tests for Truncated HMAC extension |
| 968 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 969 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 970 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 971 | "$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] | 972 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 973 | -s "dumping 'expected mac' (20 bytes)" \ |
| 974 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 975 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 976 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 977 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 978 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 979 | "$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] | 980 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 981 | -s "dumping 'expected mac' (20 bytes)" \ |
| 982 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 983 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 984 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 985 | run_test "Truncated HMAC: client enabled, server default" \ |
| 986 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 987 | "$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] | 988 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 989 | -s "dumping 'expected mac' (20 bytes)" \ |
| 990 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 991 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 992 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 993 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 994 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 995 | "$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] | 996 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 997 | -s "dumping 'expected mac' (20 bytes)" \ |
| 998 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 999 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1000 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1001 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1002 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1003 | "$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] | 1004 | 0 \ |
| 1005 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1006 | -S "dumping 'expected mac' (10 bytes)" |
| 1007 | |
| 1008 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1009 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1010 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1011 | "$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] | 1012 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1013 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1014 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1015 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1016 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1017 | "$P_SRV dtls=1 debug_level=4" \ |
| 1018 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1019 | 0 \ |
| 1020 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1021 | -S "dumping 'expected mac' (10 bytes)" |
| 1022 | |
| 1023 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1024 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1025 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1026 | "$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] | 1027 | 0 \ |
| 1028 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1029 | -S "dumping 'expected mac' (10 bytes)" |
| 1030 | |
| 1031 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1032 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1033 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1034 | "$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] | 1035 | 0 \ |
| 1036 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1037 | -S "dumping 'expected mac' (10 bytes)" |
| 1038 | |
| 1039 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1040 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1041 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1042 | "$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] | 1043 | 0 \ |
| 1044 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1045 | -S "dumping 'expected mac' (10 bytes)" |
| 1046 | |
| 1047 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1048 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1049 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1050 | "$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] | 1051 | 0 \ |
| 1052 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1053 | -S "dumping 'expected mac' (10 bytes)" |
| 1054 | |
| 1055 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1056 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1057 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1058 | "$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] | 1059 | 0 \ |
| 1060 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1061 | -s "dumping 'expected mac' (10 bytes)" |
| 1062 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1063 | # Tests for Encrypt-then-MAC extension |
| 1064 | |
| 1065 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1066 | "$P_SRV debug_level=3 \ |
| 1067 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1068 | "$P_CLI debug_level=3" \ |
| 1069 | 0 \ |
| 1070 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1071 | -s "found encrypt then mac extension" \ |
| 1072 | -s "server hello, adding encrypt then mac extension" \ |
| 1073 | -c "found encrypt_then_mac extension" \ |
| 1074 | -c "using encrypt then mac" \ |
| 1075 | -s "using encrypt then mac" |
| 1076 | |
| 1077 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1078 | "$P_SRV debug_level=3 etm=0 \ |
| 1079 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1080 | "$P_CLI debug_level=3 etm=1" \ |
| 1081 | 0 \ |
| 1082 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1083 | -s "found encrypt then mac extension" \ |
| 1084 | -S "server hello, adding encrypt then mac extension" \ |
| 1085 | -C "found encrypt_then_mac extension" \ |
| 1086 | -C "using encrypt then mac" \ |
| 1087 | -S "using encrypt then mac" |
| 1088 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1089 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1090 | "$P_SRV debug_level=3 etm=1 \ |
| 1091 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1092 | "$P_CLI debug_level=3 etm=1" \ |
| 1093 | 0 \ |
| 1094 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1095 | -s "found encrypt then mac extension" \ |
| 1096 | -S "server hello, adding encrypt then mac extension" \ |
| 1097 | -C "found encrypt_then_mac extension" \ |
| 1098 | -C "using encrypt then mac" \ |
| 1099 | -S "using encrypt then mac" |
| 1100 | |
| 1101 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1102 | "$P_SRV debug_level=3 etm=1 \ |
| 1103 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1104 | "$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] | 1105 | 0 \ |
| 1106 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1107 | -s "found encrypt then mac extension" \ |
| 1108 | -S "server hello, adding encrypt then mac extension" \ |
| 1109 | -C "found encrypt_then_mac extension" \ |
| 1110 | -C "using encrypt then mac" \ |
| 1111 | -S "using encrypt then mac" |
| 1112 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1113 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1114 | "$P_SRV debug_level=3 etm=1 \ |
| 1115 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1116 | "$P_CLI debug_level=3 etm=0" \ |
| 1117 | 0 \ |
| 1118 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1119 | -S "found encrypt then mac extension" \ |
| 1120 | -S "server hello, adding encrypt then mac extension" \ |
| 1121 | -C "found encrypt_then_mac extension" \ |
| 1122 | -C "using encrypt then mac" \ |
| 1123 | -S "using encrypt then mac" |
| 1124 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1125 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1126 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1127 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1128 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1129 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1130 | 0 \ |
| 1131 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1132 | -S "found encrypt then mac extension" \ |
| 1133 | -S "server hello, adding encrypt then mac extension" \ |
| 1134 | -C "found encrypt_then_mac extension" \ |
| 1135 | -C "using encrypt then mac" \ |
| 1136 | -S "using encrypt then mac" |
| 1137 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1138 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1139 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1140 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1141 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1142 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1143 | 0 \ |
| 1144 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1145 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1146 | -S "server hello, adding encrypt then mac extension" \ |
| 1147 | -C "found encrypt_then_mac extension" \ |
| 1148 | -C "using encrypt then mac" \ |
| 1149 | -S "using encrypt then mac" |
| 1150 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1151 | # Tests for Extended Master Secret extension |
| 1152 | |
| 1153 | run_test "Extended Master Secret: default" \ |
| 1154 | "$P_SRV debug_level=3" \ |
| 1155 | "$P_CLI debug_level=3" \ |
| 1156 | 0 \ |
| 1157 | -c "client hello, adding extended_master_secret extension" \ |
| 1158 | -s "found extended master secret extension" \ |
| 1159 | -s "server hello, adding extended master secret extension" \ |
| 1160 | -c "found extended_master_secret extension" \ |
| 1161 | -c "using extended master secret" \ |
| 1162 | -s "using extended master secret" |
| 1163 | |
| 1164 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1165 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1166 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1167 | 0 \ |
| 1168 | -c "client hello, adding extended_master_secret extension" \ |
| 1169 | -s "found extended master secret extension" \ |
| 1170 | -S "server hello, adding extended master secret extension" \ |
| 1171 | -C "found extended_master_secret extension" \ |
| 1172 | -C "using extended master secret" \ |
| 1173 | -S "using extended master secret" |
| 1174 | |
| 1175 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1176 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1177 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1178 | 0 \ |
| 1179 | -C "client hello, adding extended_master_secret extension" \ |
| 1180 | -S "found extended master secret extension" \ |
| 1181 | -S "server hello, adding extended master secret extension" \ |
| 1182 | -C "found extended_master_secret extension" \ |
| 1183 | -C "using extended master secret" \ |
| 1184 | -S "using extended master secret" |
| 1185 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1186 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1187 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1188 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1189 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1190 | 0 \ |
| 1191 | -C "client hello, adding extended_master_secret extension" \ |
| 1192 | -S "found extended master secret extension" \ |
| 1193 | -S "server hello, adding extended master secret extension" \ |
| 1194 | -C "found extended_master_secret extension" \ |
| 1195 | -C "using extended master secret" \ |
| 1196 | -S "using extended master secret" |
| 1197 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1198 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1199 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1200 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1201 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1202 | 0 \ |
| 1203 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1204 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1205 | -S "server hello, adding extended master secret extension" \ |
| 1206 | -C "found extended_master_secret extension" \ |
| 1207 | -C "using extended master secret" \ |
| 1208 | -S "using extended master secret" |
| 1209 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1210 | # Tests for FALLBACK_SCSV |
| 1211 | |
| 1212 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1213 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1214 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1215 | 0 \ |
| 1216 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1217 | -S "received FALLBACK_SCSV" \ |
| 1218 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1219 | -C "is a fatal alert message (msg 86)" |
| 1220 | |
| 1221 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1222 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1223 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1224 | 0 \ |
| 1225 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1226 | -S "received FALLBACK_SCSV" \ |
| 1227 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1228 | -C "is a fatal alert message (msg 86)" |
| 1229 | |
| 1230 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1231 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1232 | "$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] | 1233 | 1 \ |
| 1234 | -c "adding FALLBACK_SCSV" \ |
| 1235 | -s "received FALLBACK_SCSV" \ |
| 1236 | -s "inapropriate fallback" \ |
| 1237 | -c "is a fatal alert message (msg 86)" |
| 1238 | |
| 1239 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1240 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1241 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1242 | 0 \ |
| 1243 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1244 | -s "received FALLBACK_SCSV" \ |
| 1245 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1246 | -C "is a fatal alert message (msg 86)" |
| 1247 | |
| 1248 | requires_openssl_with_fallback_scsv |
| 1249 | run_test "Fallback SCSV: default, openssl server" \ |
| 1250 | "$O_SRV" \ |
| 1251 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1252 | 0 \ |
| 1253 | -C "adding FALLBACK_SCSV" \ |
| 1254 | -C "is a fatal alert message (msg 86)" |
| 1255 | |
| 1256 | requires_openssl_with_fallback_scsv |
| 1257 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1258 | "$O_SRV" \ |
| 1259 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1260 | 1 \ |
| 1261 | -c "adding FALLBACK_SCSV" \ |
| 1262 | -c "is a fatal alert message (msg 86)" |
| 1263 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1264 | requires_openssl_with_fallback_scsv |
| 1265 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1266 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1267 | "$O_CLI -tls1_1" \ |
| 1268 | 0 \ |
| 1269 | -S "received FALLBACK_SCSV" \ |
| 1270 | -S "inapropriate fallback" |
| 1271 | |
| 1272 | requires_openssl_with_fallback_scsv |
| 1273 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1274 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1275 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1276 | 1 \ |
| 1277 | -s "received FALLBACK_SCSV" \ |
| 1278 | -s "inapropriate fallback" |
| 1279 | |
| 1280 | requires_openssl_with_fallback_scsv |
| 1281 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1282 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1283 | "$O_CLI -fallback_scsv" \ |
| 1284 | 0 \ |
| 1285 | -s "received FALLBACK_SCSV" \ |
| 1286 | -S "inapropriate fallback" |
| 1287 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1288 | # Test sending and receiving empty application data records |
| 1289 | |
| 1290 | run_test "Encrypt then MAC: empty application data record" \ |
| 1291 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1292 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1293 | 0 \ |
| 1294 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1295 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1296 | -c "0 bytes written in 1 fragments" |
| 1297 | |
| 1298 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 1299 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1300 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1301 | 0 \ |
| 1302 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1303 | -c "0 bytes written in 1 fragments" |
| 1304 | |
| 1305 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1306 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1307 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1308 | 0 \ |
| 1309 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1310 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1311 | -c "0 bytes written in 1 fragments" |
| 1312 | |
| 1313 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 1314 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1315 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1316 | 0 \ |
| 1317 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1318 | -c "0 bytes written in 1 fragments" |
| 1319 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1320 | ## ClientHello generated with |
| 1321 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1322 | ## then manually twiddling the ciphersuite list. |
| 1323 | ## The ClientHello content is spelled out below as a hex string as |
| 1324 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1325 | ## The expected response is an inappropriate_fallback alert. |
| 1326 | requires_openssl_with_fallback_scsv |
| 1327 | run_test "Fallback SCSV: beginning of list" \ |
| 1328 | "$P_SRV debug_level=2" \ |
| 1329 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1330 | 0 \ |
| 1331 | -s "received FALLBACK_SCSV" \ |
| 1332 | -s "inapropriate fallback" |
| 1333 | |
| 1334 | requires_openssl_with_fallback_scsv |
| 1335 | run_test "Fallback SCSV: end of list" \ |
| 1336 | "$P_SRV debug_level=2" \ |
| 1337 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1338 | 0 \ |
| 1339 | -s "received FALLBACK_SCSV" \ |
| 1340 | -s "inapropriate fallback" |
| 1341 | |
| 1342 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1343 | requires_openssl_with_fallback_scsv |
| 1344 | run_test "Fallback SCSV: not in list" \ |
| 1345 | "$P_SRV debug_level=2" \ |
| 1346 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1347 | 0 \ |
| 1348 | -S "received FALLBACK_SCSV" \ |
| 1349 | -S "inapropriate fallback" |
| 1350 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1351 | # Tests for CBC 1/n-1 record splitting |
| 1352 | |
| 1353 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1354 | "$P_SRV" \ |
| 1355 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1356 | request_size=123 force_version=tls1_2" \ |
| 1357 | 0 \ |
| 1358 | -s "Read from client: 123 bytes read" \ |
| 1359 | -S "Read from client: 1 bytes read" \ |
| 1360 | -S "122 bytes read" |
| 1361 | |
| 1362 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1363 | "$P_SRV" \ |
| 1364 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1365 | request_size=123 force_version=tls1_1" \ |
| 1366 | 0 \ |
| 1367 | -s "Read from client: 123 bytes read" \ |
| 1368 | -S "Read from client: 1 bytes read" \ |
| 1369 | -S "122 bytes read" |
| 1370 | |
| 1371 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1372 | "$P_SRV" \ |
| 1373 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1374 | request_size=123 force_version=tls1" \ |
| 1375 | 0 \ |
| 1376 | -S "Read from client: 123 bytes read" \ |
| 1377 | -s "Read from client: 1 bytes read" \ |
| 1378 | -s "122 bytes read" |
| 1379 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1380 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1381 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1382 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1383 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1384 | request_size=123 force_version=ssl3" \ |
| 1385 | 0 \ |
| 1386 | -S "Read from client: 123 bytes read" \ |
| 1387 | -s "Read from client: 1 bytes read" \ |
| 1388 | -s "122 bytes read" |
| 1389 | |
| 1390 | 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] | 1391 | "$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] | 1392 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1393 | request_size=123 force_version=tls1" \ |
| 1394 | 0 \ |
| 1395 | -s "Read from client: 123 bytes read" \ |
| 1396 | -S "Read from client: 1 bytes read" \ |
| 1397 | -S "122 bytes read" |
| 1398 | |
| 1399 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1400 | "$P_SRV" \ |
| 1401 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1402 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1403 | 0 \ |
| 1404 | -s "Read from client: 123 bytes read" \ |
| 1405 | -S "Read from client: 1 bytes read" \ |
| 1406 | -S "122 bytes read" |
| 1407 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1408 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1409 | "$P_SRV nbio=2" \ |
| 1410 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1411 | request_size=123 force_version=tls1" \ |
| 1412 | 0 \ |
| 1413 | -S "Read from client: 123 bytes read" \ |
| 1414 | -s "Read from client: 1 bytes read" \ |
| 1415 | -s "122 bytes read" |
| 1416 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1417 | # Tests for Session Tickets |
| 1418 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1419 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1420 | "$P_SRV debug_level=3 tickets=1" \ |
| 1421 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1422 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1423 | -c "client hello, adding session ticket extension" \ |
| 1424 | -s "found session ticket extension" \ |
| 1425 | -s "server hello, adding session ticket extension" \ |
| 1426 | -c "found session_ticket extension" \ |
| 1427 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1428 | -S "session successfully restored from cache" \ |
| 1429 | -s "session successfully restored from ticket" \ |
| 1430 | -s "a session has been resumed" \ |
| 1431 | -c "a session has been resumed" |
| 1432 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1433 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1434 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1435 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1436 | 0 \ |
| 1437 | -c "client hello, adding session ticket extension" \ |
| 1438 | -s "found session ticket extension" \ |
| 1439 | -s "server hello, adding session ticket extension" \ |
| 1440 | -c "found session_ticket extension" \ |
| 1441 | -c "parse new session ticket" \ |
| 1442 | -S "session successfully restored from cache" \ |
| 1443 | -s "session successfully restored from ticket" \ |
| 1444 | -s "a session has been resumed" \ |
| 1445 | -c "a session has been resumed" |
| 1446 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1447 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1448 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1449 | "$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] | 1450 | 0 \ |
| 1451 | -c "client hello, adding session ticket extension" \ |
| 1452 | -s "found session ticket extension" \ |
| 1453 | -s "server hello, adding session ticket extension" \ |
| 1454 | -c "found session_ticket extension" \ |
| 1455 | -c "parse new session ticket" \ |
| 1456 | -S "session successfully restored from cache" \ |
| 1457 | -S "session successfully restored from ticket" \ |
| 1458 | -S "a session has been resumed" \ |
| 1459 | -C "a session has been resumed" |
| 1460 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1461 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1462 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1463 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1464 | 0 \ |
| 1465 | -c "client hello, adding session ticket extension" \ |
| 1466 | -c "found session_ticket extension" \ |
| 1467 | -c "parse new session ticket" \ |
| 1468 | -c "a session has been resumed" |
| 1469 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1470 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1471 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1472 | "( $O_CLI -sess_out $SESSION; \ |
| 1473 | $O_CLI -sess_in $SESSION; \ |
| 1474 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1475 | 0 \ |
| 1476 | -s "found session ticket extension" \ |
| 1477 | -s "server hello, adding session ticket extension" \ |
| 1478 | -S "session successfully restored from cache" \ |
| 1479 | -s "session successfully restored from ticket" \ |
| 1480 | -s "a session has been resumed" |
| 1481 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1482 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1483 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1484 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1485 | "$P_SRV debug_level=3 tickets=0" \ |
| 1486 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1487 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1488 | -c "client hello, adding session ticket extension" \ |
| 1489 | -s "found session ticket extension" \ |
| 1490 | -S "server hello, adding session ticket extension" \ |
| 1491 | -C "found session_ticket extension" \ |
| 1492 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1493 | -s "session successfully restored from cache" \ |
| 1494 | -S "session successfully restored from ticket" \ |
| 1495 | -s "a session has been resumed" \ |
| 1496 | -c "a session has been resumed" |
| 1497 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1498 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1499 | "$P_SRV debug_level=3 tickets=1" \ |
| 1500 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1501 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1502 | -C "client hello, adding session ticket extension" \ |
| 1503 | -S "found session ticket extension" \ |
| 1504 | -S "server hello, adding session ticket extension" \ |
| 1505 | -C "found session_ticket extension" \ |
| 1506 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1507 | -s "session successfully restored from cache" \ |
| 1508 | -S "session successfully restored from ticket" \ |
| 1509 | -s "a session has been resumed" \ |
| 1510 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1511 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1512 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1513 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1514 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1515 | 0 \ |
| 1516 | -S "session successfully restored from cache" \ |
| 1517 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1518 | -S "a session has been resumed" \ |
| 1519 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1520 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1521 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1522 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1523 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1524 | 0 \ |
| 1525 | -s "session successfully restored from cache" \ |
| 1526 | -S "session successfully restored from ticket" \ |
| 1527 | -s "a session has been resumed" \ |
| 1528 | -c "a session has been resumed" |
| 1529 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1530 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1531 | "$P_SRV debug_level=3 tickets=0" \ |
| 1532 | "$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] | 1533 | 0 \ |
| 1534 | -s "session successfully restored from cache" \ |
| 1535 | -S "session successfully restored from ticket" \ |
| 1536 | -s "a session has been resumed" \ |
| 1537 | -c "a session has been resumed" |
| 1538 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1539 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1540 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1541 | "$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] | 1542 | 0 \ |
| 1543 | -S "session successfully restored from cache" \ |
| 1544 | -S "session successfully restored from ticket" \ |
| 1545 | -S "a session has been resumed" \ |
| 1546 | -C "a session has been resumed" |
| 1547 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1548 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1549 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1550 | "$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] | 1551 | 0 \ |
| 1552 | -s "session successfully restored from cache" \ |
| 1553 | -S "session successfully restored from ticket" \ |
| 1554 | -s "a session has been resumed" \ |
| 1555 | -c "a session has been resumed" |
| 1556 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1557 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1558 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1559 | "( $O_CLI -sess_out $SESSION; \ |
| 1560 | $O_CLI -sess_in $SESSION; \ |
| 1561 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1562 | 0 \ |
| 1563 | -s "found session ticket extension" \ |
| 1564 | -S "server hello, adding session ticket extension" \ |
| 1565 | -s "session successfully restored from cache" \ |
| 1566 | -S "session successfully restored from ticket" \ |
| 1567 | -s "a session has been resumed" |
| 1568 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1569 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1570 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1571 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1572 | 0 \ |
| 1573 | -C "found session_ticket extension" \ |
| 1574 | -C "parse new session ticket" \ |
| 1575 | -c "a session has been resumed" |
| 1576 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1577 | # Tests for Max Fragment Length extension |
| 1578 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1579 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 1580 | 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] | 1581 | exit 1 |
| 1582 | fi |
| 1583 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1584 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 1585 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 1586 | fi |
| 1587 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1588 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1589 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1590 | "$P_SRV debug_level=3" \ |
| 1591 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1592 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1593 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1594 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1595 | -C "client hello, adding max_fragment_length extension" \ |
| 1596 | -S "found max fragment length extension" \ |
| 1597 | -S "server hello, max_fragment_length extension" \ |
| 1598 | -C "found max_fragment_length extension" |
| 1599 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1600 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1601 | run_test "Max fragment length: enabled, default, larger message" \ |
| 1602 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1603 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1604 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1605 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1606 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1607 | -C "client hello, adding max_fragment_length extension" \ |
| 1608 | -S "found max fragment length extension" \ |
| 1609 | -S "server hello, max_fragment_length extension" \ |
| 1610 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1611 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1612 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1613 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1614 | |
| 1615 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1616 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 1617 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1618 | "$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] | 1619 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1620 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1621 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1622 | -C "client hello, adding max_fragment_length extension" \ |
| 1623 | -S "found max fragment length extension" \ |
| 1624 | -S "server hello, max_fragment_length extension" \ |
| 1625 | -C "found max_fragment_length extension" \ |
| 1626 | -c "fragment larger than.*maximum " |
| 1627 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1628 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 1629 | # (session fragment length will be 16384 regardless of mbedtls |
| 1630 | # content length configuration.) |
| 1631 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1632 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1633 | run_test "Max fragment length: disabled, larger message" \ |
| 1634 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1635 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1636 | 0 \ |
| 1637 | -C "Maximum fragment length is 16384" \ |
| 1638 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1639 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1640 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1641 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1642 | |
| 1643 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1644 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 1645 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1646 | "$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] | 1647 | 1 \ |
| 1648 | -C "Maximum fragment length is 16384" \ |
| 1649 | -S "Maximum fragment length is 16384" \ |
| 1650 | -c "fragment larger than.*maximum " |
| 1651 | |
| 1652 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1653 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1654 | "$P_SRV debug_level=3" \ |
| 1655 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1656 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1657 | -c "Maximum fragment length is 4096" \ |
| 1658 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1659 | -c "client hello, adding max_fragment_length extension" \ |
| 1660 | -s "found max fragment length extension" \ |
| 1661 | -s "server hello, max_fragment_length extension" \ |
| 1662 | -c "found max_fragment_length extension" |
| 1663 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1664 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1665 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1666 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1667 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1668 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1669 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1670 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1671 | -C "client hello, adding max_fragment_length extension" \ |
| 1672 | -S "found max fragment length extension" \ |
| 1673 | -S "server hello, max_fragment_length extension" \ |
| 1674 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1675 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1676 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1677 | requires_gnutls |
| 1678 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1679 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1680 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1681 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1682 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1683 | -c "client hello, adding max_fragment_length extension" \ |
| 1684 | -c "found max_fragment_length extension" |
| 1685 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1686 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1687 | run_test "Max fragment length: client, message just fits" \ |
| 1688 | "$P_SRV debug_level=3" \ |
| 1689 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1690 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1691 | -c "Maximum fragment length is 2048" \ |
| 1692 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1693 | -c "client hello, adding max_fragment_length extension" \ |
| 1694 | -s "found max fragment length extension" \ |
| 1695 | -s "server hello, max_fragment_length extension" \ |
| 1696 | -c "found max_fragment_length extension" \ |
| 1697 | -c "2048 bytes written in 1 fragments" \ |
| 1698 | -s "2048 bytes read" |
| 1699 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1700 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1701 | run_test "Max fragment length: client, larger message" \ |
| 1702 | "$P_SRV debug_level=3" \ |
| 1703 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1704 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1705 | -c "Maximum fragment length is 2048" \ |
| 1706 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1707 | -c "client hello, adding max_fragment_length extension" \ |
| 1708 | -s "found max fragment length extension" \ |
| 1709 | -s "server hello, max_fragment_length extension" \ |
| 1710 | -c "found max_fragment_length extension" \ |
| 1711 | -c "2345 bytes written in 2 fragments" \ |
| 1712 | -s "2048 bytes read" \ |
| 1713 | -s "297 bytes read" |
| 1714 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1715 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1716 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1717 | "$P_SRV debug_level=3 dtls=1" \ |
| 1718 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1719 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1720 | -c "Maximum fragment length is 2048" \ |
| 1721 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1722 | -c "client hello, adding max_fragment_length extension" \ |
| 1723 | -s "found max fragment length extension" \ |
| 1724 | -s "server hello, max_fragment_length extension" \ |
| 1725 | -c "found max_fragment_length extension" \ |
| 1726 | -c "fragment larger than.*maximum" |
| 1727 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1728 | # Tests for renegotiation |
| 1729 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1730 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1731 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1732 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1733 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1734 | 0 \ |
| 1735 | -C "client hello, adding renegotiation extension" \ |
| 1736 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1737 | -S "found renegotiation extension" \ |
| 1738 | -s "server hello, secure renegotiation extension" \ |
| 1739 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1740 | -C "=> renegotiate" \ |
| 1741 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1742 | -S "write hello request" |
| 1743 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1744 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1745 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1746 | "$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] | 1747 | "$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] | 1748 | 0 \ |
| 1749 | -c "client hello, adding renegotiation extension" \ |
| 1750 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1751 | -s "found renegotiation extension" \ |
| 1752 | -s "server hello, secure renegotiation extension" \ |
| 1753 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1754 | -c "=> renegotiate" \ |
| 1755 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1756 | -S "write hello request" |
| 1757 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1758 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1759 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1760 | "$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] | 1761 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1762 | 0 \ |
| 1763 | -c "client hello, adding renegotiation extension" \ |
| 1764 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1765 | -s "found renegotiation extension" \ |
| 1766 | -s "server hello, secure renegotiation extension" \ |
| 1767 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1768 | -c "=> renegotiate" \ |
| 1769 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1770 | -s "write hello request" |
| 1771 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1772 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1773 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1774 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1775 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1776 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 1777 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 1778 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1779 | 0 \ |
| 1780 | -c "client hello, adding renegotiation extension" \ |
| 1781 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1782 | -s "found renegotiation extension" \ |
| 1783 | -s "server hello, secure renegotiation extension" \ |
| 1784 | -c "found renegotiation extension" \ |
| 1785 | -c "=> renegotiate" \ |
| 1786 | -s "=> renegotiate" \ |
| 1787 | -S "write hello request" \ |
| 1788 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1789 | |
| 1790 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1791 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1792 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1793 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1794 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 1795 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 1796 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1797 | 0 \ |
| 1798 | -c "client hello, adding renegotiation extension" \ |
| 1799 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1800 | -s "found renegotiation extension" \ |
| 1801 | -s "server hello, secure renegotiation extension" \ |
| 1802 | -c "found renegotiation extension" \ |
| 1803 | -c "=> renegotiate" \ |
| 1804 | -s "=> renegotiate" \ |
| 1805 | -s "write hello request" \ |
| 1806 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1807 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1808 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1809 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1810 | "$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] | 1811 | "$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] | 1812 | 0 \ |
| 1813 | -c "client hello, adding renegotiation extension" \ |
| 1814 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1815 | -s "found renegotiation extension" \ |
| 1816 | -s "server hello, secure renegotiation extension" \ |
| 1817 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1818 | -c "=> renegotiate" \ |
| 1819 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1820 | -s "write hello request" |
| 1821 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1822 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1823 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1824 | "$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] | 1825 | "$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] | 1826 | 1 \ |
| 1827 | -c "client hello, adding renegotiation extension" \ |
| 1828 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1829 | -S "found renegotiation extension" \ |
| 1830 | -s "server hello, secure renegotiation extension" \ |
| 1831 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1832 | -c "=> renegotiate" \ |
| 1833 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1834 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1835 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1836 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1837 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1838 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1839 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1840 | "$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] | 1841 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1842 | 0 \ |
| 1843 | -C "client hello, adding renegotiation extension" \ |
| 1844 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1845 | -S "found renegotiation extension" \ |
| 1846 | -s "server hello, secure renegotiation extension" \ |
| 1847 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1848 | -C "=> renegotiate" \ |
| 1849 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1850 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1851 | -S "SSL - An unexpected message was received from our peer" \ |
| 1852 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1853 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1854 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1855 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1856 | "$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] | 1857 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1858 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1859 | 0 \ |
| 1860 | -C "client hello, adding renegotiation extension" \ |
| 1861 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1862 | -S "found renegotiation extension" \ |
| 1863 | -s "server hello, secure renegotiation extension" \ |
| 1864 | -c "found renegotiation extension" \ |
| 1865 | -C "=> renegotiate" \ |
| 1866 | -S "=> renegotiate" \ |
| 1867 | -s "write hello request" \ |
| 1868 | -S "SSL - An unexpected message was received from our peer" \ |
| 1869 | -S "failed" |
| 1870 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1871 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1872 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1873 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1874 | "$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] | 1875 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1876 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1877 | 0 \ |
| 1878 | -C "client hello, adding renegotiation extension" \ |
| 1879 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1880 | -S "found renegotiation extension" \ |
| 1881 | -s "server hello, secure renegotiation extension" \ |
| 1882 | -c "found renegotiation extension" \ |
| 1883 | -C "=> renegotiate" \ |
| 1884 | -S "=> renegotiate" \ |
| 1885 | -s "write hello request" \ |
| 1886 | -S "SSL - An unexpected message was received from our peer" \ |
| 1887 | -S "failed" |
| 1888 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1889 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1890 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1891 | "$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] | 1892 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1893 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1894 | 0 \ |
| 1895 | -C "client hello, adding renegotiation extension" \ |
| 1896 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1897 | -S "found renegotiation extension" \ |
| 1898 | -s "server hello, secure renegotiation extension" \ |
| 1899 | -c "found renegotiation extension" \ |
| 1900 | -C "=> renegotiate" \ |
| 1901 | -S "=> renegotiate" \ |
| 1902 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1903 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1904 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1905 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1906 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1907 | "$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] | 1908 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1909 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1910 | 0 \ |
| 1911 | -c "client hello, adding renegotiation extension" \ |
| 1912 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1913 | -s "found renegotiation extension" \ |
| 1914 | -s "server hello, secure renegotiation extension" \ |
| 1915 | -c "found renegotiation extension" \ |
| 1916 | -c "=> renegotiate" \ |
| 1917 | -s "=> renegotiate" \ |
| 1918 | -s "write hello request" \ |
| 1919 | -S "SSL - An unexpected message was received from our peer" \ |
| 1920 | -S "failed" |
| 1921 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1922 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1923 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1924 | "$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] | 1925 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1926 | 0 \ |
| 1927 | -C "client hello, adding renegotiation extension" \ |
| 1928 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1929 | -S "found renegotiation extension" \ |
| 1930 | -s "server hello, secure renegotiation extension" \ |
| 1931 | -c "found renegotiation extension" \ |
| 1932 | -S "record counter limit reached: renegotiate" \ |
| 1933 | -C "=> renegotiate" \ |
| 1934 | -S "=> renegotiate" \ |
| 1935 | -S "write hello request" \ |
| 1936 | -S "SSL - An unexpected message was received from our peer" \ |
| 1937 | -S "failed" |
| 1938 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1939 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1940 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1941 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1942 | "$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] | 1943 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1944 | 0 \ |
| 1945 | -c "client hello, adding renegotiation extension" \ |
| 1946 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1947 | -s "found renegotiation extension" \ |
| 1948 | -s "server hello, secure renegotiation extension" \ |
| 1949 | -c "found renegotiation extension" \ |
| 1950 | -s "record counter limit reached: renegotiate" \ |
| 1951 | -c "=> renegotiate" \ |
| 1952 | -s "=> renegotiate" \ |
| 1953 | -s "write hello request" \ |
| 1954 | -S "SSL - An unexpected message was received from our peer" \ |
| 1955 | -S "failed" |
| 1956 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1958 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1959 | "$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] | 1960 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1961 | 0 \ |
| 1962 | -c "client hello, adding renegotiation extension" \ |
| 1963 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1964 | -s "found renegotiation extension" \ |
| 1965 | -s "server hello, secure renegotiation extension" \ |
| 1966 | -c "found renegotiation extension" \ |
| 1967 | -s "record counter limit reached: renegotiate" \ |
| 1968 | -c "=> renegotiate" \ |
| 1969 | -s "=> renegotiate" \ |
| 1970 | -s "write hello request" \ |
| 1971 | -S "SSL - An unexpected message was received from our peer" \ |
| 1972 | -S "failed" |
| 1973 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1974 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1975 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1976 | "$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] | 1977 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1978 | 0 \ |
| 1979 | -C "client hello, adding renegotiation extension" \ |
| 1980 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1981 | -S "found renegotiation extension" \ |
| 1982 | -s "server hello, secure renegotiation extension" \ |
| 1983 | -c "found renegotiation extension" \ |
| 1984 | -S "record counter limit reached: renegotiate" \ |
| 1985 | -C "=> renegotiate" \ |
| 1986 | -S "=> renegotiate" \ |
| 1987 | -S "write hello request" \ |
| 1988 | -S "SSL - An unexpected message was received from our peer" \ |
| 1989 | -S "failed" |
| 1990 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1991 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1992 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1993 | "$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] | 1994 | "$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] | 1995 | 0 \ |
| 1996 | -c "client hello, adding renegotiation extension" \ |
| 1997 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1998 | -s "found renegotiation extension" \ |
| 1999 | -s "server hello, secure renegotiation extension" \ |
| 2000 | -c "found renegotiation extension" \ |
| 2001 | -c "=> renegotiate" \ |
| 2002 | -s "=> renegotiate" \ |
| 2003 | -S "write hello request" |
| 2004 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2005 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2006 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2007 | "$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] | 2008 | "$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] | 2009 | 0 \ |
| 2010 | -c "client hello, adding renegotiation extension" \ |
| 2011 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2012 | -s "found renegotiation extension" \ |
| 2013 | -s "server hello, secure renegotiation extension" \ |
| 2014 | -c "found renegotiation extension" \ |
| 2015 | -c "=> renegotiate" \ |
| 2016 | -s "=> renegotiate" \ |
| 2017 | -s "write hello request" |
| 2018 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2019 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2020 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2021 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2022 | "$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] | 2023 | 0 \ |
| 2024 | -c "client hello, adding renegotiation extension" \ |
| 2025 | -c "found renegotiation extension" \ |
| 2026 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2027 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2028 | -C "error" \ |
| 2029 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2030 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2031 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2032 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2033 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2034 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2035 | "$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] | 2036 | 0 \ |
| 2037 | -c "client hello, adding renegotiation extension" \ |
| 2038 | -c "found renegotiation extension" \ |
| 2039 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2040 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2041 | -C "error" \ |
| 2042 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2043 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2044 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2045 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2046 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2047 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2048 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2049 | 1 \ |
| 2050 | -c "client hello, adding renegotiation extension" \ |
| 2051 | -C "found renegotiation extension" \ |
| 2052 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2053 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2054 | -c "error" \ |
| 2055 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2056 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2057 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2058 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2059 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2060 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2061 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2062 | allow_legacy=0" \ |
| 2063 | 1 \ |
| 2064 | -c "client hello, adding renegotiation extension" \ |
| 2065 | -C "found renegotiation extension" \ |
| 2066 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2067 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2068 | -c "error" \ |
| 2069 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2070 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2071 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2072 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2073 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 2074 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2075 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2076 | allow_legacy=1" \ |
| 2077 | 0 \ |
| 2078 | -c "client hello, adding renegotiation extension" \ |
| 2079 | -C "found renegotiation extension" \ |
| 2080 | -c "=> renegotiate" \ |
| 2081 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2082 | -C "error" \ |
| 2083 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2084 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2085 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2086 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2087 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2088 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2089 | 0 \ |
| 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" \ |
| 2095 | -c "=> renegotiate" \ |
| 2096 | -s "=> renegotiate" \ |
| 2097 | -S "write hello request" |
| 2098 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2099 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2100 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2101 | "$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] | 2102 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2103 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2104 | 0 \ |
| 2105 | -c "client hello, adding renegotiation extension" \ |
| 2106 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2107 | -s "found renegotiation extension" \ |
| 2108 | -s "server hello, secure renegotiation extension" \ |
| 2109 | -c "found renegotiation extension" \ |
| 2110 | -c "=> renegotiate" \ |
| 2111 | -s "=> renegotiate" \ |
| 2112 | -s "write hello request" |
| 2113 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2114 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2115 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2116 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2117 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2118 | 0 \ |
| 2119 | -c "client hello, adding renegotiation extension" \ |
| 2120 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2121 | -s "found renegotiation extension" \ |
| 2122 | -s "server hello, secure renegotiation extension" \ |
| 2123 | -s "record counter limit reached: renegotiate" \ |
| 2124 | -c "=> renegotiate" \ |
| 2125 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2126 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2127 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2128 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2129 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2130 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2131 | "$G_SRV -u --mtu 4096" \ |
| 2132 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2133 | 0 \ |
| 2134 | -c "client hello, adding renegotiation extension" \ |
| 2135 | -c "found renegotiation extension" \ |
| 2136 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2137 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2138 | -C "error" \ |
| 2139 | -s "Extra-header:" |
| 2140 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2141 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2142 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2143 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2144 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2145 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2146 | "$P_CLI debug_level=3" \ |
| 2147 | 0 \ |
| 2148 | -c "found renegotiation extension" \ |
| 2149 | -C "error" \ |
| 2150 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2151 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2152 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2153 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2154 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2155 | "$P_CLI debug_level=3" \ |
| 2156 | 0 \ |
| 2157 | -C "found renegotiation extension" \ |
| 2158 | -C "error" \ |
| 2159 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2160 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2161 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2162 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2163 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2164 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2165 | 1 \ |
| 2166 | -C "found renegotiation extension" \ |
| 2167 | -c "error" \ |
| 2168 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2169 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2170 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2171 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2172 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2173 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2174 | 0 \ |
| 2175 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2176 | -s "server hello, secure renegotiation extension" |
| 2177 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2178 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2179 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2180 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2181 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2182 | 0 \ |
| 2183 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2184 | -S "server hello, secure renegotiation extension" |
| 2185 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2186 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2187 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2188 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2189 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2190 | 1 \ |
| 2191 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2192 | -S "server hello, secure renegotiation extension" |
| 2193 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2194 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2195 | |
| 2196 | requires_gnutls |
| 2197 | run_test "DER format: no trailing bytes" \ |
| 2198 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2199 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2200 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2201 | 0 \ |
| 2202 | -c "Handshake was completed" \ |
| 2203 | |
| 2204 | requires_gnutls |
| 2205 | run_test "DER format: with a trailing zero byte" \ |
| 2206 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2207 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2208 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2209 | 0 \ |
| 2210 | -c "Handshake was completed" \ |
| 2211 | |
| 2212 | requires_gnutls |
| 2213 | run_test "DER format: with a trailing random byte" \ |
| 2214 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2215 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2216 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2217 | 0 \ |
| 2218 | -c "Handshake was completed" \ |
| 2219 | |
| 2220 | requires_gnutls |
| 2221 | run_test "DER format: with 2 trailing random bytes" \ |
| 2222 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2223 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2224 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2225 | 0 \ |
| 2226 | -c "Handshake was completed" \ |
| 2227 | |
| 2228 | requires_gnutls |
| 2229 | run_test "DER format: with 4 trailing random bytes" \ |
| 2230 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2231 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2232 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2233 | 0 \ |
| 2234 | -c "Handshake was completed" \ |
| 2235 | |
| 2236 | requires_gnutls |
| 2237 | run_test "DER format: with 8 trailing random bytes" \ |
| 2238 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2239 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2240 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2241 | 0 \ |
| 2242 | -c "Handshake was completed" \ |
| 2243 | |
| 2244 | requires_gnutls |
| 2245 | run_test "DER format: with 9 trailing random bytes" \ |
| 2246 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2247 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2248 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2249 | 0 \ |
| 2250 | -c "Handshake was completed" \ |
| 2251 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2252 | # Tests for auth_mode |
| 2253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2254 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2255 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2256 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2257 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2258 | 1 \ |
| 2259 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2260 | -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] | 2261 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2262 | -c "X509 - Certificate verification failed" |
| 2263 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2264 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2265 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2266 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2267 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2268 | 0 \ |
| 2269 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2270 | -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] | 2271 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2272 | -C "X509 - Certificate verification failed" |
| 2273 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2274 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2275 | "$P_SRV" \ |
| 2276 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2277 | 0 \ |
| 2278 | -c "x509_verify_cert() returned" \ |
| 2279 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2280 | -c "! Certificate verification flags"\ |
| 2281 | -C "! mbedtls_ssl_handshake returned" \ |
| 2282 | -C "X509 - Certificate verification failed" \ |
| 2283 | -C "SSL - No CA Chain is set, but required to operate" |
| 2284 | |
| 2285 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2286 | "$P_SRV" \ |
| 2287 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2288 | 1 \ |
| 2289 | -c "x509_verify_cert() returned" \ |
| 2290 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2291 | -c "! Certificate verification flags"\ |
| 2292 | -c "! mbedtls_ssl_handshake returned" \ |
| 2293 | -c "SSL - No CA Chain is set, but required to operate" |
| 2294 | |
| 2295 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2296 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2297 | # the client informs the server about the supported curves - it does, though, in the |
| 2298 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2299 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2300 | # different means to have the server ignoring the client's supported curve list. |
| 2301 | |
| 2302 | requires_config_enabled MBEDTLS_ECP_C |
| 2303 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2304 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2305 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2306 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2307 | 1 \ |
| 2308 | -c "bad certificate (EC key curve)"\ |
| 2309 | -c "! Certificate verification flags"\ |
| 2310 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2311 | |
| 2312 | requires_config_enabled MBEDTLS_ECP_C |
| 2313 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2314 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2315 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2316 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2317 | 1 \ |
| 2318 | -c "bad certificate (EC key curve)"\ |
| 2319 | -c "! Certificate verification flags"\ |
| 2320 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2321 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2322 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2323 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2324 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2325 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2326 | 0 \ |
| 2327 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2328 | -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] | 2329 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2330 | -C "X509 - Certificate verification failed" |
| 2331 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2332 | run_test "Authentication: client SHA256, server required" \ |
| 2333 | "$P_SRV auth_mode=required" \ |
| 2334 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2335 | key_file=data_files/server6.key \ |
| 2336 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2337 | 0 \ |
| 2338 | -c "Supported Signature Algorithm found: 4," \ |
| 2339 | -c "Supported Signature Algorithm found: 5," |
| 2340 | |
| 2341 | run_test "Authentication: client SHA384, server required" \ |
| 2342 | "$P_SRV auth_mode=required" \ |
| 2343 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2344 | key_file=data_files/server6.key \ |
| 2345 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2346 | 0 \ |
| 2347 | -c "Supported Signature Algorithm found: 4," \ |
| 2348 | -c "Supported Signature Algorithm found: 5," |
| 2349 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2350 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2351 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2352 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2353 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2354 | key_file=data_files/server5.key" \ |
| 2355 | 1 \ |
| 2356 | -S "skip write certificate request" \ |
| 2357 | -C "skip parse certificate request" \ |
| 2358 | -c "got a certificate request" \ |
| 2359 | -c "got no certificate to send" \ |
| 2360 | -S "x509_verify_cert() returned" \ |
| 2361 | -s "client has no certificate" \ |
| 2362 | -s "! mbedtls_ssl_handshake returned" \ |
| 2363 | -c "! mbedtls_ssl_handshake returned" \ |
| 2364 | -s "No client certification received from the client, but required by the authentication mode" |
| 2365 | |
| 2366 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2367 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2368 | "$P_CLI debug_level=3 crt_file=none \ |
| 2369 | key_file=data_files/server5.key" \ |
| 2370 | 1 \ |
| 2371 | -S "skip write certificate request" \ |
| 2372 | -C "skip parse certificate request" \ |
| 2373 | -c "got a certificate request" \ |
| 2374 | -c "= write certificate$" \ |
| 2375 | -C "skip write certificate$" \ |
| 2376 | -S "x509_verify_cert() returned" \ |
| 2377 | -s "client has no certificate" \ |
| 2378 | -s "! mbedtls_ssl_handshake returned" \ |
| 2379 | -c "! mbedtls_ssl_handshake returned" \ |
| 2380 | -s "No client certification received from the client, but required by the authentication mode" |
| 2381 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2382 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2383 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2384 | "$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] | 2385 | key_file=data_files/server5.key" \ |
| 2386 | 1 \ |
| 2387 | -S "skip write certificate request" \ |
| 2388 | -C "skip parse certificate request" \ |
| 2389 | -c "got a certificate request" \ |
| 2390 | -C "skip write certificate" \ |
| 2391 | -C "skip write certificate verify" \ |
| 2392 | -S "skip parse certificate verify" \ |
| 2393 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2394 | -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] | 2395 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2396 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2397 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2398 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2399 | # We don't check that the client receives the alert because it might |
| 2400 | # detect that its write end of the connection is closed and abort |
| 2401 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2402 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2403 | run_test "Authentication: client cert not trusted, server required" \ |
| 2404 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2405 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2406 | key_file=data_files/server5.key" \ |
| 2407 | 1 \ |
| 2408 | -S "skip write certificate request" \ |
| 2409 | -C "skip parse certificate request" \ |
| 2410 | -c "got a certificate request" \ |
| 2411 | -C "skip write certificate" \ |
| 2412 | -C "skip write certificate verify" \ |
| 2413 | -S "skip parse certificate verify" \ |
| 2414 | -s "x509_verify_cert() returned" \ |
| 2415 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2416 | -s "! mbedtls_ssl_handshake returned" \ |
| 2417 | -c "! mbedtls_ssl_handshake returned" \ |
| 2418 | -s "X509 - Certificate verification failed" |
| 2419 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2420 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2421 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2422 | "$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] | 2423 | key_file=data_files/server5.key" \ |
| 2424 | 0 \ |
| 2425 | -S "skip write certificate request" \ |
| 2426 | -C "skip parse certificate request" \ |
| 2427 | -c "got a certificate request" \ |
| 2428 | -C "skip write certificate" \ |
| 2429 | -C "skip write certificate verify" \ |
| 2430 | -S "skip parse certificate verify" \ |
| 2431 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2432 | -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] | 2433 | -S "! mbedtls_ssl_handshake returned" \ |
| 2434 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2435 | -S "X509 - Certificate verification failed" |
| 2436 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2437 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2438 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2439 | "$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] | 2440 | key_file=data_files/server5.key" \ |
| 2441 | 0 \ |
| 2442 | -s "skip write certificate request" \ |
| 2443 | -C "skip parse certificate request" \ |
| 2444 | -c "got no certificate request" \ |
| 2445 | -c "skip write certificate" \ |
| 2446 | -c "skip write certificate verify" \ |
| 2447 | -s "skip parse certificate verify" \ |
| 2448 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2449 | -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] | 2450 | -S "! mbedtls_ssl_handshake returned" \ |
| 2451 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2452 | -S "X509 - Certificate verification failed" |
| 2453 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2454 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2455 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2456 | "$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] | 2457 | 0 \ |
| 2458 | -S "skip write certificate request" \ |
| 2459 | -C "skip parse certificate request" \ |
| 2460 | -c "got a certificate request" \ |
| 2461 | -C "skip write certificate$" \ |
| 2462 | -C "got no certificate to send" \ |
| 2463 | -S "SSLv3 client has no certificate" \ |
| 2464 | -c "skip write certificate verify" \ |
| 2465 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2466 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2467 | -S "! mbedtls_ssl_handshake returned" \ |
| 2468 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2469 | -S "X509 - Certificate verification failed" |
| 2470 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2471 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2472 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2473 | "$O_CLI" \ |
| 2474 | 0 \ |
| 2475 | -S "skip write certificate request" \ |
| 2476 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2477 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2478 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2479 | -S "X509 - Certificate verification failed" |
| 2480 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2481 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2482 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2483 | "$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] | 2484 | 0 \ |
| 2485 | -C "skip parse certificate request" \ |
| 2486 | -c "got a certificate request" \ |
| 2487 | -C "skip write certificate$" \ |
| 2488 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2489 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2490 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2491 | run_test "Authentication: client no cert, openssl server required" \ |
| 2492 | "$O_SRV -Verify 10" \ |
| 2493 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2494 | 1 \ |
| 2495 | -C "skip parse certificate request" \ |
| 2496 | -c "got a certificate request" \ |
| 2497 | -C "skip write certificate$" \ |
| 2498 | -c "skip write certificate verify" \ |
| 2499 | -c "! mbedtls_ssl_handshake returned" |
| 2500 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2501 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2502 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2503 | "$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] | 2504 | "$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] | 2505 | 0 \ |
| 2506 | -S "skip write certificate request" \ |
| 2507 | -C "skip parse certificate request" \ |
| 2508 | -c "got a certificate request" \ |
| 2509 | -C "skip write certificate$" \ |
| 2510 | -c "skip write certificate verify" \ |
| 2511 | -c "got no certificate to send" \ |
| 2512 | -s "SSLv3 client has no certificate" \ |
| 2513 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2514 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2515 | -S "! mbedtls_ssl_handshake returned" \ |
| 2516 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2517 | -S "X509 - Certificate verification failed" |
| 2518 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2519 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 2520 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2521 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2522 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2523 | 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] | 2524 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2525 | 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] | 2526 | 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] | 2527 | 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] | 2528 | printf "test value of ${MAX_IM_CA}. \n" |
| 2529 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2530 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 2531 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2532 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2533 | |
| 2534 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2535 | fi |
| 2536 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2537 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2538 | run_test "Authentication: server max_int chain, client default" \ |
| 2539 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2540 | key_file=data_files/dir-maxpath/09.key" \ |
| 2541 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2542 | 0 \ |
| 2543 | -C "X509 - A fatal error occured" |
| 2544 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2545 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2546 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2547 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2548 | key_file=data_files/dir-maxpath/10.key" \ |
| 2549 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2550 | 1 \ |
| 2551 | -c "X509 - A fatal error occured" |
| 2552 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2553 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2554 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2555 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2556 | key_file=data_files/dir-maxpath/10.key" \ |
| 2557 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2558 | auth_mode=optional" \ |
| 2559 | 1 \ |
| 2560 | -c "X509 - A fatal error occured" |
| 2561 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2562 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2563 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2564 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2565 | key_file=data_files/dir-maxpath/10.key" \ |
| 2566 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2567 | auth_mode=none" \ |
| 2568 | 0 \ |
| 2569 | -C "X509 - A fatal error occured" |
| 2570 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2571 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2572 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2573 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2574 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2575 | key_file=data_files/dir-maxpath/10.key" \ |
| 2576 | 0 \ |
| 2577 | -S "X509 - A fatal error occured" |
| 2578 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2579 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2580 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2581 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2582 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2583 | key_file=data_files/dir-maxpath/10.key" \ |
| 2584 | 1 \ |
| 2585 | -s "X509 - A fatal error occured" |
| 2586 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2587 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2588 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2589 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2590 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2591 | key_file=data_files/dir-maxpath/10.key" \ |
| 2592 | 1 \ |
| 2593 | -s "X509 - A fatal error occured" |
| 2594 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2595 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2596 | run_test "Authentication: client max_int chain, server required" \ |
| 2597 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2598 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2599 | key_file=data_files/dir-maxpath/09.key" \ |
| 2600 | 0 \ |
| 2601 | -S "X509 - A fatal error occured" |
| 2602 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2603 | # Tests for CA list in CertificateRequest messages |
| 2604 | |
| 2605 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 2606 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2607 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2608 | key_file=data_files/server6.key" \ |
| 2609 | 0 \ |
| 2610 | -s "requested DN" |
| 2611 | |
| 2612 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 2613 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2614 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2615 | key_file=data_files/server6.key" \ |
| 2616 | 0 \ |
| 2617 | -S "requested DN" |
| 2618 | |
| 2619 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 2620 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2621 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2622 | key_file=data_files/server5.key" \ |
| 2623 | 1 \ |
| 2624 | -S "requested DN" \ |
| 2625 | -s "x509_verify_cert() returned" \ |
| 2626 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2627 | -s "! mbedtls_ssl_handshake returned" \ |
| 2628 | -c "! mbedtls_ssl_handshake returned" \ |
| 2629 | -s "X509 - Certificate verification failed" |
| 2630 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2631 | # Tests for certificate selection based on SHA verson |
| 2632 | |
| 2633 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 2634 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2635 | key_file=data_files/server5.key \ |
| 2636 | crt_file2=data_files/server5-sha1.crt \ |
| 2637 | key_file2=data_files/server5.key" \ |
| 2638 | "$P_CLI force_version=tls1_2" \ |
| 2639 | 0 \ |
| 2640 | -c "signed using.*ECDSA with SHA256" \ |
| 2641 | -C "signed using.*ECDSA with SHA1" |
| 2642 | |
| 2643 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 2644 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2645 | key_file=data_files/server5.key \ |
| 2646 | crt_file2=data_files/server5-sha1.crt \ |
| 2647 | key_file2=data_files/server5.key" \ |
| 2648 | "$P_CLI force_version=tls1_1" \ |
| 2649 | 0 \ |
| 2650 | -C "signed using.*ECDSA with SHA256" \ |
| 2651 | -c "signed using.*ECDSA with SHA1" |
| 2652 | |
| 2653 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 2654 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2655 | key_file=data_files/server5.key \ |
| 2656 | crt_file2=data_files/server5-sha1.crt \ |
| 2657 | key_file2=data_files/server5.key" \ |
| 2658 | "$P_CLI force_version=tls1" \ |
| 2659 | 0 \ |
| 2660 | -C "signed using.*ECDSA with SHA256" \ |
| 2661 | -c "signed using.*ECDSA with SHA1" |
| 2662 | |
| 2663 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 2664 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2665 | key_file=data_files/server5.key \ |
| 2666 | crt_file2=data_files/server6.crt \ |
| 2667 | key_file2=data_files/server6.key" \ |
| 2668 | "$P_CLI force_version=tls1_1" \ |
| 2669 | 0 \ |
| 2670 | -c "serial number.*09" \ |
| 2671 | -c "signed using.*ECDSA with SHA256" \ |
| 2672 | -C "signed using.*ECDSA with SHA1" |
| 2673 | |
| 2674 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 2675 | "$P_SRV crt_file=data_files/server6.crt \ |
| 2676 | key_file=data_files/server6.key \ |
| 2677 | crt_file2=data_files/server5.crt \ |
| 2678 | key_file2=data_files/server5.key" \ |
| 2679 | "$P_CLI force_version=tls1_1" \ |
| 2680 | 0 \ |
| 2681 | -c "serial number.*0A" \ |
| 2682 | -c "signed using.*ECDSA with SHA256" \ |
| 2683 | -C "signed using.*ECDSA with SHA1" |
| 2684 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2685 | # tests for SNI |
| 2686 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2687 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2688 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2689 | 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] | 2690 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2691 | 0 \ |
| 2692 | -S "parse ServerName extension" \ |
| 2693 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2694 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2696 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2697 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2698 | 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] | 2699 | 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] | 2700 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2701 | 0 \ |
| 2702 | -s "parse ServerName extension" \ |
| 2703 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2704 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2705 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2706 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2707 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2708 | 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] | 2709 | 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] | 2710 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2711 | 0 \ |
| 2712 | -s "parse ServerName extension" \ |
| 2713 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2714 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2716 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2717 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2718 | 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] | 2719 | 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] | 2720 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2721 | 1 \ |
| 2722 | -s "parse ServerName extension" \ |
| 2723 | -s "ssl_sni_wrapper() returned" \ |
| 2724 | -s "mbedtls_ssl_handshake returned" \ |
| 2725 | -c "mbedtls_ssl_handshake returned" \ |
| 2726 | -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] | 2727 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2728 | run_test "SNI: client auth no override: optional" \ |
| 2729 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2730 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2731 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2732 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2733 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2734 | -S "skip write certificate request" \ |
| 2735 | -C "skip parse certificate request" \ |
| 2736 | -c "got a certificate request" \ |
| 2737 | -C "skip write certificate" \ |
| 2738 | -C "skip write certificate verify" \ |
| 2739 | -S "skip parse certificate verify" |
| 2740 | |
| 2741 | run_test "SNI: client auth override: none -> optional" \ |
| 2742 | "$P_SRV debug_level=3 auth_mode=none \ |
| 2743 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2744 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2745 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2746 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2747 | -S "skip write certificate request" \ |
| 2748 | -C "skip parse certificate request" \ |
| 2749 | -c "got a certificate request" \ |
| 2750 | -C "skip write certificate" \ |
| 2751 | -C "skip write certificate verify" \ |
| 2752 | -S "skip parse certificate verify" |
| 2753 | |
| 2754 | run_test "SNI: client auth override: optional -> none" \ |
| 2755 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2756 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2757 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2758 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2759 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2760 | -s "skip write certificate request" \ |
| 2761 | -C "skip parse certificate request" \ |
| 2762 | -c "got no certificate request" \ |
| 2763 | -c "skip write certificate" \ |
| 2764 | -c "skip write certificate verify" \ |
| 2765 | -s "skip parse certificate verify" |
| 2766 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2767 | run_test "SNI: CA no override" \ |
| 2768 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2769 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2770 | ca_file=data_files/test-ca.crt \ |
| 2771 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2772 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2773 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2774 | 1 \ |
| 2775 | -S "skip write certificate request" \ |
| 2776 | -C "skip parse certificate request" \ |
| 2777 | -c "got a certificate request" \ |
| 2778 | -C "skip write certificate" \ |
| 2779 | -C "skip write certificate verify" \ |
| 2780 | -S "skip parse certificate verify" \ |
| 2781 | -s "x509_verify_cert() returned" \ |
| 2782 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2783 | -S "The certificate has been revoked (is on a CRL)" |
| 2784 | |
| 2785 | run_test "SNI: CA override" \ |
| 2786 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2787 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2788 | ca_file=data_files/test-ca.crt \ |
| 2789 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2790 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2791 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2792 | 0 \ |
| 2793 | -S "skip write certificate request" \ |
| 2794 | -C "skip parse certificate request" \ |
| 2795 | -c "got a certificate request" \ |
| 2796 | -C "skip write certificate" \ |
| 2797 | -C "skip write certificate verify" \ |
| 2798 | -S "skip parse certificate verify" \ |
| 2799 | -S "x509_verify_cert() returned" \ |
| 2800 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2801 | -S "The certificate has been revoked (is on a CRL)" |
| 2802 | |
| 2803 | run_test "SNI: CA override with CRL" \ |
| 2804 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2805 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2806 | ca_file=data_files/test-ca.crt \ |
| 2807 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2808 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2809 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2810 | 1 \ |
| 2811 | -S "skip write certificate request" \ |
| 2812 | -C "skip parse certificate request" \ |
| 2813 | -c "got a certificate request" \ |
| 2814 | -C "skip write certificate" \ |
| 2815 | -C "skip write certificate verify" \ |
| 2816 | -S "skip parse certificate verify" \ |
| 2817 | -s "x509_verify_cert() returned" \ |
| 2818 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2819 | -s "The certificate has been revoked (is on a CRL)" |
| 2820 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2821 | # Tests for SNI and DTLS |
| 2822 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2823 | run_test "SNI: DTLS, no SNI callback" \ |
| 2824 | "$P_SRV debug_level=3 dtls=1 \ |
| 2825 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2826 | "$P_CLI server_name=localhost dtls=1" \ |
| 2827 | 0 \ |
| 2828 | -S "parse ServerName extension" \ |
| 2829 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2830 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2831 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2832 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2833 | "$P_SRV debug_level=3 dtls=1 \ |
| 2834 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2835 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2836 | "$P_CLI server_name=localhost dtls=1" \ |
| 2837 | 0 \ |
| 2838 | -s "parse ServerName extension" \ |
| 2839 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2840 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2841 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2842 | run_test "SNI: DTLS, matching cert 2" \ |
| 2843 | "$P_SRV debug_level=3 dtls=1 \ |
| 2844 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2845 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2846 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 2847 | 0 \ |
| 2848 | -s "parse ServerName extension" \ |
| 2849 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2850 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 2851 | |
| 2852 | run_test "SNI: DTLS, no matching cert" \ |
| 2853 | "$P_SRV debug_level=3 dtls=1 \ |
| 2854 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2855 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2856 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 2857 | 1 \ |
| 2858 | -s "parse ServerName extension" \ |
| 2859 | -s "ssl_sni_wrapper() returned" \ |
| 2860 | -s "mbedtls_ssl_handshake returned" \ |
| 2861 | -c "mbedtls_ssl_handshake returned" \ |
| 2862 | -c "SSL - A fatal alert message was received from our peer" |
| 2863 | |
| 2864 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 2865 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2866 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2867 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2868 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2869 | 0 \ |
| 2870 | -S "skip write certificate request" \ |
| 2871 | -C "skip parse certificate request" \ |
| 2872 | -c "got a certificate request" \ |
| 2873 | -C "skip write certificate" \ |
| 2874 | -C "skip write certificate verify" \ |
| 2875 | -S "skip parse certificate verify" |
| 2876 | |
| 2877 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 2878 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 2879 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2880 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2881 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2882 | 0 \ |
| 2883 | -S "skip write certificate request" \ |
| 2884 | -C "skip parse certificate request" \ |
| 2885 | -c "got a certificate request" \ |
| 2886 | -C "skip write certificate" \ |
| 2887 | -C "skip write certificate verify" \ |
| 2888 | -S "skip parse certificate verify" |
| 2889 | |
| 2890 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 2891 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2892 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2893 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2894 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2895 | 0 \ |
| 2896 | -s "skip write certificate request" \ |
| 2897 | -C "skip parse certificate request" \ |
| 2898 | -c "got no certificate request" \ |
| 2899 | -c "skip write certificate" \ |
| 2900 | -c "skip write certificate verify" \ |
| 2901 | -s "skip parse certificate verify" |
| 2902 | |
| 2903 | run_test "SNI: DTLS, CA no override" \ |
| 2904 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2905 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2906 | ca_file=data_files/test-ca.crt \ |
| 2907 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2908 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2909 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2910 | 1 \ |
| 2911 | -S "skip write certificate request" \ |
| 2912 | -C "skip parse certificate request" \ |
| 2913 | -c "got a certificate request" \ |
| 2914 | -C "skip write certificate" \ |
| 2915 | -C "skip write certificate verify" \ |
| 2916 | -S "skip parse certificate verify" \ |
| 2917 | -s "x509_verify_cert() returned" \ |
| 2918 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2919 | -S "The certificate has been revoked (is on a CRL)" |
| 2920 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2921 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2922 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2923 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2924 | ca_file=data_files/test-ca.crt \ |
| 2925 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2926 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2927 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2928 | 0 \ |
| 2929 | -S "skip write certificate request" \ |
| 2930 | -C "skip parse certificate request" \ |
| 2931 | -c "got a certificate request" \ |
| 2932 | -C "skip write certificate" \ |
| 2933 | -C "skip write certificate verify" \ |
| 2934 | -S "skip parse certificate verify" \ |
| 2935 | -S "x509_verify_cert() returned" \ |
| 2936 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2937 | -S "The certificate has been revoked (is on a CRL)" |
| 2938 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2939 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2940 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2941 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 2942 | ca_file=data_files/test-ca.crt \ |
| 2943 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2944 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2945 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2946 | 1 \ |
| 2947 | -S "skip write certificate request" \ |
| 2948 | -C "skip parse certificate request" \ |
| 2949 | -c "got a certificate request" \ |
| 2950 | -C "skip write certificate" \ |
| 2951 | -C "skip write certificate verify" \ |
| 2952 | -S "skip parse certificate verify" \ |
| 2953 | -s "x509_verify_cert() returned" \ |
| 2954 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2955 | -s "The certificate has been revoked (is on a CRL)" |
| 2956 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2957 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 2958 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2959 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2960 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2961 | "$P_CLI nbio=2 tickets=0" \ |
| 2962 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2963 | -S "mbedtls_ssl_handshake returned" \ |
| 2964 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2965 | -c "Read from server: .* bytes read" |
| 2966 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2967 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2968 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 2969 | "$P_CLI nbio=2 tickets=0" \ |
| 2970 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2971 | -S "mbedtls_ssl_handshake returned" \ |
| 2972 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2973 | -c "Read from server: .* bytes read" |
| 2974 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2975 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2976 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2977 | "$P_CLI nbio=2 tickets=1" \ |
| 2978 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2979 | -S "mbedtls_ssl_handshake returned" \ |
| 2980 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2981 | -c "Read from server: .* bytes read" |
| 2982 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2983 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2984 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2985 | "$P_CLI nbio=2 tickets=1" \ |
| 2986 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2987 | -S "mbedtls_ssl_handshake returned" \ |
| 2988 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2989 | -c "Read from server: .* bytes read" |
| 2990 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2991 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2992 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2993 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2994 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2995 | -S "mbedtls_ssl_handshake returned" \ |
| 2996 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2997 | -c "Read from server: .* bytes read" |
| 2998 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2999 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3000 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3001 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3002 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3003 | -S "mbedtls_ssl_handshake returned" \ |
| 3004 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3005 | -c "Read from server: .* bytes read" |
| 3006 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3007 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3008 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3009 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 3010 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3011 | -S "mbedtls_ssl_handshake returned" \ |
| 3012 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3013 | -c "Read from server: .* bytes read" |
| 3014 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3015 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 3016 | |
| 3017 | run_test "Event-driven I/O: basic handshake" \ |
| 3018 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3019 | "$P_CLI event=1 tickets=0" \ |
| 3020 | 0 \ |
| 3021 | -S "mbedtls_ssl_handshake returned" \ |
| 3022 | -C "mbedtls_ssl_handshake returned" \ |
| 3023 | -c "Read from server: .* bytes read" |
| 3024 | |
| 3025 | run_test "Event-driven I/O: client auth" \ |
| 3026 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 3027 | "$P_CLI event=1 tickets=0" \ |
| 3028 | 0 \ |
| 3029 | -S "mbedtls_ssl_handshake returned" \ |
| 3030 | -C "mbedtls_ssl_handshake returned" \ |
| 3031 | -c "Read from server: .* bytes read" |
| 3032 | |
| 3033 | run_test "Event-driven I/O: ticket" \ |
| 3034 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3035 | "$P_CLI event=1 tickets=1" \ |
| 3036 | 0 \ |
| 3037 | -S "mbedtls_ssl_handshake returned" \ |
| 3038 | -C "mbedtls_ssl_handshake returned" \ |
| 3039 | -c "Read from server: .* bytes read" |
| 3040 | |
| 3041 | run_test "Event-driven I/O: ticket + client auth" \ |
| 3042 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3043 | "$P_CLI event=1 tickets=1" \ |
| 3044 | 0 \ |
| 3045 | -S "mbedtls_ssl_handshake returned" \ |
| 3046 | -C "mbedtls_ssl_handshake returned" \ |
| 3047 | -c "Read from server: .* bytes read" |
| 3048 | |
| 3049 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 3050 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3051 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3052 | 0 \ |
| 3053 | -S "mbedtls_ssl_handshake returned" \ |
| 3054 | -C "mbedtls_ssl_handshake returned" \ |
| 3055 | -c "Read from server: .* bytes read" |
| 3056 | |
| 3057 | run_test "Event-driven I/O: ticket + resume" \ |
| 3058 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3059 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3060 | 0 \ |
| 3061 | -S "mbedtls_ssl_handshake returned" \ |
| 3062 | -C "mbedtls_ssl_handshake returned" \ |
| 3063 | -c "Read from server: .* bytes read" |
| 3064 | |
| 3065 | run_test "Event-driven I/O: session-id resume" \ |
| 3066 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3067 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 3068 | 0 \ |
| 3069 | -S "mbedtls_ssl_handshake returned" \ |
| 3070 | -C "mbedtls_ssl_handshake returned" \ |
| 3071 | -c "Read from server: .* bytes read" |
| 3072 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3073 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 3074 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3075 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3076 | 0 \ |
| 3077 | -c "Read from server: .* bytes read" |
| 3078 | |
| 3079 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 3080 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3081 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3082 | 0 \ |
| 3083 | -c "Read from server: .* bytes read" |
| 3084 | |
| 3085 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 3086 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3087 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3088 | 0 \ |
| 3089 | -c "Read from server: .* bytes read" |
| 3090 | |
| 3091 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 3092 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3093 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3094 | 0 \ |
| 3095 | -c "Read from server: .* bytes read" |
| 3096 | |
| 3097 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 3098 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3099 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3100 | 0 \ |
| 3101 | -c "Read from server: .* bytes read" |
| 3102 | |
| 3103 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 3104 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3105 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3106 | 0 \ |
| 3107 | -c "Read from server: .* bytes read" |
| 3108 | |
| 3109 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 3110 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3111 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3112 | 0 \ |
| 3113 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3114 | |
| 3115 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3116 | # During session resumption, the client will send its ApplicationData record |
| 3117 | # within the same datagram as the Finished messages. In this situation, the |
| 3118 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3119 | # because the ApplicationData request has already been queued internally. |
| 3120 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3121 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3122 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3123 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3124 | 0 \ |
| 3125 | -c "Read from server: .* bytes read" |
| 3126 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3127 | # Tests for version negotiation |
| 3128 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3129 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3130 | "$P_SRV" \ |
| 3131 | "$P_CLI" \ |
| 3132 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3133 | -S "mbedtls_ssl_handshake returned" \ |
| 3134 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3135 | -s "Protocol is TLSv1.2" \ |
| 3136 | -c "Protocol is TLSv1.2" |
| 3137 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3138 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3139 | "$P_SRV" \ |
| 3140 | "$P_CLI max_version=tls1_1" \ |
| 3141 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3142 | -S "mbedtls_ssl_handshake returned" \ |
| 3143 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3144 | -s "Protocol is TLSv1.1" \ |
| 3145 | -c "Protocol is TLSv1.1" |
| 3146 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3147 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3148 | "$P_SRV max_version=tls1_1" \ |
| 3149 | "$P_CLI" \ |
| 3150 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3151 | -S "mbedtls_ssl_handshake returned" \ |
| 3152 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3153 | -s "Protocol is TLSv1.1" \ |
| 3154 | -c "Protocol is TLSv1.1" |
| 3155 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3156 | 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] | 3157 | "$P_SRV max_version=tls1_1" \ |
| 3158 | "$P_CLI max_version=tls1_1" \ |
| 3159 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3160 | -S "mbedtls_ssl_handshake returned" \ |
| 3161 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3162 | -s "Protocol is TLSv1.1" \ |
| 3163 | -c "Protocol is TLSv1.1" |
| 3164 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3165 | 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] | 3166 | "$P_SRV min_version=tls1_1" \ |
| 3167 | "$P_CLI max_version=tls1_1" \ |
| 3168 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3169 | -S "mbedtls_ssl_handshake returned" \ |
| 3170 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3171 | -s "Protocol is TLSv1.1" \ |
| 3172 | -c "Protocol is TLSv1.1" |
| 3173 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3174 | 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] | 3175 | "$P_SRV max_version=tls1_1" \ |
| 3176 | "$P_CLI min_version=tls1_1" \ |
| 3177 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3178 | -S "mbedtls_ssl_handshake returned" \ |
| 3179 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3180 | -s "Protocol is TLSv1.1" \ |
| 3181 | -c "Protocol is TLSv1.1" |
| 3182 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3183 | 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] | 3184 | "$P_SRV max_version=tls1_1" \ |
| 3185 | "$P_CLI min_version=tls1_2" \ |
| 3186 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3187 | -s "mbedtls_ssl_handshake returned" \ |
| 3188 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3189 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3190 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3191 | 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] | 3192 | "$P_SRV min_version=tls1_2" \ |
| 3193 | "$P_CLI max_version=tls1_1" \ |
| 3194 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3195 | -s "mbedtls_ssl_handshake returned" \ |
| 3196 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3197 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3198 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3199 | # Tests for ALPN extension |
| 3200 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3201 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3202 | "$P_SRV debug_level=3" \ |
| 3203 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3204 | 0 \ |
| 3205 | -C "client hello, adding alpn extension" \ |
| 3206 | -S "found alpn extension" \ |
| 3207 | -C "got an alert message, type: \\[2:120]" \ |
| 3208 | -S "server hello, adding alpn extension" \ |
| 3209 | -C "found alpn extension " \ |
| 3210 | -C "Application Layer Protocol is" \ |
| 3211 | -S "Application Layer Protocol is" |
| 3212 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3213 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3214 | "$P_SRV debug_level=3" \ |
| 3215 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3216 | 0 \ |
| 3217 | -c "client hello, adding alpn extension" \ |
| 3218 | -s "found alpn extension" \ |
| 3219 | -C "got an alert message, type: \\[2:120]" \ |
| 3220 | -S "server hello, adding alpn extension" \ |
| 3221 | -C "found alpn extension " \ |
| 3222 | -c "Application Layer Protocol is (none)" \ |
| 3223 | -S "Application Layer Protocol is" |
| 3224 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3225 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3226 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3227 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3228 | 0 \ |
| 3229 | -C "client hello, adding alpn extension" \ |
| 3230 | -S "found alpn extension" \ |
| 3231 | -C "got an alert message, type: \\[2:120]" \ |
| 3232 | -S "server hello, adding alpn extension" \ |
| 3233 | -C "found alpn extension " \ |
| 3234 | -C "Application Layer Protocol is" \ |
| 3235 | -s "Application Layer Protocol is (none)" |
| 3236 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3237 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3238 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3239 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3240 | 0 \ |
| 3241 | -c "client hello, adding alpn extension" \ |
| 3242 | -s "found alpn extension" \ |
| 3243 | -C "got an alert message, type: \\[2:120]" \ |
| 3244 | -s "server hello, adding alpn extension" \ |
| 3245 | -c "found alpn extension" \ |
| 3246 | -c "Application Layer Protocol is abc" \ |
| 3247 | -s "Application Layer Protocol is abc" |
| 3248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3249 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3250 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3251 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3252 | 0 \ |
| 3253 | -c "client hello, adding alpn extension" \ |
| 3254 | -s "found alpn extension" \ |
| 3255 | -C "got an alert message, type: \\[2:120]" \ |
| 3256 | -s "server hello, adding alpn extension" \ |
| 3257 | -c "found alpn extension" \ |
| 3258 | -c "Application Layer Protocol is abc" \ |
| 3259 | -s "Application Layer Protocol is abc" |
| 3260 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3261 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3262 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3263 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3264 | 0 \ |
| 3265 | -c "client hello, adding alpn extension" \ |
| 3266 | -s "found alpn extension" \ |
| 3267 | -C "got an alert message, type: \\[2:120]" \ |
| 3268 | -s "server hello, adding alpn extension" \ |
| 3269 | -c "found alpn extension" \ |
| 3270 | -c "Application Layer Protocol is 1234" \ |
| 3271 | -s "Application Layer Protocol is 1234" |
| 3272 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3273 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3274 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3275 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3276 | 1 \ |
| 3277 | -c "client hello, adding alpn extension" \ |
| 3278 | -s "found alpn extension" \ |
| 3279 | -c "got an alert message, type: \\[2:120]" \ |
| 3280 | -S "server hello, adding alpn extension" \ |
| 3281 | -C "found alpn extension" \ |
| 3282 | -C "Application Layer Protocol is 1234" \ |
| 3283 | -S "Application Layer Protocol is 1234" |
| 3284 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3285 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3286 | # Tests for keyUsage in leaf certificates, part 1: |
| 3287 | # server-side certificate/suite selection |
| 3288 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3289 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3290 | "$P_SRV key_file=data_files/server2.key \ |
| 3291 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3292 | "$P_CLI" \ |
| 3293 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3294 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3295 | |
| 3296 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3297 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3298 | "$P_SRV key_file=data_files/server2.key \ |
| 3299 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3300 | "$P_CLI" \ |
| 3301 | 0 \ |
| 3302 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3303 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3304 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3305 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3306 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3307 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3308 | 1 \ |
| 3309 | -C "Ciphersuite is " |
| 3310 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3311 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3312 | "$P_SRV key_file=data_files/server5.key \ |
| 3313 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3314 | "$P_CLI" \ |
| 3315 | 0 \ |
| 3316 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3317 | |
| 3318 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3319 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3320 | "$P_SRV key_file=data_files/server5.key \ |
| 3321 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3322 | "$P_CLI" \ |
| 3323 | 0 \ |
| 3324 | -c "Ciphersuite is TLS-ECDH-" |
| 3325 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3326 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3327 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3328 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3329 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3330 | 1 \ |
| 3331 | -C "Ciphersuite is " |
| 3332 | |
| 3333 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3334 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3335 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3336 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3337 | "$O_SRV -key data_files/server2.key \ |
| 3338 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3339 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3340 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3341 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3342 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3343 | -C "Processing of the Certificate handshake message failed" \ |
| 3344 | -c "Ciphersuite is TLS-" |
| 3345 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3346 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3347 | "$O_SRV -key data_files/server2.key \ |
| 3348 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3349 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3350 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3351 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3352 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3353 | -C "Processing of the Certificate handshake message failed" \ |
| 3354 | -c "Ciphersuite is TLS-" |
| 3355 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3356 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3357 | "$O_SRV -key data_files/server2.key \ |
| 3358 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3359 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3360 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3361 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3362 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3363 | -C "Processing of the Certificate handshake message failed" \ |
| 3364 | -c "Ciphersuite is TLS-" |
| 3365 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3366 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3367 | "$O_SRV -key data_files/server2.key \ |
| 3368 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3369 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3370 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3371 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3372 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3373 | -c "Processing of the Certificate handshake message failed" \ |
| 3374 | -C "Ciphersuite is TLS-" |
| 3375 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3376 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3377 | "$O_SRV -key data_files/server2.key \ |
| 3378 | -cert data_files/server2.ku-ke.crt" \ |
| 3379 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3380 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3381 | 0 \ |
| 3382 | -c "bad certificate (usage extensions)" \ |
| 3383 | -C "Processing of the Certificate handshake message failed" \ |
| 3384 | -c "Ciphersuite is TLS-" \ |
| 3385 | -c "! Usage does not match the keyUsage extension" |
| 3386 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3387 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3388 | "$O_SRV -key data_files/server2.key \ |
| 3389 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3390 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3391 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3392 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3393 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3394 | -C "Processing of the Certificate handshake message failed" \ |
| 3395 | -c "Ciphersuite is TLS-" |
| 3396 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3397 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3398 | "$O_SRV -key data_files/server2.key \ |
| 3399 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3400 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3401 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3402 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3403 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3404 | -c "Processing of the Certificate handshake message failed" \ |
| 3405 | -C "Ciphersuite is TLS-" |
| 3406 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3407 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3408 | "$O_SRV -key data_files/server2.key \ |
| 3409 | -cert data_files/server2.ku-ds.crt" \ |
| 3410 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3411 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3412 | 0 \ |
| 3413 | -c "bad certificate (usage extensions)" \ |
| 3414 | -C "Processing of the Certificate handshake message failed" \ |
| 3415 | -c "Ciphersuite is TLS-" \ |
| 3416 | -c "! Usage does not match the keyUsage extension" |
| 3417 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3418 | # Tests for keyUsage in leaf certificates, part 3: |
| 3419 | # server-side checking of client cert |
| 3420 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3421 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3422 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3423 | "$O_CLI -key data_files/server2.key \ |
| 3424 | -cert data_files/server2.ku-ds.crt" \ |
| 3425 | 0 \ |
| 3426 | -S "bad certificate (usage extensions)" \ |
| 3427 | -S "Processing of the Certificate handshake message failed" |
| 3428 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3429 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3430 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3431 | "$O_CLI -key data_files/server2.key \ |
| 3432 | -cert data_files/server2.ku-ke.crt" \ |
| 3433 | 0 \ |
| 3434 | -s "bad certificate (usage extensions)" \ |
| 3435 | -S "Processing of the Certificate handshake message failed" |
| 3436 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3437 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3438 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3439 | "$O_CLI -key data_files/server2.key \ |
| 3440 | -cert data_files/server2.ku-ke.crt" \ |
| 3441 | 1 \ |
| 3442 | -s "bad certificate (usage extensions)" \ |
| 3443 | -s "Processing of the Certificate handshake message failed" |
| 3444 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3445 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3446 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3447 | "$O_CLI -key data_files/server5.key \ |
| 3448 | -cert data_files/server5.ku-ds.crt" \ |
| 3449 | 0 \ |
| 3450 | -S "bad certificate (usage extensions)" \ |
| 3451 | -S "Processing of the Certificate handshake message failed" |
| 3452 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3453 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3454 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3455 | "$O_CLI -key data_files/server5.key \ |
| 3456 | -cert data_files/server5.ku-ka.crt" \ |
| 3457 | 0 \ |
| 3458 | -s "bad certificate (usage extensions)" \ |
| 3459 | -S "Processing of the Certificate handshake message failed" |
| 3460 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3461 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3462 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3463 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3464 | "$P_SRV key_file=data_files/server5.key \ |
| 3465 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3466 | "$P_CLI" \ |
| 3467 | 0 |
| 3468 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3469 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3470 | "$P_SRV key_file=data_files/server5.key \ |
| 3471 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3472 | "$P_CLI" \ |
| 3473 | 0 |
| 3474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3475 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3476 | "$P_SRV key_file=data_files/server5.key \ |
| 3477 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3478 | "$P_CLI" \ |
| 3479 | 0 |
| 3480 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3481 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3482 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3483 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3484 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3485 | 1 |
| 3486 | |
| 3487 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3488 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3489 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3490 | "$O_SRV -key data_files/server5.key \ |
| 3491 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3492 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3493 | 0 \ |
| 3494 | -C "bad certificate (usage extensions)" \ |
| 3495 | -C "Processing of the Certificate handshake message failed" \ |
| 3496 | -c "Ciphersuite is TLS-" |
| 3497 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3498 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3499 | "$O_SRV -key data_files/server5.key \ |
| 3500 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3501 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3502 | 0 \ |
| 3503 | -C "bad certificate (usage extensions)" \ |
| 3504 | -C "Processing of the Certificate handshake message failed" \ |
| 3505 | -c "Ciphersuite is TLS-" |
| 3506 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3507 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3508 | "$O_SRV -key data_files/server5.key \ |
| 3509 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3510 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3511 | 0 \ |
| 3512 | -C "bad certificate (usage extensions)" \ |
| 3513 | -C "Processing of the Certificate handshake message failed" \ |
| 3514 | -c "Ciphersuite is TLS-" |
| 3515 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3516 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3517 | "$O_SRV -key data_files/server5.key \ |
| 3518 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3519 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3520 | 1 \ |
| 3521 | -c "bad certificate (usage extensions)" \ |
| 3522 | -c "Processing of the Certificate handshake message failed" \ |
| 3523 | -C "Ciphersuite is TLS-" |
| 3524 | |
| 3525 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3526 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3527 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3528 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3529 | "$O_CLI -key data_files/server5.key \ |
| 3530 | -cert data_files/server5.eku-cli.crt" \ |
| 3531 | 0 \ |
| 3532 | -S "bad certificate (usage extensions)" \ |
| 3533 | -S "Processing of the Certificate handshake message failed" |
| 3534 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3535 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3536 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3537 | "$O_CLI -key data_files/server5.key \ |
| 3538 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3539 | 0 \ |
| 3540 | -S "bad certificate (usage extensions)" \ |
| 3541 | -S "Processing of the Certificate handshake message failed" |
| 3542 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3543 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3544 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3545 | "$O_CLI -key data_files/server5.key \ |
| 3546 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3547 | 0 \ |
| 3548 | -S "bad certificate (usage extensions)" \ |
| 3549 | -S "Processing of the Certificate handshake message failed" |
| 3550 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3551 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3552 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3553 | "$O_CLI -key data_files/server5.key \ |
| 3554 | -cert data_files/server5.eku-cs.crt" \ |
| 3555 | 0 \ |
| 3556 | -s "bad certificate (usage extensions)" \ |
| 3557 | -S "Processing of the Certificate handshake message failed" |
| 3558 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3559 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3560 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3561 | "$O_CLI -key data_files/server5.key \ |
| 3562 | -cert data_files/server5.eku-cs.crt" \ |
| 3563 | 1 \ |
| 3564 | -s "bad certificate (usage extensions)" \ |
| 3565 | -s "Processing of the Certificate handshake message failed" |
| 3566 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3567 | # Tests for DHM parameters loading |
| 3568 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3569 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3570 | "$P_SRV" \ |
| 3571 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3572 | debug_level=3" \ |
| 3573 | 0 \ |
| 3574 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3575 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3576 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3577 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3578 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3579 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3580 | debug_level=3" \ |
| 3581 | 0 \ |
| 3582 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3583 | -c "value of 'DHM: G ' (2 bits)" |
| 3584 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3585 | # Tests for DHM client-side size checking |
| 3586 | |
| 3587 | run_test "DHM size: server default, client default, OK" \ |
| 3588 | "$P_SRV" \ |
| 3589 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3590 | debug_level=1" \ |
| 3591 | 0 \ |
| 3592 | -C "DHM prime too short:" |
| 3593 | |
| 3594 | run_test "DHM size: server default, client 2048, OK" \ |
| 3595 | "$P_SRV" \ |
| 3596 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3597 | debug_level=1 dhmlen=2048" \ |
| 3598 | 0 \ |
| 3599 | -C "DHM prime too short:" |
| 3600 | |
| 3601 | run_test "DHM size: server 1024, client default, OK" \ |
| 3602 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3603 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3604 | debug_level=1" \ |
| 3605 | 0 \ |
| 3606 | -C "DHM prime too short:" |
| 3607 | |
| 3608 | run_test "DHM size: server 1000, client default, rejected" \ |
| 3609 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3610 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3611 | debug_level=1" \ |
| 3612 | 1 \ |
| 3613 | -c "DHM prime too short:" |
| 3614 | |
| 3615 | run_test "DHM size: server default, client 2049, rejected" \ |
| 3616 | "$P_SRV" \ |
| 3617 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3618 | debug_level=1 dhmlen=2049" \ |
| 3619 | 1 \ |
| 3620 | -c "DHM prime too short:" |
| 3621 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3622 | # Tests for PSK callback |
| 3623 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3624 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3625 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 3626 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3627 | psk_identity=foo psk=abc123" \ |
| 3628 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3629 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3630 | -S "SSL - Unknown identity received" \ |
| 3631 | -S "SSL - Verification of the message MAC failed" |
| 3632 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3633 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3634 | "$P_SRV" \ |
| 3635 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3636 | psk_identity=foo psk=abc123" \ |
| 3637 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3638 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3639 | -S "SSL - Unknown identity received" \ |
| 3640 | -S "SSL - Verification of the message MAC failed" |
| 3641 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3642 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3643 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 3644 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3645 | psk_identity=foo psk=abc123" \ |
| 3646 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3647 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3648 | -s "SSL - Unknown identity received" \ |
| 3649 | -S "SSL - Verification of the message MAC failed" |
| 3650 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3651 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3652 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3653 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3654 | psk_identity=abc psk=dead" \ |
| 3655 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3656 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3657 | -S "SSL - Unknown identity received" \ |
| 3658 | -S "SSL - Verification of the message MAC failed" |
| 3659 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3660 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3661 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3662 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3663 | psk_identity=def psk=beef" \ |
| 3664 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3665 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3666 | -S "SSL - Unknown identity received" \ |
| 3667 | -S "SSL - Verification of the message MAC failed" |
| 3668 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3669 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3670 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3671 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3672 | psk_identity=ghi psk=beef" \ |
| 3673 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3674 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3675 | -s "SSL - Unknown identity received" \ |
| 3676 | -S "SSL - Verification of the message MAC failed" |
| 3677 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3678 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3679 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3680 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3681 | psk_identity=abc psk=beef" \ |
| 3682 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3683 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3684 | -S "SSL - Unknown identity received" \ |
| 3685 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3686 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3687 | # Tests for EC J-PAKE |
| 3688 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3689 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3690 | run_test "ECJPAKE: client not configured" \ |
| 3691 | "$P_SRV debug_level=3" \ |
| 3692 | "$P_CLI debug_level=3" \ |
| 3693 | 0 \ |
| 3694 | -C "add ciphersuite: c0ff" \ |
| 3695 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3696 | -S "found ecjpake kkpp extension" \ |
| 3697 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3698 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3699 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3700 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3701 | -S "None of the common ciphersuites is usable" |
| 3702 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3703 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3704 | run_test "ECJPAKE: server not configured" \ |
| 3705 | "$P_SRV debug_level=3" \ |
| 3706 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3707 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3708 | 1 \ |
| 3709 | -c "add ciphersuite: c0ff" \ |
| 3710 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3711 | -s "found ecjpake kkpp extension" \ |
| 3712 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3713 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3714 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3715 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3716 | -s "None of the common ciphersuites is usable" |
| 3717 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3718 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3719 | run_test "ECJPAKE: working, TLS" \ |
| 3720 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3721 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3722 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 3723 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3724 | -c "add ciphersuite: c0ff" \ |
| 3725 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3726 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3727 | -s "found ecjpake kkpp extension" \ |
| 3728 | -S "skip ecjpake kkpp extension" \ |
| 3729 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3730 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3731 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3732 | -S "None of the common ciphersuites is usable" \ |
| 3733 | -S "SSL - Verification of the message MAC failed" |
| 3734 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3735 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3736 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3737 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 3738 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3739 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 3740 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3741 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3742 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3743 | -s "SSL - Verification of the message MAC failed" |
| 3744 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3745 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3746 | run_test "ECJPAKE: working, DTLS" \ |
| 3747 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3748 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3749 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3750 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3751 | -c "re-using cached ecjpake parameters" \ |
| 3752 | -S "SSL - Verification of the message MAC failed" |
| 3753 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3754 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3755 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 3756 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 3757 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3758 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3759 | 0 \ |
| 3760 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3761 | -S "SSL - Verification of the message MAC failed" |
| 3762 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3763 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3764 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3765 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 3766 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3767 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 3768 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3769 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3770 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3771 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3772 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3773 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3774 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3775 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 3776 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 3777 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 3778 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3779 | 0 |
| 3780 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3781 | # Tests for ciphersuites per version |
| 3782 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3783 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3784 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3785 | "$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] | 3786 | "$P_CLI force_version=ssl3" \ |
| 3787 | 0 \ |
| 3788 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 3789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3790 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3791 | "$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] | 3792 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3793 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3794 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3795 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3796 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3797 | "$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] | 3798 | "$P_CLI force_version=tls1_1" \ |
| 3799 | 0 \ |
| 3800 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 3801 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3802 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3803 | "$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] | 3804 | "$P_CLI force_version=tls1_2" \ |
| 3805 | 0 \ |
| 3806 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 3807 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3808 | # Test for ClientHello without extensions |
| 3809 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 3810 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3811 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3812 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3813 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3814 | 0 \ |
| 3815 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3816 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3817 | requires_gnutls |
| 3818 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 3819 | "$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] | 3820 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3821 | 0 \ |
| 3822 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3823 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3824 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3825 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3826 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3827 | "$P_SRV" \ |
| 3828 | "$P_CLI request_size=100" \ |
| 3829 | 0 \ |
| 3830 | -s "Read from client: 100 bytes read$" |
| 3831 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3832 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3833 | "$P_SRV" \ |
| 3834 | "$P_CLI request_size=500" \ |
| 3835 | 0 \ |
| 3836 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3837 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3838 | # Tests for small packets |
| 3839 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3840 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3841 | run_test "Small packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3842 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3843 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3844 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3845 | 0 \ |
| 3846 | -s "Read from client: 1 bytes read" |
| 3847 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3848 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3849 | run_test "Small packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3850 | "$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] | 3851 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3852 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3853 | 0 \ |
| 3854 | -s "Read from client: 1 bytes read" |
| 3855 | |
| 3856 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 3857 | "$P_SRV" \ |
| 3858 | "$P_CLI request_size=1 force_version=tls1 \ |
| 3859 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3860 | 0 \ |
| 3861 | -s "Read from client: 1 bytes read" |
| 3862 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3863 | run_test "Small packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3864 | "$P_SRV" \ |
| 3865 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 3866 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3867 | 0 \ |
| 3868 | -s "Read from client: 1 bytes read" |
| 3869 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3870 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3871 | run_test "Small packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3872 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3873 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3874 | 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] | 3875 | 0 \ |
| 3876 | -s "Read from client: 1 bytes read" |
| 3877 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3878 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3879 | run_test "Small packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3880 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3881 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3882 | 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] | 3883 | 0 \ |
| 3884 | -s "Read from client: 1 bytes read" |
| 3885 | |
| 3886 | run_test "Small packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3887 | "$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] | 3888 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3889 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3890 | 0 \ |
| 3891 | -s "Read from client: 1 bytes read" |
| 3892 | |
| 3893 | run_test "Small packet TLS 1.0 StreamCipher, without EtM" \ |
| 3894 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3895 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3896 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3897 | 0 \ |
| 3898 | -s "Read from client: 1 bytes read" |
| 3899 | |
| 3900 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3901 | run_test "Small packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3902 | "$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] | 3903 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3904 | 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] | 3905 | 0 \ |
| 3906 | -s "Read from client: 1 bytes read" |
| 3907 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3908 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3909 | run_test "Small packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3910 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3911 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 3912 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3913 | 0 \ |
| 3914 | -s "Read from client: 1 bytes read" |
| 3915 | |
| 3916 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 3917 | "$P_SRV" \ |
| 3918 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3919 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3920 | 0 \ |
| 3921 | -s "Read from client: 1 bytes read" |
| 3922 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3923 | run_test "Small packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3924 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3925 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3926 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3927 | 0 \ |
| 3928 | -s "Read from client: 1 bytes read" |
| 3929 | |
| 3930 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3931 | run_test "Small packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3932 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3933 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3934 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3935 | 0 \ |
| 3936 | -s "Read from client: 1 bytes read" |
| 3937 | |
| 3938 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3939 | run_test "Small packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3940 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3941 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3942 | 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] | 3943 | 0 \ |
| 3944 | -s "Read from client: 1 bytes read" |
| 3945 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3946 | run_test "Small packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3947 | "$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] | 3948 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3949 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3950 | 0 \ |
| 3951 | -s "Read from client: 1 bytes read" |
| 3952 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3953 | run_test "Small packet TLS 1.1 StreamCipher, without EtM" \ |
| 3954 | "$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] | 3955 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3956 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3957 | 0 \ |
| 3958 | -s "Read from client: 1 bytes read" |
| 3959 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3960 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3961 | run_test "Small packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3962 | "$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] | 3963 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3964 | 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] | 3965 | 0 \ |
| 3966 | -s "Read from client: 1 bytes read" |
| 3967 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3968 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3969 | run_test "Small packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3970 | "$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] | 3971 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3972 | 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] | 3973 | 0 \ |
| 3974 | -s "Read from client: 1 bytes read" |
| 3975 | |
| 3976 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 3977 | "$P_SRV" \ |
| 3978 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3979 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3980 | 0 \ |
| 3981 | -s "Read from client: 1 bytes read" |
| 3982 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3983 | run_test "Small packet TLS 1.2 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3984 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3985 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3986 | 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] | 3987 | 0 \ |
| 3988 | -s "Read from client: 1 bytes read" |
| 3989 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3990 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 3991 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3992 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3993 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3994 | 0 \ |
| 3995 | -s "Read from client: 1 bytes read" |
| 3996 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3997 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3998 | run_test "Small packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3999 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4000 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4001 | 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] | 4002 | 0 \ |
| 4003 | -s "Read from client: 1 bytes read" |
| 4004 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4005 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4006 | run_test "Small packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4007 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4008 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4009 | 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] | 4010 | 0 \ |
| 4011 | -s "Read from client: 1 bytes read" |
| 4012 | |
| 4013 | run_test "Small packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4014 | "$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] | 4015 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4016 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4017 | 0 \ |
| 4018 | -s "Read from client: 1 bytes read" |
| 4019 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4020 | run_test "Small packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4021 | "$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] | 4022 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4023 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4024 | 0 \ |
| 4025 | -s "Read from client: 1 bytes read" |
| 4026 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4027 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4028 | run_test "Small packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4029 | "$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] | 4030 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4031 | 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] | 4032 | 0 \ |
| 4033 | -s "Read from client: 1 bytes read" |
| 4034 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4035 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4036 | run_test "Small packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4037 | "$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] | 4038 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4039 | 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] | 4040 | 0 \ |
| 4041 | -s "Read from client: 1 bytes read" |
| 4042 | |
| 4043 | run_test "Small packet TLS 1.2 AEAD" \ |
| 4044 | "$P_SRV" \ |
| 4045 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4046 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4047 | 0 \ |
| 4048 | -s "Read from client: 1 bytes read" |
| 4049 | |
| 4050 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 4051 | "$P_SRV" \ |
| 4052 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4053 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4054 | 0 \ |
| 4055 | -s "Read from client: 1 bytes read" |
| 4056 | |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4057 | # Tests for small packets in DTLS |
| 4058 | |
| 4059 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4060 | run_test "Small packet DTLS 1.0" \ |
| 4061 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 4062 | "$P_CLI dtls=1 request_size=1 \ |
| 4063 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4064 | 0 \ |
| 4065 | -s "Read from client: 1 bytes read" |
| 4066 | |
| 4067 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4068 | run_test "Small packet DTLS 1.0, without EtM" \ |
| 4069 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 4070 | "$P_CLI dtls=1 request_size=1 \ |
| 4071 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4072 | 0 \ |
| 4073 | -s "Read from client: 1 bytes read" |
| 4074 | |
| 4075 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4076 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4077 | run_test "Small packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4078 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 4079 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4080 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4081 | 0 \ |
| 4082 | -s "Read from client: 1 bytes read" |
| 4083 | |
| 4084 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4085 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4086 | run_test "Small packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4087 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4088 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4089 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4090 | 0 \ |
| 4091 | -s "Read from client: 1 bytes read" |
| 4092 | |
| 4093 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4094 | run_test "Small packet DTLS 1.2" \ |
| 4095 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 4096 | "$P_CLI dtls=1 request_size=1 \ |
| 4097 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4098 | 0 \ |
| 4099 | -s "Read from client: 1 bytes read" |
| 4100 | |
| 4101 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4102 | run_test "Small packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4103 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4104 | "$P_CLI dtls=1 request_size=1 \ |
| 4105 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4106 | 0 \ |
| 4107 | -s "Read from client: 1 bytes read" |
| 4108 | |
| 4109 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4110 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4111 | run_test "Small packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4112 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4113 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4114 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4115 | 0 \ |
| 4116 | -s "Read from client: 1 bytes read" |
| 4117 | |
| 4118 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4119 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4120 | run_test "Small packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4121 | "$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] | 4122 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4123 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4124 | 0 \ |
| 4125 | -s "Read from client: 1 bytes read" |
| 4126 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4127 | # A test for extensions in SSLv3 |
| 4128 | |
| 4129 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4130 | run_test "SSLv3 with extensions, server side" \ |
| 4131 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 4132 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4133 | 0 \ |
| 4134 | -S "dumping 'client hello extensions'" \ |
| 4135 | -S "server hello, total extension length:" |
| 4136 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4137 | # Test for large packets |
| 4138 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4139 | # How many fragments do we expect to write $1 bytes? |
| 4140 | fragments_for_write() { |
| 4141 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4142 | } |
| 4143 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4144 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4145 | run_test "Large packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4146 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4147 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4148 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4149 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4150 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4151 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4152 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4153 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4154 | run_test "Large packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4155 | "$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] | 4156 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4157 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4158 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4159 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4160 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4161 | |
| 4162 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 4163 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4164 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4165 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4166 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4167 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4168 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4169 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4170 | run_test "Large packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4171 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4172 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4173 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4174 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4175 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4176 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4177 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4178 | run_test "Large packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4179 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4180 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4181 | 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] | 4182 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4183 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4184 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4185 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4186 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4187 | run_test "Large packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4188 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4189 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4190 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4191 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4192 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4193 | |
| 4194 | run_test "Large packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4195 | "$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] | 4196 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4197 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4198 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4199 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4200 | |
| 4201 | run_test "Large packet TLS 1.0 StreamCipher, without EtM" \ |
| 4202 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4203 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4204 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4205 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4206 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4207 | |
| 4208 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4209 | run_test "Large packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4210 | "$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] | 4211 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4212 | 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] | 4213 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4214 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4215 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4216 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4217 | run_test "Large packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4218 | "$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] | 4219 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4220 | 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] | 4221 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4222 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4223 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4224 | |
| 4225 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 4226 | "$P_SRV" \ |
| 4227 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4228 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4229 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4230 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4231 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4232 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4233 | run_test "Large packet TLS 1.1 BlockCipher, without EtM" \ |
| 4234 | "$P_SRV" \ |
| 4235 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4236 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4237 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4238 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4239 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4240 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4241 | run_test "Large packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4242 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4243 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4244 | 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] | 4245 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4246 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4247 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4248 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4249 | run_test "Large packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4250 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4251 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4252 | 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] | 4253 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4254 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4255 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4256 | run_test "Large packet TLS 1.1 StreamCipher" \ |
| 4257 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4258 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4259 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4260 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4261 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4262 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4263 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4264 | run_test "Large packet TLS 1.1 StreamCipher, without EtM" \ |
| 4265 | "$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] | 4266 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4267 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4268 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4269 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4270 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4271 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4272 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4273 | run_test "Large packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4274 | "$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] | 4275 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4276 | 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] | 4277 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4278 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4279 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4280 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4281 | run_test "Large packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4282 | "$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] | 4283 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4284 | 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] | 4285 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4286 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4287 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4288 | |
| 4289 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 4290 | "$P_SRV" \ |
| 4291 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4292 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4293 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4294 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4295 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4296 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4297 | run_test "Large packet TLS 1.2 BlockCipher, without EtM" \ |
| 4298 | "$P_SRV" \ |
| 4299 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 4300 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4301 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4302 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4303 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4304 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 4305 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4306 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4307 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4308 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4309 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4310 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4311 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4312 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4313 | run_test "Large packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4314 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4315 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4316 | 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] | 4317 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4318 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4319 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4320 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4321 | run_test "Large packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4322 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4323 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4324 | 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] | 4325 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4326 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4327 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4328 | |
| 4329 | run_test "Large packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4330 | "$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] | 4331 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4332 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4333 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4334 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4335 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4336 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4337 | run_test "Large packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4338 | "$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] | 4339 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4340 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4341 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4342 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4343 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4344 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4345 | run_test "Large packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4346 | "$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] | 4347 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4348 | 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] | 4349 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4350 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4351 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4352 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4353 | run_test "Large packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4354 | "$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] | 4355 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4356 | 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] | 4357 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4358 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4359 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4360 | |
| 4361 | run_test "Large packet TLS 1.2 AEAD" \ |
| 4362 | "$P_SRV" \ |
| 4363 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4364 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4365 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4366 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4367 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4368 | |
| 4369 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 4370 | "$P_SRV" \ |
| 4371 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4372 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4373 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4374 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4375 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4376 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4377 | # Tests of asynchronous private key support in SSL |
| 4378 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4379 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4380 | run_test "SSL async private: sign, delay=0" \ |
| 4381 | "$P_SRV \ |
| 4382 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4383 | "$P_CLI" \ |
| 4384 | 0 \ |
| 4385 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4386 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4387 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4388 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4389 | run_test "SSL async private: sign, delay=1" \ |
| 4390 | "$P_SRV \ |
| 4391 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4392 | "$P_CLI" \ |
| 4393 | 0 \ |
| 4394 | -s "Async sign callback: using key slot " \ |
| 4395 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4396 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4397 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 4398 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4399 | run_test "SSL async private: sign, delay=2" \ |
| 4400 | "$P_SRV \ |
| 4401 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 4402 | "$P_CLI" \ |
| 4403 | 0 \ |
| 4404 | -s "Async sign callback: using key slot " \ |
| 4405 | -U "Async sign callback: using key slot " \ |
| 4406 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 4407 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4408 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4409 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 4410 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 4411 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 4412 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4414 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 4415 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 4416 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 4417 | "$P_CLI force_version=tls1_1" \ |
| 4418 | 0 \ |
| 4419 | -s "Async sign callback: using key slot " \ |
| 4420 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4421 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4422 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 4423 | run_test "SSL async private: sign, SNI" \ |
| 4424 | "$P_SRV debug_level=3 \ |
| 4425 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 4426 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4427 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4428 | "$P_CLI server_name=polarssl.example" \ |
| 4429 | 0 \ |
| 4430 | -s "Async sign callback: using key slot " \ |
| 4431 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 4432 | -s "parse ServerName extension" \ |
| 4433 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4434 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4435 | |
| 4436 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4437 | run_test "SSL async private: decrypt, delay=0" \ |
| 4438 | "$P_SRV \ |
| 4439 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 4440 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4441 | 0 \ |
| 4442 | -s "Async decrypt callback: using key slot " \ |
| 4443 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4444 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4445 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4446 | run_test "SSL async private: decrypt, delay=1" \ |
| 4447 | "$P_SRV \ |
| 4448 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4449 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4450 | 0 \ |
| 4451 | -s "Async decrypt callback: using key slot " \ |
| 4452 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4453 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4454 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4455 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4456 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 4457 | "$P_SRV psk=abc123 \ |
| 4458 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 4459 | "$P_CLI psk=abc123 \ |
| 4460 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 4461 | 0 \ |
| 4462 | -s "Async decrypt callback: using key slot " \ |
| 4463 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4464 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4465 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4466 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 4467 | "$P_SRV psk=abc123 \ |
| 4468 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4469 | "$P_CLI psk=abc123 \ |
| 4470 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 4471 | 0 \ |
| 4472 | -s "Async decrypt callback: using key slot " \ |
| 4473 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4474 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4475 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4476 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4477 | run_test "SSL async private: sign callback not present" \ |
| 4478 | "$P_SRV \ |
| 4479 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4480 | "$P_CLI; [ \$? -eq 1 ] && |
| 4481 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4482 | 0 \ |
| 4483 | -S "Async sign callback" \ |
| 4484 | -s "! mbedtls_ssl_handshake returned" \ |
| 4485 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 4486 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 4487 | -s "Successful connection" |
| 4488 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4489 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4490 | run_test "SSL async private: decrypt callback not present" \ |
| 4491 | "$P_SRV debug_level=1 \ |
| 4492 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 4493 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 4494 | [ \$? -eq 1 ] && $P_CLI" \ |
| 4495 | 0 \ |
| 4496 | -S "Async decrypt callback" \ |
| 4497 | -s "! mbedtls_ssl_handshake returned" \ |
| 4498 | -s "got no RSA private key" \ |
| 4499 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 4500 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4501 | |
| 4502 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4503 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4504 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4505 | "$P_SRV \ |
| 4506 | async_operations=s async_private_delay1=1 \ |
| 4507 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4508 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4509 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 4510 | 0 \ |
| 4511 | -s "Async sign callback: using key slot 0," \ |
| 4512 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4513 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4514 | |
| 4515 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4516 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4517 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4518 | "$P_SRV \ |
| 4519 | async_operations=s async_private_delay2=1 \ |
| 4520 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4521 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4522 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4523 | 0 \ |
| 4524 | -s "Async sign callback: using key slot 0," \ |
| 4525 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4526 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4527 | |
| 4528 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4529 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 4530 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4531 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 4532 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4533 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4534 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4535 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4536 | 0 \ |
| 4537 | -s "Async sign callback: using key slot 1," \ |
| 4538 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4539 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4540 | |
| 4541 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4542 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4543 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4544 | "$P_SRV \ |
| 4545 | async_operations=s async_private_delay1=1 \ |
| 4546 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4547 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4548 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4549 | 0 \ |
| 4550 | -s "Async sign callback: no key matches this certificate." |
| 4551 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4552 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4553 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4554 | "$P_SRV \ |
| 4555 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4556 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4557 | "$P_CLI" \ |
| 4558 | 1 \ |
| 4559 | -s "Async sign callback: injected error" \ |
| 4560 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4561 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4562 | -s "! mbedtls_ssl_handshake returned" |
| 4563 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4564 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4565 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4566 | "$P_SRV \ |
| 4567 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4568 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4569 | "$P_CLI" \ |
| 4570 | 1 \ |
| 4571 | -s "Async sign callback: using key slot " \ |
| 4572 | -S "Async resume" \ |
| 4573 | -s "Async cancel" |
| 4574 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4575 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4576 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4577 | "$P_SRV \ |
| 4578 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4579 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4580 | "$P_CLI" \ |
| 4581 | 1 \ |
| 4582 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4583 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4584 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4585 | -s "! mbedtls_ssl_handshake returned" |
| 4586 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4587 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4588 | run_test "SSL async private: decrypt, error in start" \ |
| 4589 | "$P_SRV \ |
| 4590 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4591 | async_private_error=1" \ |
| 4592 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4593 | 1 \ |
| 4594 | -s "Async decrypt callback: injected error" \ |
| 4595 | -S "Async resume" \ |
| 4596 | -S "Async cancel" \ |
| 4597 | -s "! mbedtls_ssl_handshake returned" |
| 4598 | |
| 4599 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4600 | run_test "SSL async private: decrypt, cancel after start" \ |
| 4601 | "$P_SRV \ |
| 4602 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4603 | async_private_error=2" \ |
| 4604 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4605 | 1 \ |
| 4606 | -s "Async decrypt callback: using key slot " \ |
| 4607 | -S "Async resume" \ |
| 4608 | -s "Async cancel" |
| 4609 | |
| 4610 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4611 | run_test "SSL async private: decrypt, error in resume" \ |
| 4612 | "$P_SRV \ |
| 4613 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4614 | async_private_error=3" \ |
| 4615 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4616 | 1 \ |
| 4617 | -s "Async decrypt callback: using key slot " \ |
| 4618 | -s "Async resume callback: decrypt done but injected error" \ |
| 4619 | -S "Async cancel" \ |
| 4620 | -s "! mbedtls_ssl_handshake returned" |
| 4621 | |
| 4622 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4623 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4624 | "$P_SRV \ |
| 4625 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4626 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4627 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 4628 | 0 \ |
| 4629 | -s "Async cancel" \ |
| 4630 | -s "! mbedtls_ssl_handshake returned" \ |
| 4631 | -s "Async resume" \ |
| 4632 | -s "Successful connection" |
| 4633 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4634 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4635 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4636 | "$P_SRV \ |
| 4637 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4638 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4639 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 4640 | 0 \ |
| 4641 | -s "! mbedtls_ssl_handshake returned" \ |
| 4642 | -s "Async resume" \ |
| 4643 | -s "Successful connection" |
| 4644 | |
| 4645 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4646 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4647 | 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] | 4648 | "$P_SRV \ |
| 4649 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 4650 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4651 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4652 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 4653 | [ \$? -eq 1 ] && |
| 4654 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4655 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 4656 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4657 | -S "Async resume" \ |
| 4658 | -s "Async cancel" \ |
| 4659 | -s "! mbedtls_ssl_handshake returned" \ |
| 4660 | -s "Async sign callback: no key matches this certificate." \ |
| 4661 | -s "Successful connection" |
| 4662 | |
| 4663 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4664 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4665 | 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] | 4666 | "$P_SRV \ |
| 4667 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 4668 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4669 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4670 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 4671 | [ \$? -eq 1 ] && |
| 4672 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4673 | 0 \ |
| 4674 | -s "Async resume" \ |
| 4675 | -s "! mbedtls_ssl_handshake returned" \ |
| 4676 | -s "Async sign callback: no key matches this certificate." \ |
| 4677 | -s "Successful connection" |
| 4678 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4679 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4680 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4681 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 4682 | "$P_SRV \ |
| 4683 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4684 | exchanges=2 renegotiation=1" \ |
| 4685 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4686 | 0 \ |
| 4687 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4688 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4689 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4690 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4691 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4692 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 4693 | "$P_SRV \ |
| 4694 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4695 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4696 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 4697 | 0 \ |
| 4698 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4699 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4700 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4701 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4702 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 4703 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 4704 | "$P_SRV \ |
| 4705 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4706 | exchanges=2 renegotiation=1" \ |
| 4707 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 4708 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4709 | 0 \ |
| 4710 | -s "Async decrypt callback: using key slot " \ |
| 4711 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4712 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4713 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4714 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 4715 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 4716 | "$P_SRV \ |
| 4717 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4718 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4719 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 4720 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4721 | 0 \ |
| 4722 | -s "Async decrypt callback: using key slot " \ |
| 4723 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4724 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4725 | # Tests for ECC extensions (rfc 4492) |
| 4726 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4727 | requires_config_enabled MBEDTLS_AES_C |
| 4728 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4729 | requires_config_enabled MBEDTLS_SHA256_C |
| 4730 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4731 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 4732 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4733 | "$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] | 4734 | 0 \ |
| 4735 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 4736 | -C "client hello, adding supported_point_formats extension" \ |
| 4737 | -S "found supported elliptic curves extension" \ |
| 4738 | -S "found supported point formats extension" |
| 4739 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4740 | requires_config_enabled MBEDTLS_AES_C |
| 4741 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4742 | requires_config_enabled MBEDTLS_SHA256_C |
| 4743 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4744 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4745 | "$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] | 4746 | "$P_CLI debug_level=3" \ |
| 4747 | 0 \ |
| 4748 | -C "found supported_point_formats extension" \ |
| 4749 | -S "server hello, supported_point_formats extension" |
| 4750 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4751 | requires_config_enabled MBEDTLS_AES_C |
| 4752 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4753 | requires_config_enabled MBEDTLS_SHA256_C |
| 4754 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4755 | run_test "Force an ECC ciphersuite in the client side" \ |
| 4756 | "$P_SRV debug_level=3" \ |
| 4757 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 4758 | 0 \ |
| 4759 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 4760 | -c "client hello, adding supported_point_formats extension" \ |
| 4761 | -s "found supported elliptic curves extension" \ |
| 4762 | -s "found supported point formats extension" |
| 4763 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4764 | requires_config_enabled MBEDTLS_AES_C |
| 4765 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4766 | requires_config_enabled MBEDTLS_SHA256_C |
| 4767 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4768 | run_test "Force an ECC ciphersuite in the server side" \ |
| 4769 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 4770 | "$P_CLI debug_level=3" \ |
| 4771 | 0 \ |
| 4772 | -c "found supported_point_formats extension" \ |
| 4773 | -s "server hello, supported_point_formats extension" |
| 4774 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4775 | # Tests for DTLS HelloVerifyRequest |
| 4776 | |
| 4777 | run_test "DTLS cookie: enabled" \ |
| 4778 | "$P_SRV dtls=1 debug_level=2" \ |
| 4779 | "$P_CLI dtls=1 debug_level=2" \ |
| 4780 | 0 \ |
| 4781 | -s "cookie verification failed" \ |
| 4782 | -s "cookie verification passed" \ |
| 4783 | -S "cookie verification skipped" \ |
| 4784 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4785 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4786 | -S "SSL - The requested feature is not available" |
| 4787 | |
| 4788 | run_test "DTLS cookie: disabled" \ |
| 4789 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 4790 | "$P_CLI dtls=1 debug_level=2" \ |
| 4791 | 0 \ |
| 4792 | -S "cookie verification failed" \ |
| 4793 | -S "cookie verification passed" \ |
| 4794 | -s "cookie verification skipped" \ |
| 4795 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4796 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4797 | -S "SSL - The requested feature is not available" |
| 4798 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4799 | run_test "DTLS cookie: default (failing)" \ |
| 4800 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 4801 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 4802 | 1 \ |
| 4803 | -s "cookie verification failed" \ |
| 4804 | -S "cookie verification passed" \ |
| 4805 | -S "cookie verification skipped" \ |
| 4806 | -C "received hello verify request" \ |
| 4807 | -S "hello verification requested" \ |
| 4808 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4809 | |
| 4810 | requires_ipv6 |
| 4811 | run_test "DTLS cookie: enabled, IPv6" \ |
| 4812 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 4813 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 4814 | 0 \ |
| 4815 | -s "cookie verification failed" \ |
| 4816 | -s "cookie verification passed" \ |
| 4817 | -S "cookie verification skipped" \ |
| 4818 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4819 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4820 | -S "SSL - The requested feature is not available" |
| 4821 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4822 | run_test "DTLS cookie: enabled, nbio" \ |
| 4823 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 4824 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4825 | 0 \ |
| 4826 | -s "cookie verification failed" \ |
| 4827 | -s "cookie verification passed" \ |
| 4828 | -S "cookie verification skipped" \ |
| 4829 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4830 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4831 | -S "SSL - The requested feature is not available" |
| 4832 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4833 | # Tests for client reconnecting from the same port with DTLS |
| 4834 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4835 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4836 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4837 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 4838 | "$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] | 4839 | 0 \ |
| 4840 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4841 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4842 | -S "Client initiated reconnection from same port" |
| 4843 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4844 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4845 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4846 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 4847 | "$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] | 4848 | 0 \ |
| 4849 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4850 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4851 | -s "Client initiated reconnection from same port" |
| 4852 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4853 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 4854 | 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] | 4855 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 4856 | "$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] | 4857 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4858 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4859 | -s "Client initiated reconnection from same port" |
| 4860 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4861 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 4862 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 4863 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 4864 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 4865 | 0 \ |
| 4866 | -S "The operation timed out" \ |
| 4867 | -s "Client initiated reconnection from same port" |
| 4868 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4869 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 4870 | "$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] | 4871 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 4872 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4873 | -s "The operation timed out" \ |
| 4874 | -S "Client initiated reconnection from same port" |
| 4875 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4876 | # Tests for various cases of client authentication with DTLS |
| 4877 | # (focused on handshake flows and message parsing) |
| 4878 | |
| 4879 | run_test "DTLS client auth: required" \ |
| 4880 | "$P_SRV dtls=1 auth_mode=required" \ |
| 4881 | "$P_CLI dtls=1" \ |
| 4882 | 0 \ |
| 4883 | -s "Verifying peer X.509 certificate... ok" |
| 4884 | |
| 4885 | run_test "DTLS client auth: optional, client has no cert" \ |
| 4886 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 4887 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 4888 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4889 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4890 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4891 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4892 | "$P_SRV dtls=1 auth_mode=none" \ |
| 4893 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 4894 | 0 \ |
| 4895 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4896 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4897 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 4898 | run_test "DTLS wrong PSK: badmac alert" \ |
| 4899 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 4900 | "$P_CLI dtls=1 psk=abc124" \ |
| 4901 | 1 \ |
| 4902 | -s "SSL - Verification of the message MAC failed" \ |
| 4903 | -c "SSL - A fatal alert message was received from our peer" |
| 4904 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 4905 | # Tests for receiving fragmented handshake messages with DTLS |
| 4906 | |
| 4907 | requires_gnutls |
| 4908 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 4909 | "$G_SRV -u --mtu 2048 -a" \ |
| 4910 | "$P_CLI dtls=1 debug_level=2" \ |
| 4911 | 0 \ |
| 4912 | -C "found fragmented DTLS handshake message" \ |
| 4913 | -C "error" |
| 4914 | |
| 4915 | requires_gnutls |
| 4916 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 4917 | "$G_SRV -u --mtu 512" \ |
| 4918 | "$P_CLI dtls=1 debug_level=2" \ |
| 4919 | 0 \ |
| 4920 | -c "found fragmented DTLS handshake message" \ |
| 4921 | -C "error" |
| 4922 | |
| 4923 | requires_gnutls |
| 4924 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 4925 | "$G_SRV -u --mtu 128" \ |
| 4926 | "$P_CLI dtls=1 debug_level=2" \ |
| 4927 | 0 \ |
| 4928 | -c "found fragmented DTLS handshake message" \ |
| 4929 | -C "error" |
| 4930 | |
| 4931 | requires_gnutls |
| 4932 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 4933 | "$G_SRV -u --mtu 128" \ |
| 4934 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4935 | 0 \ |
| 4936 | -c "found fragmented DTLS handshake message" \ |
| 4937 | -C "error" |
| 4938 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4939 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4940 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4941 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 4942 | "$G_SRV -u --mtu 256" \ |
| 4943 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4944 | 0 \ |
| 4945 | -c "found fragmented DTLS handshake message" \ |
| 4946 | -c "client hello, adding renegotiation extension" \ |
| 4947 | -c "found renegotiation extension" \ |
| 4948 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4949 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4950 | -C "error" \ |
| 4951 | -s "Extra-header:" |
| 4952 | |
| 4953 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4954 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4955 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 4956 | "$G_SRV -u --mtu 256" \ |
| 4957 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4958 | 0 \ |
| 4959 | -c "found fragmented DTLS handshake message" \ |
| 4960 | -c "client hello, adding renegotiation extension" \ |
| 4961 | -c "found renegotiation extension" \ |
| 4962 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4963 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4964 | -C "error" \ |
| 4965 | -s "Extra-header:" |
| 4966 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4967 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 4968 | "$O_SRV -dtls1 -mtu 2048" \ |
| 4969 | "$P_CLI dtls=1 debug_level=2" \ |
| 4970 | 0 \ |
| 4971 | -C "found fragmented DTLS handshake message" \ |
| 4972 | -C "error" |
| 4973 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4974 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 4975 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4976 | "$P_CLI dtls=1 debug_level=2" \ |
| 4977 | 0 \ |
| 4978 | -c "found fragmented DTLS handshake message" \ |
| 4979 | -C "error" |
| 4980 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4981 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4982 | "$O_SRV -dtls1 -mtu 256" \ |
| 4983 | "$P_CLI dtls=1 debug_level=2" \ |
| 4984 | 0 \ |
| 4985 | -c "found fragmented DTLS handshake message" \ |
| 4986 | -C "error" |
| 4987 | |
| 4988 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 4989 | "$O_SRV -dtls1 -mtu 256" \ |
| 4990 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4991 | 0 \ |
| 4992 | -c "found fragmented DTLS handshake message" \ |
| 4993 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4994 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 4995 | # Tests for sending fragmented handshake messages with DTLS |
| 4996 | # |
| 4997 | # Use client auth when we need the client to send large messages, |
| 4998 | # and use large cert chains on both sides too (the long chains we have all use |
| 4999 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 5000 | # Sizes reached (UDP payload): |
| 5001 | # - 2037B for server certificate |
| 5002 | # - 1542B for client certificate |
| 5003 | # - 1013B for newsessionticket |
| 5004 | # - all others below 512B |
| 5005 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 5006 | |
| 5007 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5008 | requires_config_enabled MBEDTLS_RSA_C |
| 5009 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5010 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 5011 | run_test "DTLS fragmenting: none (for reference)" \ |
| 5012 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5013 | crt_file=data_files/server7_int-ca.crt \ |
| 5014 | key_file=data_files/server7.key \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5015 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5016 | "$P_CLI dtls=1 debug_level=2 \ |
| 5017 | crt_file=data_files/server8_int-ca2.crt \ |
| 5018 | key_file=data_files/server8.key \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5019 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5020 | 0 \ |
| 5021 | -S "found fragmented DTLS handshake message" \ |
| 5022 | -C "found fragmented DTLS handshake message" \ |
| 5023 | -C "error" |
| 5024 | |
| 5025 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5026 | requires_config_enabled MBEDTLS_RSA_C |
| 5027 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5028 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5029 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5030 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5031 | crt_file=data_files/server7_int-ca.crt \ |
| 5032 | key_file=data_files/server7.key \ |
| 5033 | max_frag_len=1024" \ |
| 5034 | "$P_CLI dtls=1 debug_level=2 \ |
| 5035 | crt_file=data_files/server8_int-ca2.crt \ |
| 5036 | key_file=data_files/server8.key \ |
| 5037 | max_frag_len=2048" \ |
| 5038 | 0 \ |
| 5039 | -S "found fragmented DTLS handshake message" \ |
| 5040 | -c "found fragmented DTLS handshake message" \ |
| 5041 | -C "error" |
| 5042 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 5043 | # With the MFL extension, the server has no way of forcing |
| 5044 | # the client to not exceed a certain MTU; hence, the following |
| 5045 | # test can't be replicated with an MTU proxy such as the one |
| 5046 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5047 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5048 | requires_config_enabled MBEDTLS_RSA_C |
| 5049 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5050 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5051 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5052 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5053 | crt_file=data_files/server7_int-ca.crt \ |
| 5054 | key_file=data_files/server7.key \ |
| 5055 | max_frag_len=512" \ |
| 5056 | "$P_CLI dtls=1 debug_level=2 \ |
| 5057 | crt_file=data_files/server8_int-ca2.crt \ |
| 5058 | key_file=data_files/server8.key \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 5059 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5060 | 0 \ |
| 5061 | -S "found fragmented DTLS handshake message" \ |
| 5062 | -c "found fragmented DTLS handshake message" \ |
| 5063 | -C "error" |
| 5064 | |
| 5065 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5066 | requires_config_enabled MBEDTLS_RSA_C |
| 5067 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5068 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5069 | 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] | 5070 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 5071 | crt_file=data_files/server7_int-ca.crt \ |
| 5072 | key_file=data_files/server7.key \ |
| 5073 | max_frag_len=2048" \ |
| 5074 | "$P_CLI dtls=1 debug_level=2 \ |
| 5075 | crt_file=data_files/server8_int-ca2.crt \ |
| 5076 | key_file=data_files/server8.key \ |
| 5077 | max_frag_len=512" \ |
| 5078 | 0 \ |
| 5079 | -S "found fragmented DTLS handshake message" \ |
| 5080 | -c "found fragmented DTLS handshake message" \ |
| 5081 | -C "error" |
| 5082 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 5083 | # While not required by the standard defining the MFL extension |
| 5084 | # (according to which it only applies to records, not to datagrams), |
| 5085 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 5086 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 5087 | # to the peer. |
| 5088 | # The next test checks that no datagrams significantly larger than the |
| 5089 | # negotiated MFL are sent. |
| 5090 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5091 | requires_config_enabled MBEDTLS_RSA_C |
| 5092 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5093 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 5094 | run_test "DTLS fragmenting: client-initiated, server only (max_frag_len), proxy MTU" \ |
| 5095 | -p "$P_PXY mtu=560" \ |
| 5096 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 5097 | crt_file=data_files/server7_int-ca.crt \ |
| 5098 | key_file=data_files/server7.key \ |
| 5099 | max_frag_len=2048" \ |
| 5100 | "$P_CLI dtls=1 debug_level=2 \ |
| 5101 | crt_file=data_files/server8_int-ca2.crt \ |
| 5102 | key_file=data_files/server8.key \ |
| 5103 | max_frag_len=512" \ |
| 5104 | 0 \ |
| 5105 | -S "found fragmented DTLS handshake message" \ |
| 5106 | -c "found fragmented DTLS handshake message" \ |
| 5107 | -C "error" |
| 5108 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5109 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5110 | requires_config_enabled MBEDTLS_RSA_C |
| 5111 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5112 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5113 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5114 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5115 | crt_file=data_files/server7_int-ca.crt \ |
| 5116 | key_file=data_files/server7.key \ |
| 5117 | max_frag_len=2048" \ |
| 5118 | "$P_CLI dtls=1 debug_level=2 \ |
| 5119 | crt_file=data_files/server8_int-ca2.crt \ |
| 5120 | key_file=data_files/server8.key \ |
| 5121 | max_frag_len=512" \ |
| 5122 | 0 \ |
| 5123 | -s "found fragmented DTLS handshake message" \ |
| 5124 | -c "found fragmented DTLS handshake message" \ |
| 5125 | -C "error" |
| 5126 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 5127 | # While not required by the standard defining the MFL extension |
| 5128 | # (according to which it only applies to records, not to datagrams), |
| 5129 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 5130 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 5131 | # to the peer. |
| 5132 | # The next test checks that no datagrams significantly larger than the |
| 5133 | # negotiated MFL are sent. |
| 5134 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5135 | requires_config_enabled MBEDTLS_RSA_C |
| 5136 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5137 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 5138 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
| 5139 | -p "$P_PXY mtu=560" \ |
| 5140 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5141 | crt_file=data_files/server7_int-ca.crt \ |
| 5142 | key_file=data_files/server7.key \ |
| 5143 | max_frag_len=2048" \ |
| 5144 | "$P_CLI dtls=1 debug_level=2 \ |
| 5145 | crt_file=data_files/server8_int-ca2.crt \ |
| 5146 | key_file=data_files/server8.key \ |
| 5147 | max_frag_len=512" \ |
| 5148 | 0 \ |
| 5149 | -s "found fragmented DTLS handshake message" \ |
| 5150 | -c "found fragmented DTLS handshake message" \ |
| 5151 | -C "error" |
| 5152 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5153 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5154 | requires_config_enabled MBEDTLS_RSA_C |
| 5155 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5156 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 5157 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5158 | crt_file=data_files/server7_int-ca.crt \ |
| 5159 | key_file=data_files/server7.key \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5160 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5161 | "$P_CLI dtls=1 debug_level=2 \ |
| 5162 | crt_file=data_files/server8_int-ca2.crt \ |
| 5163 | key_file=data_files/server8.key \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5164 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5165 | 0 \ |
| 5166 | -S "found fragmented DTLS handshake message" \ |
| 5167 | -C "found fragmented DTLS handshake message" \ |
| 5168 | -C "error" |
| 5169 | |
| 5170 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5171 | requires_config_enabled MBEDTLS_RSA_C |
| 5172 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5173 | run_test "DTLS fragmenting: client (MTU)" \ |
| 5174 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5175 | crt_file=data_files/server7_int-ca.crt \ |
| 5176 | key_file=data_files/server7.key \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5177 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5178 | "$P_CLI dtls=1 debug_level=2 \ |
| 5179 | crt_file=data_files/server8_int-ca2.crt \ |
| 5180 | key_file=data_files/server8.key \ |
| 5181 | mtu=512" \ |
| 5182 | 0 \ |
| 5183 | -s "found fragmented DTLS handshake message" \ |
| 5184 | -C "found fragmented DTLS handshake message" \ |
| 5185 | -C "error" |
| 5186 | |
| 5187 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5188 | requires_config_enabled MBEDTLS_RSA_C |
| 5189 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5190 | run_test "DTLS fragmenting: server (MTU)" \ |
| 5191 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5192 | crt_file=data_files/server7_int-ca.crt \ |
| 5193 | key_file=data_files/server7.key \ |
| 5194 | mtu=512" \ |
| 5195 | "$P_CLI dtls=1 debug_level=2 \ |
| 5196 | crt_file=data_files/server8_int-ca2.crt \ |
| 5197 | key_file=data_files/server8.key \ |
| 5198 | mtu=2048" \ |
| 5199 | 0 \ |
| 5200 | -S "found fragmented DTLS handshake message" \ |
| 5201 | -c "found fragmented DTLS handshake message" \ |
| 5202 | -C "error" |
| 5203 | |
| 5204 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5205 | requires_config_enabled MBEDTLS_RSA_C |
| 5206 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5207 | run_test "DTLS fragmenting: both (MTU)" \ |
Manuel Pégourié-Gonnard | 4532329 | 2018-08-20 11:52:24 +0200 | [diff] [blame] | 5208 | -p "$P_PXY mtu=512" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5209 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5210 | crt_file=data_files/server7_int-ca.crt \ |
| 5211 | key_file=data_files/server7.key \ |
| 5212 | mtu=512" \ |
| 5213 | "$P_CLI dtls=1 debug_level=2 \ |
| 5214 | crt_file=data_files/server8_int-ca2.crt \ |
| 5215 | key_file=data_files/server8.key \ |
| 5216 | mtu=512" \ |
| 5217 | 0 \ |
| 5218 | -s "found fragmented DTLS handshake message" \ |
| 5219 | -c "found fragmented DTLS handshake message" \ |
| 5220 | -C "error" |
| 5221 | |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 5222 | # Test for automatic MTU reduction on repeated resend |
| 5223 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5224 | requires_config_enabled MBEDTLS_RSA_C |
| 5225 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5226 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 5227 | -p "$P_PXY mtu=508" \ |
| 5228 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5229 | crt_file=data_files/server7_int-ca.crt \ |
| 5230 | key_file=data_files/server7.key\ |
| 5231 | hs_timeout=100-400" \ |
| 5232 | "$P_CLI dtls=1 debug_level=2 \ |
| 5233 | crt_file=data_files/server8_int-ca2.crt \ |
| 5234 | key_file=data_files/server8.key \ |
| 5235 | hs_timeout=100-400" \ |
| 5236 | 0 \ |
| 5237 | -s "found fragmented DTLS handshake message" \ |
| 5238 | -c "found fragmented DTLS handshake message" \ |
| 5239 | -C "error" |
| 5240 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5241 | # 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] | 5242 | # OTOH the client might resend if the server is to slow to reset after sending |
| 5243 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5244 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5245 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5246 | requires_config_enabled MBEDTLS_RSA_C |
| 5247 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5248 | run_test "DTLS fragmenting: proxy MTU, simple handshake" \ |
| 5249 | -p "$P_PXY mtu=512" \ |
| 5250 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5251 | crt_file=data_files/server7_int-ca.crt \ |
| 5252 | key_file=data_files/server7.key \ |
| 5253 | mtu=512" \ |
| 5254 | "$P_CLI dtls=1 debug_level=2 \ |
| 5255 | crt_file=data_files/server8_int-ca2.crt \ |
| 5256 | key_file=data_files/server8.key \ |
| 5257 | mtu=512" \ |
| 5258 | 0 \ |
| 5259 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5260 | -s "found fragmented DTLS handshake message" \ |
| 5261 | -c "found fragmented DTLS handshake message" \ |
| 5262 | -C "error" |
| 5263 | |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 5264 | not_with_valgrind # spurious resend due to timeout |
| 5265 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5266 | requires_config_enabled MBEDTLS_RSA_C |
| 5267 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5268 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio" \ |
| 5269 | -p "$P_PXY mtu=512" \ |
| 5270 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5271 | crt_file=data_files/server7_int-ca.crt \ |
| 5272 | key_file=data_files/server7.key \ |
| 5273 | mtu=512 nbio=2" \ |
| 5274 | "$P_CLI dtls=1 debug_level=2 \ |
| 5275 | crt_file=data_files/server8_int-ca2.crt \ |
| 5276 | key_file=data_files/server8.key \ |
| 5277 | mtu=512 nbio=2" \ |
| 5278 | 0 \ |
| 5279 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5280 | -s "found fragmented DTLS handshake message" \ |
| 5281 | -c "found fragmented DTLS handshake message" \ |
| 5282 | -C "error" |
| 5283 | |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5284 | # This ensures things still work after session_reset(), |
| 5285 | # for example it would have caught #1941. |
| 5286 | # It also exercises the "resumed hanshake" flow. |
| 5287 | # Since we don't support reading fragmented ClientHello yet, |
| 5288 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 5289 | # but still smaller than client's Certificate to ensure fragmentation). |
Hanno Becker | 5bcf2b0 | 2018-08-21 14:25:40 +0100 | [diff] [blame] | 5290 | # A resend on the client-side might happen if the server is |
| 5291 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 5292 | # reco_delay avoids races where the client reconnects before the server has |
| 5293 | # resumed listening, which would result in a spurious resend. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5294 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5295 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5296 | requires_config_enabled MBEDTLS_RSA_C |
| 5297 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5298 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 5299 | -p "$P_PXY mtu=1450" \ |
| 5300 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5301 | crt_file=data_files/server7_int-ca.crt \ |
| 5302 | key_file=data_files/server7.key \ |
| 5303 | mtu=1450" \ |
| 5304 | "$P_CLI dtls=1 debug_level=2 \ |
| 5305 | crt_file=data_files/server8_int-ca2.crt \ |
| 5306 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 5307 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5308 | 0 \ |
| 5309 | -S "resend" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5310 | -s "found fragmented DTLS handshake message" \ |
| 5311 | -c "found fragmented DTLS handshake message" \ |
| 5312 | -C "error" |
| 5313 | |
Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5314 | # A resend on the client-side might happen if the server is |
| 5315 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5316 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5317 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5318 | requires_config_enabled MBEDTLS_RSA_C |
| 5319 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5320 | requires_config_enabled MBEDTLS_SHA256_C |
| 5321 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 5322 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5323 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 5324 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 5325 | -p "$P_PXY mtu=512" \ |
| 5326 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5327 | crt_file=data_files/server7_int-ca.crt \ |
| 5328 | key_file=data_files/server7.key \ |
| 5329 | exchanges=2 renegotiation=1 \ |
| 5330 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
| 5331 | mtu=512" \ |
| 5332 | "$P_CLI dtls=1 debug_level=2 \ |
| 5333 | crt_file=data_files/server8_int-ca2.crt \ |
| 5334 | key_file=data_files/server8.key \ |
| 5335 | exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5336 | mtu=512" \ |
| 5337 | 0 \ |
| 5338 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5339 | -s "found fragmented DTLS handshake message" \ |
| 5340 | -c "found fragmented DTLS handshake message" \ |
| 5341 | -C "error" |
| 5342 | |
Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5343 | # A resend on the client-side might happen if the server is |
| 5344 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5345 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5346 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5347 | requires_config_enabled MBEDTLS_RSA_C |
| 5348 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5349 | requires_config_enabled MBEDTLS_SHA256_C |
| 5350 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 5351 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5352 | requires_config_enabled MBEDTLS_AES_C |
| 5353 | requires_config_enabled MBEDTLS_GCM_C |
| 5354 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 5355 | -p "$P_PXY mtu=512" \ |
| 5356 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5357 | crt_file=data_files/server7_int-ca.crt \ |
| 5358 | key_file=data_files/server7.key \ |
| 5359 | exchanges=2 renegotiation=1 \ |
| 5360 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5361 | mtu=512" \ |
| 5362 | "$P_CLI dtls=1 debug_level=2 \ |
| 5363 | crt_file=data_files/server8_int-ca2.crt \ |
| 5364 | key_file=data_files/server8.key \ |
| 5365 | exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5366 | mtu=512" \ |
| 5367 | 0 \ |
| 5368 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5369 | -s "found fragmented DTLS handshake message" \ |
| 5370 | -c "found fragmented DTLS handshake message" \ |
| 5371 | -C "error" |
| 5372 | |
Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5373 | # A resend on the client-side might happen if the server is |
| 5374 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5375 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5376 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5377 | requires_config_enabled MBEDTLS_RSA_C |
| 5378 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5379 | requires_config_enabled MBEDTLS_SHA256_C |
| 5380 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 5381 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5382 | requires_config_enabled MBEDTLS_AES_C |
| 5383 | requires_config_enabled MBEDTLS_CCM_C |
| 5384 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
| 5385 | -p "$P_PXY mtu=512" \ |
| 5386 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5387 | crt_file=data_files/server7_int-ca.crt \ |
| 5388 | key_file=data_files/server7.key \ |
| 5389 | exchanges=2 renegotiation=1 \ |
| 5390 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
| 5391 | mtu=512" \ |
| 5392 | "$P_CLI dtls=1 debug_level=2 \ |
| 5393 | crt_file=data_files/server8_int-ca2.crt \ |
| 5394 | key_file=data_files/server8.key \ |
| 5395 | exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5396 | mtu=512" \ |
| 5397 | 0 \ |
| 5398 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5399 | -s "found fragmented DTLS handshake message" \ |
| 5400 | -c "found fragmented DTLS handshake message" \ |
| 5401 | -C "error" |
| 5402 | |
Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5403 | # A resend on the client-side might happen if the server is |
| 5404 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5405 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5406 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5407 | requires_config_enabled MBEDTLS_RSA_C |
| 5408 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5409 | requires_config_enabled MBEDTLS_SHA256_C |
| 5410 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 5411 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5412 | requires_config_enabled MBEDTLS_AES_C |
| 5413 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5414 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 5415 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
| 5416 | -p "$P_PXY mtu=512" \ |
| 5417 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5418 | crt_file=data_files/server7_int-ca.crt \ |
| 5419 | key_file=data_files/server7.key \ |
| 5420 | exchanges=2 renegotiation=1 \ |
| 5421 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
| 5422 | mtu=512" \ |
| 5423 | "$P_CLI dtls=1 debug_level=2 \ |
| 5424 | crt_file=data_files/server8_int-ca2.crt \ |
| 5425 | key_file=data_files/server8.key \ |
| 5426 | exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5427 | mtu=512" \ |
| 5428 | 0 \ |
| 5429 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5430 | -s "found fragmented DTLS handshake message" \ |
| 5431 | -c "found fragmented DTLS handshake message" \ |
| 5432 | -C "error" |
| 5433 | |
Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5434 | # A resend on the client-side might happen if the server is |
| 5435 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5436 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5437 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5438 | requires_config_enabled MBEDTLS_RSA_C |
| 5439 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5440 | requires_config_enabled MBEDTLS_SHA256_C |
| 5441 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 5442 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5443 | requires_config_enabled MBEDTLS_AES_C |
| 5444 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5445 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
| 5446 | -p "$P_PXY mtu=512" \ |
| 5447 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5448 | crt_file=data_files/server7_int-ca.crt \ |
| 5449 | key_file=data_files/server7.key \ |
| 5450 | exchanges=2 renegotiation=1 \ |
| 5451 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
| 5452 | mtu=512" \ |
| 5453 | "$P_CLI dtls=1 debug_level=2 \ |
| 5454 | crt_file=data_files/server8_int-ca2.crt \ |
| 5455 | key_file=data_files/server8.key \ |
| 5456 | exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5457 | mtu=512" \ |
| 5458 | 0 \ |
| 5459 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5460 | -s "found fragmented DTLS handshake message" \ |
| 5461 | -c "found fragmented DTLS handshake message" \ |
| 5462 | -C "error" |
| 5463 | |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 5464 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5465 | requires_config_enabled MBEDTLS_RSA_C |
| 5466 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5467 | client_needs_more_time 2 |
| 5468 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 5469 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5470 | "$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] | 5471 | crt_file=data_files/server7_int-ca.crt \ |
| 5472 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5473 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5474 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 5475 | crt_file=data_files/server8_int-ca2.crt \ |
| 5476 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5477 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 5478 | 0 \ |
| 5479 | -s "found fragmented DTLS handshake message" \ |
| 5480 | -c "found fragmented DTLS handshake message" \ |
| 5481 | -C "error" |
| 5482 | |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 5483 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5484 | requires_config_enabled MBEDTLS_RSA_C |
| 5485 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5486 | client_needs_more_time 2 |
| 5487 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 5488 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 5489 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5490 | crt_file=data_files/server7_int-ca.crt \ |
| 5491 | key_file=data_files/server7.key \ |
| 5492 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 5493 | "$P_CLI dtls=1 debug_level=2 \ |
| 5494 | crt_file=data_files/server8_int-ca2.crt \ |
| 5495 | key_file=data_files/server8.key \ |
| 5496 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 5497 | 0 \ |
| 5498 | -s "found fragmented DTLS handshake message" \ |
| 5499 | -c "found fragmented DTLS handshake message" \ |
| 5500 | -C "error" |
| 5501 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5502 | # interop tests for DTLS fragmentating with reliable connection |
| 5503 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5504 | # here and below we just want to test that the we fragment in a way that |
| 5505 | # pleases other implementations, so we don't need the peer to fragment |
Hanno Becker | f362c29 | 2018-08-20 12:40:23 +0100 | [diff] [blame] | 5506 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5507 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5508 | requires_config_enabled MBEDTLS_RSA_C |
| 5509 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5511 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5512 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 5513 | "$G_SRV -u" \ |
| 5514 | "$P_CLI dtls=1 debug_level=2 \ |
| 5515 | crt_file=data_files/server8_int-ca2.crt \ |
| 5516 | key_file=data_files/server8.key \ |
| 5517 | mtu=512 force_version=dtls1_2" \ |
| 5518 | 0 \ |
| 5519 | -c "fragmenting handshake message" \ |
| 5520 | -C "error" |
| 5521 | |
Hanno Becker | f362c29 | 2018-08-20 12:40:23 +0100 | [diff] [blame] | 5522 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5523 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5524 | requires_config_enabled MBEDTLS_RSA_C |
| 5525 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5527 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5528 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 5529 | "$G_SRV -u" \ |
| 5530 | "$P_CLI dtls=1 debug_level=2 \ |
| 5531 | crt_file=data_files/server8_int-ca2.crt \ |
| 5532 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5533 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5534 | 0 \ |
| 5535 | -c "fragmenting handshake message" \ |
| 5536 | -C "error" |
| 5537 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5538 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5539 | requires_config_enabled MBEDTLS_RSA_C |
| 5540 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5542 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5543 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5544 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5545 | crt_file=data_files/server7_int-ca.crt \ |
| 5546 | key_file=data_files/server7.key \ |
| 5547 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5548 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5549 | 0 \ |
| 5550 | -s "fragmenting handshake message" |
| 5551 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5552 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5553 | requires_config_enabled MBEDTLS_RSA_C |
| 5554 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5556 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5557 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5558 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5559 | crt_file=data_files/server7_int-ca.crt \ |
| 5560 | key_file=data_files/server7.key \ |
| 5561 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5562 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5563 | 0 \ |
| 5564 | -s "fragmenting handshake message" |
| 5565 | |
| 5566 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5567 | requires_config_enabled MBEDTLS_RSA_C |
| 5568 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5570 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 5571 | "$O_SRV -dtls1_2 -verify 10" \ |
| 5572 | "$P_CLI dtls=1 debug_level=2 \ |
| 5573 | crt_file=data_files/server8_int-ca2.crt \ |
| 5574 | key_file=data_files/server8.key \ |
| 5575 | mtu=512 force_version=dtls1_2" \ |
| 5576 | 0 \ |
| 5577 | -c "fragmenting handshake message" \ |
| 5578 | -C "error" |
| 5579 | |
| 5580 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5581 | requires_config_enabled MBEDTLS_RSA_C |
| 5582 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5584 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 5585 | "$O_SRV -dtls1 -verify 10" \ |
| 5586 | "$P_CLI dtls=1 debug_level=2 \ |
| 5587 | crt_file=data_files/server8_int-ca2.crt \ |
| 5588 | key_file=data_files/server8.key \ |
| 5589 | mtu=512 force_version=dtls1" \ |
| 5590 | 0 \ |
| 5591 | -c "fragmenting handshake message" \ |
| 5592 | -C "error" |
| 5593 | |
| 5594 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5595 | requires_config_enabled MBEDTLS_RSA_C |
| 5596 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5598 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 5599 | "$P_SRV dtls=1 debug_level=2 \ |
| 5600 | crt_file=data_files/server7_int-ca.crt \ |
| 5601 | key_file=data_files/server7.key \ |
| 5602 | mtu=512 force_version=dtls1_2" \ |
| 5603 | "$O_CLI -dtls1_2" \ |
| 5604 | 0 \ |
| 5605 | -s "fragmenting handshake message" |
| 5606 | |
| 5607 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5608 | requires_config_enabled MBEDTLS_RSA_C |
| 5609 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5611 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 5612 | "$P_SRV dtls=1 debug_level=2 \ |
| 5613 | crt_file=data_files/server7_int-ca.crt \ |
| 5614 | key_file=data_files/server7.key \ |
| 5615 | mtu=512 force_version=dtls1" \ |
| 5616 | "$O_CLI -dtls1" \ |
| 5617 | 0 \ |
| 5618 | -s "fragmenting handshake message" |
| 5619 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5620 | # interop tests for DTLS fragmentating with unreliable connection |
| 5621 | # |
| 5622 | # again we just want to test that the we fragment in a way that |
| 5623 | # pleases other implementations, so we don't need the peer to fragment |
| 5624 | requires_gnutls_next |
| 5625 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5626 | requires_config_enabled MBEDTLS_RSA_C |
| 5627 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5629 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5630 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 5631 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5632 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5633 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5634 | crt_file=data_files/server8_int-ca2.crt \ |
| 5635 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5636 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5637 | 0 \ |
| 5638 | -c "fragmenting handshake message" \ |
| 5639 | -C "error" |
| 5640 | |
| 5641 | requires_gnutls_next |
| 5642 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5643 | requires_config_enabled MBEDTLS_RSA_C |
| 5644 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5646 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5647 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 5648 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5649 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5650 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5651 | crt_file=data_files/server8_int-ca2.crt \ |
| 5652 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5653 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5654 | 0 \ |
| 5655 | -c "fragmenting handshake message" \ |
| 5656 | -C "error" |
| 5657 | |
| 5658 | ## The two tests below are disabled due to a bug in GnuTLS client that causes |
| 5659 | ## handshake failures when the NewSessionTicket message is lost, see |
| 5660 | ## https://gitlab.com/gnutls/gnutls/issues/543 |
| 5661 | ## We can re-enable them when a fixed version fo GnuTLS is available |
| 5662 | ## and installed in our CI system. |
| 5663 | ## |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5664 | ## requires_gnutls |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5665 | ## requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5666 | ## requires_config_enabled MBEDTLS_RSA_C |
| 5667 | ## requires_config_enabled MBEDTLS_ECDSA_C |
| 5668 | ## requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5669 | ## client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5670 | ## run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 5671 | ## -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5672 | ## "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5673 | ## crt_file=data_files/server7_int-ca.crt \ |
| 5674 | ## key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5675 | ## hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5676 | ## "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5677 | ## 0 \ |
| 5678 | ## -s "fragmenting handshake message" |
| 5679 | ## |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5680 | ## requires_gnutls |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5681 | ## requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5682 | ## requires_config_enabled MBEDTLS_RSA_C |
| 5683 | ## requires_config_enabled MBEDTLS_ECDSA_C |
| 5684 | ## requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5685 | ## client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5686 | ## run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 5687 | ## -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5688 | ## "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5689 | ## crt_file=data_files/server7_int-ca.crt \ |
| 5690 | ## key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5691 | ## hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5692 | ## "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5693 | ## 0 \ |
| 5694 | ## -s "fragmenting handshake message" |
| 5695 | |
| 5696 | ## Interop test with OpenSSL might triger a bug in recent versions (that |
| 5697 | ## probably won't be fixed before 1.1.1X), so we use an old version that |
| 5698 | ## doesn't have this bug, but unfortunately it doesn't have support for DTLS |
| 5699 | ## 1.2 either, so the DTLS 1.2 tests are commented for now. |
| 5700 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 5701 | ## They should be re-enabled (and the DTLS 1.0 switched back to a non-legacy |
| 5702 | ## version of OpenSSL once a fixed version of OpenSSL is available) |
| 5703 | ## |
| 5704 | ## requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5705 | ## requires_config_enabled MBEDTLS_RSA_C |
| 5706 | ## requires_config_enabled MBEDTLS_ECDSA_C |
| 5707 | ## requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5708 | ## client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5709 | ## run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 5710 | ## -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5711 | ## "$O_SRV -dtls1_2 -verify 10" \ |
| 5712 | ## "$P_CLI dtls=1 debug_level=2 \ |
| 5713 | ## crt_file=data_files/server8_int-ca2.crt \ |
| 5714 | ## key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5715 | ## hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5716 | ## 0 \ |
| 5717 | ## -c "fragmenting handshake message" \ |
| 5718 | ## -C "error" |
| 5719 | |
| 5720 | requires_openssl_legacy |
| 5721 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5722 | requires_config_enabled MBEDTLS_RSA_C |
| 5723 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5725 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5726 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 5727 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5728 | "$O_LEGACY_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5729 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5730 | crt_file=data_files/server8_int-ca2.crt \ |
| 5731 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5732 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5733 | 0 \ |
| 5734 | -c "fragmenting handshake message" \ |
| 5735 | -C "error" |
| 5736 | |
| 5737 | ## see comment on the previous-previous test |
| 5738 | ## requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5739 | ## requires_config_enabled MBEDTLS_RSA_C |
| 5740 | ## requires_config_enabled MBEDTLS_ECDSA_C |
| 5741 | ## requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5742 | ## client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5743 | ## run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 5744 | ## -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5745 | ## "$P_SRV dtls=1 debug_level=2 \ |
| 5746 | ## crt_file=data_files/server7_int-ca.crt \ |
| 5747 | ## key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5748 | ## hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5749 | ## "$O_CLI -dtls1_2" \ |
| 5750 | ## 0 \ |
| 5751 | ## -s "fragmenting handshake message" |
| 5752 | |
| 5753 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 5754 | # messages at the end of the handshake |
Hanno Becker | 4a9d006 | 2018-08-17 16:10:47 +0100 | [diff] [blame] | 5755 | requires_openssl_legacy |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5756 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5757 | requires_config_enabled MBEDTLS_RSA_C |
| 5758 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5760 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5761 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 5762 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5763 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5764 | crt_file=data_files/server7_int-ca.crt \ |
| 5765 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5766 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5767 | "$O_LEGACY_CLI -nbio -dtls1" \ |
| 5768 | 0 \ |
| 5769 | -s "fragmenting handshake message" |
| 5770 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 5771 | # Tests for specific things with "unreliable" UDP connection |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 5772 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5773 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5774 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 5775 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5776 | "$P_SRV dtls=1 debug_level=2" \ |
| 5777 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5778 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 5779 | -C "replayed record" \ |
| 5780 | -S "replayed record" \ |
| 5781 | -C "record from another epoch" \ |
| 5782 | -S "record from another epoch" \ |
| 5783 | -C "discarding invalid record" \ |
| 5784 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5785 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 5786 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5787 | -c "HTTP/1.0 200 OK" |
| 5788 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5789 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 5790 | run_test "DTLS proxy: duplicate every packet" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5791 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5792 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 5793 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5794 | 0 \ |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 5795 | -c "replayed record" \ |
| 5796 | -s "replayed record" \ |
Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 5797 | -c "record from another epoch" \ |
| 5798 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5799 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 5800 | -s "Extra-header:" \ |
| 5801 | -c "HTTP/1.0 200 OK" |
| 5802 | |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 5803 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 5804 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5805 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 5806 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 5807 | 0 \ |
| 5808 | -c "replayed record" \ |
| 5809 | -S "replayed record" \ |
Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 5810 | -c "record from another epoch" \ |
| 5811 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5812 | -c "resend" \ |
| 5813 | -s "resend" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 5814 | -s "Extra-header:" \ |
| 5815 | -c "HTTP/1.0 200 OK" |
| 5816 | |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 5817 | run_test "DTLS proxy: multiple records in same datagram" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5818 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5819 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 5820 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 5821 | 0 \ |
| 5822 | -c "next record in same datagram" \ |
| 5823 | -s "next record in same datagram" |
| 5824 | |
| 5825 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5826 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5827 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 5828 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 5829 | 0 \ |
| 5830 | -c "next record in same datagram" \ |
| 5831 | -s "next record in same datagram" |
| 5832 | |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5833 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 5834 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5835 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 5836 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5837 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5838 | -c "discarding invalid record (mac)" \ |
| 5839 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5840 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5841 | -c "HTTP/1.0 200 OK" \ |
| 5842 | -S "too many records with bad MAC" \ |
| 5843 | -S "Verification of the message MAC failed" |
| 5844 | |
| 5845 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 5846 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5847 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 5848 | "$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] | 5849 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5850 | -C "discarding invalid record (mac)" \ |
| 5851 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5852 | -S "Extra-header:" \ |
| 5853 | -C "HTTP/1.0 200 OK" \ |
| 5854 | -s "too many records with bad MAC" \ |
| 5855 | -s "Verification of the message MAC failed" |
| 5856 | |
| 5857 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 5858 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5859 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 5860 | "$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] | 5861 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5862 | -c "discarding invalid record (mac)" \ |
| 5863 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5864 | -s "Extra-header:" \ |
| 5865 | -c "HTTP/1.0 200 OK" \ |
| 5866 | -S "too many records with bad MAC" \ |
| 5867 | -S "Verification of the message MAC failed" |
| 5868 | |
| 5869 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 5870 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5871 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 5872 | "$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] | 5873 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5874 | -c "discarding invalid record (mac)" \ |
| 5875 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5876 | -s "Extra-header:" \ |
| 5877 | -c "HTTP/1.0 200 OK" \ |
| 5878 | -s "too many records with bad MAC" \ |
| 5879 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5880 | |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 5881 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 5882 | -p "$P_PXY delay_ccs=1" \ |
| 5883 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 5884 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
| 5885 | 0 \ |
| 5886 | -c "record from another epoch" \ |
| 5887 | -s "record from another epoch" \ |
| 5888 | -s "Extra-header:" \ |
| 5889 | -c "HTTP/1.0 200 OK" |
| 5890 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 5891 | # Tests for reordering support with DTLS |
| 5892 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5893 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 5894 | -p "$P_PXY delay_srv=ServerHello" \ |
Hanno Becker | 8727304 | 2018-08-16 16:53:13 +0100 | [diff] [blame] | 5895 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5896 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 5897 | 0 \ |
| 5898 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5899 | -c "Next handshake message has been buffered - load"\ |
| 5900 | -S "Buffering HS message" \ |
| 5901 | -S "Next handshake message has been buffered - load"\ |
| 5902 | -C "Inject buffered CCS message" \ |
| 5903 | -C "Remember CCS message" \ |
| 5904 | -S "Inject buffered CCS message" \ |
| 5905 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 5906 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame^] | 5907 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 5908 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 5909 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 5910 | # while keeping the ServerKeyExchange. |
| 5911 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 5912 | 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] | 5913 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
| 5914 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5915 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 5916 | 0 \ |
| 5917 | -c "Buffering HS message" \ |
| 5918 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame^] | 5919 | -C "attempt to make space by freeing buffered messages" \ |
| 5920 | -S "Buffering HS message" \ |
| 5921 | -S "Next handshake message has been buffered - load"\ |
| 5922 | -C "Inject buffered CCS message" \ |
| 5923 | -C "Remember CCS message" \ |
| 5924 | -S "Inject buffered CCS message" \ |
| 5925 | -S "Remember CCS message" |
| 5926 | |
| 5927 | # The size constraints ensure that the delayed certificate message can't |
| 5928 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 5929 | # when dropping it first. |
| 5930 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 5931 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 5932 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 5933 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
| 5934 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5935 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 5936 | 0 \ |
| 5937 | -c "Buffering HS message" \ |
| 5938 | -c "attempt to make space by freeing buffered future messages" \ |
| 5939 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 5940 | -S "Buffering HS message" \ |
| 5941 | -S "Next handshake message has been buffered - load"\ |
| 5942 | -C "Inject buffered CCS message" \ |
| 5943 | -C "Remember CCS message" \ |
| 5944 | -S "Inject buffered CCS message" \ |
| 5945 | -S "Remember CCS message" |
| 5946 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5947 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 5948 | -p "$P_PXY delay_cli=Certificate" \ |
| 5949 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2" \ |
| 5950 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 5951 | 0 \ |
| 5952 | -C "Buffering HS message" \ |
| 5953 | -C "Next handshake message has been buffered - load"\ |
| 5954 | -s "Buffering HS message" \ |
| 5955 | -s "Next handshake message has been buffered - load" \ |
| 5956 | -C "Inject buffered CCS message" \ |
| 5957 | -C "Remember CCS message" \ |
| 5958 | -S "Inject buffered CCS message" \ |
| 5959 | -S "Remember CCS message" |
| 5960 | |
| 5961 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 5962 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
| 5963 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5964 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 5965 | 0 \ |
| 5966 | -C "Buffering HS message" \ |
| 5967 | -C "Next handshake message has been buffered - load"\ |
| 5968 | -S "Buffering HS message" \ |
| 5969 | -S "Next handshake message has been buffered - load" \ |
| 5970 | -c "Inject buffered CCS message" \ |
| 5971 | -c "Remember CCS message" \ |
| 5972 | -S "Inject buffered CCS message" \ |
| 5973 | -S "Remember CCS message" |
| 5974 | |
| 5975 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 5976 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
| 5977 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5978 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 5979 | 0 \ |
| 5980 | -C "Buffering HS message" \ |
| 5981 | -C "Next handshake message has been buffered - load"\ |
| 5982 | -S "Buffering HS message" \ |
| 5983 | -S "Next handshake message has been buffered - load" \ |
| 5984 | -C "Inject buffered CCS message" \ |
| 5985 | -C "Remember CCS message" \ |
| 5986 | -s "Inject buffered CCS message" \ |
| 5987 | -s "Remember CCS message" |
| 5988 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame^] | 5989 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5990 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | 8727304 | 2018-08-16 16:53:13 +0100 | [diff] [blame] | 5991 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5992 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 5993 | 0 \ |
| 5994 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5995 | -s "Found buffered record from current epoch - load" \ |
| 5996 | -c "Buffer record from epoch 1" \ |
| 5997 | -c "Found buffered record from current epoch - load" |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 5998 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame^] | 5999 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 6000 | # from the server are delayed, so that the encrypted Finished message |
| 6001 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 6002 | # in afterwards, the encrypted Finished message must be freed in order |
| 6003 | # to make space for the NewSessionTicket to be reassembled. |
| 6004 | # This works only in very particular circumstances: |
| 6005 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 6006 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 6007 | # the encrypted Finished message. |
| 6008 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 6009 | # needs to be fragmented. |
| 6010 | # - All messages sent by the server must be small enough to be either sent |
| 6011 | # without fragmentation or be reassembled within the bounds of |
| 6012 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 6013 | # handshake, omitting CRTs. |
| 6014 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 6015 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 6016 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 6017 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 6018 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 6019 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 6020 | 0 \ |
| 6021 | -s "Buffer record from epoch 1" \ |
| 6022 | -s "Found buffered record from current epoch - load" \ |
| 6023 | -c "Buffer record from epoch 1" \ |
| 6024 | -C "Found buffered record from current epoch - load" \ |
| 6025 | -c "Enough space available after freeing future epoch record" |
| 6026 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 6027 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6028 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6029 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6030 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6031 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6032 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6033 | psk=abc123" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6034 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6035 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6036 | 0 \ |
| 6037 | -s "Extra-header:" \ |
| 6038 | -c "HTTP/1.0 200 OK" |
| 6039 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6040 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6041 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 6042 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6043 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 6044 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6045 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6046 | 0 \ |
| 6047 | -s "Extra-header:" \ |
| 6048 | -c "HTTP/1.0 200 OK" |
| 6049 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6050 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6051 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 6052 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6053 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 6054 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6055 | 0 \ |
| 6056 | -s "Extra-header:" \ |
| 6057 | -c "HTTP/1.0 200 OK" |
| 6058 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6059 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6060 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 6061 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6062 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=required" \ |
| 6063 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6064 | 0 \ |
| 6065 | -s "Extra-header:" \ |
| 6066 | -c "HTTP/1.0 200 OK" |
| 6067 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6068 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6069 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 6070 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6071 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=1 auth_mode=none" \ |
| 6072 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6073 | 0 \ |
| 6074 | -s "Extra-header:" \ |
| 6075 | -c "HTTP/1.0 200 OK" |
| 6076 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6077 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6078 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 6079 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6080 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=1 auth_mode=required" \ |
| 6081 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6082 | 0 \ |
| 6083 | -s "Extra-header:" \ |
| 6084 | -c "HTTP/1.0 200 OK" |
| 6085 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6086 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6087 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 6088 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6089 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6090 | auth_mode=required" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6091 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 nbio=2 tickets=1" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6092 | 0 \ |
| 6093 | -s "Extra-header:" \ |
| 6094 | -c "HTTP/1.0 200 OK" |
| 6095 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6096 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 6097 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 6098 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6099 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 6100 | psk=abc123 debug_level=3" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6101 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 6102 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 6103 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6104 | 0 \ |
| 6105 | -s "a session has been resumed" \ |
| 6106 | -c "a session has been resumed" \ |
| 6107 | -s "Extra-header:" \ |
| 6108 | -c "HTTP/1.0 200 OK" |
| 6109 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6110 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 6111 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 6112 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6113 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 6114 | psk=abc123 debug_level=3 nbio=2" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6115 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 6116 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 6117 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 6118 | 0 \ |
| 6119 | -s "a session has been resumed" \ |
| 6120 | -c "a session has been resumed" \ |
| 6121 | -s "Extra-header:" \ |
| 6122 | -c "HTTP/1.0 200 OK" |
| 6123 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6124 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6125 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6126 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 6127 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6128 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6129 | psk=abc123 renegotiation=1 debug_level=2" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6130 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6131 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 6132 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6133 | 0 \ |
| 6134 | -c "=> renegotiate" \ |
| 6135 | -s "=> renegotiate" \ |
| 6136 | -s "Extra-header:" \ |
| 6137 | -c "HTTP/1.0 200 OK" |
| 6138 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6139 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6140 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6141 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 6142 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6143 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6144 | psk=abc123 renegotiation=1 debug_level=2" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6145 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6146 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6147 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6148 | 0 \ |
| 6149 | -c "=> renegotiate" \ |
| 6150 | -s "=> renegotiate" \ |
| 6151 | -s "Extra-header:" \ |
| 6152 | -c "HTTP/1.0 200 OK" |
| 6153 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6154 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6155 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6156 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6157 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6158 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6159 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6160 | debug_level=2" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6161 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6162 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6163 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6164 | 0 \ |
| 6165 | -c "=> renegotiate" \ |
| 6166 | -s "=> renegotiate" \ |
| 6167 | -s "Extra-header:" \ |
| 6168 | -c "HTTP/1.0 200 OK" |
| 6169 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6170 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6171 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6172 | 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] | 6173 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6174 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6175 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6176 | debug_level=2 nbio=2" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6177 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6178 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6179 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6180 | 0 \ |
| 6181 | -c "=> renegotiate" \ |
| 6182 | -s "=> renegotiate" \ |
| 6183 | -s "Extra-header:" \ |
| 6184 | -c "HTTP/1.0 200 OK" |
| 6185 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6186 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6187 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6188 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 6189 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 6190 | "$O_SRV -dtls1 -mtu 2048" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6191 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 6192 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 6193 | -c "HTTP/1.0 200 OK" |
| 6194 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6195 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6196 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6197 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 6198 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 6199 | "$O_SRV -dtls1 -mtu 768" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6200 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6201 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6202 | -c "HTTP/1.0 200 OK" |
| 6203 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6204 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6205 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6206 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 6207 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 6208 | "$O_SRV -dtls1 -mtu 768" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6209 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000 nbio=2 tickets=0" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6210 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6211 | -c "HTTP/1.0 200 OK" |
| 6212 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 6213 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6214 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6215 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6216 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 6217 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 6218 | "$G_SRV -u --mtu 2048 -a" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6219 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6220 | 0 \ |
| 6221 | -s "Extra-header:" \ |
| 6222 | -c "Extra-header:" |
| 6223 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 6224 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6225 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6226 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6227 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 6228 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 6229 | "$G_SRV -u --mtu 512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6230 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6231 | 0 \ |
| 6232 | -s "Extra-header:" \ |
| 6233 | -c "Extra-header:" |
| 6234 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 6235 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6236 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6237 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6238 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 6239 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 6240 | "$G_SRV -u --mtu 512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6241 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6242 | 0 \ |
| 6243 | -s "Extra-header:" \ |
| 6244 | -c "Extra-header:" |
| 6245 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6246 | # Final report |
| 6247 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6248 | echo "------------------------------------------------------------------------" |
| 6249 | |
| 6250 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 6251 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6252 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 6253 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6254 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 6255 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 6256 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6257 | |
| 6258 | exit $FAILS |