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 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 145 | # Skip next test; use this macro to skip tests which are legitimate |
| 146 | # in theory and expected to be re-introduced at some point, but |
| 147 | # aren't expected to succeed at the moment due to problems outside |
| 148 | # our control (such as bugs in other TLS implementations). |
| 149 | skip_next_test() { |
| 150 | SKIP_NEXT="YES" |
| 151 | } |
| 152 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 153 | # skip next test if the flag is not enabled in config.h |
| 154 | requires_config_enabled() { |
| 155 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 156 | SKIP_NEXT="YES" |
| 157 | fi |
| 158 | } |
| 159 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 160 | # skip next test if the flag is enabled in config.h |
| 161 | requires_config_disabled() { |
| 162 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 163 | SKIP_NEXT="YES" |
| 164 | fi |
| 165 | } |
| 166 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 167 | get_config_value_or_default() { |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 168 | NAME="$1" |
Hanno Becker | e604556 | 2018-08-28 11:24:55 +0100 | [diff] [blame] | 169 | DEF_VAL=$( grep ".*#define.*${NAME}" ../include/mbedtls/config.h | |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 170 | sed 's/^.*\s\([0-9]*\)$/\1/' ) |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 171 | ../scripts/config.pl get $NAME || echo "$DEF_VAL" |
| 172 | } |
| 173 | |
| 174 | requires_config_value_at_least() { |
| 175 | VAL=$( get_config_value_or_default "$1" ) |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 176 | if [ "$VAL" -lt "$2" ]; then |
| 177 | SKIP_NEXT="YES" |
| 178 | fi |
| 179 | } |
| 180 | |
| 181 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 182 | VAL=$( get_config_value_or_default "$1" ) |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 183 | if [ "$VAL" -gt "$2" ]; then |
| 184 | SKIP_NEXT="YES" |
| 185 | fi |
| 186 | } |
| 187 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 188 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 189 | requires_openssl_with_fallback_scsv() { |
| 190 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 191 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 192 | then |
| 193 | OPENSSL_HAS_FBSCSV="YES" |
| 194 | else |
| 195 | OPENSSL_HAS_FBSCSV="NO" |
| 196 | fi |
| 197 | fi |
| 198 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 199 | SKIP_NEXT="YES" |
| 200 | fi |
| 201 | } |
| 202 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 203 | # skip next test if GnuTLS isn't available |
| 204 | requires_gnutls() { |
| 205 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 206 | 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] | 207 | GNUTLS_AVAILABLE="YES" |
| 208 | else |
| 209 | GNUTLS_AVAILABLE="NO" |
| 210 | fi |
| 211 | fi |
| 212 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 213 | SKIP_NEXT="YES" |
| 214 | fi |
| 215 | } |
| 216 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 217 | # skip next test if GnuTLS-next isn't available |
| 218 | requires_gnutls_next() { |
| 219 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 220 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 221 | GNUTLS_NEXT_AVAILABLE="YES" |
| 222 | else |
| 223 | GNUTLS_NEXT_AVAILABLE="NO" |
| 224 | fi |
| 225 | fi |
| 226 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 227 | SKIP_NEXT="YES" |
| 228 | fi |
| 229 | } |
| 230 | |
| 231 | # skip next test if OpenSSL-legacy isn't available |
| 232 | requires_openssl_legacy() { |
| 233 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 234 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 235 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 236 | else |
| 237 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 238 | fi |
| 239 | fi |
| 240 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 241 | SKIP_NEXT="YES" |
| 242 | fi |
| 243 | } |
| 244 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 245 | # skip next test if IPv6 isn't available on this host |
| 246 | requires_ipv6() { |
| 247 | if [ -z "${HAS_IPV6:-}" ]; then |
| 248 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 249 | SRV_PID=$! |
| 250 | sleep 1 |
| 251 | kill $SRV_PID >/dev/null 2>&1 |
| 252 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 253 | HAS_IPV6="NO" |
| 254 | else |
| 255 | HAS_IPV6="YES" |
| 256 | fi |
| 257 | rm -r $SRV_OUT |
| 258 | fi |
| 259 | |
| 260 | if [ "$HAS_IPV6" = "NO" ]; then |
| 261 | SKIP_NEXT="YES" |
| 262 | fi |
| 263 | } |
| 264 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 265 | # Calculate the input & output maximum content lengths set in the config |
| 266 | MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 267 | MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 268 | MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 269 | |
| 270 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 271 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 272 | fi |
| 273 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 274 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 275 | fi |
| 276 | |
| 277 | # skip the next test if the SSL output buffer is less than 16KB |
| 278 | requires_full_size_output_buffer() { |
| 279 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 280 | SKIP_NEXT="YES" |
| 281 | fi |
| 282 | } |
| 283 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 284 | # skip the next test if valgrind is in use |
| 285 | not_with_valgrind() { |
| 286 | if [ "$MEMCHECK" -gt 0 ]; then |
| 287 | SKIP_NEXT="YES" |
| 288 | fi |
| 289 | } |
| 290 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 291 | # skip the next test if valgrind is NOT in use |
| 292 | only_with_valgrind() { |
| 293 | if [ "$MEMCHECK" -eq 0 ]; then |
| 294 | SKIP_NEXT="YES" |
| 295 | fi |
| 296 | } |
| 297 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 298 | # 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] | 299 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 300 | CLI_DELAY_FACTOR=$1 |
| 301 | } |
| 302 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 303 | # wait for the given seconds after the client finished in the next test |
| 304 | server_needs_more_time() { |
| 305 | SRV_DELAY_SECONDS=$1 |
| 306 | } |
| 307 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 308 | # print_name <name> |
| 309 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 310 | TESTS=$(( $TESTS + 1 )) |
| 311 | LINE="" |
| 312 | |
| 313 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 314 | LINE="$TESTS " |
| 315 | fi |
| 316 | |
| 317 | LINE="$LINE$1" |
| 318 | printf "$LINE " |
| 319 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 320 | for i in `seq 1 $LEN`; do printf '.'; done |
| 321 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 322 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | # fail <message> |
| 326 | fail() { |
| 327 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 328 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 329 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 330 | mv $SRV_OUT o-srv-${TESTS}.log |
| 331 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 332 | if [ -n "$PXY_CMD" ]; then |
| 333 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 334 | fi |
| 335 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 336 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 337 | 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] | 338 | echo " ! server output:" |
| 339 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 340 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 341 | echo " ! client output:" |
| 342 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 343 | if [ -n "$PXY_CMD" ]; then |
| 344 | echo " ! ========================================================" |
| 345 | echo " ! proxy output:" |
| 346 | cat o-pxy-${TESTS}.log |
| 347 | fi |
| 348 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 349 | fi |
| 350 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 351 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 352 | } |
| 353 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 354 | # is_polar <cmd_line> |
| 355 | is_polar() { |
| 356 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 357 | } |
| 358 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 359 | # openssl s_server doesn't have -www with DTLS |
| 360 | check_osrv_dtls() { |
| 361 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 362 | NEEDS_INPUT=1 |
| 363 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 364 | else |
| 365 | NEEDS_INPUT=0 |
| 366 | fi |
| 367 | } |
| 368 | |
| 369 | # provide input to commands that need it |
| 370 | provide_input() { |
| 371 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 372 | return |
| 373 | fi |
| 374 | |
| 375 | while true; do |
| 376 | echo "HTTP/1.0 200 OK" |
| 377 | sleep 1 |
| 378 | done |
| 379 | } |
| 380 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 381 | # has_mem_err <log_file_name> |
| 382 | has_mem_err() { |
| 383 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 384 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 385 | then |
| 386 | return 1 # false: does not have errors |
| 387 | else |
| 388 | return 0 # true: has errors |
| 389 | fi |
| 390 | } |
| 391 | |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 392 | # Wait for process $2 to be listening on port $1 |
| 393 | if type lsof >/dev/null 2>/dev/null; then |
| 394 | wait_server_start() { |
| 395 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 396 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 397 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 398 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 399 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 400 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 401 | # Make a tight loop, server normally takes less than 1s to start. |
| 402 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 403 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 404 | echo "SERVERSTART TIMEOUT" |
| 405 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 406 | break |
| 407 | fi |
| 408 | # Linux and *BSD support decimal arguments to sleep. On other |
| 409 | # OSes this may be a tight loop. |
| 410 | sleep 0.1 2>/dev/null || true |
| 411 | done |
| 412 | } |
| 413 | else |
Gilles Peskine | a931265 | 2018-06-29 15:48:13 +0200 | [diff] [blame] | 414 | echo "Warning: lsof not available, wait_server_start = sleep" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 415 | wait_server_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 416 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 417 | } |
| 418 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 419 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 420 | # 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] | 421 | # 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] | 422 | # acceptable bounds |
| 423 | check_server_hello_time() { |
| 424 | # 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] | 425 | 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] | 426 | # Get the Unix timestamp for now |
| 427 | CUR_TIME=$(date +'%s') |
| 428 | THRESHOLD_IN_SECS=300 |
| 429 | |
| 430 | # Check if the ServerHello time was printed |
| 431 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 432 | return 1 |
| 433 | fi |
| 434 | |
| 435 | # Check the time in ServerHello is within acceptable bounds |
| 436 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 437 | # The time in ServerHello is at least 5 minutes before now |
| 438 | return 1 |
| 439 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 440 | # 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] | 441 | return 1 |
| 442 | else |
| 443 | return 0 |
| 444 | fi |
| 445 | } |
| 446 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 447 | # wait for client to terminate and set CLI_EXIT |
| 448 | # must be called right after starting the client |
| 449 | wait_client_done() { |
| 450 | CLI_PID=$! |
| 451 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 452 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 453 | CLI_DELAY_FACTOR=1 |
| 454 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 455 | ( 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] | 456 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 457 | |
| 458 | wait $CLI_PID |
| 459 | CLI_EXIT=$? |
| 460 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 461 | kill $DOG_PID >/dev/null 2>&1 |
| 462 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 463 | |
| 464 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 465 | |
| 466 | sleep $SRV_DELAY_SECONDS |
| 467 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 468 | } |
| 469 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 470 | # check if the given command uses dtls and sets global variable DTLS |
| 471 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 472 | 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] | 473 | DTLS=1 |
| 474 | else |
| 475 | DTLS=0 |
| 476 | fi |
| 477 | } |
| 478 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 479 | # 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] | 480 | # Options: -s pattern pattern that must be present in server output |
| 481 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 482 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 483 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 484 | # -S pattern pattern that must be absent in server output |
| 485 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 486 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 487 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 488 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 489 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 490 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 491 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 492 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 493 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 494 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 495 | return |
| 496 | fi |
| 497 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 498 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 499 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 500 | # Do we only run numbered tests? |
| 501 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 502 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 503 | else |
| 504 | SKIP_NEXT="YES" |
| 505 | fi |
| 506 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 507 | # should we skip? |
| 508 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 509 | SKIP_NEXT="NO" |
| 510 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 511 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 512 | return |
| 513 | fi |
| 514 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 515 | # does this test use a proxy? |
| 516 | if [ "X$1" = "X-p" ]; then |
| 517 | PXY_CMD="$2" |
| 518 | shift 2 |
| 519 | else |
| 520 | PXY_CMD="" |
| 521 | fi |
| 522 | |
| 523 | # get commands and client output |
| 524 | SRV_CMD="$1" |
| 525 | CLI_CMD="$2" |
| 526 | CLI_EXPECT="$3" |
| 527 | shift 3 |
| 528 | |
| 529 | # fix client port |
| 530 | if [ -n "$PXY_CMD" ]; then |
| 531 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 532 | else |
| 533 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 534 | fi |
| 535 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 536 | # update DTLS variable |
| 537 | detect_dtls "$SRV_CMD" |
| 538 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 539 | # prepend valgrind to our commands if active |
| 540 | if [ "$MEMCHECK" -gt 0 ]; then |
| 541 | if is_polar "$SRV_CMD"; then |
| 542 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 543 | fi |
| 544 | if is_polar "$CLI_CMD"; then |
| 545 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 546 | fi |
| 547 | fi |
| 548 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 549 | TIMES_LEFT=2 |
| 550 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 551 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 552 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 553 | # run the commands |
| 554 | if [ -n "$PXY_CMD" ]; then |
| 555 | echo "$PXY_CMD" > $PXY_OUT |
| 556 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 557 | PXY_PID=$! |
| 558 | # assume proxy starts faster than server |
| 559 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 560 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 561 | check_osrv_dtls |
| 562 | echo "$SRV_CMD" > $SRV_OUT |
| 563 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 564 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 565 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 566 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 567 | echo "$CLI_CMD" > $CLI_OUT |
| 568 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 569 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 570 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 571 | sleep 0.05 |
| 572 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 573 | # terminate the server (and the proxy) |
| 574 | kill $SRV_PID |
| 575 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 576 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 577 | if [ -n "$PXY_CMD" ]; then |
| 578 | kill $PXY_PID >/dev/null 2>&1 |
| 579 | wait $PXY_PID |
| 580 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 581 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 582 | # retry only on timeouts |
| 583 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 584 | printf "RETRY " |
| 585 | else |
| 586 | TIMES_LEFT=0 |
| 587 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 588 | done |
| 589 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 590 | # 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] | 591 | # (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] | 592 | # expected client exit to incorrectly succeed in case of catastrophic |
| 593 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 594 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 595 | 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] | 596 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 597 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 598 | return |
| 599 | fi |
| 600 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 601 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 602 | 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] | 603 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 604 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 605 | return |
| 606 | fi |
| 607 | fi |
| 608 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 609 | # check server exit code |
| 610 | if [ $? != 0 ]; then |
| 611 | fail "server fail" |
| 612 | return |
| 613 | fi |
| 614 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 615 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 616 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 617 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 618 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 619 | 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] | 620 | return |
| 621 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 622 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 623 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 624 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 625 | # 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] | 626 | while [ $# -gt 0 ] |
| 627 | do |
| 628 | case $1 in |
| 629 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 630 | 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] | 631 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 632 | return |
| 633 | fi |
| 634 | ;; |
| 635 | |
| 636 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 637 | 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] | 638 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 639 | return |
| 640 | fi |
| 641 | ;; |
| 642 | |
| 643 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 644 | 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] | 645 | 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] | 646 | return |
| 647 | fi |
| 648 | ;; |
| 649 | |
| 650 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 651 | 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] | 652 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 653 | return |
| 654 | fi |
| 655 | ;; |
| 656 | |
| 657 | # The filtering in the following two options (-u and -U) do the following |
| 658 | # - ignore valgrind output |
| 659 | # - filter out everything but lines right after the pattern occurances |
| 660 | # - keep one of each non-unique line |
| 661 | # - count how many lines remain |
| 662 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 663 | # if there were no duplicates. |
| 664 | "-U") |
| 665 | 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 |
| 666 | fail "lines following pattern '$2' must be unique in Server output" |
| 667 | return |
| 668 | fi |
| 669 | ;; |
| 670 | |
| 671 | "-u") |
| 672 | 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 |
| 673 | 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] | 674 | return |
| 675 | fi |
| 676 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 677 | "-F") |
| 678 | if ! $2 "$SRV_OUT"; then |
| 679 | fail "function call to '$2' failed on Server output" |
| 680 | return |
| 681 | fi |
| 682 | ;; |
| 683 | "-f") |
| 684 | if ! $2 "$CLI_OUT"; then |
| 685 | fail "function call to '$2' failed on Client output" |
| 686 | return |
| 687 | fi |
| 688 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 689 | |
| 690 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 691 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 692 | exit 1 |
| 693 | esac |
| 694 | shift 2 |
| 695 | done |
| 696 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 697 | # check valgrind's results |
| 698 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 699 | 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] | 700 | fail "Server has memory errors" |
| 701 | return |
| 702 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 703 | 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] | 704 | fail "Client has memory errors" |
| 705 | return |
| 706 | fi |
| 707 | fi |
| 708 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 709 | # if we're here, everything is ok |
| 710 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 711 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 712 | mv $SRV_OUT o-srv-${TESTS}.log |
| 713 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 4e1a9c1 | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 714 | if [ -n "$PXY_CMD" ]; then |
| 715 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 716 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 717 | fi |
| 718 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 719 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 720 | } |
| 721 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 722 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 723 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 724 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 725 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 726 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 727 | 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] | 728 | exit 1 |
| 729 | } |
| 730 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 731 | # |
| 732 | # MAIN |
| 733 | # |
| 734 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 735 | get_options "$@" |
| 736 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 737 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 738 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 739 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 740 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 741 | if [ ! -x "$P_SRV_BIN" ]; then |
| 742 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 743 | exit 1 |
| 744 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 745 | if [ ! -x "$P_CLI_BIN" ]; then |
| 746 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 747 | exit 1 |
| 748 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 749 | if [ ! -x "$P_PXY_BIN" ]; then |
| 750 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 751 | exit 1 |
| 752 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 753 | if [ "$MEMCHECK" -gt 0 ]; then |
| 754 | if which valgrind >/dev/null 2>&1; then :; else |
| 755 | echo "Memcheck not possible. Valgrind not found" |
| 756 | exit 1 |
| 757 | fi |
| 758 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 759 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 760 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 761 | exit 1 |
| 762 | fi |
| 763 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 764 | # used by watchdog |
| 765 | MAIN_PID="$$" |
| 766 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 767 | # We use somewhat arbitrary delays for tests: |
| 768 | # - how long do we wait for the server to start (when lsof not available)? |
| 769 | # - how long do we allow for the client to finish? |
| 770 | # (not to check performance, just to avoid waiting indefinitely) |
| 771 | # Things are slower with valgrind, so give extra time here. |
| 772 | # |
| 773 | # Note: without lsof, there is a trade-off between the running time of this |
| 774 | # script and the risk of spurious errors because we didn't wait long enough. |
| 775 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 776 | # 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] | 777 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 778 | START_DELAY=6 |
| 779 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 780 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 781 | START_DELAY=2 |
| 782 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 783 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 784 | |
| 785 | # some particular tests need more time: |
| 786 | # - for the client, we multiply the usual watchdog limit by a factor |
| 787 | # - for the server, we sleep for a number of seconds after the client exits |
| 788 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 789 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 790 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 791 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 792 | # 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] | 793 | # +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] | 794 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 795 | 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] | 796 | 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] | 797 | 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] | 798 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 799 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 800 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 801 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 802 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 803 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 804 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 805 | fi |
| 806 | |
Hanno Becker | bc73e4a | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 807 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 808 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 809 | fi |
| 810 | |
Hanno Becker | bc73e4a | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 811 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 812 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 813 | fi |
| 814 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 815 | # Allow SHA-1, because many of our test certificates use it |
| 816 | P_SRV="$P_SRV allow_sha1=1" |
| 817 | P_CLI="$P_CLI allow_sha1=1" |
| 818 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 819 | # Also pick a unique name for intermediate files |
| 820 | SRV_OUT="srv_out.$$" |
| 821 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 822 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 823 | SESSION="session.$$" |
| 824 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 825 | SKIP_NEXT="NO" |
| 826 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 827 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 828 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 829 | # Basic test |
| 830 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 831 | # Checks that: |
| 832 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 833 | # - the expected (highest security) parameters are selected |
| 834 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 835 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 836 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 837 | "$P_CLI" \ |
| 838 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 839 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 840 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 841 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 842 | -s "ECDHE curve: secp521r1" \ |
| 843 | -S "error" \ |
| 844 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 845 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 846 | run_test "Default, DTLS" \ |
| 847 | "$P_SRV dtls=1" \ |
| 848 | "$P_CLI dtls=1" \ |
| 849 | 0 \ |
| 850 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 851 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 852 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 853 | # Test current time in ServerHello |
| 854 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 855 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 856 | "$P_SRV debug_level=3" \ |
| 857 | "$P_CLI debug_level=3" \ |
| 858 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 859 | -f "check_server_hello_time" \ |
| 860 | -F "check_server_hello_time" |
| 861 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 862 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 863 | run_test "Unique IV in GCM" \ |
| 864 | "$P_SRV exchanges=20 debug_level=4" \ |
| 865 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 866 | 0 \ |
| 867 | -u "IV used" \ |
| 868 | -U "IV used" |
| 869 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 870 | # Tests for rc4 option |
| 871 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 872 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 873 | run_test "RC4: server disabled, client enabled" \ |
| 874 | "$P_SRV" \ |
| 875 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 876 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 877 | -s "SSL - The server has no ciphersuites in common" |
| 878 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 879 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 880 | run_test "RC4: server half, client enabled" \ |
| 881 | "$P_SRV arc4=1" \ |
| 882 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 883 | 1 \ |
| 884 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 885 | |
| 886 | run_test "RC4: server enabled, client disabled" \ |
| 887 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 888 | "$P_CLI" \ |
| 889 | 1 \ |
| 890 | -s "SSL - The server has no ciphersuites in common" |
| 891 | |
| 892 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 893 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 894 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 895 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 896 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 897 | -S "SSL - The server has no ciphersuites in common" |
| 898 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 899 | # Tests for SHA-1 support |
| 900 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 901 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 902 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 903 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 904 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 905 | 1 \ |
| 906 | -c "The certificate is signed with an unacceptable hash" |
| 907 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 908 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 909 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 910 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 911 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 912 | 0 |
| 913 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 914 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 915 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 916 | "$P_CLI allow_sha1=1" \ |
| 917 | 0 |
| 918 | |
| 919 | run_test "SHA-256 allowed by default in server certificate" \ |
| 920 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 921 | "$P_CLI allow_sha1=0" \ |
| 922 | 0 |
| 923 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 924 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 925 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 926 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 927 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 928 | 1 \ |
| 929 | -s "The certificate is signed with an unacceptable hash" |
| 930 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 931 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 932 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 933 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 934 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 935 | 0 |
| 936 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 937 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 938 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 939 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 940 | 0 |
| 941 | |
| 942 | run_test "SHA-256 allowed by default in client certificate" \ |
| 943 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 944 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 945 | 0 |
| 946 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 947 | # Tests for datagram packing |
| 948 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 949 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 950 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 951 | 0 \ |
| 952 | -c "next record in same datagram" \ |
| 953 | -s "next record in same datagram" |
| 954 | |
| 955 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 956 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 957 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 958 | 0 \ |
| 959 | -s "next record in same datagram" \ |
| 960 | -C "next record in same datagram" |
| 961 | |
| 962 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 963 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 964 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 965 | 0 \ |
| 966 | -S "next record in same datagram" \ |
| 967 | -c "next record in same datagram" |
| 968 | |
| 969 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 970 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 971 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 972 | 0 \ |
| 973 | -S "next record in same datagram" \ |
| 974 | -C "next record in same datagram" |
| 975 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 976 | # Tests for Truncated HMAC extension |
| 977 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 978 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 979 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 980 | "$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] | 981 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 982 | -s "dumping 'expected mac' (20 bytes)" \ |
| 983 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 984 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 985 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 986 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 987 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 988 | "$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] | 989 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 990 | -s "dumping 'expected mac' (20 bytes)" \ |
| 991 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 992 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 993 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 994 | run_test "Truncated HMAC: client enabled, server default" \ |
| 995 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 996 | "$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] | 997 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 998 | -s "dumping 'expected mac' (20 bytes)" \ |
| 999 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1000 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1001 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1002 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1003 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1004 | "$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] | 1005 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1006 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1007 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1008 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1009 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1010 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1011 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1012 | "$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] | 1013 | 0 \ |
| 1014 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1015 | -S "dumping 'expected mac' (10 bytes)" |
| 1016 | |
| 1017 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1018 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1019 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1020 | "$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] | 1021 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1022 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1023 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1024 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1025 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1026 | "$P_SRV dtls=1 debug_level=4" \ |
| 1027 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1028 | 0 \ |
| 1029 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1030 | -S "dumping 'expected mac' (10 bytes)" |
| 1031 | |
| 1032 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1033 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1034 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1035 | "$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] | 1036 | 0 \ |
| 1037 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1038 | -S "dumping 'expected mac' (10 bytes)" |
| 1039 | |
| 1040 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1041 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1042 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1043 | "$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] | 1044 | 0 \ |
| 1045 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1046 | -S "dumping 'expected mac' (10 bytes)" |
| 1047 | |
| 1048 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1049 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1050 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1051 | "$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] | 1052 | 0 \ |
| 1053 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1054 | -S "dumping 'expected mac' (10 bytes)" |
| 1055 | |
| 1056 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1057 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1058 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1059 | "$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] | 1060 | 0 \ |
| 1061 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1062 | -S "dumping 'expected mac' (10 bytes)" |
| 1063 | |
| 1064 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1065 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1066 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1067 | "$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] | 1068 | 0 \ |
| 1069 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1070 | -s "dumping 'expected mac' (10 bytes)" |
| 1071 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1072 | # Tests for Encrypt-then-MAC extension |
| 1073 | |
| 1074 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1075 | "$P_SRV debug_level=3 \ |
| 1076 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1077 | "$P_CLI debug_level=3" \ |
| 1078 | 0 \ |
| 1079 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1080 | -s "found encrypt then mac extension" \ |
| 1081 | -s "server hello, adding encrypt then mac extension" \ |
| 1082 | -c "found encrypt_then_mac extension" \ |
| 1083 | -c "using encrypt then mac" \ |
| 1084 | -s "using encrypt then mac" |
| 1085 | |
| 1086 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1087 | "$P_SRV debug_level=3 etm=0 \ |
| 1088 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1089 | "$P_CLI debug_level=3 etm=1" \ |
| 1090 | 0 \ |
| 1091 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1092 | -s "found encrypt then mac extension" \ |
| 1093 | -S "server hello, adding encrypt then mac extension" \ |
| 1094 | -C "found encrypt_then_mac extension" \ |
| 1095 | -C "using encrypt then mac" \ |
| 1096 | -S "using encrypt then mac" |
| 1097 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1098 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1099 | "$P_SRV debug_level=3 etm=1 \ |
| 1100 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1101 | "$P_CLI debug_level=3 etm=1" \ |
| 1102 | 0 \ |
| 1103 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1104 | -s "found encrypt then mac extension" \ |
| 1105 | -S "server hello, adding encrypt then mac extension" \ |
| 1106 | -C "found encrypt_then_mac extension" \ |
| 1107 | -C "using encrypt then mac" \ |
| 1108 | -S "using encrypt then mac" |
| 1109 | |
| 1110 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1111 | "$P_SRV debug_level=3 etm=1 \ |
| 1112 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1113 | "$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] | 1114 | 0 \ |
| 1115 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1116 | -s "found encrypt then mac extension" \ |
| 1117 | -S "server hello, adding encrypt then mac extension" \ |
| 1118 | -C "found encrypt_then_mac extension" \ |
| 1119 | -C "using encrypt then mac" \ |
| 1120 | -S "using encrypt then mac" |
| 1121 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1122 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1123 | "$P_SRV debug_level=3 etm=1 \ |
| 1124 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1125 | "$P_CLI debug_level=3 etm=0" \ |
| 1126 | 0 \ |
| 1127 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1128 | -S "found encrypt then mac extension" \ |
| 1129 | -S "server hello, adding encrypt then mac extension" \ |
| 1130 | -C "found encrypt_then_mac extension" \ |
| 1131 | -C "using encrypt then mac" \ |
| 1132 | -S "using encrypt then mac" |
| 1133 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1134 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1135 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1136 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1137 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1138 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1139 | 0 \ |
| 1140 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1141 | -S "found encrypt then mac extension" \ |
| 1142 | -S "server hello, adding encrypt then mac extension" \ |
| 1143 | -C "found encrypt_then_mac extension" \ |
| 1144 | -C "using encrypt then mac" \ |
| 1145 | -S "using encrypt then mac" |
| 1146 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1147 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1148 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1149 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1150 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1151 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1152 | 0 \ |
| 1153 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1154 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1155 | -S "server hello, adding encrypt then mac extension" \ |
| 1156 | -C "found encrypt_then_mac extension" \ |
| 1157 | -C "using encrypt then mac" \ |
| 1158 | -S "using encrypt then mac" |
| 1159 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1160 | # Tests for Extended Master Secret extension |
| 1161 | |
| 1162 | run_test "Extended Master Secret: default" \ |
| 1163 | "$P_SRV debug_level=3" \ |
| 1164 | "$P_CLI debug_level=3" \ |
| 1165 | 0 \ |
| 1166 | -c "client hello, adding extended_master_secret extension" \ |
| 1167 | -s "found extended master secret extension" \ |
| 1168 | -s "server hello, adding extended master secret extension" \ |
| 1169 | -c "found extended_master_secret extension" \ |
| 1170 | -c "using extended master secret" \ |
| 1171 | -s "using extended master secret" |
| 1172 | |
| 1173 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1174 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1175 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1176 | 0 \ |
| 1177 | -c "client hello, adding extended_master_secret extension" \ |
| 1178 | -s "found extended master secret extension" \ |
| 1179 | -S "server hello, adding extended master secret extension" \ |
| 1180 | -C "found extended_master_secret extension" \ |
| 1181 | -C "using extended master secret" \ |
| 1182 | -S "using extended master secret" |
| 1183 | |
| 1184 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1185 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1186 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1187 | 0 \ |
| 1188 | -C "client hello, adding extended_master_secret extension" \ |
| 1189 | -S "found extended master secret extension" \ |
| 1190 | -S "server hello, adding extended master secret extension" \ |
| 1191 | -C "found extended_master_secret extension" \ |
| 1192 | -C "using extended master secret" \ |
| 1193 | -S "using extended master secret" |
| 1194 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1195 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1196 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1197 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1198 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1199 | 0 \ |
| 1200 | -C "client hello, adding extended_master_secret extension" \ |
| 1201 | -S "found extended master secret extension" \ |
| 1202 | -S "server hello, adding extended master secret extension" \ |
| 1203 | -C "found extended_master_secret extension" \ |
| 1204 | -C "using extended master secret" \ |
| 1205 | -S "using extended master secret" |
| 1206 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1207 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1208 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1209 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1210 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1211 | 0 \ |
| 1212 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1213 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1214 | -S "server hello, adding extended master secret extension" \ |
| 1215 | -C "found extended_master_secret extension" \ |
| 1216 | -C "using extended master secret" \ |
| 1217 | -S "using extended master secret" |
| 1218 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1219 | # Tests for FALLBACK_SCSV |
| 1220 | |
| 1221 | run_test "Fallback SCSV: default" \ |
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" \ |
| 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: explicitly disabled" \ |
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=0" \ |
| 1233 | 0 \ |
| 1234 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1235 | -S "received FALLBACK_SCSV" \ |
| 1236 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1237 | -C "is a fatal alert message (msg 86)" |
| 1238 | |
| 1239 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1240 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1241 | "$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] | 1242 | 1 \ |
| 1243 | -c "adding FALLBACK_SCSV" \ |
| 1244 | -s "received FALLBACK_SCSV" \ |
| 1245 | -s "inapropriate fallback" \ |
| 1246 | -c "is a fatal alert message (msg 86)" |
| 1247 | |
| 1248 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1249 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1250 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1251 | 0 \ |
| 1252 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1253 | -s "received FALLBACK_SCSV" \ |
| 1254 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1255 | -C "is a fatal alert message (msg 86)" |
| 1256 | |
| 1257 | requires_openssl_with_fallback_scsv |
| 1258 | run_test "Fallback SCSV: default, openssl server" \ |
| 1259 | "$O_SRV" \ |
| 1260 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1261 | 0 \ |
| 1262 | -C "adding FALLBACK_SCSV" \ |
| 1263 | -C "is a fatal alert message (msg 86)" |
| 1264 | |
| 1265 | requires_openssl_with_fallback_scsv |
| 1266 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1267 | "$O_SRV" \ |
| 1268 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1269 | 1 \ |
| 1270 | -c "adding FALLBACK_SCSV" \ |
| 1271 | -c "is a fatal alert message (msg 86)" |
| 1272 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1273 | requires_openssl_with_fallback_scsv |
| 1274 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1275 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1276 | "$O_CLI -tls1_1" \ |
| 1277 | 0 \ |
| 1278 | -S "received FALLBACK_SCSV" \ |
| 1279 | -S "inapropriate fallback" |
| 1280 | |
| 1281 | requires_openssl_with_fallback_scsv |
| 1282 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1283 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1284 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1285 | 1 \ |
| 1286 | -s "received FALLBACK_SCSV" \ |
| 1287 | -s "inapropriate fallback" |
| 1288 | |
| 1289 | requires_openssl_with_fallback_scsv |
| 1290 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1291 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1292 | "$O_CLI -fallback_scsv" \ |
| 1293 | 0 \ |
| 1294 | -s "received FALLBACK_SCSV" \ |
| 1295 | -S "inapropriate fallback" |
| 1296 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1297 | # Test sending and receiving empty application data records |
| 1298 | |
| 1299 | run_test "Encrypt then MAC: empty application data record" \ |
| 1300 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1301 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1302 | 0 \ |
| 1303 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1304 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1305 | -c "0 bytes written in 1 fragments" |
| 1306 | |
| 1307 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 1308 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1309 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1310 | 0 \ |
| 1311 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1312 | -c "0 bytes written in 1 fragments" |
| 1313 | |
| 1314 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1315 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1316 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1317 | 0 \ |
| 1318 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1319 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1320 | -c "0 bytes written in 1 fragments" |
| 1321 | |
| 1322 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 1323 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1324 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1325 | 0 \ |
| 1326 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1327 | -c "0 bytes written in 1 fragments" |
| 1328 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1329 | ## ClientHello generated with |
| 1330 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1331 | ## then manually twiddling the ciphersuite list. |
| 1332 | ## The ClientHello content is spelled out below as a hex string as |
| 1333 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1334 | ## The expected response is an inappropriate_fallback alert. |
| 1335 | requires_openssl_with_fallback_scsv |
| 1336 | run_test "Fallback SCSV: beginning of list" \ |
| 1337 | "$P_SRV debug_level=2" \ |
| 1338 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1339 | 0 \ |
| 1340 | -s "received FALLBACK_SCSV" \ |
| 1341 | -s "inapropriate fallback" |
| 1342 | |
| 1343 | requires_openssl_with_fallback_scsv |
| 1344 | run_test "Fallback SCSV: end of list" \ |
| 1345 | "$P_SRV debug_level=2" \ |
| 1346 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1347 | 0 \ |
| 1348 | -s "received FALLBACK_SCSV" \ |
| 1349 | -s "inapropriate fallback" |
| 1350 | |
| 1351 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1352 | requires_openssl_with_fallback_scsv |
| 1353 | run_test "Fallback SCSV: not in list" \ |
| 1354 | "$P_SRV debug_level=2" \ |
| 1355 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1356 | 0 \ |
| 1357 | -S "received FALLBACK_SCSV" \ |
| 1358 | -S "inapropriate fallback" |
| 1359 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1360 | # Tests for CBC 1/n-1 record splitting |
| 1361 | |
| 1362 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1363 | "$P_SRV" \ |
| 1364 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1365 | request_size=123 force_version=tls1_2" \ |
| 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.1, no splitting" \ |
| 1372 | "$P_SRV" \ |
| 1373 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1374 | request_size=123 force_version=tls1_1" \ |
| 1375 | 0 \ |
| 1376 | -s "Read from client: 123 bytes read" \ |
| 1377 | -S "Read from client: 1 bytes read" \ |
| 1378 | -S "122 bytes read" |
| 1379 | |
| 1380 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1381 | "$P_SRV" \ |
| 1382 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1383 | request_size=123 force_version=tls1" \ |
| 1384 | 0 \ |
| 1385 | -S "Read from client: 123 bytes read" \ |
| 1386 | -s "Read from client: 1 bytes read" \ |
| 1387 | -s "122 bytes read" |
| 1388 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1389 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1390 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1391 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1392 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1393 | request_size=123 force_version=ssl3" \ |
| 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 RC4, no splitting" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1400 | "$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] | 1401 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1402 | request_size=123 force_version=tls1" \ |
| 1403 | 0 \ |
| 1404 | -s "Read from client: 123 bytes read" \ |
| 1405 | -S "Read from client: 1 bytes read" \ |
| 1406 | -S "122 bytes read" |
| 1407 | |
| 1408 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1409 | "$P_SRV" \ |
| 1410 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1411 | request_size=123 force_version=tls1 recsplit=0" \ |
| 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 | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1417 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1418 | "$P_SRV nbio=2" \ |
| 1419 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1420 | request_size=123 force_version=tls1" \ |
| 1421 | 0 \ |
| 1422 | -S "Read from client: 123 bytes read" \ |
| 1423 | -s "Read from client: 1 bytes read" \ |
| 1424 | -s "122 bytes read" |
| 1425 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1426 | # Tests for Session Tickets |
| 1427 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1428 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1429 | "$P_SRV debug_level=3 tickets=1" \ |
| 1430 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1431 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1432 | -c "client hello, adding session ticket extension" \ |
| 1433 | -s "found session ticket extension" \ |
| 1434 | -s "server hello, adding session ticket extension" \ |
| 1435 | -c "found session_ticket extension" \ |
| 1436 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1437 | -S "session successfully restored from cache" \ |
| 1438 | -s "session successfully restored from ticket" \ |
| 1439 | -s "a session has been resumed" \ |
| 1440 | -c "a session has been resumed" |
| 1441 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1442 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1443 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1444 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1445 | 0 \ |
| 1446 | -c "client hello, adding session ticket extension" \ |
| 1447 | -s "found session ticket extension" \ |
| 1448 | -s "server hello, adding session ticket extension" \ |
| 1449 | -c "found session_ticket extension" \ |
| 1450 | -c "parse new session ticket" \ |
| 1451 | -S "session successfully restored from cache" \ |
| 1452 | -s "session successfully restored from ticket" \ |
| 1453 | -s "a session has been resumed" \ |
| 1454 | -c "a session has been resumed" |
| 1455 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1456 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1457 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1458 | "$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] | 1459 | 0 \ |
| 1460 | -c "client hello, adding session ticket extension" \ |
| 1461 | -s "found session ticket extension" \ |
| 1462 | -s "server hello, adding session ticket extension" \ |
| 1463 | -c "found session_ticket extension" \ |
| 1464 | -c "parse new session ticket" \ |
| 1465 | -S "session successfully restored from cache" \ |
| 1466 | -S "session successfully restored from ticket" \ |
| 1467 | -S "a session has been resumed" \ |
| 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 server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1471 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1472 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1473 | 0 \ |
| 1474 | -c "client hello, adding session ticket extension" \ |
| 1475 | -c "found session_ticket extension" \ |
| 1476 | -c "parse new session ticket" \ |
| 1477 | -c "a session has been resumed" |
| 1478 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1479 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1480 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1481 | "( $O_CLI -sess_out $SESSION; \ |
| 1482 | $O_CLI -sess_in $SESSION; \ |
| 1483 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1484 | 0 \ |
| 1485 | -s "found session ticket extension" \ |
| 1486 | -s "server hello, adding session ticket extension" \ |
| 1487 | -S "session successfully restored from cache" \ |
| 1488 | -s "session successfully restored from ticket" \ |
| 1489 | -s "a session has been resumed" |
| 1490 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1491 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1492 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1493 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1494 | "$P_SRV debug_level=3 tickets=0" \ |
| 1495 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1496 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1497 | -c "client hello, adding session ticket extension" \ |
| 1498 | -s "found session ticket extension" \ |
| 1499 | -S "server hello, adding session ticket extension" \ |
| 1500 | -C "found session_ticket extension" \ |
| 1501 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1502 | -s "session successfully restored from cache" \ |
| 1503 | -S "session successfully restored from ticket" \ |
| 1504 | -s "a session has been resumed" \ |
| 1505 | -c "a session has been resumed" |
| 1506 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1507 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1508 | "$P_SRV debug_level=3 tickets=1" \ |
| 1509 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1510 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1511 | -C "client hello, adding session ticket extension" \ |
| 1512 | -S "found session ticket extension" \ |
| 1513 | -S "server hello, adding session ticket extension" \ |
| 1514 | -C "found session_ticket extension" \ |
| 1515 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1516 | -s "session successfully restored from cache" \ |
| 1517 | -S "session successfully restored from ticket" \ |
| 1518 | -s "a session has been resumed" \ |
| 1519 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +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=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1522 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1523 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1524 | 0 \ |
| 1525 | -S "session successfully restored from cache" \ |
| 1526 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1527 | -S "a session has been resumed" \ |
| 1528 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1529 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1530 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1531 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1532 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
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 | 6df3196 | 2015-05-04 10:55:47 +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" \ |
| 1541 | "$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] | 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: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1549 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1550 | "$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] | 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: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1558 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1559 | "$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] | 1560 | 0 \ |
| 1561 | -s "session successfully restored from cache" \ |
| 1562 | -S "session successfully restored from ticket" \ |
| 1563 | -s "a session has been resumed" \ |
| 1564 | -c "a session has been resumed" |
| 1565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1566 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1567 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1568 | "( $O_CLI -sess_out $SESSION; \ |
| 1569 | $O_CLI -sess_in $SESSION; \ |
| 1570 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1571 | 0 \ |
| 1572 | -s "found session ticket extension" \ |
| 1573 | -S "server hello, adding session ticket extension" \ |
| 1574 | -s "session successfully restored from cache" \ |
| 1575 | -S "session successfully restored from ticket" \ |
| 1576 | -s "a session has been resumed" |
| 1577 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1578 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1579 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1580 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1581 | 0 \ |
| 1582 | -C "found session_ticket extension" \ |
| 1583 | -C "parse new session ticket" \ |
| 1584 | -c "a session has been resumed" |
| 1585 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1586 | # Tests for Max Fragment Length extension |
| 1587 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1588 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 1589 | 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] | 1590 | exit 1 |
| 1591 | fi |
| 1592 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1593 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 1594 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 1595 | fi |
| 1596 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1597 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1598 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1599 | "$P_SRV debug_level=3" \ |
| 1600 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1601 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1602 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1603 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1604 | -C "client hello, adding max_fragment_length extension" \ |
| 1605 | -S "found max fragment length extension" \ |
| 1606 | -S "server hello, max_fragment_length extension" \ |
| 1607 | -C "found max_fragment_length extension" |
| 1608 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1609 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1610 | run_test "Max fragment length: enabled, default, larger message" \ |
| 1611 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1612 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1613 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1614 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1615 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1616 | -C "client hello, adding max_fragment_length extension" \ |
| 1617 | -S "found max fragment length extension" \ |
| 1618 | -S "server hello, max_fragment_length extension" \ |
| 1619 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1620 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1621 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1622 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1623 | |
| 1624 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1625 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 1626 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1627 | "$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] | 1628 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1629 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1630 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1631 | -C "client hello, adding max_fragment_length extension" \ |
| 1632 | -S "found max fragment length extension" \ |
| 1633 | -S "server hello, max_fragment_length extension" \ |
| 1634 | -C "found max_fragment_length extension" \ |
| 1635 | -c "fragment larger than.*maximum " |
| 1636 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1637 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 1638 | # (session fragment length will be 16384 regardless of mbedtls |
| 1639 | # content length configuration.) |
| 1640 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1641 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1642 | run_test "Max fragment length: disabled, larger message" \ |
| 1643 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1644 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1645 | 0 \ |
| 1646 | -C "Maximum fragment length is 16384" \ |
| 1647 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1648 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1649 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1650 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1651 | |
| 1652 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1653 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 1654 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1655 | "$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] | 1656 | 1 \ |
| 1657 | -C "Maximum fragment length is 16384" \ |
| 1658 | -S "Maximum fragment length is 16384" \ |
| 1659 | -c "fragment larger than.*maximum " |
| 1660 | |
| 1661 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1662 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1663 | "$P_SRV debug_level=3" \ |
| 1664 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1665 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1666 | -c "Maximum fragment length is 4096" \ |
| 1667 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1668 | -c "client hello, adding max_fragment_length extension" \ |
| 1669 | -s "found max fragment length extension" \ |
| 1670 | -s "server hello, max_fragment_length extension" \ |
| 1671 | -c "found max_fragment_length extension" |
| 1672 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1673 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1674 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1675 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1676 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1677 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1678 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1679 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1680 | -C "client hello, adding max_fragment_length extension" \ |
| 1681 | -S "found max fragment length extension" \ |
| 1682 | -S "server hello, max_fragment_length extension" \ |
| 1683 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1684 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1685 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1686 | requires_gnutls |
| 1687 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1688 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1689 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1690 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1691 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1692 | -c "client hello, adding max_fragment_length extension" \ |
| 1693 | -c "found max_fragment_length extension" |
| 1694 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1695 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1696 | run_test "Max fragment length: client, message just fits" \ |
| 1697 | "$P_SRV debug_level=3" \ |
| 1698 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1699 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1700 | -c "Maximum fragment length is 2048" \ |
| 1701 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1702 | -c "client hello, adding max_fragment_length extension" \ |
| 1703 | -s "found max fragment length extension" \ |
| 1704 | -s "server hello, max_fragment_length extension" \ |
| 1705 | -c "found max_fragment_length extension" \ |
| 1706 | -c "2048 bytes written in 1 fragments" \ |
| 1707 | -s "2048 bytes read" |
| 1708 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1709 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1710 | run_test "Max fragment length: client, larger message" \ |
| 1711 | "$P_SRV debug_level=3" \ |
| 1712 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1713 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1714 | -c "Maximum fragment length is 2048" \ |
| 1715 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1716 | -c "client hello, adding max_fragment_length extension" \ |
| 1717 | -s "found max fragment length extension" \ |
| 1718 | -s "server hello, max_fragment_length extension" \ |
| 1719 | -c "found max_fragment_length extension" \ |
| 1720 | -c "2345 bytes written in 2 fragments" \ |
| 1721 | -s "2048 bytes read" \ |
| 1722 | -s "297 bytes read" |
| 1723 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1724 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1725 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1726 | "$P_SRV debug_level=3 dtls=1" \ |
| 1727 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1728 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1729 | -c "Maximum fragment length is 2048" \ |
| 1730 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1731 | -c "client hello, adding max_fragment_length extension" \ |
| 1732 | -s "found max fragment length extension" \ |
| 1733 | -s "server hello, max_fragment_length extension" \ |
| 1734 | -c "found max_fragment_length extension" \ |
| 1735 | -c "fragment larger than.*maximum" |
| 1736 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1737 | # Tests for renegotiation |
| 1738 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1739 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1740 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1741 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1742 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1743 | 0 \ |
| 1744 | -C "client hello, adding renegotiation extension" \ |
| 1745 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1746 | -S "found renegotiation extension" \ |
| 1747 | -s "server hello, secure renegotiation extension" \ |
| 1748 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1749 | -C "=> renegotiate" \ |
| 1750 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1751 | -S "write hello request" |
| 1752 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1753 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1754 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1755 | "$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] | 1756 | "$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] | 1757 | 0 \ |
| 1758 | -c "client hello, adding renegotiation extension" \ |
| 1759 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1760 | -s "found renegotiation extension" \ |
| 1761 | -s "server hello, secure renegotiation extension" \ |
| 1762 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1763 | -c "=> renegotiate" \ |
| 1764 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1765 | -S "write hello request" |
| 1766 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1767 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1768 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1769 | "$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] | 1770 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1771 | 0 \ |
| 1772 | -c "client hello, adding renegotiation extension" \ |
| 1773 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1774 | -s "found renegotiation extension" \ |
| 1775 | -s "server hello, secure renegotiation extension" \ |
| 1776 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1777 | -c "=> renegotiate" \ |
| 1778 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1779 | -s "write hello request" |
| 1780 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1781 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1782 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1783 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1784 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1785 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 1786 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 1787 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1788 | 0 \ |
| 1789 | -c "client hello, adding renegotiation extension" \ |
| 1790 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1791 | -s "found renegotiation extension" \ |
| 1792 | -s "server hello, secure renegotiation extension" \ |
| 1793 | -c "found renegotiation extension" \ |
| 1794 | -c "=> renegotiate" \ |
| 1795 | -s "=> renegotiate" \ |
| 1796 | -S "write hello request" \ |
| 1797 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1798 | |
| 1799 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1800 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1801 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1802 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1803 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 1804 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 1805 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1806 | 0 \ |
| 1807 | -c "client hello, adding renegotiation extension" \ |
| 1808 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1809 | -s "found renegotiation extension" \ |
| 1810 | -s "server hello, secure renegotiation extension" \ |
| 1811 | -c "found renegotiation extension" \ |
| 1812 | -c "=> renegotiate" \ |
| 1813 | -s "=> renegotiate" \ |
| 1814 | -s "write hello request" \ |
| 1815 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1816 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1817 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1818 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1819 | "$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] | 1820 | "$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] | 1821 | 0 \ |
| 1822 | -c "client hello, adding renegotiation extension" \ |
| 1823 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1824 | -s "found renegotiation extension" \ |
| 1825 | -s "server hello, secure renegotiation extension" \ |
| 1826 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1827 | -c "=> renegotiate" \ |
| 1828 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1829 | -s "write hello request" |
| 1830 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1831 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1832 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1833 | "$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] | 1834 | "$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] | 1835 | 1 \ |
| 1836 | -c "client hello, adding renegotiation extension" \ |
| 1837 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1838 | -S "found renegotiation extension" \ |
| 1839 | -s "server hello, secure renegotiation extension" \ |
| 1840 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1841 | -c "=> renegotiate" \ |
| 1842 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1843 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1844 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1845 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1846 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1847 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1848 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1849 | "$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] | 1850 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1851 | 0 \ |
| 1852 | -C "client hello, adding renegotiation extension" \ |
| 1853 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1854 | -S "found renegotiation extension" \ |
| 1855 | -s "server hello, secure renegotiation extension" \ |
| 1856 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1857 | -C "=> renegotiate" \ |
| 1858 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1859 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1860 | -S "SSL - An unexpected message was received from our peer" \ |
| 1861 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1862 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1863 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1864 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1865 | "$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] | 1866 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1867 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1868 | 0 \ |
| 1869 | -C "client hello, adding renegotiation extension" \ |
| 1870 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1871 | -S "found renegotiation extension" \ |
| 1872 | -s "server hello, secure renegotiation extension" \ |
| 1873 | -c "found renegotiation extension" \ |
| 1874 | -C "=> renegotiate" \ |
| 1875 | -S "=> renegotiate" \ |
| 1876 | -s "write hello request" \ |
| 1877 | -S "SSL - An unexpected message was received from our peer" \ |
| 1878 | -S "failed" |
| 1879 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1880 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1881 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1882 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1883 | "$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] | 1884 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1885 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1886 | 0 \ |
| 1887 | -C "client hello, adding renegotiation extension" \ |
| 1888 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1889 | -S "found renegotiation extension" \ |
| 1890 | -s "server hello, secure renegotiation extension" \ |
| 1891 | -c "found renegotiation extension" \ |
| 1892 | -C "=> renegotiate" \ |
| 1893 | -S "=> renegotiate" \ |
| 1894 | -s "write hello request" \ |
| 1895 | -S "SSL - An unexpected message was received from our peer" \ |
| 1896 | -S "failed" |
| 1897 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1898 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1899 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1900 | "$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] | 1901 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1902 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1903 | 0 \ |
| 1904 | -C "client hello, adding renegotiation extension" \ |
| 1905 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1906 | -S "found renegotiation extension" \ |
| 1907 | -s "server hello, secure renegotiation extension" \ |
| 1908 | -c "found renegotiation extension" \ |
| 1909 | -C "=> renegotiate" \ |
| 1910 | -S "=> renegotiate" \ |
| 1911 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1912 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1913 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1914 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1915 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1916 | "$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] | 1917 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1918 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1919 | 0 \ |
| 1920 | -c "client hello, adding renegotiation extension" \ |
| 1921 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1922 | -s "found renegotiation extension" \ |
| 1923 | -s "server hello, secure renegotiation extension" \ |
| 1924 | -c "found renegotiation extension" \ |
| 1925 | -c "=> renegotiate" \ |
| 1926 | -s "=> renegotiate" \ |
| 1927 | -s "write hello request" \ |
| 1928 | -S "SSL - An unexpected message was received from our peer" \ |
| 1929 | -S "failed" |
| 1930 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1931 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1932 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1933 | "$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] | 1934 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1935 | 0 \ |
| 1936 | -C "client hello, adding renegotiation extension" \ |
| 1937 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1938 | -S "found renegotiation extension" \ |
| 1939 | -s "server hello, secure renegotiation extension" \ |
| 1940 | -c "found renegotiation extension" \ |
| 1941 | -S "record counter limit reached: renegotiate" \ |
| 1942 | -C "=> renegotiate" \ |
| 1943 | -S "=> renegotiate" \ |
| 1944 | -S "write hello request" \ |
| 1945 | -S "SSL - An unexpected message was received from our peer" \ |
| 1946 | -S "failed" |
| 1947 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1948 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1949 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1950 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1951 | "$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] | 1952 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1953 | 0 \ |
| 1954 | -c "client hello, adding renegotiation extension" \ |
| 1955 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1956 | -s "found renegotiation extension" \ |
| 1957 | -s "server hello, secure renegotiation extension" \ |
| 1958 | -c "found renegotiation extension" \ |
| 1959 | -s "record counter limit reached: renegotiate" \ |
| 1960 | -c "=> renegotiate" \ |
| 1961 | -s "=> renegotiate" \ |
| 1962 | -s "write hello request" \ |
| 1963 | -S "SSL - An unexpected message was received from our peer" \ |
| 1964 | -S "failed" |
| 1965 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1966 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1967 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1968 | "$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] | 1969 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1970 | 0 \ |
| 1971 | -c "client hello, adding renegotiation extension" \ |
| 1972 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1973 | -s "found renegotiation extension" \ |
| 1974 | -s "server hello, secure renegotiation extension" \ |
| 1975 | -c "found renegotiation extension" \ |
| 1976 | -s "record counter limit reached: renegotiate" \ |
| 1977 | -c "=> renegotiate" \ |
| 1978 | -s "=> renegotiate" \ |
| 1979 | -s "write hello request" \ |
| 1980 | -S "SSL - An unexpected message was received from our peer" \ |
| 1981 | -S "failed" |
| 1982 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1983 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1984 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1985 | "$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] | 1986 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1987 | 0 \ |
| 1988 | -C "client hello, adding renegotiation extension" \ |
| 1989 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1990 | -S "found renegotiation extension" \ |
| 1991 | -s "server hello, secure renegotiation extension" \ |
| 1992 | -c "found renegotiation extension" \ |
| 1993 | -S "record counter limit reached: renegotiate" \ |
| 1994 | -C "=> renegotiate" \ |
| 1995 | -S "=> renegotiate" \ |
| 1996 | -S "write hello request" \ |
| 1997 | -S "SSL - An unexpected message was received from our peer" \ |
| 1998 | -S "failed" |
| 1999 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2000 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2001 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2002 | "$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] | 2003 | "$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] | 2004 | 0 \ |
| 2005 | -c "client hello, adding renegotiation extension" \ |
| 2006 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2007 | -s "found renegotiation extension" \ |
| 2008 | -s "server hello, secure renegotiation extension" \ |
| 2009 | -c "found renegotiation extension" \ |
| 2010 | -c "=> renegotiate" \ |
| 2011 | -s "=> renegotiate" \ |
| 2012 | -S "write hello request" |
| 2013 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2014 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2015 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2016 | "$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] | 2017 | "$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] | 2018 | 0 \ |
| 2019 | -c "client hello, adding renegotiation extension" \ |
| 2020 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2021 | -s "found renegotiation extension" \ |
| 2022 | -s "server hello, secure renegotiation extension" \ |
| 2023 | -c "found renegotiation extension" \ |
| 2024 | -c "=> renegotiate" \ |
| 2025 | -s "=> renegotiate" \ |
| 2026 | -s "write hello request" |
| 2027 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2028 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2029 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2030 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2031 | "$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] | 2032 | 0 \ |
| 2033 | -c "client hello, adding renegotiation extension" \ |
| 2034 | -c "found renegotiation extension" \ |
| 2035 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2036 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2037 | -C "error" \ |
| 2038 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2039 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2040 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2041 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2042 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2043 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2044 | "$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] | 2045 | 0 \ |
| 2046 | -c "client hello, adding renegotiation extension" \ |
| 2047 | -c "found renegotiation extension" \ |
| 2048 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2049 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2050 | -C "error" \ |
| 2051 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2052 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2053 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2054 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2055 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2056 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2057 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2058 | 1 \ |
| 2059 | -c "client hello, adding renegotiation extension" \ |
| 2060 | -C "found renegotiation extension" \ |
| 2061 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2062 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2063 | -c "error" \ |
| 2064 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2065 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2066 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2067 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2068 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2069 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2070 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2071 | allow_legacy=0" \ |
| 2072 | 1 \ |
| 2073 | -c "client hello, adding renegotiation extension" \ |
| 2074 | -C "found renegotiation extension" \ |
| 2075 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2076 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2077 | -c "error" \ |
| 2078 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2079 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2080 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2081 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2082 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 2083 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2084 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2085 | allow_legacy=1" \ |
| 2086 | 0 \ |
| 2087 | -c "client hello, adding renegotiation extension" \ |
| 2088 | -C "found renegotiation extension" \ |
| 2089 | -c "=> renegotiate" \ |
| 2090 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2091 | -C "error" \ |
| 2092 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2093 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2094 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2095 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2096 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2097 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2098 | 0 \ |
| 2099 | -c "client hello, adding renegotiation extension" \ |
| 2100 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2101 | -s "found renegotiation extension" \ |
| 2102 | -s "server hello, secure renegotiation extension" \ |
| 2103 | -c "found renegotiation extension" \ |
| 2104 | -c "=> renegotiate" \ |
| 2105 | -s "=> renegotiate" \ |
| 2106 | -S "write hello request" |
| 2107 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2108 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2109 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2110 | "$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] | 2111 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2112 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2113 | 0 \ |
| 2114 | -c "client hello, adding renegotiation extension" \ |
| 2115 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2116 | -s "found renegotiation extension" \ |
| 2117 | -s "server hello, secure renegotiation extension" \ |
| 2118 | -c "found renegotiation extension" \ |
| 2119 | -c "=> renegotiate" \ |
| 2120 | -s "=> renegotiate" \ |
| 2121 | -s "write hello request" |
| 2122 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2123 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2124 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2125 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2126 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2127 | 0 \ |
| 2128 | -c "client hello, adding renegotiation extension" \ |
| 2129 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2130 | -s "found renegotiation extension" \ |
| 2131 | -s "server hello, secure renegotiation extension" \ |
| 2132 | -s "record counter limit reached: renegotiate" \ |
| 2133 | -c "=> renegotiate" \ |
| 2134 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2135 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2136 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2137 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2138 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2139 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2140 | "$G_SRV -u --mtu 4096" \ |
| 2141 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2142 | 0 \ |
| 2143 | -c "client hello, adding renegotiation extension" \ |
| 2144 | -c "found renegotiation extension" \ |
| 2145 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2146 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2147 | -C "error" \ |
| 2148 | -s "Extra-header:" |
| 2149 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2150 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 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 strict, client default" \ |
| 2154 | "$G_SRV --priority=NORMAL:%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 default" \ |
| 2163 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2164 | "$P_CLI debug_level=3" \ |
| 2165 | 0 \ |
| 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 server unsafe, client break legacy" \ |
| 2172 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2173 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2174 | 1 \ |
| 2175 | -C "found renegotiation extension" \ |
| 2176 | -c "error" \ |
| 2177 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2178 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2179 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2180 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2181 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2182 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2183 | 0 \ |
| 2184 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2185 | -s "server hello, secure renegotiation extension" |
| 2186 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2187 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2188 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2189 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2190 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2191 | 0 \ |
| 2192 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2193 | -S "server hello, secure renegotiation extension" |
| 2194 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2195 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2196 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2197 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2198 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2199 | 1 \ |
| 2200 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2201 | -S "server hello, secure renegotiation extension" |
| 2202 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2203 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2204 | |
| 2205 | requires_gnutls |
| 2206 | run_test "DER format: no trailing bytes" \ |
| 2207 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2208 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2209 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2210 | 0 \ |
| 2211 | -c "Handshake was completed" \ |
| 2212 | |
| 2213 | requires_gnutls |
| 2214 | run_test "DER format: with a trailing zero byte" \ |
| 2215 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2216 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2217 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2218 | 0 \ |
| 2219 | -c "Handshake was completed" \ |
| 2220 | |
| 2221 | requires_gnutls |
| 2222 | run_test "DER format: with a trailing random byte" \ |
| 2223 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2224 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2225 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2226 | 0 \ |
| 2227 | -c "Handshake was completed" \ |
| 2228 | |
| 2229 | requires_gnutls |
| 2230 | run_test "DER format: with 2 trailing random bytes" \ |
| 2231 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2232 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2233 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2234 | 0 \ |
| 2235 | -c "Handshake was completed" \ |
| 2236 | |
| 2237 | requires_gnutls |
| 2238 | run_test "DER format: with 4 trailing random bytes" \ |
| 2239 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2240 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2241 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2242 | 0 \ |
| 2243 | -c "Handshake was completed" \ |
| 2244 | |
| 2245 | requires_gnutls |
| 2246 | run_test "DER format: with 8 trailing random bytes" \ |
| 2247 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2248 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2249 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2250 | 0 \ |
| 2251 | -c "Handshake was completed" \ |
| 2252 | |
| 2253 | requires_gnutls |
| 2254 | run_test "DER format: with 9 trailing random bytes" \ |
| 2255 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2256 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2257 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2258 | 0 \ |
| 2259 | -c "Handshake was completed" \ |
| 2260 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2261 | # Tests for auth_mode |
| 2262 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2263 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2264 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2265 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2266 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2267 | 1 \ |
| 2268 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2269 | -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] | 2270 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2271 | -c "X509 - Certificate verification failed" |
| 2272 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2273 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2274 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2275 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2276 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2277 | 0 \ |
| 2278 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2279 | -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] | 2280 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2281 | -C "X509 - Certificate verification failed" |
| 2282 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2283 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2284 | "$P_SRV" \ |
| 2285 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2286 | 0 \ |
| 2287 | -c "x509_verify_cert() returned" \ |
| 2288 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2289 | -c "! Certificate verification flags"\ |
| 2290 | -C "! mbedtls_ssl_handshake returned" \ |
| 2291 | -C "X509 - Certificate verification failed" \ |
| 2292 | -C "SSL - No CA Chain is set, but required to operate" |
| 2293 | |
| 2294 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2295 | "$P_SRV" \ |
| 2296 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2297 | 1 \ |
| 2298 | -c "x509_verify_cert() returned" \ |
| 2299 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2300 | -c "! Certificate verification flags"\ |
| 2301 | -c "! mbedtls_ssl_handshake returned" \ |
| 2302 | -c "SSL - No CA Chain is set, but required to operate" |
| 2303 | |
| 2304 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2305 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2306 | # the client informs the server about the supported curves - it does, though, in the |
| 2307 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2308 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2309 | # different means to have the server ignoring the client's supported curve list. |
| 2310 | |
| 2311 | requires_config_enabled MBEDTLS_ECP_C |
| 2312 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2313 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2314 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2315 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2316 | 1 \ |
| 2317 | -c "bad certificate (EC key curve)"\ |
| 2318 | -c "! Certificate verification flags"\ |
| 2319 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2320 | |
| 2321 | requires_config_enabled MBEDTLS_ECP_C |
| 2322 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2323 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2324 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2325 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2326 | 1 \ |
| 2327 | -c "bad certificate (EC key curve)"\ |
| 2328 | -c "! Certificate verification flags"\ |
| 2329 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2330 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2331 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2332 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2333 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2334 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2335 | 0 \ |
| 2336 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2337 | -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] | 2338 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2339 | -C "X509 - Certificate verification failed" |
| 2340 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2341 | run_test "Authentication: client SHA256, 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-256-GCM-SHA384" \ |
| 2346 | 0 \ |
| 2347 | -c "Supported Signature Algorithm found: 4," \ |
| 2348 | -c "Supported Signature Algorithm found: 5," |
| 2349 | |
| 2350 | run_test "Authentication: client SHA384, server required" \ |
| 2351 | "$P_SRV auth_mode=required" \ |
| 2352 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2353 | key_file=data_files/server6.key \ |
| 2354 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2355 | 0 \ |
| 2356 | -c "Supported Signature Algorithm found: 4," \ |
| 2357 | -c "Supported Signature Algorithm found: 5," |
| 2358 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2359 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2360 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2361 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2362 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2363 | key_file=data_files/server5.key" \ |
| 2364 | 1 \ |
| 2365 | -S "skip write certificate request" \ |
| 2366 | -C "skip parse certificate request" \ |
| 2367 | -c "got a certificate request" \ |
| 2368 | -c "got no certificate to send" \ |
| 2369 | -S "x509_verify_cert() returned" \ |
| 2370 | -s "client has no certificate" \ |
| 2371 | -s "! mbedtls_ssl_handshake returned" \ |
| 2372 | -c "! mbedtls_ssl_handshake returned" \ |
| 2373 | -s "No client certification received from the client, but required by the authentication mode" |
| 2374 | |
| 2375 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2376 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2377 | "$P_CLI debug_level=3 crt_file=none \ |
| 2378 | key_file=data_files/server5.key" \ |
| 2379 | 1 \ |
| 2380 | -S "skip write certificate request" \ |
| 2381 | -C "skip parse certificate request" \ |
| 2382 | -c "got a certificate request" \ |
| 2383 | -c "= write certificate$" \ |
| 2384 | -C "skip write certificate$" \ |
| 2385 | -S "x509_verify_cert() returned" \ |
| 2386 | -s "client has no certificate" \ |
| 2387 | -s "! mbedtls_ssl_handshake returned" \ |
| 2388 | -c "! mbedtls_ssl_handshake returned" \ |
| 2389 | -s "No client certification received from the client, but required by the authentication mode" |
| 2390 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2391 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2392 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2393 | "$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] | 2394 | key_file=data_files/server5.key" \ |
| 2395 | 1 \ |
| 2396 | -S "skip write certificate request" \ |
| 2397 | -C "skip parse certificate request" \ |
| 2398 | -c "got a certificate request" \ |
| 2399 | -C "skip write certificate" \ |
| 2400 | -C "skip write certificate verify" \ |
| 2401 | -S "skip parse certificate verify" \ |
| 2402 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2403 | -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] | 2404 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2405 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2406 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2407 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2408 | # We don't check that the client receives the alert because it might |
| 2409 | # detect that its write end of the connection is closed and abort |
| 2410 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2411 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2412 | run_test "Authentication: client cert not trusted, server required" \ |
| 2413 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2414 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2415 | key_file=data_files/server5.key" \ |
| 2416 | 1 \ |
| 2417 | -S "skip write certificate request" \ |
| 2418 | -C "skip parse certificate request" \ |
| 2419 | -c "got a certificate request" \ |
| 2420 | -C "skip write certificate" \ |
| 2421 | -C "skip write certificate verify" \ |
| 2422 | -S "skip parse certificate verify" \ |
| 2423 | -s "x509_verify_cert() returned" \ |
| 2424 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2425 | -s "! mbedtls_ssl_handshake returned" \ |
| 2426 | -c "! mbedtls_ssl_handshake returned" \ |
| 2427 | -s "X509 - Certificate verification failed" |
| 2428 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2429 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2430 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2431 | "$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] | 2432 | key_file=data_files/server5.key" \ |
| 2433 | 0 \ |
| 2434 | -S "skip write certificate request" \ |
| 2435 | -C "skip parse certificate request" \ |
| 2436 | -c "got a certificate request" \ |
| 2437 | -C "skip write certificate" \ |
| 2438 | -C "skip write certificate verify" \ |
| 2439 | -S "skip parse certificate verify" \ |
| 2440 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2441 | -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] | 2442 | -S "! mbedtls_ssl_handshake returned" \ |
| 2443 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2444 | -S "X509 - Certificate verification failed" |
| 2445 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2446 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2447 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2448 | "$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] | 2449 | key_file=data_files/server5.key" \ |
| 2450 | 0 \ |
| 2451 | -s "skip write certificate request" \ |
| 2452 | -C "skip parse certificate request" \ |
| 2453 | -c "got no certificate request" \ |
| 2454 | -c "skip write certificate" \ |
| 2455 | -c "skip write certificate verify" \ |
| 2456 | -s "skip parse certificate verify" \ |
| 2457 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2458 | -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] | 2459 | -S "! mbedtls_ssl_handshake returned" \ |
| 2460 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2461 | -S "X509 - Certificate verification failed" |
| 2462 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2463 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2464 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2465 | "$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] | 2466 | 0 \ |
| 2467 | -S "skip write certificate request" \ |
| 2468 | -C "skip parse certificate request" \ |
| 2469 | -c "got a certificate request" \ |
| 2470 | -C "skip write certificate$" \ |
| 2471 | -C "got no certificate to send" \ |
| 2472 | -S "SSLv3 client has no certificate" \ |
| 2473 | -c "skip write certificate verify" \ |
| 2474 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2475 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2476 | -S "! mbedtls_ssl_handshake returned" \ |
| 2477 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2478 | -S "X509 - Certificate verification failed" |
| 2479 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2480 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2481 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2482 | "$O_CLI" \ |
| 2483 | 0 \ |
| 2484 | -S "skip write certificate request" \ |
| 2485 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2486 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2487 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2488 | -S "X509 - Certificate verification failed" |
| 2489 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2490 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2491 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2492 | "$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] | 2493 | 0 \ |
| 2494 | -C "skip parse certificate request" \ |
| 2495 | -c "got a certificate request" \ |
| 2496 | -C "skip write certificate$" \ |
| 2497 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2498 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2499 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2500 | run_test "Authentication: client no cert, openssl server required" \ |
| 2501 | "$O_SRV -Verify 10" \ |
| 2502 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2503 | 1 \ |
| 2504 | -C "skip parse certificate request" \ |
| 2505 | -c "got a certificate request" \ |
| 2506 | -C "skip write certificate$" \ |
| 2507 | -c "skip write certificate verify" \ |
| 2508 | -c "! mbedtls_ssl_handshake returned" |
| 2509 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2510 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2511 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2512 | "$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] | 2513 | "$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] | 2514 | 0 \ |
| 2515 | -S "skip write certificate request" \ |
| 2516 | -C "skip parse certificate request" \ |
| 2517 | -c "got a certificate request" \ |
| 2518 | -C "skip write certificate$" \ |
| 2519 | -c "skip write certificate verify" \ |
| 2520 | -c "got no certificate to send" \ |
| 2521 | -s "SSLv3 client has no certificate" \ |
| 2522 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2523 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2524 | -S "! mbedtls_ssl_handshake returned" \ |
| 2525 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2526 | -S "X509 - Certificate verification failed" |
| 2527 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2528 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 2529 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2530 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2531 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2532 | 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] | 2533 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2534 | 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] | 2535 | 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] | 2536 | 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] | 2537 | printf "test value of ${MAX_IM_CA}. \n" |
| 2538 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2539 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 2540 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2541 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2542 | |
| 2543 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2544 | fi |
| 2545 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2546 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2547 | run_test "Authentication: server max_int chain, client default" \ |
| 2548 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2549 | key_file=data_files/dir-maxpath/09.key" \ |
| 2550 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2551 | 0 \ |
| 2552 | -C "X509 - A fatal error occured" |
| 2553 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2554 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2555 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2556 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2557 | key_file=data_files/dir-maxpath/10.key" \ |
| 2558 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 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 optional" \ |
| 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=optional" \ |
| 2568 | 1 \ |
| 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: server max_int+1 chain, client none" \ |
| 2573 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2574 | key_file=data_files/dir-maxpath/10.key" \ |
| 2575 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2576 | auth_mode=none" \ |
| 2577 | 0 \ |
| 2578 | -C "X509 - A fatal error occured" |
| 2579 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2580 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2581 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2582 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2583 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2584 | key_file=data_files/dir-maxpath/10.key" \ |
| 2585 | 0 \ |
| 2586 | -S "X509 - A fatal error occured" |
| 2587 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2588 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2589 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2590 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2591 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2592 | key_file=data_files/dir-maxpath/10.key" \ |
| 2593 | 1 \ |
| 2594 | -s "X509 - A fatal error occured" |
| 2595 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2596 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2597 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2598 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2599 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2600 | key_file=data_files/dir-maxpath/10.key" \ |
| 2601 | 1 \ |
| 2602 | -s "X509 - A fatal error occured" |
| 2603 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2604 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2605 | run_test "Authentication: client max_int chain, server required" \ |
| 2606 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2607 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2608 | key_file=data_files/dir-maxpath/09.key" \ |
| 2609 | 0 \ |
| 2610 | -S "X509 - A fatal error occured" |
| 2611 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2612 | # Tests for CA list in CertificateRequest messages |
| 2613 | |
| 2614 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 2615 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2616 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2617 | key_file=data_files/server6.key" \ |
| 2618 | 0 \ |
| 2619 | -s "requested DN" |
| 2620 | |
| 2621 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 2622 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2623 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2624 | key_file=data_files/server6.key" \ |
| 2625 | 0 \ |
| 2626 | -S "requested DN" |
| 2627 | |
| 2628 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 2629 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2630 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2631 | key_file=data_files/server5.key" \ |
| 2632 | 1 \ |
| 2633 | -S "requested DN" \ |
| 2634 | -s "x509_verify_cert() returned" \ |
| 2635 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2636 | -s "! mbedtls_ssl_handshake returned" \ |
| 2637 | -c "! mbedtls_ssl_handshake returned" \ |
| 2638 | -s "X509 - Certificate verification failed" |
| 2639 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2640 | # Tests for certificate selection based on SHA verson |
| 2641 | |
| 2642 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 2643 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2644 | key_file=data_files/server5.key \ |
| 2645 | crt_file2=data_files/server5-sha1.crt \ |
| 2646 | key_file2=data_files/server5.key" \ |
| 2647 | "$P_CLI force_version=tls1_2" \ |
| 2648 | 0 \ |
| 2649 | -c "signed using.*ECDSA with SHA256" \ |
| 2650 | -C "signed using.*ECDSA with SHA1" |
| 2651 | |
| 2652 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 2653 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2654 | key_file=data_files/server5.key \ |
| 2655 | crt_file2=data_files/server5-sha1.crt \ |
| 2656 | key_file2=data_files/server5.key" \ |
| 2657 | "$P_CLI force_version=tls1_1" \ |
| 2658 | 0 \ |
| 2659 | -C "signed using.*ECDSA with SHA256" \ |
| 2660 | -c "signed using.*ECDSA with SHA1" |
| 2661 | |
| 2662 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 2663 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2664 | key_file=data_files/server5.key \ |
| 2665 | crt_file2=data_files/server5-sha1.crt \ |
| 2666 | key_file2=data_files/server5.key" \ |
| 2667 | "$P_CLI force_version=tls1" \ |
| 2668 | 0 \ |
| 2669 | -C "signed using.*ECDSA with SHA256" \ |
| 2670 | -c "signed using.*ECDSA with SHA1" |
| 2671 | |
| 2672 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 2673 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2674 | key_file=data_files/server5.key \ |
| 2675 | crt_file2=data_files/server6.crt \ |
| 2676 | key_file2=data_files/server6.key" \ |
| 2677 | "$P_CLI force_version=tls1_1" \ |
| 2678 | 0 \ |
| 2679 | -c "serial number.*09" \ |
| 2680 | -c "signed using.*ECDSA with SHA256" \ |
| 2681 | -C "signed using.*ECDSA with SHA1" |
| 2682 | |
| 2683 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 2684 | "$P_SRV crt_file=data_files/server6.crt \ |
| 2685 | key_file=data_files/server6.key \ |
| 2686 | crt_file2=data_files/server5.crt \ |
| 2687 | key_file2=data_files/server5.key" \ |
| 2688 | "$P_CLI force_version=tls1_1" \ |
| 2689 | 0 \ |
| 2690 | -c "serial number.*0A" \ |
| 2691 | -c "signed using.*ECDSA with SHA256" \ |
| 2692 | -C "signed using.*ECDSA with SHA1" |
| 2693 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2694 | # tests for SNI |
| 2695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2696 | run_test "SNI: no SNI callback" \ |
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 | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2699 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2700 | 0 \ |
| 2701 | -S "parse ServerName extension" \ |
| 2702 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2703 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2704 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2705 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2706 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2707 | 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] | 2708 | 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] | 2709 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2710 | 0 \ |
| 2711 | -s "parse ServerName extension" \ |
| 2712 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2713 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2714 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2715 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2716 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2717 | 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] | 2718 | 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] | 2719 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2720 | 0 \ |
| 2721 | -s "parse ServerName extension" \ |
| 2722 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2723 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2724 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2725 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2726 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2727 | 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] | 2728 | 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] | 2729 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2730 | 1 \ |
| 2731 | -s "parse ServerName extension" \ |
| 2732 | -s "ssl_sni_wrapper() returned" \ |
| 2733 | -s "mbedtls_ssl_handshake returned" \ |
| 2734 | -c "mbedtls_ssl_handshake returned" \ |
| 2735 | -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] | 2736 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2737 | run_test "SNI: client auth no override: optional" \ |
| 2738 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2739 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2740 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2741 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2742 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2743 | -S "skip write certificate request" \ |
| 2744 | -C "skip parse certificate request" \ |
| 2745 | -c "got a certificate request" \ |
| 2746 | -C "skip write certificate" \ |
| 2747 | -C "skip write certificate verify" \ |
| 2748 | -S "skip parse certificate verify" |
| 2749 | |
| 2750 | run_test "SNI: client auth override: none -> optional" \ |
| 2751 | "$P_SRV debug_level=3 auth_mode=none \ |
| 2752 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2753 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2754 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2755 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2756 | -S "skip write certificate request" \ |
| 2757 | -C "skip parse certificate request" \ |
| 2758 | -c "got a certificate request" \ |
| 2759 | -C "skip write certificate" \ |
| 2760 | -C "skip write certificate verify" \ |
| 2761 | -S "skip parse certificate verify" |
| 2762 | |
| 2763 | run_test "SNI: client auth override: optional -> none" \ |
| 2764 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2765 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2766 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2767 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2768 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2769 | -s "skip write certificate request" \ |
| 2770 | -C "skip parse certificate request" \ |
| 2771 | -c "got no certificate request" \ |
| 2772 | -c "skip write certificate" \ |
| 2773 | -c "skip write certificate verify" \ |
| 2774 | -s "skip parse certificate verify" |
| 2775 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2776 | run_test "SNI: CA no override" \ |
| 2777 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2778 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2779 | ca_file=data_files/test-ca.crt \ |
| 2780 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2781 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2782 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2783 | 1 \ |
| 2784 | -S "skip write certificate request" \ |
| 2785 | -C "skip parse certificate request" \ |
| 2786 | -c "got a certificate request" \ |
| 2787 | -C "skip write certificate" \ |
| 2788 | -C "skip write certificate verify" \ |
| 2789 | -S "skip parse certificate verify" \ |
| 2790 | -s "x509_verify_cert() returned" \ |
| 2791 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2792 | -S "The certificate has been revoked (is on a CRL)" |
| 2793 | |
| 2794 | run_test "SNI: CA override" \ |
| 2795 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2796 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2797 | ca_file=data_files/test-ca.crt \ |
| 2798 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2799 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2800 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2801 | 0 \ |
| 2802 | -S "skip write certificate request" \ |
| 2803 | -C "skip parse certificate request" \ |
| 2804 | -c "got a certificate request" \ |
| 2805 | -C "skip write certificate" \ |
| 2806 | -C "skip write certificate verify" \ |
| 2807 | -S "skip parse certificate verify" \ |
| 2808 | -S "x509_verify_cert() returned" \ |
| 2809 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2810 | -S "The certificate has been revoked (is on a CRL)" |
| 2811 | |
| 2812 | run_test "SNI: CA override with CRL" \ |
| 2813 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2814 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2815 | ca_file=data_files/test-ca.crt \ |
| 2816 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2817 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2818 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2819 | 1 \ |
| 2820 | -S "skip write certificate request" \ |
| 2821 | -C "skip parse certificate request" \ |
| 2822 | -c "got a certificate request" \ |
| 2823 | -C "skip write certificate" \ |
| 2824 | -C "skip write certificate verify" \ |
| 2825 | -S "skip parse certificate verify" \ |
| 2826 | -s "x509_verify_cert() returned" \ |
| 2827 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2828 | -s "The certificate has been revoked (is on a CRL)" |
| 2829 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2830 | # Tests for SNI and DTLS |
| 2831 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2832 | run_test "SNI: DTLS, no SNI callback" \ |
| 2833 | "$P_SRV debug_level=3 dtls=1 \ |
| 2834 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2835 | "$P_CLI server_name=localhost dtls=1" \ |
| 2836 | 0 \ |
| 2837 | -S "parse ServerName extension" \ |
| 2838 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2839 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2840 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2841 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2842 | "$P_SRV debug_level=3 dtls=1 \ |
| 2843 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2844 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2845 | "$P_CLI server_name=localhost dtls=1" \ |
| 2846 | 0 \ |
| 2847 | -s "parse ServerName extension" \ |
| 2848 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2849 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2850 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2851 | run_test "SNI: DTLS, matching cert 2" \ |
| 2852 | "$P_SRV debug_level=3 dtls=1 \ |
| 2853 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2854 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2855 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 2856 | 0 \ |
| 2857 | -s "parse ServerName extension" \ |
| 2858 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2859 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 2860 | |
| 2861 | run_test "SNI: DTLS, no matching cert" \ |
| 2862 | "$P_SRV debug_level=3 dtls=1 \ |
| 2863 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2864 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2865 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 2866 | 1 \ |
| 2867 | -s "parse ServerName extension" \ |
| 2868 | -s "ssl_sni_wrapper() returned" \ |
| 2869 | -s "mbedtls_ssl_handshake returned" \ |
| 2870 | -c "mbedtls_ssl_handshake returned" \ |
| 2871 | -c "SSL - A fatal alert message was received from our peer" |
| 2872 | |
| 2873 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 2874 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2875 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2876 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2877 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2878 | 0 \ |
| 2879 | -S "skip write certificate request" \ |
| 2880 | -C "skip parse certificate request" \ |
| 2881 | -c "got a certificate request" \ |
| 2882 | -C "skip write certificate" \ |
| 2883 | -C "skip write certificate verify" \ |
| 2884 | -S "skip parse certificate verify" |
| 2885 | |
| 2886 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 2887 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 2888 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2889 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2890 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2891 | 0 \ |
| 2892 | -S "skip write certificate request" \ |
| 2893 | -C "skip parse certificate request" \ |
| 2894 | -c "got a certificate request" \ |
| 2895 | -C "skip write certificate" \ |
| 2896 | -C "skip write certificate verify" \ |
| 2897 | -S "skip parse certificate verify" |
| 2898 | |
| 2899 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 2900 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2901 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2902 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2903 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2904 | 0 \ |
| 2905 | -s "skip write certificate request" \ |
| 2906 | -C "skip parse certificate request" \ |
| 2907 | -c "got no certificate request" \ |
| 2908 | -c "skip write certificate" \ |
| 2909 | -c "skip write certificate verify" \ |
| 2910 | -s "skip parse certificate verify" |
| 2911 | |
| 2912 | run_test "SNI: DTLS, CA no override" \ |
| 2913 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2914 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2915 | ca_file=data_files/test-ca.crt \ |
| 2916 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2917 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2918 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2919 | 1 \ |
| 2920 | -S "skip write certificate request" \ |
| 2921 | -C "skip parse certificate request" \ |
| 2922 | -c "got a certificate request" \ |
| 2923 | -C "skip write certificate" \ |
| 2924 | -C "skip write certificate verify" \ |
| 2925 | -S "skip parse certificate verify" \ |
| 2926 | -s "x509_verify_cert() returned" \ |
| 2927 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2928 | -S "The certificate has been revoked (is on a CRL)" |
| 2929 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2930 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2931 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2932 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2933 | ca_file=data_files/test-ca.crt \ |
| 2934 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2935 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2936 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2937 | 0 \ |
| 2938 | -S "skip write certificate request" \ |
| 2939 | -C "skip parse certificate request" \ |
| 2940 | -c "got a certificate request" \ |
| 2941 | -C "skip write certificate" \ |
| 2942 | -C "skip write certificate verify" \ |
| 2943 | -S "skip parse certificate verify" \ |
| 2944 | -S "x509_verify_cert() returned" \ |
| 2945 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2946 | -S "The certificate has been revoked (is on a CRL)" |
| 2947 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2948 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2949 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2950 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 2951 | ca_file=data_files/test-ca.crt \ |
| 2952 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2953 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2954 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2955 | 1 \ |
| 2956 | -S "skip write certificate request" \ |
| 2957 | -C "skip parse certificate request" \ |
| 2958 | -c "got a certificate request" \ |
| 2959 | -C "skip write certificate" \ |
| 2960 | -C "skip write certificate verify" \ |
| 2961 | -S "skip parse certificate verify" \ |
| 2962 | -s "x509_verify_cert() returned" \ |
| 2963 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2964 | -s "The certificate has been revoked (is on a CRL)" |
| 2965 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2966 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 2967 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2968 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2969 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2970 | "$P_CLI nbio=2 tickets=0" \ |
| 2971 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2972 | -S "mbedtls_ssl_handshake returned" \ |
| 2973 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2974 | -c "Read from server: .* bytes read" |
| 2975 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2976 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2977 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 2978 | "$P_CLI nbio=2 tickets=0" \ |
| 2979 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2980 | -S "mbedtls_ssl_handshake returned" \ |
| 2981 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2982 | -c "Read from server: .* bytes read" |
| 2983 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2984 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2985 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2986 | "$P_CLI nbio=2 tickets=1" \ |
| 2987 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2988 | -S "mbedtls_ssl_handshake returned" \ |
| 2989 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2990 | -c "Read from server: .* bytes read" |
| 2991 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2992 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2993 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2994 | "$P_CLI nbio=2 tickets=1" \ |
| 2995 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2996 | -S "mbedtls_ssl_handshake returned" \ |
| 2997 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2998 | -c "Read from server: .* bytes read" |
| 2999 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3000 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3001 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3002 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3003 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3004 | -S "mbedtls_ssl_handshake returned" \ |
| 3005 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3006 | -c "Read from server: .* bytes read" |
| 3007 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3008 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3009 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3010 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3011 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3012 | -S "mbedtls_ssl_handshake returned" \ |
| 3013 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3014 | -c "Read from server: .* bytes read" |
| 3015 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3016 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3017 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3018 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 3019 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3020 | -S "mbedtls_ssl_handshake returned" \ |
| 3021 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3022 | -c "Read from server: .* bytes read" |
| 3023 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3024 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 3025 | |
| 3026 | run_test "Event-driven I/O: basic handshake" \ |
| 3027 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3028 | "$P_CLI event=1 tickets=0" \ |
| 3029 | 0 \ |
| 3030 | -S "mbedtls_ssl_handshake returned" \ |
| 3031 | -C "mbedtls_ssl_handshake returned" \ |
| 3032 | -c "Read from server: .* bytes read" |
| 3033 | |
| 3034 | run_test "Event-driven I/O: client auth" \ |
| 3035 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 3036 | "$P_CLI event=1 tickets=0" \ |
| 3037 | 0 \ |
| 3038 | -S "mbedtls_ssl_handshake returned" \ |
| 3039 | -C "mbedtls_ssl_handshake returned" \ |
| 3040 | -c "Read from server: .* bytes read" |
| 3041 | |
| 3042 | run_test "Event-driven I/O: ticket" \ |
| 3043 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3044 | "$P_CLI event=1 tickets=1" \ |
| 3045 | 0 \ |
| 3046 | -S "mbedtls_ssl_handshake returned" \ |
| 3047 | -C "mbedtls_ssl_handshake returned" \ |
| 3048 | -c "Read from server: .* bytes read" |
| 3049 | |
| 3050 | run_test "Event-driven I/O: ticket + client auth" \ |
| 3051 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3052 | "$P_CLI event=1 tickets=1" \ |
| 3053 | 0 \ |
| 3054 | -S "mbedtls_ssl_handshake returned" \ |
| 3055 | -C "mbedtls_ssl_handshake returned" \ |
| 3056 | -c "Read from server: .* bytes read" |
| 3057 | |
| 3058 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 3059 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3060 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3061 | 0 \ |
| 3062 | -S "mbedtls_ssl_handshake returned" \ |
| 3063 | -C "mbedtls_ssl_handshake returned" \ |
| 3064 | -c "Read from server: .* bytes read" |
| 3065 | |
| 3066 | run_test "Event-driven I/O: ticket + resume" \ |
| 3067 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3068 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3069 | 0 \ |
| 3070 | -S "mbedtls_ssl_handshake returned" \ |
| 3071 | -C "mbedtls_ssl_handshake returned" \ |
| 3072 | -c "Read from server: .* bytes read" |
| 3073 | |
| 3074 | run_test "Event-driven I/O: session-id resume" \ |
| 3075 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3076 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 3077 | 0 \ |
| 3078 | -S "mbedtls_ssl_handshake returned" \ |
| 3079 | -C "mbedtls_ssl_handshake returned" \ |
| 3080 | -c "Read from server: .* bytes read" |
| 3081 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3082 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 3083 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3084 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3085 | 0 \ |
| 3086 | -c "Read from server: .* bytes read" |
| 3087 | |
| 3088 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 3089 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3090 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3091 | 0 \ |
| 3092 | -c "Read from server: .* bytes read" |
| 3093 | |
| 3094 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 3095 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3096 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3097 | 0 \ |
| 3098 | -c "Read from server: .* bytes read" |
| 3099 | |
| 3100 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 3101 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3102 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3103 | 0 \ |
| 3104 | -c "Read from server: .* bytes read" |
| 3105 | |
| 3106 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 3107 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3108 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3109 | 0 \ |
| 3110 | -c "Read from server: .* bytes read" |
| 3111 | |
| 3112 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 3113 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3114 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3115 | 0 \ |
| 3116 | -c "Read from server: .* bytes read" |
| 3117 | |
| 3118 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 3119 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3120 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3121 | 0 \ |
| 3122 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3123 | |
| 3124 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3125 | # During session resumption, the client will send its ApplicationData record |
| 3126 | # within the same datagram as the Finished messages. In this situation, the |
| 3127 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3128 | # because the ApplicationData request has already been queued internally. |
| 3129 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3130 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3131 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3132 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3133 | 0 \ |
| 3134 | -c "Read from server: .* bytes read" |
| 3135 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3136 | # Tests for version negotiation |
| 3137 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3138 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3139 | "$P_SRV" \ |
| 3140 | "$P_CLI" \ |
| 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.2" \ |
| 3145 | -c "Protocol is TLSv1.2" |
| 3146 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3147 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3148 | "$P_SRV" \ |
| 3149 | "$P_CLI max_version=tls1_1" \ |
| 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: 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" \ |
| 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+srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3166 | "$P_SRV max_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 max 1.1, srv min 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3175 | "$P_SRV min_version=tls1_1" \ |
| 3176 | "$P_CLI max_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.1, srv max 1.1 -> 1.1" \ |
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_1" \ |
| 3186 | 0 \ |
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 | -s "Protocol is TLSv1.1" \ |
| 3190 | -c "Protocol is TLSv1.1" |
| 3191 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3192 | 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] | 3193 | "$P_SRV max_version=tls1_1" \ |
| 3194 | "$P_CLI min_version=tls1_2" \ |
| 3195 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3196 | -s "mbedtls_ssl_handshake returned" \ |
| 3197 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3198 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3199 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3200 | 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] | 3201 | "$P_SRV min_version=tls1_2" \ |
| 3202 | "$P_CLI max_version=tls1_1" \ |
| 3203 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3204 | -s "mbedtls_ssl_handshake returned" \ |
| 3205 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3206 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3207 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3208 | # Tests for ALPN extension |
| 3209 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3210 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3211 | "$P_SRV debug_level=3" \ |
| 3212 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3213 | 0 \ |
| 3214 | -C "client hello, adding alpn extension" \ |
| 3215 | -S "found alpn extension" \ |
| 3216 | -C "got an alert message, type: \\[2:120]" \ |
| 3217 | -S "server hello, adding alpn extension" \ |
| 3218 | -C "found alpn extension " \ |
| 3219 | -C "Application Layer Protocol is" \ |
| 3220 | -S "Application Layer Protocol is" |
| 3221 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3222 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3223 | "$P_SRV debug_level=3" \ |
| 3224 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3225 | 0 \ |
| 3226 | -c "client hello, adding alpn extension" \ |
| 3227 | -s "found alpn extension" \ |
| 3228 | -C "got an alert message, type: \\[2:120]" \ |
| 3229 | -S "server hello, adding alpn extension" \ |
| 3230 | -C "found alpn extension " \ |
| 3231 | -c "Application Layer Protocol is (none)" \ |
| 3232 | -S "Application Layer Protocol is" |
| 3233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3234 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3235 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3236 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3237 | 0 \ |
| 3238 | -C "client hello, adding alpn extension" \ |
| 3239 | -S "found alpn extension" \ |
| 3240 | -C "got an alert message, type: \\[2:120]" \ |
| 3241 | -S "server hello, adding alpn extension" \ |
| 3242 | -C "found alpn extension " \ |
| 3243 | -C "Application Layer Protocol is" \ |
| 3244 | -s "Application Layer Protocol is (none)" |
| 3245 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3246 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3247 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3248 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3249 | 0 \ |
| 3250 | -c "client hello, adding alpn extension" \ |
| 3251 | -s "found alpn extension" \ |
| 3252 | -C "got an alert message, type: \\[2:120]" \ |
| 3253 | -s "server hello, adding alpn extension" \ |
| 3254 | -c "found alpn extension" \ |
| 3255 | -c "Application Layer Protocol is abc" \ |
| 3256 | -s "Application Layer Protocol is abc" |
| 3257 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3258 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3259 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3260 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3261 | 0 \ |
| 3262 | -c "client hello, adding alpn extension" \ |
| 3263 | -s "found alpn extension" \ |
| 3264 | -C "got an alert message, type: \\[2:120]" \ |
| 3265 | -s "server hello, adding alpn extension" \ |
| 3266 | -c "found alpn extension" \ |
| 3267 | -c "Application Layer Protocol is abc" \ |
| 3268 | -s "Application Layer Protocol is abc" |
| 3269 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3270 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3271 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3272 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3273 | 0 \ |
| 3274 | -c "client hello, adding alpn extension" \ |
| 3275 | -s "found alpn extension" \ |
| 3276 | -C "got an alert message, type: \\[2:120]" \ |
| 3277 | -s "server hello, adding alpn extension" \ |
| 3278 | -c "found alpn extension" \ |
| 3279 | -c "Application Layer Protocol is 1234" \ |
| 3280 | -s "Application Layer Protocol is 1234" |
| 3281 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3282 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3283 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3284 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3285 | 1 \ |
| 3286 | -c "client hello, adding alpn extension" \ |
| 3287 | -s "found alpn extension" \ |
| 3288 | -c "got an alert message, type: \\[2:120]" \ |
| 3289 | -S "server hello, adding alpn extension" \ |
| 3290 | -C "found alpn extension" \ |
| 3291 | -C "Application Layer Protocol is 1234" \ |
| 3292 | -S "Application Layer Protocol is 1234" |
| 3293 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3294 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3295 | # Tests for keyUsage in leaf certificates, part 1: |
| 3296 | # server-side certificate/suite selection |
| 3297 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3298 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3299 | "$P_SRV key_file=data_files/server2.key \ |
| 3300 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3301 | "$P_CLI" \ |
| 3302 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3303 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3304 | |
| 3305 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3306 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3307 | "$P_SRV key_file=data_files/server2.key \ |
| 3308 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3309 | "$P_CLI" \ |
| 3310 | 0 \ |
| 3311 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3312 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3313 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3314 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3315 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3316 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3317 | 1 \ |
| 3318 | -C "Ciphersuite is " |
| 3319 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3320 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3321 | "$P_SRV key_file=data_files/server5.key \ |
| 3322 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3323 | "$P_CLI" \ |
| 3324 | 0 \ |
| 3325 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3326 | |
| 3327 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3328 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3329 | "$P_SRV key_file=data_files/server5.key \ |
| 3330 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3331 | "$P_CLI" \ |
| 3332 | 0 \ |
| 3333 | -c "Ciphersuite is TLS-ECDH-" |
| 3334 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3335 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3336 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3337 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3338 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3339 | 1 \ |
| 3340 | -C "Ciphersuite is " |
| 3341 | |
| 3342 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3343 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3344 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3345 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3346 | "$O_SRV -key data_files/server2.key \ |
| 3347 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3348 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3349 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3350 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3351 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3352 | -C "Processing of the Certificate handshake message failed" \ |
| 3353 | -c "Ciphersuite is TLS-" |
| 3354 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3355 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3356 | "$O_SRV -key data_files/server2.key \ |
| 3357 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3358 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3359 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3360 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3361 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3362 | -C "Processing of the Certificate handshake message failed" \ |
| 3363 | -c "Ciphersuite is TLS-" |
| 3364 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3365 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3366 | "$O_SRV -key data_files/server2.key \ |
| 3367 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3368 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3369 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3370 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3371 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3372 | -C "Processing of the Certificate handshake message failed" \ |
| 3373 | -c "Ciphersuite is TLS-" |
| 3374 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3375 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3376 | "$O_SRV -key data_files/server2.key \ |
| 3377 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3378 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3379 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3380 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3381 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3382 | -c "Processing of the Certificate handshake message failed" \ |
| 3383 | -C "Ciphersuite is TLS-" |
| 3384 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3385 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3386 | "$O_SRV -key data_files/server2.key \ |
| 3387 | -cert data_files/server2.ku-ke.crt" \ |
| 3388 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3389 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3390 | 0 \ |
| 3391 | -c "bad certificate (usage extensions)" \ |
| 3392 | -C "Processing of the Certificate handshake message failed" \ |
| 3393 | -c "Ciphersuite is TLS-" \ |
| 3394 | -c "! Usage does not match the keyUsage extension" |
| 3395 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3396 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3397 | "$O_SRV -key data_files/server2.key \ |
| 3398 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3399 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3400 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3401 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3402 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3403 | -C "Processing of the Certificate handshake message failed" \ |
| 3404 | -c "Ciphersuite is TLS-" |
| 3405 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3406 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3407 | "$O_SRV -key data_files/server2.key \ |
| 3408 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3409 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3410 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3411 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3412 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3413 | -c "Processing of the Certificate handshake message failed" \ |
| 3414 | -C "Ciphersuite is TLS-" |
| 3415 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3416 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3417 | "$O_SRV -key data_files/server2.key \ |
| 3418 | -cert data_files/server2.ku-ds.crt" \ |
| 3419 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3420 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3421 | 0 \ |
| 3422 | -c "bad certificate (usage extensions)" \ |
| 3423 | -C "Processing of the Certificate handshake message failed" \ |
| 3424 | -c "Ciphersuite is TLS-" \ |
| 3425 | -c "! Usage does not match the keyUsage extension" |
| 3426 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3427 | # Tests for keyUsage in leaf certificates, part 3: |
| 3428 | # server-side checking of client cert |
| 3429 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3430 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3431 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3432 | "$O_CLI -key data_files/server2.key \ |
| 3433 | -cert data_files/server2.ku-ds.crt" \ |
| 3434 | 0 \ |
| 3435 | -S "bad certificate (usage extensions)" \ |
| 3436 | -S "Processing of the Certificate handshake message failed" |
| 3437 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3438 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3439 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3440 | "$O_CLI -key data_files/server2.key \ |
| 3441 | -cert data_files/server2.ku-ke.crt" \ |
| 3442 | 0 \ |
| 3443 | -s "bad certificate (usage extensions)" \ |
| 3444 | -S "Processing of the Certificate handshake message failed" |
| 3445 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3446 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3447 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3448 | "$O_CLI -key data_files/server2.key \ |
| 3449 | -cert data_files/server2.ku-ke.crt" \ |
| 3450 | 1 \ |
| 3451 | -s "bad certificate (usage extensions)" \ |
| 3452 | -s "Processing of the Certificate handshake message failed" |
| 3453 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3454 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3455 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3456 | "$O_CLI -key data_files/server5.key \ |
| 3457 | -cert data_files/server5.ku-ds.crt" \ |
| 3458 | 0 \ |
| 3459 | -S "bad certificate (usage extensions)" \ |
| 3460 | -S "Processing of the Certificate handshake message failed" |
| 3461 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3462 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3463 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3464 | "$O_CLI -key data_files/server5.key \ |
| 3465 | -cert data_files/server5.ku-ka.crt" \ |
| 3466 | 0 \ |
| 3467 | -s "bad certificate (usage extensions)" \ |
| 3468 | -S "Processing of the Certificate handshake message failed" |
| 3469 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3470 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3471 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3472 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3473 | "$P_SRV key_file=data_files/server5.key \ |
| 3474 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3475 | "$P_CLI" \ |
| 3476 | 0 |
| 3477 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3478 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3479 | "$P_SRV key_file=data_files/server5.key \ |
| 3480 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3481 | "$P_CLI" \ |
| 3482 | 0 |
| 3483 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3484 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3485 | "$P_SRV key_file=data_files/server5.key \ |
| 3486 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3487 | "$P_CLI" \ |
| 3488 | 0 |
| 3489 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3490 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3491 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3492 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3493 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3494 | 1 |
| 3495 | |
| 3496 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3497 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3498 | run_test "extKeyUsage cli: serverAuth -> 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.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: serverAuth,clientAuth -> 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-srv_cli.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,anyEKU -> OK" \ |
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_any.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 | 0 \ |
| 3521 | -C "bad certificate (usage extensions)" \ |
| 3522 | -C "Processing of the Certificate handshake message failed" \ |
| 3523 | -c "Ciphersuite is TLS-" |
| 3524 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3525 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3526 | "$O_SRV -key data_files/server5.key \ |
| 3527 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3528 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3529 | 1 \ |
| 3530 | -c "bad certificate (usage extensions)" \ |
| 3531 | -c "Processing of the Certificate handshake message failed" \ |
| 3532 | -C "Ciphersuite is TLS-" |
| 3533 | |
| 3534 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3536 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3537 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3538 | "$O_CLI -key data_files/server5.key \ |
| 3539 | -cert data_files/server5.eku-cli.crt" \ |
| 3540 | 0 \ |
| 3541 | -S "bad certificate (usage extensions)" \ |
| 3542 | -S "Processing of the Certificate handshake message failed" |
| 3543 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3544 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3545 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3546 | "$O_CLI -key data_files/server5.key \ |
| 3547 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3548 | 0 \ |
| 3549 | -S "bad certificate (usage extensions)" \ |
| 3550 | -S "Processing of the Certificate handshake message failed" |
| 3551 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3552 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3553 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3554 | "$O_CLI -key data_files/server5.key \ |
| 3555 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3556 | 0 \ |
| 3557 | -S "bad certificate (usage extensions)" \ |
| 3558 | -S "Processing of the Certificate handshake message failed" |
| 3559 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3560 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3561 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3562 | "$O_CLI -key data_files/server5.key \ |
| 3563 | -cert data_files/server5.eku-cs.crt" \ |
| 3564 | 0 \ |
| 3565 | -s "bad certificate (usage extensions)" \ |
| 3566 | -S "Processing of the Certificate handshake message failed" |
| 3567 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3568 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3569 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3570 | "$O_CLI -key data_files/server5.key \ |
| 3571 | -cert data_files/server5.eku-cs.crt" \ |
| 3572 | 1 \ |
| 3573 | -s "bad certificate (usage extensions)" \ |
| 3574 | -s "Processing of the Certificate handshake message failed" |
| 3575 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3576 | # Tests for DHM parameters loading |
| 3577 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3578 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3579 | "$P_SRV" \ |
| 3580 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3581 | debug_level=3" \ |
| 3582 | 0 \ |
| 3583 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3584 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3585 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3586 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3587 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3588 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3589 | debug_level=3" \ |
| 3590 | 0 \ |
| 3591 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3592 | -c "value of 'DHM: G ' (2 bits)" |
| 3593 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3594 | # Tests for DHM client-side size checking |
| 3595 | |
| 3596 | run_test "DHM size: server default, client default, OK" \ |
| 3597 | "$P_SRV" \ |
| 3598 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3599 | debug_level=1" \ |
| 3600 | 0 \ |
| 3601 | -C "DHM prime too short:" |
| 3602 | |
| 3603 | run_test "DHM size: server default, client 2048, OK" \ |
| 3604 | "$P_SRV" \ |
| 3605 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3606 | debug_level=1 dhmlen=2048" \ |
| 3607 | 0 \ |
| 3608 | -C "DHM prime too short:" |
| 3609 | |
| 3610 | run_test "DHM size: server 1024, client default, OK" \ |
| 3611 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3612 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3613 | debug_level=1" \ |
| 3614 | 0 \ |
| 3615 | -C "DHM prime too short:" |
| 3616 | |
| 3617 | run_test "DHM size: server 1000, client default, rejected" \ |
| 3618 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3619 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3620 | debug_level=1" \ |
| 3621 | 1 \ |
| 3622 | -c "DHM prime too short:" |
| 3623 | |
| 3624 | run_test "DHM size: server default, client 2049, rejected" \ |
| 3625 | "$P_SRV" \ |
| 3626 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3627 | debug_level=1 dhmlen=2049" \ |
| 3628 | 1 \ |
| 3629 | -c "DHM prime too short:" |
| 3630 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3631 | # Tests for PSK callback |
| 3632 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3633 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3634 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 3635 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3636 | psk_identity=foo psk=abc123" \ |
| 3637 | 0 \ |
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 | 10c3c9f | 2014-06-10 15:28:52 +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: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3643 | "$P_SRV" \ |
| 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: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3652 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 3653 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3654 | psk_identity=foo psk=abc123" \ |
| 3655 | 1 \ |
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: first 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=abc psk=dead" \ |
| 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: second id matches" \ |
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=def psk=beef" \ |
| 3673 | 0 \ |
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: no match" \ |
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=ghi 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" |
| 3686 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3687 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3688 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3689 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3690 | psk_identity=abc psk=beef" \ |
| 3691 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3692 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3693 | -S "SSL - Unknown identity received" \ |
| 3694 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3695 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3696 | # Tests for EC J-PAKE |
| 3697 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3698 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3699 | run_test "ECJPAKE: client not configured" \ |
| 3700 | "$P_SRV debug_level=3" \ |
| 3701 | "$P_CLI debug_level=3" \ |
| 3702 | 0 \ |
| 3703 | -C "add ciphersuite: c0ff" \ |
| 3704 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3705 | -S "found ecjpake kkpp extension" \ |
| 3706 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3707 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3708 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3709 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3710 | -S "None of the common ciphersuites is usable" |
| 3711 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3712 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3713 | run_test "ECJPAKE: server not configured" \ |
| 3714 | "$P_SRV debug_level=3" \ |
| 3715 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3716 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3717 | 1 \ |
| 3718 | -c "add ciphersuite: c0ff" \ |
| 3719 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3720 | -s "found ecjpake kkpp extension" \ |
| 3721 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3722 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3723 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3724 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3725 | -s "None of the common ciphersuites is usable" |
| 3726 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3727 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3728 | run_test "ECJPAKE: working, TLS" \ |
| 3729 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3730 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3731 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 3732 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3733 | -c "add ciphersuite: c0ff" \ |
| 3734 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3735 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3736 | -s "found ecjpake kkpp extension" \ |
| 3737 | -S "skip ecjpake kkpp extension" \ |
| 3738 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3739 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3740 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3741 | -S "None of the common ciphersuites is usable" \ |
| 3742 | -S "SSL - Verification of the message MAC failed" |
| 3743 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3744 | server_needs_more_time 1 |
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: password mismatch, TLS" \ |
| 3747 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3748 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 3749 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3750 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3751 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 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 | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3755 | run_test "ECJPAKE: working, DTLS" \ |
| 3756 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3757 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3758 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3759 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3760 | -c "re-using cached ecjpake parameters" \ |
| 3761 | -S "SSL - Verification of the message MAC failed" |
| 3762 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3763 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3764 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 3765 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 3766 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3767 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3768 | 0 \ |
| 3769 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3770 | -S "SSL - Verification of the message MAC failed" |
| 3771 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3772 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3773 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3774 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 3775 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3776 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 3777 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3778 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3779 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3780 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3781 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3782 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3783 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3784 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 3785 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 3786 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 3787 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3788 | 0 |
| 3789 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3790 | # Tests for ciphersuites per version |
| 3791 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3792 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3793 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3794 | "$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] | 3795 | "$P_CLI force_version=ssl3" \ |
| 3796 | 0 \ |
| 3797 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 3798 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3799 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3800 | "$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] | 3801 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3802 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3803 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3804 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3805 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3806 | "$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] | 3807 | "$P_CLI force_version=tls1_1" \ |
| 3808 | 0 \ |
| 3809 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 3810 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3811 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3812 | "$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] | 3813 | "$P_CLI force_version=tls1_2" \ |
| 3814 | 0 \ |
| 3815 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 3816 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3817 | # Test for ClientHello without extensions |
| 3818 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 3819 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3820 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3821 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3822 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3823 | 0 \ |
| 3824 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3825 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3826 | requires_gnutls |
| 3827 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 3828 | "$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] | 3829 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3830 | 0 \ |
| 3831 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3832 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3833 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3834 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3835 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3836 | "$P_SRV" \ |
| 3837 | "$P_CLI request_size=100" \ |
| 3838 | 0 \ |
| 3839 | -s "Read from client: 100 bytes read$" |
| 3840 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3841 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3842 | "$P_SRV" \ |
| 3843 | "$P_CLI request_size=500" \ |
| 3844 | 0 \ |
| 3845 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3846 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3847 | # Tests for small packets |
| 3848 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3849 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3850 | run_test "Small packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3851 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3852 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3853 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3854 | 0 \ |
| 3855 | -s "Read from client: 1 bytes read" |
| 3856 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3857 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3858 | run_test "Small packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3859 | "$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] | 3860 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3861 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3862 | 0 \ |
| 3863 | -s "Read from client: 1 bytes read" |
| 3864 | |
| 3865 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 3866 | "$P_SRV" \ |
| 3867 | "$P_CLI request_size=1 force_version=tls1 \ |
| 3868 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3869 | 0 \ |
| 3870 | -s "Read from client: 1 bytes read" |
| 3871 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3872 | run_test "Small packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3873 | "$P_SRV" \ |
| 3874 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 3875 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3876 | 0 \ |
| 3877 | -s "Read from client: 1 bytes read" |
| 3878 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3879 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3880 | run_test "Small packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3881 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3882 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3883 | 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] | 3884 | 0 \ |
| 3885 | -s "Read from client: 1 bytes read" |
| 3886 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3887 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3888 | run_test "Small packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3889 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3890 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3891 | 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] | 3892 | 0 \ |
| 3893 | -s "Read from client: 1 bytes read" |
| 3894 | |
| 3895 | run_test "Small packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3896 | "$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] | 3897 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3898 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3899 | 0 \ |
| 3900 | -s "Read from client: 1 bytes read" |
| 3901 | |
| 3902 | run_test "Small packet TLS 1.0 StreamCipher, without EtM" \ |
| 3903 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3904 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3905 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3906 | 0 \ |
| 3907 | -s "Read from client: 1 bytes read" |
| 3908 | |
| 3909 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3910 | run_test "Small packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3911 | "$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] | 3912 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3913 | 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] | 3914 | 0 \ |
| 3915 | -s "Read from client: 1 bytes read" |
| 3916 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3917 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3918 | run_test "Small packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3919 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3920 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 3921 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3922 | 0 \ |
| 3923 | -s "Read from client: 1 bytes read" |
| 3924 | |
| 3925 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 3926 | "$P_SRV" \ |
| 3927 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3928 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3929 | 0 \ |
| 3930 | -s "Read from client: 1 bytes read" |
| 3931 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3932 | run_test "Small packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3933 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3934 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3935 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3936 | 0 \ |
| 3937 | -s "Read from client: 1 bytes read" |
| 3938 | |
| 3939 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3940 | run_test "Small packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3941 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3942 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3943 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3944 | 0 \ |
| 3945 | -s "Read from client: 1 bytes read" |
| 3946 | |
| 3947 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3948 | run_test "Small packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3949 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3950 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3951 | 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] | 3952 | 0 \ |
| 3953 | -s "Read from client: 1 bytes read" |
| 3954 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3955 | run_test "Small packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3956 | "$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] | 3957 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3958 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3959 | 0 \ |
| 3960 | -s "Read from client: 1 bytes read" |
| 3961 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3962 | run_test "Small packet TLS 1.1 StreamCipher, without EtM" \ |
| 3963 | "$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] | 3964 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3965 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3966 | 0 \ |
| 3967 | -s "Read from client: 1 bytes read" |
| 3968 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3969 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3970 | run_test "Small packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3971 | "$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] | 3972 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3973 | 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] | 3974 | 0 \ |
| 3975 | -s "Read from client: 1 bytes read" |
| 3976 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3977 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3978 | run_test "Small packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3979 | "$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] | 3980 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3981 | 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] | 3982 | 0 \ |
| 3983 | -s "Read from client: 1 bytes read" |
| 3984 | |
| 3985 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 3986 | "$P_SRV" \ |
| 3987 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3988 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3989 | 0 \ |
| 3990 | -s "Read from client: 1 bytes read" |
| 3991 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3992 | run_test "Small packet TLS 1.2 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3993 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3994 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3995 | 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] | 3996 | 0 \ |
| 3997 | -s "Read from client: 1 bytes read" |
| 3998 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3999 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 4000 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4001 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4002 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4003 | 0 \ |
| 4004 | -s "Read from client: 1 bytes read" |
| 4005 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4006 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4007 | run_test "Small packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4008 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4009 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4010 | 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] | 4011 | 0 \ |
| 4012 | -s "Read from client: 1 bytes read" |
| 4013 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4014 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4015 | run_test "Small packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4016 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4017 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4018 | 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] | 4019 | 0 \ |
| 4020 | -s "Read from client: 1 bytes read" |
| 4021 | |
| 4022 | run_test "Small packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4023 | "$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] | 4024 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4025 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4026 | 0 \ |
| 4027 | -s "Read from client: 1 bytes read" |
| 4028 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4029 | run_test "Small packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4030 | "$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] | 4031 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4032 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4033 | 0 \ |
| 4034 | -s "Read from client: 1 bytes read" |
| 4035 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4036 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4037 | run_test "Small packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4038 | "$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] | 4039 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4040 | 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] | 4041 | 0 \ |
| 4042 | -s "Read from client: 1 bytes read" |
| 4043 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4044 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4045 | run_test "Small packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4046 | "$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] | 4047 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4048 | 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] | 4049 | 0 \ |
| 4050 | -s "Read from client: 1 bytes read" |
| 4051 | |
| 4052 | run_test "Small packet TLS 1.2 AEAD" \ |
| 4053 | "$P_SRV" \ |
| 4054 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4055 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4056 | 0 \ |
| 4057 | -s "Read from client: 1 bytes read" |
| 4058 | |
| 4059 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 4060 | "$P_SRV" \ |
| 4061 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4062 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4063 | 0 \ |
| 4064 | -s "Read from client: 1 bytes read" |
| 4065 | |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4066 | # Tests for small packets in DTLS |
| 4067 | |
| 4068 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4069 | run_test "Small packet DTLS 1.0" \ |
| 4070 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 4071 | "$P_CLI dtls=1 request_size=1 \ |
| 4072 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4073 | 0 \ |
| 4074 | -s "Read from client: 1 bytes read" |
| 4075 | |
| 4076 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4077 | run_test "Small packet DTLS 1.0, without EtM" \ |
| 4078 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 4079 | "$P_CLI dtls=1 request_size=1 \ |
| 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, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4087 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 4088 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4089 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4090 | 0 \ |
| 4091 | -s "Read from client: 1 bytes read" |
| 4092 | |
| 4093 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4094 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4095 | run_test "Small packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4096 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4097 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4098 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4099 | 0 \ |
| 4100 | -s "Read from client: 1 bytes read" |
| 4101 | |
| 4102 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4103 | run_test "Small packet DTLS 1.2" \ |
| 4104 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 4105 | "$P_CLI dtls=1 request_size=1 \ |
| 4106 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4107 | 0 \ |
| 4108 | -s "Read from client: 1 bytes read" |
| 4109 | |
| 4110 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4111 | run_test "Small packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4112 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4113 | "$P_CLI dtls=1 request_size=1 \ |
| 4114 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 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, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4121 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
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 | |
| 4127 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4128 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4129 | run_test "Small packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4130 | "$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] | 4131 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4132 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4133 | 0 \ |
| 4134 | -s "Read from client: 1 bytes read" |
| 4135 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4136 | # A test for extensions in SSLv3 |
| 4137 | |
| 4138 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4139 | run_test "SSLv3 with extensions, server side" \ |
| 4140 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 4141 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4142 | 0 \ |
| 4143 | -S "dumping 'client hello extensions'" \ |
| 4144 | -S "server hello, total extension length:" |
| 4145 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4146 | # Test for large packets |
| 4147 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4148 | # How many fragments do we expect to write $1 bytes? |
| 4149 | fragments_for_write() { |
| 4150 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4151 | } |
| 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 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4155 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4156 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4157 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-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 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4162 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4163 | run_test "Large packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4164 | "$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] | 4165 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4166 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4167 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4168 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4169 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4170 | |
| 4171 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 4172 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4173 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4174 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4175 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4176 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4177 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4178 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4179 | run_test "Large packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4180 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4181 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4182 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4183 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4184 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [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, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4188 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4189 | "$P_CLI request_size=16384 force_version=tls1 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" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4191 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4192 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4193 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4194 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4195 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4196 | run_test "Large packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4197 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4198 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4199 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4200 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4201 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4202 | |
| 4203 | run_test "Large packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4204 | "$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] | 4205 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4206 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4207 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4208 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4209 | |
| 4210 | run_test "Large packet TLS 1.0 StreamCipher, without EtM" \ |
| 4211 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4212 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4213 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4214 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4215 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4216 | |
| 4217 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4218 | run_test "Large packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4219 | "$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] | 4220 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4221 | 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] | 4222 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 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 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4225 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4226 | run_test "Large packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4227 | "$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] | 4228 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4229 | 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] | 4230 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4231 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4232 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4233 | |
| 4234 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 4235 | "$P_SRV" \ |
| 4236 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4237 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4238 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4239 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4240 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4241 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4242 | run_test "Large packet TLS 1.1 BlockCipher, without EtM" \ |
| 4243 | "$P_SRV" \ |
| 4244 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4245 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4246 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4247 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4248 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4249 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4250 | run_test "Large packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4251 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4252 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4253 | 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] | 4254 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4255 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4256 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4257 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4258 | run_test "Large packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4259 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4260 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4261 | 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] | 4262 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4263 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4264 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4265 | run_test "Large packet TLS 1.1 StreamCipher" \ |
| 4266 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4267 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4268 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4269 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4270 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4271 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4272 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4273 | run_test "Large packet TLS 1.1 StreamCipher, without EtM" \ |
| 4274 | "$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] | 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 etm=0" \ |
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 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4279 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4280 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4281 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4282 | run_test "Large packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4283 | "$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] | 4284 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4285 | 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] | 4286 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 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 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4289 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4290 | run_test "Large packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4291 | "$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] | 4292 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4293 | 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] | 4294 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4295 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4296 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4297 | |
| 4298 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 4299 | "$P_SRV" \ |
| 4300 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4301 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4302 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4303 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4304 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4305 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4306 | run_test "Large packet TLS 1.2 BlockCipher, without EtM" \ |
| 4307 | "$P_SRV" \ |
| 4308 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 4309 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4310 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4311 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4312 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4313 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 4314 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4315 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4316 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
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 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4319 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4320 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4321 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4322 | run_test "Large packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4323 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4324 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4325 | 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] | 4326 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 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 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4329 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4330 | run_test "Large packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4331 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4332 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4333 | 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] | 4334 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4335 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4336 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4337 | |
| 4338 | run_test "Large packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4339 | "$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] | 4340 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4341 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4342 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4343 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4344 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4345 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4346 | run_test "Large packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4347 | "$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] | 4348 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4349 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4350 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4351 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4352 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4353 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4354 | run_test "Large packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4355 | "$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] | 4356 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4357 | 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] | 4358 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 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 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4361 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4362 | run_test "Large packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4363 | "$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] | 4364 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4365 | 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] | 4366 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4367 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4368 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4369 | |
| 4370 | run_test "Large packet TLS 1.2 AEAD" \ |
| 4371 | "$P_SRV" \ |
| 4372 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4373 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4374 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4375 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4376 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4377 | |
| 4378 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 4379 | "$P_SRV" \ |
| 4380 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4381 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4382 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4383 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4384 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4385 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4386 | # Tests of asynchronous private key support in SSL |
| 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=0" \ |
| 4390 | "$P_SRV \ |
| 4391 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
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 " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4395 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4396 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4397 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4398 | run_test "SSL async private: sign, delay=1" \ |
| 4399 | "$P_SRV \ |
| 4400 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4401 | "$P_CLI" \ |
| 4402 | 0 \ |
| 4403 | -s "Async sign callback: using key slot " \ |
| 4404 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4405 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4406 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 4407 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4408 | run_test "SSL async private: sign, delay=2" \ |
| 4409 | "$P_SRV \ |
| 4410 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 4411 | "$P_CLI" \ |
| 4412 | 0 \ |
| 4413 | -s "Async sign callback: using key slot " \ |
| 4414 | -U "Async sign callback: using key slot " \ |
| 4415 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 4416 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4417 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4418 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 4419 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 4420 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 4421 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4423 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 4424 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 4425 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 4426 | "$P_CLI force_version=tls1_1" \ |
| 4427 | 0 \ |
| 4428 | -s "Async sign callback: using key slot " \ |
| 4429 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4430 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4431 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 4432 | run_test "SSL async private: sign, SNI" \ |
| 4433 | "$P_SRV debug_level=3 \ |
| 4434 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 4435 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4436 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4437 | "$P_CLI server_name=polarssl.example" \ |
| 4438 | 0 \ |
| 4439 | -s "Async sign callback: using key slot " \ |
| 4440 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 4441 | -s "parse ServerName extension" \ |
| 4442 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4443 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4444 | |
| 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=0" \ |
| 4447 | "$P_SRV \ |
| 4448 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 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]): decrypt done, status=0" |
| 4453 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4454 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4455 | run_test "SSL async private: decrypt, delay=1" \ |
| 4456 | "$P_SRV \ |
| 4457 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4458 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4459 | 0 \ |
| 4460 | -s "Async decrypt callback: using key slot " \ |
| 4461 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4462 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4463 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4464 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4465 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 4466 | "$P_SRV psk=abc123 \ |
| 4467 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 4468 | "$P_CLI psk=abc123 \ |
| 4469 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 4470 | 0 \ |
| 4471 | -s "Async decrypt callback: using key slot " \ |
| 4472 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4473 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4474 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4475 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 4476 | "$P_SRV psk=abc123 \ |
| 4477 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4478 | "$P_CLI psk=abc123 \ |
| 4479 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 4480 | 0 \ |
| 4481 | -s "Async decrypt callback: using key slot " \ |
| 4482 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4483 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4484 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4485 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4486 | run_test "SSL async private: sign callback not present" \ |
| 4487 | "$P_SRV \ |
| 4488 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4489 | "$P_CLI; [ \$? -eq 1 ] && |
| 4490 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4491 | 0 \ |
| 4492 | -S "Async sign callback" \ |
| 4493 | -s "! mbedtls_ssl_handshake returned" \ |
| 4494 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 4495 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 4496 | -s "Successful connection" |
| 4497 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4498 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4499 | run_test "SSL async private: decrypt callback not present" \ |
| 4500 | "$P_SRV debug_level=1 \ |
| 4501 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 4502 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 4503 | [ \$? -eq 1 ] && $P_CLI" \ |
| 4504 | 0 \ |
| 4505 | -S "Async decrypt callback" \ |
| 4506 | -s "! mbedtls_ssl_handshake returned" \ |
| 4507 | -s "got no RSA private key" \ |
| 4508 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 4509 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4510 | |
| 4511 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4512 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4513 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4514 | "$P_SRV \ |
| 4515 | async_operations=s async_private_delay1=1 \ |
| 4516 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4517 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4518 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 4519 | 0 \ |
| 4520 | -s "Async sign callback: using key slot 0," \ |
| 4521 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4522 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4523 | |
| 4524 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4525 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4526 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4527 | "$P_SRV \ |
| 4528 | async_operations=s async_private_delay2=1 \ |
| 4529 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4530 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4531 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4532 | 0 \ |
| 4533 | -s "Async sign callback: using key slot 0," \ |
| 4534 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4535 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4536 | |
| 4537 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4538 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 4539 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4540 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 4541 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4542 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4543 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4544 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4545 | 0 \ |
| 4546 | -s "Async sign callback: using key slot 1," \ |
| 4547 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4548 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4549 | |
| 4550 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4551 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4552 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4553 | "$P_SRV \ |
| 4554 | async_operations=s async_private_delay1=1 \ |
| 4555 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4556 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4557 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4558 | 0 \ |
| 4559 | -s "Async sign callback: no key matches this certificate." |
| 4560 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4561 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4562 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4563 | "$P_SRV \ |
| 4564 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4565 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4566 | "$P_CLI" \ |
| 4567 | 1 \ |
| 4568 | -s "Async sign callback: injected error" \ |
| 4569 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4570 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4571 | -s "! mbedtls_ssl_handshake returned" |
| 4572 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4573 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4574 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4575 | "$P_SRV \ |
| 4576 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4577 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4578 | "$P_CLI" \ |
| 4579 | 1 \ |
| 4580 | -s "Async sign callback: using key slot " \ |
| 4581 | -S "Async resume" \ |
| 4582 | -s "Async cancel" |
| 4583 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4584 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4585 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4586 | "$P_SRV \ |
| 4587 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4588 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4589 | "$P_CLI" \ |
| 4590 | 1 \ |
| 4591 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4592 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4593 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4594 | -s "! mbedtls_ssl_handshake returned" |
| 4595 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4596 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4597 | run_test "SSL async private: decrypt, error in start" \ |
| 4598 | "$P_SRV \ |
| 4599 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4600 | async_private_error=1" \ |
| 4601 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4602 | 1 \ |
| 4603 | -s "Async decrypt callback: injected error" \ |
| 4604 | -S "Async resume" \ |
| 4605 | -S "Async cancel" \ |
| 4606 | -s "! mbedtls_ssl_handshake returned" |
| 4607 | |
| 4608 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4609 | run_test "SSL async private: decrypt, cancel after start" \ |
| 4610 | "$P_SRV \ |
| 4611 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4612 | async_private_error=2" \ |
| 4613 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4614 | 1 \ |
| 4615 | -s "Async decrypt callback: using key slot " \ |
| 4616 | -S "Async resume" \ |
| 4617 | -s "Async cancel" |
| 4618 | |
| 4619 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4620 | run_test "SSL async private: decrypt, error in resume" \ |
| 4621 | "$P_SRV \ |
| 4622 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4623 | async_private_error=3" \ |
| 4624 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4625 | 1 \ |
| 4626 | -s "Async decrypt callback: using key slot " \ |
| 4627 | -s "Async resume callback: decrypt done but injected error" \ |
| 4628 | -S "Async cancel" \ |
| 4629 | -s "! mbedtls_ssl_handshake returned" |
| 4630 | |
| 4631 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4632 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4633 | "$P_SRV \ |
| 4634 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4635 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4636 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 4637 | 0 \ |
| 4638 | -s "Async cancel" \ |
| 4639 | -s "! mbedtls_ssl_handshake returned" \ |
| 4640 | -s "Async resume" \ |
| 4641 | -s "Successful connection" |
| 4642 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4643 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4644 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4645 | "$P_SRV \ |
| 4646 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4647 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4648 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 4649 | 0 \ |
| 4650 | -s "! mbedtls_ssl_handshake returned" \ |
| 4651 | -s "Async resume" \ |
| 4652 | -s "Successful connection" |
| 4653 | |
| 4654 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4655 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4656 | 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] | 4657 | "$P_SRV \ |
| 4658 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 4659 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4660 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4661 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 4662 | [ \$? -eq 1 ] && |
| 4663 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4664 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 4665 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4666 | -S "Async resume" \ |
| 4667 | -s "Async cancel" \ |
| 4668 | -s "! mbedtls_ssl_handshake returned" \ |
| 4669 | -s "Async sign callback: no key matches this certificate." \ |
| 4670 | -s "Successful connection" |
| 4671 | |
| 4672 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4673 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4674 | 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] | 4675 | "$P_SRV \ |
| 4676 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 4677 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4678 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4679 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 4680 | [ \$? -eq 1 ] && |
| 4681 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4682 | 0 \ |
| 4683 | -s "Async resume" \ |
| 4684 | -s "! mbedtls_ssl_handshake returned" \ |
| 4685 | -s "Async sign callback: no key matches this certificate." \ |
| 4686 | -s "Successful connection" |
| 4687 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4688 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4689 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4690 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 4691 | "$P_SRV \ |
| 4692 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4693 | exchanges=2 renegotiation=1" \ |
| 4694 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4695 | 0 \ |
| 4696 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4697 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4698 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4699 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4700 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4701 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 4702 | "$P_SRV \ |
| 4703 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4704 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4705 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 4706 | 0 \ |
| 4707 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4708 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4709 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4710 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4711 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 4712 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 4713 | "$P_SRV \ |
| 4714 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4715 | exchanges=2 renegotiation=1" \ |
| 4716 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 4717 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4718 | 0 \ |
| 4719 | -s "Async decrypt callback: using key slot " \ |
| 4720 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4721 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4722 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4723 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 4724 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 4725 | "$P_SRV \ |
| 4726 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4727 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4728 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 4729 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4730 | 0 \ |
| 4731 | -s "Async decrypt callback: using key slot " \ |
| 4732 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4733 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4734 | # Tests for ECC extensions (rfc 4492) |
| 4735 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4736 | requires_config_enabled MBEDTLS_AES_C |
| 4737 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4738 | requires_config_enabled MBEDTLS_SHA256_C |
| 4739 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4740 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 4741 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4742 | "$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] | 4743 | 0 \ |
| 4744 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 4745 | -C "client hello, adding supported_point_formats extension" \ |
| 4746 | -S "found supported elliptic curves extension" \ |
| 4747 | -S "found supported point formats extension" |
| 4748 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4749 | requires_config_enabled MBEDTLS_AES_C |
| 4750 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4751 | requires_config_enabled MBEDTLS_SHA256_C |
| 4752 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4753 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4754 | "$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] | 4755 | "$P_CLI debug_level=3" \ |
| 4756 | 0 \ |
| 4757 | -C "found supported_point_formats extension" \ |
| 4758 | -S "server hello, supported_point_formats extension" |
| 4759 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4760 | requires_config_enabled MBEDTLS_AES_C |
| 4761 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4762 | requires_config_enabled MBEDTLS_SHA256_C |
| 4763 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4764 | run_test "Force an ECC ciphersuite in the client side" \ |
| 4765 | "$P_SRV debug_level=3" \ |
| 4766 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 4767 | 0 \ |
| 4768 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 4769 | -c "client hello, adding supported_point_formats extension" \ |
| 4770 | -s "found supported elliptic curves extension" \ |
| 4771 | -s "found supported point formats extension" |
| 4772 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4773 | requires_config_enabled MBEDTLS_AES_C |
| 4774 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4775 | requires_config_enabled MBEDTLS_SHA256_C |
| 4776 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4777 | run_test "Force an ECC ciphersuite in the server side" \ |
| 4778 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 4779 | "$P_CLI debug_level=3" \ |
| 4780 | 0 \ |
| 4781 | -c "found supported_point_formats extension" \ |
| 4782 | -s "server hello, supported_point_formats extension" |
| 4783 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4784 | # Tests for DTLS HelloVerifyRequest |
| 4785 | |
| 4786 | run_test "DTLS cookie: enabled" \ |
| 4787 | "$P_SRV dtls=1 debug_level=2" \ |
| 4788 | "$P_CLI dtls=1 debug_level=2" \ |
| 4789 | 0 \ |
| 4790 | -s "cookie verification failed" \ |
| 4791 | -s "cookie verification passed" \ |
| 4792 | -S "cookie verification skipped" \ |
| 4793 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4794 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4795 | -S "SSL - The requested feature is not available" |
| 4796 | |
| 4797 | run_test "DTLS cookie: disabled" \ |
| 4798 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 4799 | "$P_CLI dtls=1 debug_level=2" \ |
| 4800 | 0 \ |
| 4801 | -S "cookie verification failed" \ |
| 4802 | -S "cookie verification passed" \ |
| 4803 | -s "cookie verification skipped" \ |
| 4804 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4805 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4806 | -S "SSL - The requested feature is not available" |
| 4807 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4808 | run_test "DTLS cookie: default (failing)" \ |
| 4809 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 4810 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 4811 | 1 \ |
| 4812 | -s "cookie verification failed" \ |
| 4813 | -S "cookie verification passed" \ |
| 4814 | -S "cookie verification skipped" \ |
| 4815 | -C "received hello verify request" \ |
| 4816 | -S "hello verification requested" \ |
| 4817 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4818 | |
| 4819 | requires_ipv6 |
| 4820 | run_test "DTLS cookie: enabled, IPv6" \ |
| 4821 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 4822 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 4823 | 0 \ |
| 4824 | -s "cookie verification failed" \ |
| 4825 | -s "cookie verification passed" \ |
| 4826 | -S "cookie verification skipped" \ |
| 4827 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4828 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4829 | -S "SSL - The requested feature is not available" |
| 4830 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4831 | run_test "DTLS cookie: enabled, nbio" \ |
| 4832 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 4833 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4834 | 0 \ |
| 4835 | -s "cookie verification failed" \ |
| 4836 | -s "cookie verification passed" \ |
| 4837 | -S "cookie verification skipped" \ |
| 4838 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4839 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4840 | -S "SSL - The requested feature is not available" |
| 4841 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4842 | # Tests for client reconnecting from the same port with DTLS |
| 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: reference" \ |
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" \ |
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 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4853 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4854 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4855 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 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 \ |
| 4858 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4859 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4860 | -s "Client initiated reconnection from same port" |
| 4861 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4862 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 4863 | 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] | 4864 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 4865 | "$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] | 4866 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4867 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4868 | -s "Client initiated reconnection from same port" |
| 4869 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4870 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 4871 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 4872 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 4873 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 4874 | 0 \ |
| 4875 | -S "The operation timed out" \ |
| 4876 | -s "Client initiated reconnection from same port" |
| 4877 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4878 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 4879 | "$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] | 4880 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 4881 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4882 | -s "The operation timed out" \ |
| 4883 | -S "Client initiated reconnection from same port" |
| 4884 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4885 | # Tests for various cases of client authentication with DTLS |
| 4886 | # (focused on handshake flows and message parsing) |
| 4887 | |
| 4888 | run_test "DTLS client auth: required" \ |
| 4889 | "$P_SRV dtls=1 auth_mode=required" \ |
| 4890 | "$P_CLI dtls=1" \ |
| 4891 | 0 \ |
| 4892 | -s "Verifying peer X.509 certificate... ok" |
| 4893 | |
| 4894 | run_test "DTLS client auth: optional, client has no cert" \ |
| 4895 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 4896 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 4897 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4898 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4899 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4900 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4901 | "$P_SRV dtls=1 auth_mode=none" \ |
| 4902 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 4903 | 0 \ |
| 4904 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4905 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4906 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 4907 | run_test "DTLS wrong PSK: badmac alert" \ |
| 4908 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 4909 | "$P_CLI dtls=1 psk=abc124" \ |
| 4910 | 1 \ |
| 4911 | -s "SSL - Verification of the message MAC failed" \ |
| 4912 | -c "SSL - A fatal alert message was received from our peer" |
| 4913 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 4914 | # Tests for receiving fragmented handshake messages with DTLS |
| 4915 | |
| 4916 | requires_gnutls |
| 4917 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 4918 | "$G_SRV -u --mtu 2048 -a" \ |
| 4919 | "$P_CLI dtls=1 debug_level=2" \ |
| 4920 | 0 \ |
| 4921 | -C "found fragmented DTLS handshake message" \ |
| 4922 | -C "error" |
| 4923 | |
| 4924 | requires_gnutls |
| 4925 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 4926 | "$G_SRV -u --mtu 512" \ |
| 4927 | "$P_CLI dtls=1 debug_level=2" \ |
| 4928 | 0 \ |
| 4929 | -c "found fragmented DTLS handshake message" \ |
| 4930 | -C "error" |
| 4931 | |
| 4932 | requires_gnutls |
| 4933 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 4934 | "$G_SRV -u --mtu 128" \ |
| 4935 | "$P_CLI dtls=1 debug_level=2" \ |
| 4936 | 0 \ |
| 4937 | -c "found fragmented DTLS handshake message" \ |
| 4938 | -C "error" |
| 4939 | |
| 4940 | requires_gnutls |
| 4941 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 4942 | "$G_SRV -u --mtu 128" \ |
| 4943 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4944 | 0 \ |
| 4945 | -c "found fragmented DTLS handshake message" \ |
| 4946 | -C "error" |
| 4947 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4948 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4949 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4950 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 4951 | "$G_SRV -u --mtu 256" \ |
| 4952 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4953 | 0 \ |
| 4954 | -c "found fragmented DTLS handshake message" \ |
| 4955 | -c "client hello, adding renegotiation extension" \ |
| 4956 | -c "found renegotiation extension" \ |
| 4957 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4958 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4959 | -C "error" \ |
| 4960 | -s "Extra-header:" |
| 4961 | |
| 4962 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4963 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4964 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 4965 | "$G_SRV -u --mtu 256" \ |
| 4966 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4967 | 0 \ |
| 4968 | -c "found fragmented DTLS handshake message" \ |
| 4969 | -c "client hello, adding renegotiation extension" \ |
| 4970 | -c "found renegotiation extension" \ |
| 4971 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4972 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4973 | -C "error" \ |
| 4974 | -s "Extra-header:" |
| 4975 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4976 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 4977 | "$O_SRV -dtls1 -mtu 2048" \ |
| 4978 | "$P_CLI dtls=1 debug_level=2" \ |
| 4979 | 0 \ |
| 4980 | -C "found fragmented DTLS handshake message" \ |
| 4981 | -C "error" |
| 4982 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4983 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 4984 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4985 | "$P_CLI dtls=1 debug_level=2" \ |
| 4986 | 0 \ |
| 4987 | -c "found fragmented DTLS handshake message" \ |
| 4988 | -C "error" |
| 4989 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4990 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4991 | "$O_SRV -dtls1 -mtu 256" \ |
| 4992 | "$P_CLI dtls=1 debug_level=2" \ |
| 4993 | 0 \ |
| 4994 | -c "found fragmented DTLS handshake message" \ |
| 4995 | -C "error" |
| 4996 | |
| 4997 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 4998 | "$O_SRV -dtls1 -mtu 256" \ |
| 4999 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5000 | 0 \ |
| 5001 | -c "found fragmented DTLS handshake message" \ |
| 5002 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 5003 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5004 | # Tests for sending fragmented handshake messages with DTLS |
| 5005 | # |
| 5006 | # Use client auth when we need the client to send large messages, |
| 5007 | # and use large cert chains on both sides too (the long chains we have all use |
| 5008 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 5009 | # Sizes reached (UDP payload): |
| 5010 | # - 2037B for server certificate |
| 5011 | # - 1542B for client certificate |
| 5012 | # - 1013B for newsessionticket |
| 5013 | # - all others below 512B |
| 5014 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 5015 | |
| 5016 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5017 | requires_config_enabled MBEDTLS_RSA_C |
| 5018 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5019 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 5020 | run_test "DTLS fragmenting: none (for reference)" \ |
| 5021 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5022 | crt_file=data_files/server7_int-ca.crt \ |
| 5023 | key_file=data_files/server7.key \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5024 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5025 | "$P_CLI dtls=1 debug_level=2 \ |
| 5026 | crt_file=data_files/server8_int-ca2.crt \ |
| 5027 | key_file=data_files/server8.key \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5028 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5029 | 0 \ |
| 5030 | -S "found fragmented DTLS handshake message" \ |
| 5031 | -C "found fragmented DTLS handshake message" \ |
| 5032 | -C "error" |
| 5033 | |
| 5034 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5035 | requires_config_enabled MBEDTLS_RSA_C |
| 5036 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5037 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5038 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5039 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5040 | crt_file=data_files/server7_int-ca.crt \ |
| 5041 | key_file=data_files/server7.key \ |
| 5042 | max_frag_len=1024" \ |
| 5043 | "$P_CLI dtls=1 debug_level=2 \ |
| 5044 | crt_file=data_files/server8_int-ca2.crt \ |
| 5045 | key_file=data_files/server8.key \ |
| 5046 | max_frag_len=2048" \ |
| 5047 | 0 \ |
| 5048 | -S "found fragmented DTLS handshake message" \ |
| 5049 | -c "found fragmented DTLS handshake message" \ |
| 5050 | -C "error" |
| 5051 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 5052 | # With the MFL extension, the server has no way of forcing |
| 5053 | # the client to not exceed a certain MTU; hence, the following |
| 5054 | # test can't be replicated with an MTU proxy such as the one |
| 5055 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5056 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5057 | requires_config_enabled MBEDTLS_RSA_C |
| 5058 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5059 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5060 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5061 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5062 | crt_file=data_files/server7_int-ca.crt \ |
| 5063 | key_file=data_files/server7.key \ |
| 5064 | max_frag_len=512" \ |
| 5065 | "$P_CLI dtls=1 debug_level=2 \ |
| 5066 | crt_file=data_files/server8_int-ca2.crt \ |
| 5067 | key_file=data_files/server8.key \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 5068 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5069 | 0 \ |
| 5070 | -S "found fragmented DTLS handshake message" \ |
| 5071 | -c "found fragmented DTLS handshake message" \ |
| 5072 | -C "error" |
| 5073 | |
| 5074 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5075 | requires_config_enabled MBEDTLS_RSA_C |
| 5076 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5077 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5078 | 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] | 5079 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 5080 | crt_file=data_files/server7_int-ca.crt \ |
| 5081 | key_file=data_files/server7.key \ |
| 5082 | max_frag_len=2048" \ |
| 5083 | "$P_CLI dtls=1 debug_level=2 \ |
| 5084 | crt_file=data_files/server8_int-ca2.crt \ |
| 5085 | key_file=data_files/server8.key \ |
| 5086 | max_frag_len=512" \ |
| 5087 | 0 \ |
| 5088 | -S "found fragmented DTLS handshake message" \ |
| 5089 | -c "found fragmented DTLS handshake message" \ |
| 5090 | -C "error" |
| 5091 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 5092 | # While not required by the standard defining the MFL extension |
| 5093 | # (according to which it only applies to records, not to datagrams), |
| 5094 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 5095 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 5096 | # to the peer. |
| 5097 | # The next test checks that no datagrams significantly larger than the |
| 5098 | # negotiated MFL are sent. |
| 5099 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5100 | requires_config_enabled MBEDTLS_RSA_C |
| 5101 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5102 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 5103 | run_test "DTLS fragmenting: client-initiated, server only (max_frag_len), proxy MTU" \ |
| 5104 | -p "$P_PXY mtu=560" \ |
| 5105 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 5106 | crt_file=data_files/server7_int-ca.crt \ |
| 5107 | key_file=data_files/server7.key \ |
| 5108 | max_frag_len=2048" \ |
| 5109 | "$P_CLI dtls=1 debug_level=2 \ |
| 5110 | crt_file=data_files/server8_int-ca2.crt \ |
| 5111 | key_file=data_files/server8.key \ |
| 5112 | max_frag_len=512" \ |
| 5113 | 0 \ |
| 5114 | -S "found fragmented DTLS handshake message" \ |
| 5115 | -c "found fragmented DTLS handshake message" \ |
| 5116 | -C "error" |
| 5117 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5118 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5119 | requires_config_enabled MBEDTLS_RSA_C |
| 5120 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5121 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5122 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5123 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5124 | crt_file=data_files/server7_int-ca.crt \ |
| 5125 | key_file=data_files/server7.key \ |
| 5126 | max_frag_len=2048" \ |
| 5127 | "$P_CLI dtls=1 debug_level=2 \ |
| 5128 | crt_file=data_files/server8_int-ca2.crt \ |
| 5129 | key_file=data_files/server8.key \ |
| 5130 | max_frag_len=512" \ |
| 5131 | 0 \ |
| 5132 | -s "found fragmented DTLS handshake message" \ |
| 5133 | -c "found fragmented DTLS handshake message" \ |
| 5134 | -C "error" |
| 5135 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 5136 | # While not required by the standard defining the MFL extension |
| 5137 | # (according to which it only applies to records, not to datagrams), |
| 5138 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 5139 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 5140 | # to the peer. |
| 5141 | # The next test checks that no datagrams significantly larger than the |
| 5142 | # negotiated MFL are sent. |
| 5143 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5144 | requires_config_enabled MBEDTLS_RSA_C |
| 5145 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5146 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 5147 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
| 5148 | -p "$P_PXY mtu=560" \ |
| 5149 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5150 | crt_file=data_files/server7_int-ca.crt \ |
| 5151 | key_file=data_files/server7.key \ |
| 5152 | max_frag_len=2048" \ |
| 5153 | "$P_CLI dtls=1 debug_level=2 \ |
| 5154 | crt_file=data_files/server8_int-ca2.crt \ |
| 5155 | key_file=data_files/server8.key \ |
| 5156 | max_frag_len=512" \ |
| 5157 | 0 \ |
| 5158 | -s "found fragmented DTLS handshake message" \ |
| 5159 | -c "found fragmented DTLS handshake message" \ |
| 5160 | -C "error" |
| 5161 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5162 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5163 | requires_config_enabled MBEDTLS_RSA_C |
| 5164 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5165 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 5166 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5167 | crt_file=data_files/server7_int-ca.crt \ |
| 5168 | key_file=data_files/server7.key \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5169 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5170 | "$P_CLI dtls=1 debug_level=2 \ |
| 5171 | crt_file=data_files/server8_int-ca2.crt \ |
| 5172 | key_file=data_files/server8.key \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5173 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5174 | 0 \ |
| 5175 | -S "found fragmented DTLS handshake message" \ |
| 5176 | -C "found fragmented DTLS handshake message" \ |
| 5177 | -C "error" |
| 5178 | |
| 5179 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5180 | requires_config_enabled MBEDTLS_RSA_C |
| 5181 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5182 | run_test "DTLS fragmenting: client (MTU)" \ |
| 5183 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5184 | crt_file=data_files/server7_int-ca.crt \ |
| 5185 | key_file=data_files/server7.key \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5186 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5187 | "$P_CLI dtls=1 debug_level=2 \ |
| 5188 | crt_file=data_files/server8_int-ca2.crt \ |
| 5189 | key_file=data_files/server8.key \ |
| 5190 | mtu=512" \ |
| 5191 | 0 \ |
| 5192 | -s "found fragmented DTLS handshake message" \ |
| 5193 | -C "found fragmented DTLS handshake message" \ |
| 5194 | -C "error" |
| 5195 | |
| 5196 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5197 | requires_config_enabled MBEDTLS_RSA_C |
| 5198 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5199 | run_test "DTLS fragmenting: server (MTU)" \ |
| 5200 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5201 | crt_file=data_files/server7_int-ca.crt \ |
| 5202 | key_file=data_files/server7.key \ |
| 5203 | mtu=512" \ |
| 5204 | "$P_CLI dtls=1 debug_level=2 \ |
| 5205 | crt_file=data_files/server8_int-ca2.crt \ |
| 5206 | key_file=data_files/server8.key \ |
| 5207 | mtu=2048" \ |
| 5208 | 0 \ |
| 5209 | -S "found fragmented DTLS handshake message" \ |
| 5210 | -c "found fragmented DTLS handshake message" \ |
| 5211 | -C "error" |
| 5212 | |
| 5213 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5214 | requires_config_enabled MBEDTLS_RSA_C |
| 5215 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5216 | run_test "DTLS fragmenting: both (MTU)" \ |
Manuel Pégourié-Gonnard | 4532329 | 2018-08-20 11:52:24 +0200 | [diff] [blame] | 5217 | -p "$P_PXY mtu=512" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5218 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5219 | crt_file=data_files/server7_int-ca.crt \ |
| 5220 | key_file=data_files/server7.key \ |
| 5221 | mtu=512" \ |
| 5222 | "$P_CLI dtls=1 debug_level=2 \ |
| 5223 | crt_file=data_files/server8_int-ca2.crt \ |
| 5224 | key_file=data_files/server8.key \ |
| 5225 | mtu=512" \ |
| 5226 | 0 \ |
| 5227 | -s "found fragmented DTLS handshake message" \ |
| 5228 | -c "found fragmented DTLS handshake message" \ |
| 5229 | -C "error" |
| 5230 | |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 5231 | # Test for automatic MTU reduction on repeated resend |
| 5232 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5233 | requires_config_enabled MBEDTLS_RSA_C |
| 5234 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5235 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 5236 | -p "$P_PXY mtu=508" \ |
| 5237 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5238 | crt_file=data_files/server7_int-ca.crt \ |
| 5239 | key_file=data_files/server7.key\ |
| 5240 | hs_timeout=100-400" \ |
| 5241 | "$P_CLI dtls=1 debug_level=2 \ |
| 5242 | crt_file=data_files/server8_int-ca2.crt \ |
| 5243 | key_file=data_files/server8.key \ |
| 5244 | hs_timeout=100-400" \ |
| 5245 | 0 \ |
| 5246 | -s "found fragmented DTLS handshake message" \ |
| 5247 | -c "found fragmented DTLS handshake message" \ |
| 5248 | -C "error" |
| 5249 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5250 | # 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] | 5251 | # OTOH the client might resend if the server is to slow to reset after sending |
| 5252 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5253 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5254 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5255 | requires_config_enabled MBEDTLS_RSA_C |
| 5256 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5257 | run_test "DTLS fragmenting: proxy MTU, simple handshake" \ |
| 5258 | -p "$P_PXY mtu=512" \ |
| 5259 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5260 | crt_file=data_files/server7_int-ca.crt \ |
| 5261 | key_file=data_files/server7.key \ |
| 5262 | mtu=512" \ |
| 5263 | "$P_CLI dtls=1 debug_level=2 \ |
| 5264 | crt_file=data_files/server8_int-ca2.crt \ |
| 5265 | key_file=data_files/server8.key \ |
| 5266 | mtu=512" \ |
| 5267 | 0 \ |
| 5268 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5269 | -s "found fragmented DTLS handshake message" \ |
| 5270 | -c "found fragmented DTLS handshake message" \ |
| 5271 | -C "error" |
| 5272 | |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 5273 | not_with_valgrind # spurious resend due to timeout |
| 5274 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5275 | requires_config_enabled MBEDTLS_RSA_C |
| 5276 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5277 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio" \ |
| 5278 | -p "$P_PXY mtu=512" \ |
| 5279 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5280 | crt_file=data_files/server7_int-ca.crt \ |
| 5281 | key_file=data_files/server7.key \ |
| 5282 | mtu=512 nbio=2" \ |
| 5283 | "$P_CLI dtls=1 debug_level=2 \ |
| 5284 | crt_file=data_files/server8_int-ca2.crt \ |
| 5285 | key_file=data_files/server8.key \ |
| 5286 | mtu=512 nbio=2" \ |
| 5287 | 0 \ |
| 5288 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5289 | -s "found fragmented DTLS handshake message" \ |
| 5290 | -c "found fragmented DTLS handshake message" \ |
| 5291 | -C "error" |
| 5292 | |
Hanno Becker | b841b4f | 2018-08-28 10:25:51 +0100 | [diff] [blame] | 5293 | # This ensures things still work after session_reset(). |
| 5294 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5295 | # Since we don't support reading fragmented ClientHello yet, |
| 5296 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 5297 | # but still smaller than client's Certificate to ensure fragmentation). |
Hanno Becker | 5bcf2b0 | 2018-08-21 14:25:40 +0100 | [diff] [blame] | 5298 | # A resend on the client-side might happen if the server is |
| 5299 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 5300 | # reco_delay avoids races where the client reconnects before the server has |
| 5301 | # resumed listening, which would result in a spurious resend. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5302 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5303 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5304 | requires_config_enabled MBEDTLS_RSA_C |
| 5305 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5306 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 5307 | -p "$P_PXY mtu=1450" \ |
| 5308 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5309 | crt_file=data_files/server7_int-ca.crt \ |
| 5310 | key_file=data_files/server7.key \ |
| 5311 | mtu=1450" \ |
| 5312 | "$P_CLI dtls=1 debug_level=2 \ |
| 5313 | crt_file=data_files/server8_int-ca2.crt \ |
| 5314 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 5315 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5316 | 0 \ |
| 5317 | -S "resend" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5318 | -s "found fragmented DTLS handshake message" \ |
| 5319 | -c "found fragmented DTLS handshake message" \ |
| 5320 | -C "error" |
| 5321 | |
Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5322 | # A resend on the client-side might happen if the server is |
| 5323 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5324 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5325 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5326 | requires_config_enabled MBEDTLS_RSA_C |
| 5327 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5328 | requires_config_enabled MBEDTLS_SHA256_C |
| 5329 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 5330 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5331 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 5332 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 5333 | -p "$P_PXY mtu=512" \ |
| 5334 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5335 | crt_file=data_files/server7_int-ca.crt \ |
| 5336 | key_file=data_files/server7.key \ |
| 5337 | exchanges=2 renegotiation=1 \ |
| 5338 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
| 5339 | mtu=512" \ |
| 5340 | "$P_CLI dtls=1 debug_level=2 \ |
| 5341 | crt_file=data_files/server8_int-ca2.crt \ |
| 5342 | key_file=data_files/server8.key \ |
| 5343 | exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5344 | mtu=512" \ |
| 5345 | 0 \ |
| 5346 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5347 | -s "found fragmented DTLS handshake message" \ |
| 5348 | -c "found fragmented DTLS handshake message" \ |
| 5349 | -C "error" |
| 5350 | |
Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5351 | # A resend on the client-side might happen if the server is |
| 5352 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5353 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5354 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5355 | requires_config_enabled MBEDTLS_RSA_C |
| 5356 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5357 | requires_config_enabled MBEDTLS_SHA256_C |
| 5358 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 5359 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5360 | requires_config_enabled MBEDTLS_AES_C |
| 5361 | requires_config_enabled MBEDTLS_GCM_C |
| 5362 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 5363 | -p "$P_PXY mtu=512" \ |
| 5364 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5365 | crt_file=data_files/server7_int-ca.crt \ |
| 5366 | key_file=data_files/server7.key \ |
| 5367 | exchanges=2 renegotiation=1 \ |
| 5368 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5369 | mtu=512" \ |
| 5370 | "$P_CLI dtls=1 debug_level=2 \ |
| 5371 | crt_file=data_files/server8_int-ca2.crt \ |
| 5372 | key_file=data_files/server8.key \ |
| 5373 | exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5374 | mtu=512" \ |
| 5375 | 0 \ |
| 5376 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5377 | -s "found fragmented DTLS handshake message" \ |
| 5378 | -c "found fragmented DTLS handshake message" \ |
| 5379 | -C "error" |
| 5380 | |
Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5381 | # A resend on the client-side might happen if the server is |
| 5382 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5383 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5384 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5385 | requires_config_enabled MBEDTLS_RSA_C |
| 5386 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5387 | requires_config_enabled MBEDTLS_SHA256_C |
| 5388 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 5389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5390 | requires_config_enabled MBEDTLS_AES_C |
| 5391 | requires_config_enabled MBEDTLS_CCM_C |
| 5392 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
| 5393 | -p "$P_PXY mtu=512" \ |
| 5394 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5395 | crt_file=data_files/server7_int-ca.crt \ |
| 5396 | key_file=data_files/server7.key \ |
| 5397 | exchanges=2 renegotiation=1 \ |
| 5398 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
| 5399 | mtu=512" \ |
| 5400 | "$P_CLI dtls=1 debug_level=2 \ |
| 5401 | crt_file=data_files/server8_int-ca2.crt \ |
| 5402 | key_file=data_files/server8.key \ |
| 5403 | exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5404 | mtu=512" \ |
| 5405 | 0 \ |
| 5406 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5407 | -s "found fragmented DTLS handshake message" \ |
| 5408 | -c "found fragmented DTLS handshake message" \ |
| 5409 | -C "error" |
| 5410 | |
Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5411 | # A resend on the client-side might happen if the server is |
| 5412 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5413 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5414 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5415 | requires_config_enabled MBEDTLS_RSA_C |
| 5416 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5417 | requires_config_enabled MBEDTLS_SHA256_C |
| 5418 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 5419 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5420 | requires_config_enabled MBEDTLS_AES_C |
| 5421 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5422 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 5423 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
| 5424 | -p "$P_PXY mtu=512" \ |
| 5425 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5426 | crt_file=data_files/server7_int-ca.crt \ |
| 5427 | key_file=data_files/server7.key \ |
| 5428 | exchanges=2 renegotiation=1 \ |
| 5429 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
| 5430 | mtu=512" \ |
| 5431 | "$P_CLI dtls=1 debug_level=2 \ |
| 5432 | crt_file=data_files/server8_int-ca2.crt \ |
| 5433 | key_file=data_files/server8.key \ |
| 5434 | exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5435 | mtu=512" \ |
| 5436 | 0 \ |
| 5437 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5438 | -s "found fragmented DTLS handshake message" \ |
| 5439 | -c "found fragmented DTLS handshake message" \ |
| 5440 | -C "error" |
| 5441 | |
Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5442 | # A resend on the client-side might happen if the server is |
| 5443 | # slow to reset, therefore omitting '-C "resend"' below. |
Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5444 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5445 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5446 | requires_config_enabled MBEDTLS_RSA_C |
| 5447 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5448 | requires_config_enabled MBEDTLS_SHA256_C |
| 5449 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 5450 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5451 | requires_config_enabled MBEDTLS_AES_C |
| 5452 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5453 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
| 5454 | -p "$P_PXY mtu=512" \ |
| 5455 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5456 | crt_file=data_files/server7_int-ca.crt \ |
| 5457 | key_file=data_files/server7.key \ |
| 5458 | exchanges=2 renegotiation=1 \ |
| 5459 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
| 5460 | mtu=512" \ |
| 5461 | "$P_CLI dtls=1 debug_level=2 \ |
| 5462 | crt_file=data_files/server8_int-ca2.crt \ |
| 5463 | key_file=data_files/server8.key \ |
| 5464 | exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5465 | mtu=512" \ |
| 5466 | 0 \ |
| 5467 | -S "resend" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5468 | -s "found fragmented DTLS handshake message" \ |
| 5469 | -c "found fragmented DTLS handshake message" \ |
| 5470 | -C "error" |
| 5471 | |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 5472 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5473 | requires_config_enabled MBEDTLS_RSA_C |
| 5474 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5475 | client_needs_more_time 2 |
| 5476 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 5477 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5478 | "$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] | 5479 | crt_file=data_files/server7_int-ca.crt \ |
| 5480 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5481 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5482 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 5483 | crt_file=data_files/server8_int-ca2.crt \ |
| 5484 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5485 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 5486 | 0 \ |
| 5487 | -s "found fragmented DTLS handshake message" \ |
| 5488 | -c "found fragmented DTLS handshake message" \ |
| 5489 | -C "error" |
| 5490 | |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 5491 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5492 | requires_config_enabled MBEDTLS_RSA_C |
| 5493 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5494 | client_needs_more_time 2 |
| 5495 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 5496 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 5497 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5498 | crt_file=data_files/server7_int-ca.crt \ |
| 5499 | key_file=data_files/server7.key \ |
| 5500 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 5501 | "$P_CLI dtls=1 debug_level=2 \ |
| 5502 | crt_file=data_files/server8_int-ca2.crt \ |
| 5503 | key_file=data_files/server8.key \ |
| 5504 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 5505 | 0 \ |
| 5506 | -s "found fragmented DTLS handshake message" \ |
| 5507 | -c "found fragmented DTLS handshake message" \ |
| 5508 | -C "error" |
| 5509 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5510 | # interop tests for DTLS fragmentating with reliable connection |
| 5511 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5512 | # here and below we just want to test that the we fragment in a way that |
| 5513 | # pleases other implementations, so we don't need the peer to fragment |
Hanno Becker | f362c29 | 2018-08-20 12:40:23 +0100 | [diff] [blame] | 5514 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5515 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5516 | requires_config_enabled MBEDTLS_RSA_C |
| 5517 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5519 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5520 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 5521 | "$G_SRV -u" \ |
| 5522 | "$P_CLI dtls=1 debug_level=2 \ |
| 5523 | crt_file=data_files/server8_int-ca2.crt \ |
| 5524 | key_file=data_files/server8.key \ |
| 5525 | mtu=512 force_version=dtls1_2" \ |
| 5526 | 0 \ |
| 5527 | -c "fragmenting handshake message" \ |
| 5528 | -C "error" |
| 5529 | |
Hanno Becker | f362c29 | 2018-08-20 12:40:23 +0100 | [diff] [blame] | 5530 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5531 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5532 | requires_config_enabled MBEDTLS_RSA_C |
| 5533 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5535 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5536 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 5537 | "$G_SRV -u" \ |
| 5538 | "$P_CLI dtls=1 debug_level=2 \ |
| 5539 | crt_file=data_files/server8_int-ca2.crt \ |
| 5540 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5541 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5542 | 0 \ |
| 5543 | -c "fragmenting handshake message" \ |
| 5544 | -C "error" |
| 5545 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 5546 | # We use --insecure for the GnuTLS client because it expects |
| 5547 | # the hostname / IP it connects to to be the name used in the |
| 5548 | # certificate obtained from the server. Here, however, it |
| 5549 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 5550 | # as the server name in the certificate. This will make the |
| 5551 | # certifiate validation fail, but passing --insecure makes |
| 5552 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5553 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5554 | requires_config_enabled MBEDTLS_RSA_C |
| 5555 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5557 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5558 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5559 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5560 | crt_file=data_files/server7_int-ca.crt \ |
| 5561 | key_file=data_files/server7.key \ |
| 5562 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5563 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5564 | 0 \ |
| 5565 | -s "fragmenting handshake message" |
| 5566 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 5567 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5568 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5569 | requires_config_enabled MBEDTLS_RSA_C |
| 5570 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5572 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5573 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5574 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5575 | crt_file=data_files/server7_int-ca.crt \ |
| 5576 | key_file=data_files/server7.key \ |
| 5577 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5578 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5579 | 0 \ |
| 5580 | -s "fragmenting handshake message" |
| 5581 | |
| 5582 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5583 | requires_config_enabled MBEDTLS_RSA_C |
| 5584 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5586 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 5587 | "$O_SRV -dtls1_2 -verify 10" \ |
| 5588 | "$P_CLI dtls=1 debug_level=2 \ |
| 5589 | crt_file=data_files/server8_int-ca2.crt \ |
| 5590 | key_file=data_files/server8.key \ |
| 5591 | mtu=512 force_version=dtls1_2" \ |
| 5592 | 0 \ |
| 5593 | -c "fragmenting handshake message" \ |
| 5594 | -C "error" |
| 5595 | |
| 5596 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5597 | requires_config_enabled MBEDTLS_RSA_C |
| 5598 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5599 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5600 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 5601 | "$O_SRV -dtls1 -verify 10" \ |
| 5602 | "$P_CLI dtls=1 debug_level=2 \ |
| 5603 | crt_file=data_files/server8_int-ca2.crt \ |
| 5604 | key_file=data_files/server8.key \ |
| 5605 | mtu=512 force_version=dtls1" \ |
| 5606 | 0 \ |
| 5607 | -c "fragmenting handshake message" \ |
| 5608 | -C "error" |
| 5609 | |
| 5610 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5611 | requires_config_enabled MBEDTLS_RSA_C |
| 5612 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5613 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5614 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 5615 | "$P_SRV dtls=1 debug_level=2 \ |
| 5616 | crt_file=data_files/server7_int-ca.crt \ |
| 5617 | key_file=data_files/server7.key \ |
| 5618 | mtu=512 force_version=dtls1_2" \ |
| 5619 | "$O_CLI -dtls1_2" \ |
| 5620 | 0 \ |
| 5621 | -s "fragmenting handshake message" |
| 5622 | |
| 5623 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5624 | requires_config_enabled MBEDTLS_RSA_C |
| 5625 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5627 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 5628 | "$P_SRV dtls=1 debug_level=2 \ |
| 5629 | crt_file=data_files/server7_int-ca.crt \ |
| 5630 | key_file=data_files/server7.key \ |
| 5631 | mtu=512 force_version=dtls1" \ |
| 5632 | "$O_CLI -dtls1" \ |
| 5633 | 0 \ |
| 5634 | -s "fragmenting handshake message" |
| 5635 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5636 | # interop tests for DTLS fragmentating with unreliable connection |
| 5637 | # |
| 5638 | # again we just want to test that the we fragment in a way that |
| 5639 | # pleases other implementations, so we don't need the peer to fragment |
| 5640 | requires_gnutls_next |
| 5641 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5642 | requires_config_enabled MBEDTLS_RSA_C |
| 5643 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5644 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5645 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5646 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 5647 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5648 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5649 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5650 | crt_file=data_files/server8_int-ca2.crt \ |
| 5651 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5652 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5653 | 0 \ |
| 5654 | -c "fragmenting handshake message" \ |
| 5655 | -C "error" |
| 5656 | |
| 5657 | requires_gnutls_next |
| 5658 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5659 | requires_config_enabled MBEDTLS_RSA_C |
| 5660 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5662 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5663 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 5664 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5665 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5666 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5667 | crt_file=data_files/server8_int-ca2.crt \ |
| 5668 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5669 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5670 | 0 \ |
| 5671 | -c "fragmenting handshake message" \ |
| 5672 | -C "error" |
| 5673 | |
| 5674 | ## The two tests below are disabled due to a bug in GnuTLS client that causes |
| 5675 | ## handshake failures when the NewSessionTicket message is lost, see |
| 5676 | ## https://gitlab.com/gnutls/gnutls/issues/543 |
| 5677 | ## We can re-enable them when a fixed version fo GnuTLS is available |
| 5678 | ## and installed in our CI system. |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 5679 | skip_next_test |
| 5680 | requires_gnutls |
| 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_2 |
| 5685 | client_needs_more_time 4 |
| 5686 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 5687 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5688 | "$P_SRV dtls=1 debug_level=2 \ |
| 5689 | crt_file=data_files/server7_int-ca.crt \ |
| 5690 | key_file=data_files/server7.key \ |
| 5691 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 5692 | "$G_CLI -u --insecure 127.0.0.1" \ |
| 5693 | 0 \ |
| 5694 | -s "fragmenting handshake message" |
| 5695 | |
| 5696 | skip_next_test |
| 5697 | requires_gnutls |
| 5698 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5699 | requires_config_enabled MBEDTLS_RSA_C |
| 5700 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5701 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5702 | client_needs_more_time 4 |
| 5703 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 5704 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5705 | "$P_SRV dtls=1 debug_level=2 \ |
| 5706 | crt_file=data_files/server7_int-ca.crt \ |
| 5707 | key_file=data_files/server7.key \ |
| 5708 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
| 5709 | "$G_CLI -u --insecure 127.0.0.1" \ |
| 5710 | 0 \ |
| 5711 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5712 | |
| 5713 | ## Interop test with OpenSSL might triger a bug in recent versions (that |
| 5714 | ## probably won't be fixed before 1.1.1X), so we use an old version that |
| 5715 | ## doesn't have this bug, but unfortunately it doesn't have support for DTLS |
| 5716 | ## 1.2 either, so the DTLS 1.2 tests are commented for now. |
| 5717 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 5718 | ## They should be re-enabled (and the DTLS 1.0 switched back to a non-legacy |
| 5719 | ## version of OpenSSL once a fixed version of OpenSSL is available) |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 5720 | skip_next_test |
| 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_2 |
| 5725 | client_needs_more_time 4 |
| 5726 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 5727 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5728 | "$O_SRV -dtls1_2 -verify 10" \ |
| 5729 | "$P_CLI dtls=1 debug_level=2 \ |
| 5730 | crt_file=data_files/server8_int-ca2.crt \ |
| 5731 | key_file=data_files/server8.key \ |
| 5732 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 5733 | 0 \ |
| 5734 | -c "fragmenting handshake message" \ |
| 5735 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5736 | |
| 5737 | requires_openssl_legacy |
| 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_1 |
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 server, DTLS 1.0" \ |
| 5744 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5745 | "$O_LEGACY_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5746 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5747 | crt_file=data_files/server8_int-ca2.crt \ |
| 5748 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5749 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5750 | 0 \ |
| 5751 | -c "fragmenting handshake message" \ |
| 5752 | -C "error" |
| 5753 | |
| 5754 | ## see comment on the previous-previous test |
| 5755 | ## requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5756 | ## requires_config_enabled MBEDTLS_RSA_C |
| 5757 | ## requires_config_enabled MBEDTLS_ECDSA_C |
| 5758 | ## requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5759 | ## client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5760 | ## run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 5761 | ## -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 5762 | ## "$P_SRV dtls=1 debug_level=2 \ |
| 5763 | ## crt_file=data_files/server7_int-ca.crt \ |
| 5764 | ## key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5765 | ## hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5766 | ## "$O_CLI -dtls1_2" \ |
| 5767 | ## 0 \ |
| 5768 | ## -s "fragmenting handshake message" |
| 5769 | |
| 5770 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 5771 | # messages at the end of the handshake |
Hanno Becker | 4a9d006 | 2018-08-17 16:10:47 +0100 | [diff] [blame] | 5772 | requires_openssl_legacy |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5773 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5774 | requires_config_enabled MBEDTLS_RSA_C |
| 5775 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5777 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5778 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 5779 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5780 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5781 | crt_file=data_files/server7_int-ca.crt \ |
| 5782 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5783 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5784 | "$O_LEGACY_CLI -nbio -dtls1" \ |
| 5785 | 0 \ |
| 5786 | -s "fragmenting handshake message" |
| 5787 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 5788 | # Tests for specific things with "unreliable" UDP connection |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 5789 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5790 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5791 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 5792 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5793 | "$P_SRV dtls=1 debug_level=2" \ |
| 5794 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5795 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 5796 | -C "replayed record" \ |
| 5797 | -S "replayed record" \ |
| 5798 | -C "record from another epoch" \ |
| 5799 | -S "record from another epoch" \ |
| 5800 | -C "discarding invalid record" \ |
| 5801 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5802 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 5803 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5804 | -c "HTTP/1.0 200 OK" |
| 5805 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5806 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 5807 | run_test "DTLS proxy: duplicate every packet" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5808 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5809 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 5810 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5811 | 0 \ |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 5812 | -c "replayed record" \ |
| 5813 | -s "replayed record" \ |
Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 5814 | -c "record from another epoch" \ |
| 5815 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5816 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 5817 | -s "Extra-header:" \ |
| 5818 | -c "HTTP/1.0 200 OK" |
| 5819 | |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 5820 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 5821 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5822 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 5823 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 5824 | 0 \ |
| 5825 | -c "replayed record" \ |
| 5826 | -S "replayed record" \ |
Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 5827 | -c "record from another epoch" \ |
| 5828 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5829 | -c "resend" \ |
| 5830 | -s "resend" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 5831 | -s "Extra-header:" \ |
| 5832 | -c "HTTP/1.0 200 OK" |
| 5833 | |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 5834 | run_test "DTLS proxy: multiple records in same datagram" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5835 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5836 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 5837 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 5838 | 0 \ |
| 5839 | -c "next record in same datagram" \ |
| 5840 | -s "next record in same datagram" |
| 5841 | |
| 5842 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5843 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5844 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 5845 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 5846 | 0 \ |
| 5847 | -c "next record in same datagram" \ |
| 5848 | -s "next record in same datagram" |
| 5849 | |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5850 | 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] | 5851 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5852 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 5853 | "$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] | 5854 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5855 | -c "discarding invalid record (mac)" \ |
| 5856 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5857 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5858 | -c "HTTP/1.0 200 OK" \ |
| 5859 | -S "too many records with bad MAC" \ |
| 5860 | -S "Verification of the message MAC failed" |
| 5861 | |
| 5862 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 5863 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5864 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 5865 | "$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] | 5866 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5867 | -C "discarding invalid record (mac)" \ |
| 5868 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5869 | -S "Extra-header:" \ |
| 5870 | -C "HTTP/1.0 200 OK" \ |
| 5871 | -s "too many records with bad MAC" \ |
| 5872 | -s "Verification of the message MAC failed" |
| 5873 | |
| 5874 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 5875 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5876 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 5877 | "$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] | 5878 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5879 | -c "discarding invalid record (mac)" \ |
| 5880 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5881 | -s "Extra-header:" \ |
| 5882 | -c "HTTP/1.0 200 OK" \ |
| 5883 | -S "too many records with bad MAC" \ |
| 5884 | -S "Verification of the message MAC failed" |
| 5885 | |
| 5886 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 5887 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5888 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 5889 | "$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] | 5890 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5891 | -c "discarding invalid record (mac)" \ |
| 5892 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5893 | -s "Extra-header:" \ |
| 5894 | -c "HTTP/1.0 200 OK" \ |
| 5895 | -s "too many records with bad MAC" \ |
| 5896 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5897 | |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 5898 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 5899 | -p "$P_PXY delay_ccs=1" \ |
| 5900 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 5901 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
| 5902 | 0 \ |
| 5903 | -c "record from another epoch" \ |
| 5904 | -s "record from another epoch" \ |
| 5905 | -s "Extra-header:" \ |
| 5906 | -c "HTTP/1.0 200 OK" |
| 5907 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 5908 | # Tests for reordering support with DTLS |
| 5909 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5910 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 5911 | -p "$P_PXY delay_srv=ServerHello" \ |
Hanno Becker | 8727304 | 2018-08-16 16:53:13 +0100 | [diff] [blame] | 5912 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5913 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 5914 | 0 \ |
| 5915 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5916 | -c "Next handshake message has been buffered - load"\ |
| 5917 | -S "Buffering HS message" \ |
| 5918 | -S "Next handshake message has been buffered - load"\ |
| 5919 | -C "Inject buffered CCS message" \ |
| 5920 | -C "Remember CCS message" \ |
| 5921 | -S "Inject buffered CCS message" \ |
| 5922 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 5923 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 5924 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 5925 | -p "$P_PXY delay_srv=ServerHello" \ |
| 5926 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5927 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 5928 | 0 \ |
| 5929 | -c "Buffering HS message" \ |
| 5930 | -c "found fragmented DTLS handshake message"\ |
| 5931 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 5932 | -c "Next handshake message has been buffered - load"\ |
| 5933 | -S "Buffering HS message" \ |
| 5934 | -S "Next handshake message has been buffered - load"\ |
| 5935 | -C "Inject buffered CCS message" \ |
| 5936 | -C "Remember CCS message" \ |
| 5937 | -S "Inject buffered CCS message" \ |
| 5938 | -S "Remember CCS message" |
| 5939 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 5940 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 5941 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 5942 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 5943 | # while keeping the ServerKeyExchange. |
| 5944 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 5945 | 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] | 5946 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
| 5947 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5948 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 5949 | 0 \ |
| 5950 | -c "Buffering HS message" \ |
| 5951 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 5952 | -C "attempt to make space by freeing buffered messages" \ |
| 5953 | -S "Buffering HS message" \ |
| 5954 | -S "Next handshake message has been buffered - load"\ |
| 5955 | -C "Inject buffered CCS message" \ |
| 5956 | -C "Remember CCS message" \ |
| 5957 | -S "Inject buffered CCS message" \ |
| 5958 | -S "Remember CCS message" |
| 5959 | |
| 5960 | # The size constraints ensure that the delayed certificate message can't |
| 5961 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 5962 | # when dropping it first. |
| 5963 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 5964 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 5965 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 5966 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
| 5967 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5968 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 5969 | 0 \ |
| 5970 | -c "Buffering HS message" \ |
| 5971 | -c "attempt to make space by freeing buffered future messages" \ |
| 5972 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 5973 | -S "Buffering HS message" \ |
| 5974 | -S "Next handshake message has been buffered - load"\ |
| 5975 | -C "Inject buffered CCS message" \ |
| 5976 | -C "Remember CCS message" \ |
| 5977 | -S "Inject buffered CCS message" \ |
| 5978 | -S "Remember CCS message" |
| 5979 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5980 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 5981 | -p "$P_PXY delay_cli=Certificate" \ |
| 5982 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2" \ |
| 5983 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 5984 | 0 \ |
| 5985 | -C "Buffering HS message" \ |
| 5986 | -C "Next handshake message has been buffered - load"\ |
| 5987 | -s "Buffering HS message" \ |
| 5988 | -s "Next handshake message has been buffered - load" \ |
| 5989 | -C "Inject buffered CCS message" \ |
| 5990 | -C "Remember CCS message" \ |
| 5991 | -S "Inject buffered CCS message" \ |
| 5992 | -S "Remember CCS message" |
| 5993 | |
| 5994 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 5995 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
| 5996 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 5997 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 5998 | 0 \ |
| 5999 | -C "Buffering HS message" \ |
| 6000 | -C "Next handshake message has been buffered - load"\ |
| 6001 | -S "Buffering HS message" \ |
| 6002 | -S "Next handshake message has been buffered - load" \ |
| 6003 | -c "Inject buffered CCS message" \ |
| 6004 | -c "Remember CCS message" \ |
| 6005 | -S "Inject buffered CCS message" \ |
| 6006 | -S "Remember CCS message" |
| 6007 | |
| 6008 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 6009 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
| 6010 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 6011 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
| 6012 | 0 \ |
| 6013 | -C "Buffering HS message" \ |
| 6014 | -C "Next handshake message has been buffered - load"\ |
| 6015 | -S "Buffering HS message" \ |
| 6016 | -S "Next handshake message has been buffered - load" \ |
| 6017 | -C "Inject buffered CCS message" \ |
| 6018 | -C "Remember CCS message" \ |
| 6019 | -s "Inject buffered CCS message" \ |
| 6020 | -s "Remember CCS message" |
| 6021 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 6022 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6023 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | 8727304 | 2018-08-16 16:53:13 +0100 | [diff] [blame] | 6024 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ |
| 6025 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 6026 | 0 \ |
| 6027 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6028 | -s "Found buffered record from current epoch - load" \ |
| 6029 | -c "Buffer record from epoch 1" \ |
| 6030 | -c "Found buffered record from current epoch - load" |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 6031 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 6032 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 6033 | # from the server are delayed, so that the encrypted Finished message |
| 6034 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 6035 | # in afterwards, the encrypted Finished message must be freed in order |
| 6036 | # to make space for the NewSessionTicket to be reassembled. |
| 6037 | # This works only in very particular circumstances: |
| 6038 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 6039 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 6040 | # the encrypted Finished message. |
| 6041 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 6042 | # needs to be fragmented. |
| 6043 | # - All messages sent by the server must be small enough to be either sent |
| 6044 | # without fragmentation or be reassembled within the bounds of |
| 6045 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 6046 | # handshake, omitting CRTs. |
| 6047 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 6048 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 6049 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 6050 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 6051 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 6052 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 6053 | 0 \ |
| 6054 | -s "Buffer record from epoch 1" \ |
| 6055 | -s "Found buffered record from current epoch - load" \ |
| 6056 | -c "Buffer record from epoch 1" \ |
| 6057 | -C "Found buffered record from current epoch - load" \ |
| 6058 | -c "Enough space available after freeing future epoch record" |
| 6059 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 6060 | # 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] | 6061 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6062 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6063 | 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] | 6064 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6065 | "$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] | 6066 | psk=abc123" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6067 | "$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] | 6068 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6069 | 0 \ |
| 6070 | -s "Extra-header:" \ |
| 6071 | -c "HTTP/1.0 200 OK" |
| 6072 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6073 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6074 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 6075 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6076 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 6077 | "$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] | 6078 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6079 | 0 \ |
| 6080 | -s "Extra-header:" \ |
| 6081 | -c "HTTP/1.0 200 OK" |
| 6082 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6083 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6084 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 6085 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6086 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 6087 | "$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] | 6088 | 0 \ |
| 6089 | -s "Extra-header:" \ |
| 6090 | -c "HTTP/1.0 200 OK" |
| 6091 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6092 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6093 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 6094 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6095 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=required" \ |
| 6096 | "$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] | 6097 | 0 \ |
| 6098 | -s "Extra-header:" \ |
| 6099 | -c "HTTP/1.0 200 OK" |
| 6100 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6101 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6102 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 6103 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6104 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=1 auth_mode=none" \ |
| 6105 | "$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] | 6106 | 0 \ |
| 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 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6111 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 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=1 auth_mode=required" \ |
| 6114 | "$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] | 6115 | 0 \ |
| 6116 | -s "Extra-header:" \ |
| 6117 | -c "HTTP/1.0 200 OK" |
| 6118 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6119 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6120 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 6121 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6122 | "$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] | 6123 | auth_mode=required" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6124 | "$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] | 6125 | 0 \ |
| 6126 | -s "Extra-header:" \ |
| 6127 | -c "HTTP/1.0 200 OK" |
| 6128 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6129 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 6130 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 6131 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6132 | "$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] | 6133 | psk=abc123 debug_level=3" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6134 | "$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] | 6135 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 6136 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6137 | 0 \ |
| 6138 | -s "a session has been resumed" \ |
| 6139 | -c "a session has been resumed" \ |
| 6140 | -s "Extra-header:" \ |
| 6141 | -c "HTTP/1.0 200 OK" |
| 6142 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6143 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 6144 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 6145 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6146 | "$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] | 6147 | psk=abc123 debug_level=3 nbio=2" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6148 | "$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] | 6149 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 6150 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 6151 | 0 \ |
| 6152 | -s "a session has been resumed" \ |
| 6153 | -c "a session has been resumed" \ |
| 6154 | -s "Extra-header:" \ |
| 6155 | -c "HTTP/1.0 200 OK" |
| 6156 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6157 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6158 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6159 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 6160 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6161 | "$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] | 6162 | psk=abc123 renegotiation=1 debug_level=2" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6163 | "$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] | 6164 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 6165 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6166 | 0 \ |
| 6167 | -c "=> renegotiate" \ |
| 6168 | -s "=> renegotiate" \ |
| 6169 | -s "Extra-header:" \ |
| 6170 | -c "HTTP/1.0 200 OK" |
| 6171 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6172 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6173 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6174 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 6175 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6176 | "$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] | 6177 | psk=abc123 renegotiation=1 debug_level=2" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6178 | "$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] | 6179 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6180 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6181 | 0 \ |
| 6182 | -c "=> renegotiate" \ |
| 6183 | -s "=> renegotiate" \ |
| 6184 | -s "Extra-header:" \ |
| 6185 | -c "HTTP/1.0 200 OK" |
| 6186 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6187 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6188 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6189 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6190 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6191 | "$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] | 6192 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6193 | debug_level=2" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6194 | "$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] | 6195 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6196 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6197 | 0 \ |
| 6198 | -c "=> renegotiate" \ |
| 6199 | -s "=> renegotiate" \ |
| 6200 | -s "Extra-header:" \ |
| 6201 | -c "HTTP/1.0 200 OK" |
| 6202 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6203 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6204 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6205 | 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] | 6206 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6207 | "$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] | 6208 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6209 | debug_level=2 nbio=2" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6210 | "$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] | 6211 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6212 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 6213 | 0 \ |
| 6214 | -c "=> renegotiate" \ |
| 6215 | -s "=> renegotiate" \ |
| 6216 | -s "Extra-header:" \ |
| 6217 | -c "HTTP/1.0 200 OK" |
| 6218 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6219 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6220 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6221 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 6222 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 6223 | "$O_SRV -dtls1 -mtu 2048" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6224 | "$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] | 6225 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 6226 | -c "HTTP/1.0 200 OK" |
| 6227 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6228 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6229 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6230 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 6231 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 6232 | "$O_SRV -dtls1 -mtu 768" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6233 | "$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] | 6234 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6235 | -c "HTTP/1.0 200 OK" |
| 6236 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6237 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6238 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6239 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 6240 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 6241 | "$O_SRV -dtls1 -mtu 768" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6242 | "$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] | 6243 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6244 | -c "HTTP/1.0 200 OK" |
| 6245 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 6246 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6247 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6248 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6249 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 6250 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 6251 | "$G_SRV -u --mtu 2048 -a" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6252 | "$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] | 6253 | 0 \ |
| 6254 | -s "Extra-header:" \ |
| 6255 | -c "Extra-header:" |
| 6256 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 6257 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6258 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6259 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6260 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 6261 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 6262 | "$G_SRV -u --mtu 512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6263 | "$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] | 6264 | 0 \ |
| 6265 | -s "Extra-header:" \ |
| 6266 | -c "Extra-header:" |
| 6267 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 6268 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6269 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6270 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6271 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 6272 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 6273 | "$G_SRV -u --mtu 512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6274 | "$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] | 6275 | 0 \ |
| 6276 | -s "Extra-header:" \ |
| 6277 | -c "Extra-header:" |
| 6278 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6279 | # Final report |
| 6280 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6281 | echo "------------------------------------------------------------------------" |
| 6282 | |
| 6283 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 6284 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6285 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 6286 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6287 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 6288 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 6289 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6290 | |
| 6291 | exit $FAILS |