Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 6 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 7 | # Copyright (c) 2016, ARM Limited, All Rights Reserved |
| 8 | # |
| 9 | # Purpose |
| 10 | # |
| 11 | # Executes tests to prove various TLS/SSL options and extensions. |
| 12 | # |
| 13 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 14 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 15 | # (session resumption from cache or ticket, renego, etc). |
| 16 | # |
| 17 | # The tests assume a build with default options, with exceptions expressed |
| 18 | # with a dependency. The tests focus on functionality and do not consider |
| 19 | # performance. |
| 20 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 21 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 22 | set -u |
| 23 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 24 | if cd $( dirname $0 ); then :; else |
| 25 | echo "cd $( dirname $0 ) failed" >&2 |
| 26 | exit 1 |
| 27 | fi |
| 28 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 29 | # default values, can be overriden by the environment |
| 30 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 31 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 32 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 33 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 34 | : ${GNUTLS_CLI:=gnutls-cli} |
| 35 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 36 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 37 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 38 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 39 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 40 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 41 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 42 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 43 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 44 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 45 | |
| 46 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 47 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 48 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 49 | else |
| 50 | O_LEGACY_SRV=false |
| 51 | O_LEGACY_CLI=false |
| 52 | fi |
| 53 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 54 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 55 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 56 | else |
| 57 | G_NEXT_SRV=false |
| 58 | fi |
| 59 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 60 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 61 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 62 | else |
| 63 | G_NEXT_CLI=false |
| 64 | fi |
| 65 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 66 | TESTS=0 |
| 67 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 68 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 69 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 70 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 71 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 72 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 73 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 74 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 75 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 76 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 77 | RUN_TEST_NUMBER='' |
| 78 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 79 | PRESERVE_LOGS=0 |
| 80 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 81 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 82 | # port which is this plus 10000. Each port number may be independently |
| 83 | # overridden by a command line option. |
| 84 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 85 | PXY_PORT=$((SRV_PORT + 10000)) |
| 86 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 87 | print_usage() { |
| 88 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 89 | printf " -h|--help\tPrint this help.\n" |
| 90 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 91 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 92 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 93 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 94 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 95 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 96 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 97 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 98 | printf " --seed\tInteger seed value to use for this test run\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | get_options() { |
| 102 | while [ $# -gt 0 ]; do |
| 103 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 104 | -f|--filter) |
| 105 | shift; FILTER=$1 |
| 106 | ;; |
| 107 | -e|--exclude) |
| 108 | shift; EXCLUDE=$1 |
| 109 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 110 | -m|--memcheck) |
| 111 | MEMCHECK=1 |
| 112 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 113 | -n|--number) |
| 114 | shift; RUN_TEST_NUMBER=$1 |
| 115 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 116 | -s|--show-numbers) |
| 117 | SHOW_TEST_NUMBER=1 |
| 118 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 119 | -p|--preserve-logs) |
| 120 | PRESERVE_LOGS=1 |
| 121 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 122 | --port) |
| 123 | shift; SRV_PORT=$1 |
| 124 | ;; |
| 125 | --proxy-port) |
| 126 | shift; PXY_PORT=$1 |
| 127 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 128 | --seed) |
| 129 | shift; SEED="$1" |
| 130 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 131 | -h|--help) |
| 132 | print_usage |
| 133 | exit 0 |
| 134 | ;; |
| 135 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 136 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 137 | print_usage |
| 138 | exit 1 |
| 139 | ;; |
| 140 | esac |
| 141 | shift |
| 142 | done |
| 143 | } |
| 144 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 145 | # Skip next test; use this macro to skip tests which are legitimate |
| 146 | # in theory and expected to be re-introduced at some point, but |
| 147 | # aren't expected to succeed at the moment due to problems outside |
| 148 | # our control (such as bugs in other TLS implementations). |
| 149 | skip_next_test() { |
| 150 | SKIP_NEXT="YES" |
| 151 | } |
| 152 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 153 | # skip next test if the flag is not enabled in config.h |
| 154 | requires_config_enabled() { |
| 155 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 156 | SKIP_NEXT="YES" |
| 157 | fi |
| 158 | } |
| 159 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 160 | # skip next test if the flag is enabled in config.h |
| 161 | requires_config_disabled() { |
| 162 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 163 | SKIP_NEXT="YES" |
| 164 | fi |
| 165 | } |
| 166 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 167 | get_config_value_or_default() { |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 168 | # This function uses the query_config command line option to query the |
| 169 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 170 | # program. The command will always return a success value if the |
| 171 | # configuration is defined and the value will be printed to stdout. |
| 172 | # |
| 173 | # Note that if the configuration is not defined or is defined to nothing, |
| 174 | # the output of this function will be an empty string. |
| 175 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | requires_config_value_at_least() { |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 179 | VAL="$( get_config_value_or_default "$1" )" |
| 180 | if [ -z "$VAL" ]; then |
| 181 | # Should never happen |
| 182 | echo "Mbed TLS configuration $1 is not defined" |
| 183 | exit 1 |
| 184 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 185 | SKIP_NEXT="YES" |
| 186 | fi |
| 187 | } |
| 188 | |
| 189 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 190 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 191 | if [ -z "$VAL" ]; then |
| 192 | # Should never happen |
| 193 | echo "Mbed TLS configuration $1 is not defined" |
| 194 | exit 1 |
| 195 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 196 | SKIP_NEXT="YES" |
| 197 | fi |
| 198 | } |
| 199 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 200 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 201 | requires_openssl_with_fallback_scsv() { |
| 202 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 203 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 204 | then |
| 205 | OPENSSL_HAS_FBSCSV="YES" |
| 206 | else |
| 207 | OPENSSL_HAS_FBSCSV="NO" |
| 208 | fi |
| 209 | fi |
| 210 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 211 | SKIP_NEXT="YES" |
| 212 | fi |
| 213 | } |
| 214 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 215 | # skip next test if GnuTLS isn't available |
| 216 | requires_gnutls() { |
| 217 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 218 | 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] | 219 | GNUTLS_AVAILABLE="YES" |
| 220 | else |
| 221 | GNUTLS_AVAILABLE="NO" |
| 222 | fi |
| 223 | fi |
| 224 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 225 | SKIP_NEXT="YES" |
| 226 | fi |
| 227 | } |
| 228 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 229 | # skip next test if GnuTLS-next isn't available |
| 230 | requires_gnutls_next() { |
| 231 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 232 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 233 | GNUTLS_NEXT_AVAILABLE="YES" |
| 234 | else |
| 235 | GNUTLS_NEXT_AVAILABLE="NO" |
| 236 | fi |
| 237 | fi |
| 238 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 239 | SKIP_NEXT="YES" |
| 240 | fi |
| 241 | } |
| 242 | |
| 243 | # skip next test if OpenSSL-legacy isn't available |
| 244 | requires_openssl_legacy() { |
| 245 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 246 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 247 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 248 | else |
| 249 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 250 | fi |
| 251 | fi |
| 252 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 253 | SKIP_NEXT="YES" |
| 254 | fi |
| 255 | } |
| 256 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 257 | # skip next test if IPv6 isn't available on this host |
| 258 | requires_ipv6() { |
| 259 | if [ -z "${HAS_IPV6:-}" ]; then |
| 260 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 261 | SRV_PID=$! |
| 262 | sleep 1 |
| 263 | kill $SRV_PID >/dev/null 2>&1 |
| 264 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 265 | HAS_IPV6="NO" |
| 266 | else |
| 267 | HAS_IPV6="YES" |
| 268 | fi |
| 269 | rm -r $SRV_OUT |
| 270 | fi |
| 271 | |
| 272 | if [ "$HAS_IPV6" = "NO" ]; then |
| 273 | SKIP_NEXT="YES" |
| 274 | fi |
| 275 | } |
| 276 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 277 | # skip next test if it's i686 or uname is not available |
| 278 | requires_not_i686() { |
| 279 | if [ -z "${IS_I686:-}" ]; then |
| 280 | IS_I686="YES" |
| 281 | if which "uname" >/dev/null 2>&1; then |
| 282 | if [ -z "$(uname -a | grep i686)" ]; then |
| 283 | IS_I686="NO" |
| 284 | fi |
| 285 | fi |
| 286 | fi |
| 287 | if [ "$IS_I686" = "YES" ]; then |
| 288 | SKIP_NEXT="YES" |
| 289 | fi |
| 290 | } |
| 291 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 292 | # Calculate the input & output maximum content lengths set in the config |
| 293 | MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 294 | MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 295 | MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 296 | |
| 297 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 298 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 299 | fi |
| 300 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 301 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 302 | fi |
| 303 | |
| 304 | # skip the next test if the SSL output buffer is less than 16KB |
| 305 | requires_full_size_output_buffer() { |
| 306 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 307 | SKIP_NEXT="YES" |
| 308 | fi |
| 309 | } |
| 310 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 311 | # skip the next test if valgrind is in use |
| 312 | not_with_valgrind() { |
| 313 | if [ "$MEMCHECK" -gt 0 ]; then |
| 314 | SKIP_NEXT="YES" |
| 315 | fi |
| 316 | } |
| 317 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 318 | # skip the next test if valgrind is NOT in use |
| 319 | only_with_valgrind() { |
| 320 | if [ "$MEMCHECK" -eq 0 ]; then |
| 321 | SKIP_NEXT="YES" |
| 322 | fi |
| 323 | } |
| 324 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 325 | # 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] | 326 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 327 | CLI_DELAY_FACTOR=$1 |
| 328 | } |
| 329 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 330 | # wait for the given seconds after the client finished in the next test |
| 331 | server_needs_more_time() { |
| 332 | SRV_DELAY_SECONDS=$1 |
| 333 | } |
| 334 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 335 | # print_name <name> |
| 336 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 337 | TESTS=$(( $TESTS + 1 )) |
| 338 | LINE="" |
| 339 | |
| 340 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 341 | LINE="$TESTS " |
| 342 | fi |
| 343 | |
| 344 | LINE="$LINE$1" |
| 345 | printf "$LINE " |
| 346 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 347 | for i in `seq 1 $LEN`; do printf '.'; done |
| 348 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 349 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | # fail <message> |
| 353 | fail() { |
| 354 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 355 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 356 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 357 | mv $SRV_OUT o-srv-${TESTS}.log |
| 358 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 359 | if [ -n "$PXY_CMD" ]; then |
| 360 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 361 | fi |
| 362 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 363 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 364 | 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] | 365 | echo " ! server output:" |
| 366 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 367 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 368 | echo " ! client output:" |
| 369 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 370 | if [ -n "$PXY_CMD" ]; then |
| 371 | echo " ! ========================================================" |
| 372 | echo " ! proxy output:" |
| 373 | cat o-pxy-${TESTS}.log |
| 374 | fi |
| 375 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 376 | fi |
| 377 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 378 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 379 | } |
| 380 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 381 | # is_polar <cmd_line> |
| 382 | is_polar() { |
| 383 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 384 | } |
| 385 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 386 | # openssl s_server doesn't have -www with DTLS |
| 387 | check_osrv_dtls() { |
| 388 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 389 | NEEDS_INPUT=1 |
| 390 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 391 | else |
| 392 | NEEDS_INPUT=0 |
| 393 | fi |
| 394 | } |
| 395 | |
| 396 | # provide input to commands that need it |
| 397 | provide_input() { |
| 398 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 399 | return |
| 400 | fi |
| 401 | |
| 402 | while true; do |
| 403 | echo "HTTP/1.0 200 OK" |
| 404 | sleep 1 |
| 405 | done |
| 406 | } |
| 407 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 408 | # has_mem_err <log_file_name> |
| 409 | has_mem_err() { |
| 410 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 411 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 412 | then |
| 413 | return 1 # false: does not have errors |
| 414 | else |
| 415 | return 0 # true: has errors |
| 416 | fi |
| 417 | } |
| 418 | |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 419 | # Wait for process $2 to be listening on port $1 |
| 420 | if type lsof >/dev/null 2>/dev/null; then |
| 421 | wait_server_start() { |
| 422 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 423 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 424 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 425 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 426 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 427 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 428 | # Make a tight loop, server normally takes less than 1s to start. |
| 429 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 430 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 431 | echo "SERVERSTART TIMEOUT" |
| 432 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 433 | break |
| 434 | fi |
| 435 | # Linux and *BSD support decimal arguments to sleep. On other |
| 436 | # OSes this may be a tight loop. |
| 437 | sleep 0.1 2>/dev/null || true |
| 438 | done |
| 439 | } |
| 440 | else |
Gilles Peskine | a931265 | 2018-06-29 15:48:13 +0200 | [diff] [blame] | 441 | echo "Warning: lsof not available, wait_server_start = sleep" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 442 | wait_server_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 443 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 444 | } |
| 445 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 446 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 447 | # 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] | 448 | # 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] | 449 | # acceptable bounds |
| 450 | check_server_hello_time() { |
| 451 | # 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] | 452 | 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] | 453 | # Get the Unix timestamp for now |
| 454 | CUR_TIME=$(date +'%s') |
| 455 | THRESHOLD_IN_SECS=300 |
| 456 | |
| 457 | # Check if the ServerHello time was printed |
| 458 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 459 | return 1 |
| 460 | fi |
| 461 | |
| 462 | # Check the time in ServerHello is within acceptable bounds |
| 463 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 464 | # The time in ServerHello is at least 5 minutes before now |
| 465 | return 1 |
| 466 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 467 | # 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] | 468 | return 1 |
| 469 | else |
| 470 | return 0 |
| 471 | fi |
| 472 | } |
| 473 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 474 | # wait for client to terminate and set CLI_EXIT |
| 475 | # must be called right after starting the client |
| 476 | wait_client_done() { |
| 477 | CLI_PID=$! |
| 478 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 479 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 480 | CLI_DELAY_FACTOR=1 |
| 481 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 482 | ( 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] | 483 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 484 | |
| 485 | wait $CLI_PID |
| 486 | CLI_EXIT=$? |
| 487 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 488 | kill $DOG_PID >/dev/null 2>&1 |
| 489 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 490 | |
| 491 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 492 | |
| 493 | sleep $SRV_DELAY_SECONDS |
| 494 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 495 | } |
| 496 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 497 | # check if the given command uses dtls and sets global variable DTLS |
| 498 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 499 | 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] | 500 | DTLS=1 |
| 501 | else |
| 502 | DTLS=0 |
| 503 | fi |
| 504 | } |
| 505 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 506 | # 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] | 507 | # Options: -s pattern pattern that must be present in server output |
| 508 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 509 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 510 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 511 | # -S pattern pattern that must be absent in server output |
| 512 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 513 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 514 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 515 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 516 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 517 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 518 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 519 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 520 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 521 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 522 | return |
| 523 | fi |
| 524 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 525 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 526 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 527 | # Do we only run numbered tests? |
| 528 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 529 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 530 | else |
| 531 | SKIP_NEXT="YES" |
| 532 | fi |
| 533 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 534 | # should we skip? |
| 535 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 536 | SKIP_NEXT="NO" |
| 537 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 538 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 539 | return |
| 540 | fi |
| 541 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 542 | # does this test use a proxy? |
| 543 | if [ "X$1" = "X-p" ]; then |
| 544 | PXY_CMD="$2" |
| 545 | shift 2 |
| 546 | else |
| 547 | PXY_CMD="" |
| 548 | fi |
| 549 | |
| 550 | # get commands and client output |
| 551 | SRV_CMD="$1" |
| 552 | CLI_CMD="$2" |
| 553 | CLI_EXPECT="$3" |
| 554 | shift 3 |
| 555 | |
| 556 | # fix client port |
| 557 | if [ -n "$PXY_CMD" ]; then |
| 558 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 559 | else |
| 560 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 561 | fi |
| 562 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 563 | # update DTLS variable |
| 564 | detect_dtls "$SRV_CMD" |
| 565 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 566 | # prepend valgrind to our commands if active |
| 567 | if [ "$MEMCHECK" -gt 0 ]; then |
| 568 | if is_polar "$SRV_CMD"; then |
| 569 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 570 | fi |
| 571 | if is_polar "$CLI_CMD"; then |
| 572 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 573 | fi |
| 574 | fi |
| 575 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 576 | TIMES_LEFT=2 |
| 577 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 578 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 579 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 580 | # run the commands |
| 581 | if [ -n "$PXY_CMD" ]; then |
| 582 | echo "$PXY_CMD" > $PXY_OUT |
| 583 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 584 | PXY_PID=$! |
| 585 | # assume proxy starts faster than server |
| 586 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 587 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 588 | check_osrv_dtls |
| 589 | echo "$SRV_CMD" > $SRV_OUT |
| 590 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 591 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 592 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 593 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 594 | echo "$CLI_CMD" > $CLI_OUT |
| 595 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 596 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 597 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 598 | sleep 0.05 |
| 599 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 600 | # terminate the server (and the proxy) |
| 601 | kill $SRV_PID |
| 602 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 603 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 604 | if [ -n "$PXY_CMD" ]; then |
| 605 | kill $PXY_PID >/dev/null 2>&1 |
| 606 | wait $PXY_PID |
| 607 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 608 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 609 | # retry only on timeouts |
| 610 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 611 | printf "RETRY " |
| 612 | else |
| 613 | TIMES_LEFT=0 |
| 614 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 615 | done |
| 616 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 617 | # 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] | 618 | # (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] | 619 | # expected client exit to incorrectly succeed in case of catastrophic |
| 620 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 621 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 622 | 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] | 623 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 624 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 625 | return |
| 626 | fi |
| 627 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 628 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 629 | 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] | 630 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 631 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 632 | return |
| 633 | fi |
| 634 | fi |
| 635 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 636 | # check server exit code |
| 637 | if [ $? != 0 ]; then |
| 638 | fail "server fail" |
| 639 | return |
| 640 | fi |
| 641 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 642 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 643 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 644 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 645 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 646 | 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] | 647 | return |
| 648 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 649 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 650 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 651 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 652 | # 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] | 653 | while [ $# -gt 0 ] |
| 654 | do |
| 655 | case $1 in |
| 656 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 657 | 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] | 658 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 659 | return |
| 660 | fi |
| 661 | ;; |
| 662 | |
| 663 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 664 | 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] | 665 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 666 | return |
| 667 | fi |
| 668 | ;; |
| 669 | |
| 670 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 671 | 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] | 672 | 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] | 673 | return |
| 674 | fi |
| 675 | ;; |
| 676 | |
| 677 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 678 | 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] | 679 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 680 | return |
| 681 | fi |
| 682 | ;; |
| 683 | |
| 684 | # The filtering in the following two options (-u and -U) do the following |
| 685 | # - ignore valgrind output |
| 686 | # - filter out everything but lines right after the pattern occurances |
| 687 | # - keep one of each non-unique line |
| 688 | # - count how many lines remain |
| 689 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 690 | # if there were no duplicates. |
| 691 | "-U") |
| 692 | 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 |
| 693 | fail "lines following pattern '$2' must be unique in Server output" |
| 694 | return |
| 695 | fi |
| 696 | ;; |
| 697 | |
| 698 | "-u") |
| 699 | 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 |
| 700 | 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] | 701 | return |
| 702 | fi |
| 703 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 704 | "-F") |
| 705 | if ! $2 "$SRV_OUT"; then |
| 706 | fail "function call to '$2' failed on Server output" |
| 707 | return |
| 708 | fi |
| 709 | ;; |
| 710 | "-f") |
| 711 | if ! $2 "$CLI_OUT"; then |
| 712 | fail "function call to '$2' failed on Client output" |
| 713 | return |
| 714 | fi |
| 715 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 716 | |
| 717 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 718 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 719 | exit 1 |
| 720 | esac |
| 721 | shift 2 |
| 722 | done |
| 723 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 724 | # check valgrind's results |
| 725 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 726 | 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] | 727 | fail "Server has memory errors" |
| 728 | return |
| 729 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 730 | 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] | 731 | fail "Client has memory errors" |
| 732 | return |
| 733 | fi |
| 734 | fi |
| 735 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 736 | # if we're here, everything is ok |
| 737 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 738 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 739 | mv $SRV_OUT o-srv-${TESTS}.log |
| 740 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 741 | if [ -n "$PXY_CMD" ]; then |
| 742 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 743 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 744 | fi |
| 745 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 746 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 747 | } |
| 748 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 749 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 750 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 751 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 752 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 753 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 754 | 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] | 755 | exit 1 |
| 756 | } |
| 757 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 758 | # |
| 759 | # MAIN |
| 760 | # |
| 761 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 762 | get_options "$@" |
| 763 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 764 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 765 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 766 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 767 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 768 | if [ ! -x "$P_SRV_BIN" ]; then |
| 769 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 770 | exit 1 |
| 771 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 772 | if [ ! -x "$P_CLI_BIN" ]; then |
| 773 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 774 | exit 1 |
| 775 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 776 | if [ ! -x "$P_PXY_BIN" ]; then |
| 777 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 778 | exit 1 |
| 779 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 780 | if [ "$MEMCHECK" -gt 0 ]; then |
| 781 | if which valgrind >/dev/null 2>&1; then :; else |
| 782 | echo "Memcheck not possible. Valgrind not found" |
| 783 | exit 1 |
| 784 | fi |
| 785 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 786 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 787 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 788 | exit 1 |
| 789 | fi |
| 790 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 791 | # used by watchdog |
| 792 | MAIN_PID="$$" |
| 793 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 794 | # We use somewhat arbitrary delays for tests: |
| 795 | # - how long do we wait for the server to start (when lsof not available)? |
| 796 | # - how long do we allow for the client to finish? |
| 797 | # (not to check performance, just to avoid waiting indefinitely) |
| 798 | # Things are slower with valgrind, so give extra time here. |
| 799 | # |
| 800 | # Note: without lsof, there is a trade-off between the running time of this |
| 801 | # script and the risk of spurious errors because we didn't wait long enough. |
| 802 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 803 | # 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] | 804 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 805 | START_DELAY=6 |
| 806 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 807 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 808 | START_DELAY=2 |
| 809 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 810 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 811 | |
| 812 | # some particular tests need more time: |
| 813 | # - for the client, we multiply the usual watchdog limit by a factor |
| 814 | # - for the server, we sleep for a number of seconds after the client exits |
| 815 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 816 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 817 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 818 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 819 | # 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] | 820 | # +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] | 821 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 822 | 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] | 823 | 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] | 824 | 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] | 825 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 826 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 827 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 828 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 829 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 830 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 831 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 832 | fi |
| 833 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 834 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 835 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 836 | fi |
| 837 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 838 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 839 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 840 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 841 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 842 | # Allow SHA-1, because many of our test certificates use it |
| 843 | P_SRV="$P_SRV allow_sha1=1" |
| 844 | P_CLI="$P_CLI allow_sha1=1" |
| 845 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 846 | # Also pick a unique name for intermediate files |
| 847 | SRV_OUT="srv_out.$$" |
| 848 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 849 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 850 | SESSION="session.$$" |
| 851 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 852 | SKIP_NEXT="NO" |
| 853 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 854 | trap cleanup INT TERM HUP |
| 855 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 856 | # Basic test |
| 857 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 858 | # Checks that: |
| 859 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 860 | # - the expected (highest security) parameters are selected |
| 861 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 862 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 863 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 864 | "$P_CLI" \ |
| 865 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 866 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 867 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 868 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 869 | -s "ECDHE curve: secp521r1" \ |
| 870 | -S "error" \ |
| 871 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 872 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 873 | run_test "Default, DTLS" \ |
| 874 | "$P_SRV dtls=1" \ |
| 875 | "$P_CLI dtls=1" \ |
| 876 | 0 \ |
| 877 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 878 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 879 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 880 | # Test current time in ServerHello |
| 881 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 882 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 883 | "$P_SRV debug_level=3" \ |
| 884 | "$P_CLI debug_level=3" \ |
| 885 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 886 | -f "check_server_hello_time" \ |
| 887 | -F "check_server_hello_time" |
| 888 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 889 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 890 | run_test "Unique IV in GCM" \ |
| 891 | "$P_SRV exchanges=20 debug_level=4" \ |
| 892 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 893 | 0 \ |
| 894 | -u "IV used" \ |
| 895 | -U "IV used" |
| 896 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 897 | # Tests for rc4 option |
| 898 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 899 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 900 | run_test "RC4: server disabled, client enabled" \ |
| 901 | "$P_SRV" \ |
| 902 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 903 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 904 | -s "SSL - The server has no ciphersuites in common" |
| 905 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 906 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 907 | run_test "RC4: server half, client enabled" \ |
| 908 | "$P_SRV arc4=1" \ |
| 909 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 910 | 1 \ |
| 911 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 912 | |
| 913 | run_test "RC4: server enabled, client disabled" \ |
| 914 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 915 | "$P_CLI" \ |
| 916 | 1 \ |
| 917 | -s "SSL - The server has no ciphersuites in common" |
| 918 | |
| 919 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 920 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 921 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 922 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 923 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 924 | -S "SSL - The server has no ciphersuites in common" |
| 925 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 926 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 927 | |
| 928 | requires_gnutls |
| 929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 930 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 931 | "$G_SRV"\ |
| 932 | "$P_CLI force_version=tls1_1" \ |
| 933 | 0 |
| 934 | |
| 935 | requires_gnutls |
| 936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 937 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 938 | "$G_SRV"\ |
| 939 | "$P_CLI force_version=tls1" \ |
| 940 | 0 |
| 941 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 942 | # Tests for SHA-1 support |
| 943 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 944 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 945 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 946 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 947 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 948 | 1 \ |
| 949 | -c "The certificate is signed with an unacceptable hash" |
| 950 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 951 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 952 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 953 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 954 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 955 | 0 |
| 956 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 957 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 958 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 959 | "$P_CLI allow_sha1=1" \ |
| 960 | 0 |
| 961 | |
| 962 | run_test "SHA-256 allowed by default in server certificate" \ |
| 963 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 964 | "$P_CLI allow_sha1=0" \ |
| 965 | 0 |
| 966 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 967 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 968 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 969 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 970 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 971 | 1 \ |
| 972 | -s "The certificate is signed with an unacceptable hash" |
| 973 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 974 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 975 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 976 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 977 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 978 | 0 |
| 979 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 980 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 981 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 982 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 983 | 0 |
| 984 | |
| 985 | run_test "SHA-256 allowed by default in client certificate" \ |
| 986 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 987 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 988 | 0 |
| 989 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 990 | # Tests for datagram packing |
| 991 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 992 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 993 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 994 | 0 \ |
| 995 | -c "next record in same datagram" \ |
| 996 | -s "next record in same datagram" |
| 997 | |
| 998 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 999 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1000 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1001 | 0 \ |
| 1002 | -s "next record in same datagram" \ |
| 1003 | -C "next record in same datagram" |
| 1004 | |
| 1005 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1006 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1007 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1008 | 0 \ |
| 1009 | -S "next record in same datagram" \ |
| 1010 | -c "next record in same datagram" |
| 1011 | |
| 1012 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1013 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1014 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1015 | 0 \ |
| 1016 | -S "next record in same datagram" \ |
| 1017 | -C "next record in same datagram" |
| 1018 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1019 | # Tests for Truncated HMAC extension |
| 1020 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1021 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1022 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1023 | "$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] | 1024 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1025 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1026 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1027 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1028 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1029 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1030 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1031 | "$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] | 1032 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1033 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1034 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1035 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1036 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1037 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1038 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1039 | "$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] | 1040 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1041 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1042 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1043 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1044 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1045 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1046 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1047 | "$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] | 1048 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1049 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1050 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1051 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1052 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1053 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1054 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1055 | "$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] | 1056 | 0 \ |
| 1057 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1058 | -S "dumping 'expected mac' (10 bytes)" |
| 1059 | |
| 1060 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1061 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1062 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1063 | "$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] | 1064 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1065 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1066 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1067 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1068 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1069 | "$P_SRV dtls=1 debug_level=4" \ |
| 1070 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1071 | 0 \ |
| 1072 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1073 | -S "dumping 'expected mac' (10 bytes)" |
| 1074 | |
| 1075 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1076 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1077 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1078 | "$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] | 1079 | 0 \ |
| 1080 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1081 | -S "dumping 'expected mac' (10 bytes)" |
| 1082 | |
| 1083 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1084 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1085 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1086 | "$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] | 1087 | 0 \ |
| 1088 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1089 | -S "dumping 'expected mac' (10 bytes)" |
| 1090 | |
| 1091 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1092 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1093 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1094 | "$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] | 1095 | 0 \ |
| 1096 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1097 | -S "dumping 'expected mac' (10 bytes)" |
| 1098 | |
| 1099 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1100 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1101 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1102 | "$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] | 1103 | 0 \ |
| 1104 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1105 | -S "dumping 'expected mac' (10 bytes)" |
| 1106 | |
| 1107 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1108 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1109 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1110 | "$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] | 1111 | 0 \ |
| 1112 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1113 | -s "dumping 'expected mac' (10 bytes)" |
| 1114 | |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1115 | # Tests for DTLS Connection ID extension |
| 1116 | |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1117 | # So far, the CID API isn't implemented, so we can't |
| 1118 | # grep for output witnessing its use. This needs to be |
| 1119 | # changed once the CID extension is implemented. |
| 1120 | |
| 1121 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1122 | run_test "(STUB) Connection ID: Client enabled, server disabled" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1123 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1124 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1125 | 0 \ |
| 1126 | -s "Disable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1127 | -s "found CID extension" \ |
| 1128 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1129 | -c "Enable use of CID extension." \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1130 | -c "client hello, adding CID extension" \ |
| 1131 | -S "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1132 | |
| 1133 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1134 | run_test "(STUB) Connection ID: Client disabled, server enabled" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1135 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1136 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1137 | 0 \ |
| 1138 | -c "Disable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1139 | -C "client hello, adding CID extension" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1140 | -S "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1141 | -s "Enable use of CID extension." \ |
| 1142 | -S "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1143 | |
| 1144 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1145 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID nonempty" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1146 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1147 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1148 | 0 \ |
| 1149 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1150 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1151 | -c "client hello, adding CID extension" \ |
| 1152 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1153 | -s "Use of CID extension negotiated" \ |
| 1154 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1155 | |
| 1156 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1157 | run_test "(STUB) Connection ID: Client+Server enabled, Client CID empty" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1158 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1159 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1160 | 0 \ |
| 1161 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1162 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1163 | -c "client hello, adding CID extension" \ |
| 1164 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1165 | -s "Use of CID extension negotiated" \ |
| 1166 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1167 | |
| 1168 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1169 | run_test "(STUB) Connection ID: Client+Server enabled, Server CID empty" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1170 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1171 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1172 | 0 \ |
| 1173 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1174 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1175 | -c "client hello, adding CID extension" \ |
| 1176 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1177 | -s "Use of CID extension negotiated" \ |
| 1178 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1179 | |
| 1180 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1181 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID empty" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1182 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1183 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1184 | 0 \ |
| 1185 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1186 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1187 | -c "client hello, adding CID extension" \ |
| 1188 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1189 | -s "Use of CID extension negotiated" \ |
| 1190 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1191 | |
| 1192 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1193 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1194 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1195 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1196 | 0 \ |
| 1197 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1198 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1199 | -c "client hello, adding CID extension" \ |
| 1200 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1201 | -s "Use of CID extension negotiated" \ |
| 1202 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1203 | |
| 1204 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1205 | run_test "(STUB) Connection ID: Client+Server enabled, Client CID empty, AES-128-CCM-8" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1206 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1207 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1208 | 0 \ |
| 1209 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1210 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1211 | -c "client hello, adding CID extension" \ |
| 1212 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1213 | -s "Use of CID extension negotiated" \ |
| 1214 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1215 | |
| 1216 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1217 | run_test "(STUB) Connection ID: Client+Server enabled, Server CID empty, AES-128-CCM-8" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1218 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1219 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1220 | 0 \ |
| 1221 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1222 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1223 | -c "client hello, adding CID extension" \ |
| 1224 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1225 | -s "Use of CID extension negotiated" \ |
| 1226 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1227 | |
| 1228 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1229 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID empty, AES-128-CCM-8" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1230 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1231 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1232 | 0 \ |
| 1233 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1234 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1235 | -c "client hello, adding CID extension" \ |
| 1236 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1237 | -s "Use of CID extension negotiated" \ |
| 1238 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1239 | |
| 1240 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1241 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID nonempty, AES-128-CBC" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1242 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1243 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1244 | 0 \ |
| 1245 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1246 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1247 | -c "client hello, adding CID extension" \ |
| 1248 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1249 | -s "Use of CID extension negotiated" \ |
| 1250 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1251 | |
| 1252 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1253 | run_test "(STUB) Connection ID: Client+Server enabled, Client CID empty, AES-128-CBC" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1254 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1255 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1256 | 0 \ |
| 1257 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1258 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1259 | -c "client hello, adding CID extension" \ |
| 1260 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1261 | -s "Use of CID extension negotiated" \ |
| 1262 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1263 | |
| 1264 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1265 | run_test "(STUB) Connection ID: Client+Server enabled, Server CID empty, AES-128-CBC" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1266 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1267 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1268 | 0 \ |
| 1269 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1270 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1271 | -c "client hello, adding CID extension" \ |
| 1272 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1273 | -s "Use of CID extension negotiated" \ |
| 1274 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1275 | |
| 1276 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1277 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID empty, AES-128-CBC" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1278 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1279 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1280 | 0 \ |
| 1281 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1282 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1283 | -c "client hello, adding CID extension" \ |
| 1284 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1285 | -s "Use of CID extension negotiated" \ |
| 1286 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1287 | |
Hanno Becker | 963cb35 | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 1288 | requires_config_enabled MBEDTLS_SSL_CID |
| 1289 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | b60c85c | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1290 | run_test "(STUB) Connection ID: Client+Server enabled, renegotiate" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1291 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1292 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1293 | 0 \ |
| 1294 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1295 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1296 | -c "client hello, adding CID extension" \ |
| 1297 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1298 | -s "Use of CID extension negotiated" \ |
| 1299 | -s "server hello, adding CID extension" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1300 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1301 | # Tests for Encrypt-then-MAC extension |
| 1302 | |
| 1303 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1304 | "$P_SRV debug_level=3 \ |
| 1305 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1306 | "$P_CLI debug_level=3" \ |
| 1307 | 0 \ |
| 1308 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1309 | -s "found encrypt then mac extension" \ |
| 1310 | -s "server hello, adding encrypt then mac extension" \ |
| 1311 | -c "found encrypt_then_mac extension" \ |
| 1312 | -c "using encrypt then mac" \ |
| 1313 | -s "using encrypt then mac" |
| 1314 | |
| 1315 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1316 | "$P_SRV debug_level=3 etm=0 \ |
| 1317 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1318 | "$P_CLI debug_level=3 etm=1" \ |
| 1319 | 0 \ |
| 1320 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1321 | -s "found encrypt then mac extension" \ |
| 1322 | -S "server hello, adding encrypt then mac extension" \ |
| 1323 | -C "found encrypt_then_mac extension" \ |
| 1324 | -C "using encrypt then mac" \ |
| 1325 | -S "using encrypt then mac" |
| 1326 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1327 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1328 | "$P_SRV debug_level=3 etm=1 \ |
| 1329 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1330 | "$P_CLI debug_level=3 etm=1" \ |
| 1331 | 0 \ |
| 1332 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1333 | -s "found encrypt then mac extension" \ |
| 1334 | -S "server hello, adding encrypt then mac extension" \ |
| 1335 | -C "found encrypt_then_mac extension" \ |
| 1336 | -C "using encrypt then mac" \ |
| 1337 | -S "using encrypt then mac" |
| 1338 | |
| 1339 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1340 | "$P_SRV debug_level=3 etm=1 \ |
| 1341 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1342 | "$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] | 1343 | 0 \ |
| 1344 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1345 | -s "found encrypt then mac extension" \ |
| 1346 | -S "server hello, adding encrypt then mac extension" \ |
| 1347 | -C "found encrypt_then_mac extension" \ |
| 1348 | -C "using encrypt then mac" \ |
| 1349 | -S "using encrypt then mac" |
| 1350 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1351 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1352 | "$P_SRV debug_level=3 etm=1 \ |
| 1353 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1354 | "$P_CLI debug_level=3 etm=0" \ |
| 1355 | 0 \ |
| 1356 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1357 | -S "found encrypt then mac extension" \ |
| 1358 | -S "server hello, adding encrypt then mac extension" \ |
| 1359 | -C "found encrypt_then_mac extension" \ |
| 1360 | -C "using encrypt then mac" \ |
| 1361 | -S "using encrypt then mac" |
| 1362 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1363 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1364 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1365 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1366 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1367 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1368 | 0 \ |
| 1369 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1370 | -S "found encrypt then mac extension" \ |
| 1371 | -S "server hello, adding encrypt then mac extension" \ |
| 1372 | -C "found encrypt_then_mac extension" \ |
| 1373 | -C "using encrypt then mac" \ |
| 1374 | -S "using encrypt then mac" |
| 1375 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1376 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1377 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1378 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1379 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1380 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1381 | 0 \ |
| 1382 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1383 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1384 | -S "server hello, adding encrypt then mac extension" \ |
| 1385 | -C "found encrypt_then_mac extension" \ |
| 1386 | -C "using encrypt then mac" \ |
| 1387 | -S "using encrypt then mac" |
| 1388 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1389 | # Tests for Extended Master Secret extension |
| 1390 | |
| 1391 | run_test "Extended Master Secret: default" \ |
| 1392 | "$P_SRV debug_level=3" \ |
| 1393 | "$P_CLI debug_level=3" \ |
| 1394 | 0 \ |
| 1395 | -c "client hello, adding extended_master_secret extension" \ |
| 1396 | -s "found extended master secret extension" \ |
| 1397 | -s "server hello, adding extended master secret extension" \ |
| 1398 | -c "found extended_master_secret extension" \ |
| 1399 | -c "using extended master secret" \ |
| 1400 | -s "using extended master secret" |
| 1401 | |
| 1402 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1403 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1404 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1405 | 0 \ |
| 1406 | -c "client hello, adding extended_master_secret extension" \ |
| 1407 | -s "found extended master secret extension" \ |
| 1408 | -S "server hello, adding extended master secret extension" \ |
| 1409 | -C "found extended_master_secret extension" \ |
| 1410 | -C "using extended master secret" \ |
| 1411 | -S "using extended master secret" |
| 1412 | |
| 1413 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1414 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1415 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1416 | 0 \ |
| 1417 | -C "client hello, adding extended_master_secret extension" \ |
| 1418 | -S "found extended master secret extension" \ |
| 1419 | -S "server hello, adding extended master secret extension" \ |
| 1420 | -C "found extended_master_secret extension" \ |
| 1421 | -C "using extended master secret" \ |
| 1422 | -S "using extended master secret" |
| 1423 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1424 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1425 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1426 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1427 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1428 | 0 \ |
| 1429 | -C "client hello, adding extended_master_secret extension" \ |
| 1430 | -S "found extended master secret extension" \ |
| 1431 | -S "server hello, adding extended master secret extension" \ |
| 1432 | -C "found extended_master_secret extension" \ |
| 1433 | -C "using extended master secret" \ |
| 1434 | -S "using extended master secret" |
| 1435 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1436 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1437 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1438 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1439 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1440 | 0 \ |
| 1441 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1442 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1443 | -S "server hello, adding extended master secret extension" \ |
| 1444 | -C "found extended_master_secret extension" \ |
| 1445 | -C "using extended master secret" \ |
| 1446 | -S "using extended master secret" |
| 1447 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1448 | # Tests for FALLBACK_SCSV |
| 1449 | |
| 1450 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1451 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1452 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1453 | 0 \ |
| 1454 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1455 | -S "received FALLBACK_SCSV" \ |
| 1456 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1457 | -C "is a fatal alert message (msg 86)" |
| 1458 | |
| 1459 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1460 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1461 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1462 | 0 \ |
| 1463 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1464 | -S "received FALLBACK_SCSV" \ |
| 1465 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1466 | -C "is a fatal alert message (msg 86)" |
| 1467 | |
| 1468 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1469 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1470 | "$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] | 1471 | 1 \ |
| 1472 | -c "adding FALLBACK_SCSV" \ |
| 1473 | -s "received FALLBACK_SCSV" \ |
| 1474 | -s "inapropriate fallback" \ |
| 1475 | -c "is a fatal alert message (msg 86)" |
| 1476 | |
| 1477 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1478 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1479 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1480 | 0 \ |
| 1481 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1482 | -s "received FALLBACK_SCSV" \ |
| 1483 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1484 | -C "is a fatal alert message (msg 86)" |
| 1485 | |
| 1486 | requires_openssl_with_fallback_scsv |
| 1487 | run_test "Fallback SCSV: default, openssl server" \ |
| 1488 | "$O_SRV" \ |
| 1489 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1490 | 0 \ |
| 1491 | -C "adding FALLBACK_SCSV" \ |
| 1492 | -C "is a fatal alert message (msg 86)" |
| 1493 | |
| 1494 | requires_openssl_with_fallback_scsv |
| 1495 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1496 | "$O_SRV" \ |
| 1497 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1498 | 1 \ |
| 1499 | -c "adding FALLBACK_SCSV" \ |
| 1500 | -c "is a fatal alert message (msg 86)" |
| 1501 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1502 | requires_openssl_with_fallback_scsv |
| 1503 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1504 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1505 | "$O_CLI -tls1_1" \ |
| 1506 | 0 \ |
| 1507 | -S "received FALLBACK_SCSV" \ |
| 1508 | -S "inapropriate fallback" |
| 1509 | |
| 1510 | requires_openssl_with_fallback_scsv |
| 1511 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1512 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1513 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1514 | 1 \ |
| 1515 | -s "received FALLBACK_SCSV" \ |
| 1516 | -s "inapropriate fallback" |
| 1517 | |
| 1518 | requires_openssl_with_fallback_scsv |
| 1519 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1520 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1521 | "$O_CLI -fallback_scsv" \ |
| 1522 | 0 \ |
| 1523 | -s "received FALLBACK_SCSV" \ |
| 1524 | -S "inapropriate fallback" |
| 1525 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1526 | # Test sending and receiving empty application data records |
| 1527 | |
| 1528 | run_test "Encrypt then MAC: empty application data record" \ |
| 1529 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1530 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1531 | 0 \ |
| 1532 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1533 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1534 | -c "0 bytes written in 1 fragments" |
| 1535 | |
| 1536 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 1537 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1538 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1539 | 0 \ |
| 1540 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1541 | -c "0 bytes written in 1 fragments" |
| 1542 | |
| 1543 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1544 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1545 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1546 | 0 \ |
| 1547 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1548 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1549 | -c "0 bytes written in 1 fragments" |
| 1550 | |
| 1551 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 1552 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1553 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1554 | 0 \ |
| 1555 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1556 | -c "0 bytes written in 1 fragments" |
| 1557 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1558 | ## ClientHello generated with |
| 1559 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1560 | ## then manually twiddling the ciphersuite list. |
| 1561 | ## The ClientHello content is spelled out below as a hex string as |
| 1562 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1563 | ## The expected response is an inappropriate_fallback alert. |
| 1564 | requires_openssl_with_fallback_scsv |
| 1565 | run_test "Fallback SCSV: beginning of list" \ |
| 1566 | "$P_SRV debug_level=2" \ |
| 1567 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1568 | 0 \ |
| 1569 | -s "received FALLBACK_SCSV" \ |
| 1570 | -s "inapropriate fallback" |
| 1571 | |
| 1572 | requires_openssl_with_fallback_scsv |
| 1573 | run_test "Fallback SCSV: end of list" \ |
| 1574 | "$P_SRV debug_level=2" \ |
| 1575 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1576 | 0 \ |
| 1577 | -s "received FALLBACK_SCSV" \ |
| 1578 | -s "inapropriate fallback" |
| 1579 | |
| 1580 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1581 | requires_openssl_with_fallback_scsv |
| 1582 | run_test "Fallback SCSV: not in list" \ |
| 1583 | "$P_SRV debug_level=2" \ |
| 1584 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1585 | 0 \ |
| 1586 | -S "received FALLBACK_SCSV" \ |
| 1587 | -S "inapropriate fallback" |
| 1588 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1589 | # Tests for CBC 1/n-1 record splitting |
| 1590 | |
| 1591 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1592 | "$P_SRV" \ |
| 1593 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1594 | request_size=123 force_version=tls1_2" \ |
| 1595 | 0 \ |
| 1596 | -s "Read from client: 123 bytes read" \ |
| 1597 | -S "Read from client: 1 bytes read" \ |
| 1598 | -S "122 bytes read" |
| 1599 | |
| 1600 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1601 | "$P_SRV" \ |
| 1602 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1603 | request_size=123 force_version=tls1_1" \ |
| 1604 | 0 \ |
| 1605 | -s "Read from client: 123 bytes read" \ |
| 1606 | -S "Read from client: 1 bytes read" \ |
| 1607 | -S "122 bytes read" |
| 1608 | |
| 1609 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1610 | "$P_SRV" \ |
| 1611 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1612 | request_size=123 force_version=tls1" \ |
| 1613 | 0 \ |
| 1614 | -S "Read from client: 123 bytes read" \ |
| 1615 | -s "Read from client: 1 bytes read" \ |
| 1616 | -s "122 bytes read" |
| 1617 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1618 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1619 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1620 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1621 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1622 | request_size=123 force_version=ssl3" \ |
| 1623 | 0 \ |
| 1624 | -S "Read from client: 123 bytes read" \ |
| 1625 | -s "Read from client: 1 bytes read" \ |
| 1626 | -s "122 bytes read" |
| 1627 | |
| 1628 | 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] | 1629 | "$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] | 1630 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1631 | request_size=123 force_version=tls1" \ |
| 1632 | 0 \ |
| 1633 | -s "Read from client: 123 bytes read" \ |
| 1634 | -S "Read from client: 1 bytes read" \ |
| 1635 | -S "122 bytes read" |
| 1636 | |
| 1637 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1638 | "$P_SRV" \ |
| 1639 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1640 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1641 | 0 \ |
| 1642 | -s "Read from client: 123 bytes read" \ |
| 1643 | -S "Read from client: 1 bytes read" \ |
| 1644 | -S "122 bytes read" |
| 1645 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1646 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1647 | "$P_SRV nbio=2" \ |
| 1648 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1649 | request_size=123 force_version=tls1" \ |
| 1650 | 0 \ |
| 1651 | -S "Read from client: 123 bytes read" \ |
| 1652 | -s "Read from client: 1 bytes read" \ |
| 1653 | -s "122 bytes read" |
| 1654 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1655 | # Tests for Session Tickets |
| 1656 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1657 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1658 | "$P_SRV debug_level=3 tickets=1" \ |
| 1659 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1660 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1661 | -c "client hello, adding session ticket extension" \ |
| 1662 | -s "found session ticket extension" \ |
| 1663 | -s "server hello, adding session ticket extension" \ |
| 1664 | -c "found session_ticket extension" \ |
| 1665 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1666 | -S "session successfully restored from cache" \ |
| 1667 | -s "session successfully restored from ticket" \ |
| 1668 | -s "a session has been resumed" \ |
| 1669 | -c "a session has been resumed" |
| 1670 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1671 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1672 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1673 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1674 | 0 \ |
| 1675 | -c "client hello, adding session ticket extension" \ |
| 1676 | -s "found session ticket extension" \ |
| 1677 | -s "server hello, adding session ticket extension" \ |
| 1678 | -c "found session_ticket extension" \ |
| 1679 | -c "parse new session ticket" \ |
| 1680 | -S "session successfully restored from cache" \ |
| 1681 | -s "session successfully restored from ticket" \ |
| 1682 | -s "a session has been resumed" \ |
| 1683 | -c "a session has been resumed" |
| 1684 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1685 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1686 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1687 | "$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] | 1688 | 0 \ |
| 1689 | -c "client hello, adding session ticket extension" \ |
| 1690 | -s "found session ticket extension" \ |
| 1691 | -s "server hello, adding session ticket extension" \ |
| 1692 | -c "found session_ticket extension" \ |
| 1693 | -c "parse new session ticket" \ |
| 1694 | -S "session successfully restored from cache" \ |
| 1695 | -S "session successfully restored from ticket" \ |
| 1696 | -S "a session has been resumed" \ |
| 1697 | -C "a session has been resumed" |
| 1698 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1699 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1700 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1701 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1702 | 0 \ |
| 1703 | -c "client hello, adding session ticket extension" \ |
| 1704 | -c "found session_ticket extension" \ |
| 1705 | -c "parse new session ticket" \ |
| 1706 | -c "a session has been resumed" |
| 1707 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1708 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1709 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1710 | "( $O_CLI -sess_out $SESSION; \ |
| 1711 | $O_CLI -sess_in $SESSION; \ |
| 1712 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1713 | 0 \ |
| 1714 | -s "found session ticket extension" \ |
| 1715 | -s "server hello, adding session ticket extension" \ |
| 1716 | -S "session successfully restored from cache" \ |
| 1717 | -s "session successfully restored from ticket" \ |
| 1718 | -s "a session has been resumed" |
| 1719 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1720 | # Tests for Session Tickets with DTLS |
| 1721 | |
| 1722 | run_test "Session resume using tickets, DTLS: basic" \ |
| 1723 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 1724 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1725 | 0 \ |
| 1726 | -c "client hello, adding session ticket extension" \ |
| 1727 | -s "found session ticket extension" \ |
| 1728 | -s "server hello, adding session ticket extension" \ |
| 1729 | -c "found session_ticket extension" \ |
| 1730 | -c "parse new session ticket" \ |
| 1731 | -S "session successfully restored from cache" \ |
| 1732 | -s "session successfully restored from ticket" \ |
| 1733 | -s "a session has been resumed" \ |
| 1734 | -c "a session has been resumed" |
| 1735 | |
| 1736 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 1737 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 1738 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1739 | 0 \ |
| 1740 | -c "client hello, adding session ticket extension" \ |
| 1741 | -s "found session ticket extension" \ |
| 1742 | -s "server hello, adding session ticket extension" \ |
| 1743 | -c "found session_ticket extension" \ |
| 1744 | -c "parse new session ticket" \ |
| 1745 | -S "session successfully restored from cache" \ |
| 1746 | -s "session successfully restored from ticket" \ |
| 1747 | -s "a session has been resumed" \ |
| 1748 | -c "a session has been resumed" |
| 1749 | |
| 1750 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 1751 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1752 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 1753 | 0 \ |
| 1754 | -c "client hello, adding session ticket extension" \ |
| 1755 | -s "found session ticket extension" \ |
| 1756 | -s "server hello, adding session ticket extension" \ |
| 1757 | -c "found session_ticket extension" \ |
| 1758 | -c "parse new session ticket" \ |
| 1759 | -S "session successfully restored from cache" \ |
| 1760 | -S "session successfully restored from ticket" \ |
| 1761 | -S "a session has been resumed" \ |
| 1762 | -C "a session has been resumed" |
| 1763 | |
| 1764 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 1765 | "$O_SRV -dtls1" \ |
| 1766 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1767 | 0 \ |
| 1768 | -c "client hello, adding session ticket extension" \ |
| 1769 | -c "found session_ticket extension" \ |
| 1770 | -c "parse new session ticket" \ |
| 1771 | -c "a session has been resumed" |
| 1772 | |
| 1773 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 1774 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1775 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1776 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1777 | rm -f $SESSION )" \ |
| 1778 | 0 \ |
| 1779 | -s "found session ticket extension" \ |
| 1780 | -s "server hello, adding session ticket extension" \ |
| 1781 | -S "session successfully restored from cache" \ |
| 1782 | -s "session successfully restored from ticket" \ |
| 1783 | -s "a session has been resumed" |
| 1784 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1785 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1786 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1787 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1788 | "$P_SRV debug_level=3 tickets=0" \ |
| 1789 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1790 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1791 | -c "client hello, adding session ticket extension" \ |
| 1792 | -s "found session ticket extension" \ |
| 1793 | -S "server hello, adding session ticket extension" \ |
| 1794 | -C "found session_ticket extension" \ |
| 1795 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1796 | -s "session successfully restored from cache" \ |
| 1797 | -S "session successfully restored from ticket" \ |
| 1798 | -s "a session has been resumed" \ |
| 1799 | -c "a session has been resumed" |
| 1800 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1801 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1802 | "$P_SRV debug_level=3 tickets=1" \ |
| 1803 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1804 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1805 | -C "client hello, adding session ticket extension" \ |
| 1806 | -S "found session ticket extension" \ |
| 1807 | -S "server hello, adding session ticket extension" \ |
| 1808 | -C "found session_ticket extension" \ |
| 1809 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1810 | -s "session successfully restored from cache" \ |
| 1811 | -S "session successfully restored from ticket" \ |
| 1812 | -s "a session has been resumed" \ |
| 1813 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1814 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1815 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1816 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1817 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1818 | 0 \ |
| 1819 | -S "session successfully restored from cache" \ |
| 1820 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1821 | -S "a session has been resumed" \ |
| 1822 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1824 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1825 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1826 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1827 | 0 \ |
| 1828 | -s "session successfully restored from cache" \ |
| 1829 | -S "session successfully restored from ticket" \ |
| 1830 | -s "a session has been resumed" \ |
| 1831 | -c "a session has been resumed" |
| 1832 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1833 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1834 | "$P_SRV debug_level=3 tickets=0" \ |
| 1835 | "$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] | 1836 | 0 \ |
| 1837 | -s "session successfully restored from cache" \ |
| 1838 | -S "session successfully restored from ticket" \ |
| 1839 | -s "a session has been resumed" \ |
| 1840 | -c "a session has been resumed" |
| 1841 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1842 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1843 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1844 | "$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] | 1845 | 0 \ |
| 1846 | -S "session successfully restored from cache" \ |
| 1847 | -S "session successfully restored from ticket" \ |
| 1848 | -S "a session has been resumed" \ |
| 1849 | -C "a session has been resumed" |
| 1850 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1851 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1852 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1853 | "$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] | 1854 | 0 \ |
| 1855 | -s "session successfully restored from cache" \ |
| 1856 | -S "session successfully restored from ticket" \ |
| 1857 | -s "a session has been resumed" \ |
| 1858 | -c "a session has been resumed" |
| 1859 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1860 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1861 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1862 | "( $O_CLI -sess_out $SESSION; \ |
| 1863 | $O_CLI -sess_in $SESSION; \ |
| 1864 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1865 | 0 \ |
| 1866 | -s "found session ticket extension" \ |
| 1867 | -S "server hello, adding session ticket extension" \ |
| 1868 | -s "session successfully restored from cache" \ |
| 1869 | -S "session successfully restored from ticket" \ |
| 1870 | -s "a session has been resumed" |
| 1871 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1872 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1873 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1874 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1875 | 0 \ |
| 1876 | -C "found session_ticket extension" \ |
| 1877 | -C "parse new session ticket" \ |
| 1878 | -c "a session has been resumed" |
| 1879 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1880 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 1881 | |
| 1882 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 1883 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1884 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1885 | 0 \ |
| 1886 | -c "client hello, adding session ticket extension" \ |
| 1887 | -s "found session ticket extension" \ |
| 1888 | -S "server hello, adding session ticket extension" \ |
| 1889 | -C "found session_ticket extension" \ |
| 1890 | -C "parse new session ticket" \ |
| 1891 | -s "session successfully restored from cache" \ |
| 1892 | -S "session successfully restored from ticket" \ |
| 1893 | -s "a session has been resumed" \ |
| 1894 | -c "a session has been resumed" |
| 1895 | |
| 1896 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 1897 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1898 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1899 | 0 \ |
| 1900 | -C "client hello, adding session ticket extension" \ |
| 1901 | -S "found session ticket extension" \ |
| 1902 | -S "server hello, adding session ticket extension" \ |
| 1903 | -C "found session_ticket extension" \ |
| 1904 | -C "parse new session ticket" \ |
| 1905 | -s "session successfully restored from cache" \ |
| 1906 | -S "session successfully restored from ticket" \ |
| 1907 | -s "a session has been resumed" \ |
| 1908 | -c "a session has been resumed" |
| 1909 | |
| 1910 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 1911 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 1912 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1913 | 0 \ |
| 1914 | -S "session successfully restored from cache" \ |
| 1915 | -S "session successfully restored from ticket" \ |
| 1916 | -S "a session has been resumed" \ |
| 1917 | -C "a session has been resumed" |
| 1918 | |
| 1919 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 1920 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 1921 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1922 | 0 \ |
| 1923 | -s "session successfully restored from cache" \ |
| 1924 | -S "session successfully restored from ticket" \ |
| 1925 | -s "a session has been resumed" \ |
| 1926 | -c "a session has been resumed" |
| 1927 | |
| 1928 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 1929 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1930 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 1931 | 0 \ |
| 1932 | -s "session successfully restored from cache" \ |
| 1933 | -S "session successfully restored from ticket" \ |
| 1934 | -s "a session has been resumed" \ |
| 1935 | -c "a session has been resumed" |
| 1936 | |
| 1937 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 1938 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 1939 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 1940 | 0 \ |
| 1941 | -S "session successfully restored from cache" \ |
| 1942 | -S "session successfully restored from ticket" \ |
| 1943 | -S "a session has been resumed" \ |
| 1944 | -C "a session has been resumed" |
| 1945 | |
| 1946 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 1947 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 1948 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 1949 | 0 \ |
| 1950 | -s "session successfully restored from cache" \ |
| 1951 | -S "session successfully restored from ticket" \ |
| 1952 | -s "a session has been resumed" \ |
| 1953 | -c "a session has been resumed" |
| 1954 | |
| 1955 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 1956 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1957 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1958 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1959 | rm -f $SESSION )" \ |
| 1960 | 0 \ |
| 1961 | -s "found session ticket extension" \ |
| 1962 | -S "server hello, adding session ticket extension" \ |
| 1963 | -s "session successfully restored from cache" \ |
| 1964 | -S "session successfully restored from ticket" \ |
| 1965 | -s "a session has been resumed" |
| 1966 | |
| 1967 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 1968 | "$O_SRV -dtls1" \ |
| 1969 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1970 | 0 \ |
| 1971 | -C "found session_ticket extension" \ |
| 1972 | -C "parse new session ticket" \ |
| 1973 | -c "a session has been resumed" |
| 1974 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1975 | # Tests for Max Fragment Length extension |
| 1976 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1977 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 1978 | 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] | 1979 | exit 1 |
| 1980 | fi |
| 1981 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1982 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 1983 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 1984 | fi |
| 1985 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1986 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1987 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1988 | "$P_SRV debug_level=3" \ |
| 1989 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1990 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1991 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1992 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1993 | -C "client hello, adding max_fragment_length extension" \ |
| 1994 | -S "found max fragment length extension" \ |
| 1995 | -S "server hello, max_fragment_length extension" \ |
| 1996 | -C "found max_fragment_length extension" |
| 1997 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1998 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1999 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2000 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2001 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2002 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2003 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2004 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2005 | -C "client hello, adding max_fragment_length extension" \ |
| 2006 | -S "found max fragment length extension" \ |
| 2007 | -S "server hello, max_fragment_length extension" \ |
| 2008 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2009 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2010 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2011 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2012 | |
| 2013 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2014 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2015 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2016 | "$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] | 2017 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2018 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2019 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2020 | -C "client hello, adding max_fragment_length extension" \ |
| 2021 | -S "found max fragment length extension" \ |
| 2022 | -S "server hello, max_fragment_length extension" \ |
| 2023 | -C "found max_fragment_length extension" \ |
| 2024 | -c "fragment larger than.*maximum " |
| 2025 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2026 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2027 | # (session fragment length will be 16384 regardless of mbedtls |
| 2028 | # content length configuration.) |
| 2029 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2030 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2031 | run_test "Max fragment length: disabled, larger message" \ |
| 2032 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2033 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2034 | 0 \ |
| 2035 | -C "Maximum fragment length is 16384" \ |
| 2036 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2037 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2038 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2039 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2040 | |
| 2041 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2042 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 2043 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2044 | "$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] | 2045 | 1 \ |
| 2046 | -C "Maximum fragment length is 16384" \ |
| 2047 | -S "Maximum fragment length is 16384" \ |
| 2048 | -c "fragment larger than.*maximum " |
| 2049 | |
| 2050 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2051 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2052 | "$P_SRV debug_level=3" \ |
| 2053 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2054 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2055 | -c "Maximum fragment length is 4096" \ |
| 2056 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2057 | -c "client hello, adding max_fragment_length extension" \ |
| 2058 | -s "found max fragment length extension" \ |
| 2059 | -s "server hello, max_fragment_length extension" \ |
| 2060 | -c "found max_fragment_length extension" |
| 2061 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2062 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2063 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2064 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2065 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2066 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2067 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2068 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2069 | -C "client hello, adding max_fragment_length extension" \ |
| 2070 | -S "found max fragment length extension" \ |
| 2071 | -S "server hello, max_fragment_length extension" \ |
| 2072 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2073 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2074 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2075 | requires_gnutls |
| 2076 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2077 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2078 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2079 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2080 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2081 | -c "client hello, adding max_fragment_length extension" \ |
| 2082 | -c "found max_fragment_length extension" |
| 2083 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2084 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2085 | run_test "Max fragment length: client, message just fits" \ |
| 2086 | "$P_SRV debug_level=3" \ |
| 2087 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 2088 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2089 | -c "Maximum fragment length is 2048" \ |
| 2090 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2091 | -c "client hello, adding max_fragment_length extension" \ |
| 2092 | -s "found max fragment length extension" \ |
| 2093 | -s "server hello, max_fragment_length extension" \ |
| 2094 | -c "found max_fragment_length extension" \ |
| 2095 | -c "2048 bytes written in 1 fragments" \ |
| 2096 | -s "2048 bytes read" |
| 2097 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2098 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2099 | run_test "Max fragment length: client, larger message" \ |
| 2100 | "$P_SRV debug_level=3" \ |
| 2101 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 2102 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2103 | -c "Maximum fragment length is 2048" \ |
| 2104 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2105 | -c "client hello, adding max_fragment_length extension" \ |
| 2106 | -s "found max fragment length extension" \ |
| 2107 | -s "server hello, max_fragment_length extension" \ |
| 2108 | -c "found max_fragment_length extension" \ |
| 2109 | -c "2345 bytes written in 2 fragments" \ |
| 2110 | -s "2048 bytes read" \ |
| 2111 | -s "297 bytes read" |
| 2112 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2113 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2114 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2115 | "$P_SRV debug_level=3 dtls=1" \ |
| 2116 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 2117 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2118 | -c "Maximum fragment length is 2048" \ |
| 2119 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2120 | -c "client hello, adding max_fragment_length extension" \ |
| 2121 | -s "found max fragment length extension" \ |
| 2122 | -s "server hello, max_fragment_length extension" \ |
| 2123 | -c "found max_fragment_length extension" \ |
| 2124 | -c "fragment larger than.*maximum" |
| 2125 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2126 | # Tests for renegotiation |
| 2127 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2128 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2129 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2130 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2131 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2132 | 0 \ |
| 2133 | -C "client hello, adding renegotiation extension" \ |
| 2134 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2135 | -S "found renegotiation extension" \ |
| 2136 | -s "server hello, secure renegotiation extension" \ |
| 2137 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2138 | -C "=> renegotiate" \ |
| 2139 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2140 | -S "write hello request" |
| 2141 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2142 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2143 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2144 | "$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] | 2145 | "$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] | 2146 | 0 \ |
| 2147 | -c "client hello, adding renegotiation extension" \ |
| 2148 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2149 | -s "found renegotiation extension" \ |
| 2150 | -s "server hello, secure renegotiation extension" \ |
| 2151 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2152 | -c "=> renegotiate" \ |
| 2153 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2154 | -S "write hello request" |
| 2155 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2156 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2157 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2158 | "$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] | 2159 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2160 | 0 \ |
| 2161 | -c "client hello, adding renegotiation extension" \ |
| 2162 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2163 | -s "found renegotiation extension" \ |
| 2164 | -s "server hello, secure renegotiation extension" \ |
| 2165 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2166 | -c "=> renegotiate" \ |
| 2167 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2168 | -s "write hello request" |
| 2169 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2170 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2171 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2172 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2173 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2174 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2175 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2176 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2177 | 0 \ |
| 2178 | -c "client hello, adding renegotiation extension" \ |
| 2179 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2180 | -s "found renegotiation extension" \ |
| 2181 | -s "server hello, secure renegotiation extension" \ |
| 2182 | -c "found renegotiation extension" \ |
| 2183 | -c "=> renegotiate" \ |
| 2184 | -s "=> renegotiate" \ |
| 2185 | -S "write hello request" \ |
| 2186 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2187 | |
| 2188 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2189 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2190 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2191 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2192 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2193 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2194 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2195 | 0 \ |
| 2196 | -c "client hello, adding renegotiation extension" \ |
| 2197 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2198 | -s "found renegotiation extension" \ |
| 2199 | -s "server hello, secure renegotiation extension" \ |
| 2200 | -c "found renegotiation extension" \ |
| 2201 | -c "=> renegotiate" \ |
| 2202 | -s "=> renegotiate" \ |
| 2203 | -s "write hello request" \ |
| 2204 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2205 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2206 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2207 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2208 | "$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] | 2209 | "$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] | 2210 | 0 \ |
| 2211 | -c "client hello, adding renegotiation extension" \ |
| 2212 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2213 | -s "found renegotiation extension" \ |
| 2214 | -s "server hello, secure renegotiation extension" \ |
| 2215 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2216 | -c "=> renegotiate" \ |
| 2217 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2218 | -s "write hello request" |
| 2219 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2221 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2222 | "$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] | 2223 | "$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] | 2224 | 1 \ |
| 2225 | -c "client hello, adding renegotiation extension" \ |
| 2226 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2227 | -S "found renegotiation extension" \ |
| 2228 | -s "server hello, secure renegotiation extension" \ |
| 2229 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2230 | -c "=> renegotiate" \ |
| 2231 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2232 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 2233 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2234 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2235 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2237 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2238 | "$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] | 2239 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2240 | 0 \ |
| 2241 | -C "client hello, adding renegotiation extension" \ |
| 2242 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2243 | -S "found renegotiation extension" \ |
| 2244 | -s "server hello, secure renegotiation extension" \ |
| 2245 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2246 | -C "=> renegotiate" \ |
| 2247 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2248 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 2249 | -S "SSL - An unexpected message was received from our peer" \ |
| 2250 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2251 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2252 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2253 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2254 | "$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] | 2255 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2256 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2257 | 0 \ |
| 2258 | -C "client hello, adding renegotiation extension" \ |
| 2259 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2260 | -S "found renegotiation extension" \ |
| 2261 | -s "server hello, secure renegotiation extension" \ |
| 2262 | -c "found renegotiation extension" \ |
| 2263 | -C "=> renegotiate" \ |
| 2264 | -S "=> renegotiate" \ |
| 2265 | -s "write hello request" \ |
| 2266 | -S "SSL - An unexpected message was received from our peer" \ |
| 2267 | -S "failed" |
| 2268 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2269 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2270 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2271 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2272 | "$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] | 2273 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2274 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2275 | 0 \ |
| 2276 | -C "client hello, adding renegotiation extension" \ |
| 2277 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2278 | -S "found renegotiation extension" \ |
| 2279 | -s "server hello, secure renegotiation extension" \ |
| 2280 | -c "found renegotiation extension" \ |
| 2281 | -C "=> renegotiate" \ |
| 2282 | -S "=> renegotiate" \ |
| 2283 | -s "write hello request" \ |
| 2284 | -S "SSL - An unexpected message was received from our peer" \ |
| 2285 | -S "failed" |
| 2286 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2287 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2288 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2289 | "$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] | 2290 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2291 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2292 | 0 \ |
| 2293 | -C "client hello, adding renegotiation extension" \ |
| 2294 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2295 | -S "found renegotiation extension" \ |
| 2296 | -s "server hello, secure renegotiation extension" \ |
| 2297 | -c "found renegotiation extension" \ |
| 2298 | -C "=> renegotiate" \ |
| 2299 | -S "=> renegotiate" \ |
| 2300 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2301 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2302 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2303 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2304 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2305 | "$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] | 2306 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2307 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2308 | 0 \ |
| 2309 | -c "client hello, adding renegotiation extension" \ |
| 2310 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2311 | -s "found renegotiation extension" \ |
| 2312 | -s "server hello, secure renegotiation extension" \ |
| 2313 | -c "found renegotiation extension" \ |
| 2314 | -c "=> renegotiate" \ |
| 2315 | -s "=> renegotiate" \ |
| 2316 | -s "write hello request" \ |
| 2317 | -S "SSL - An unexpected message was received from our peer" \ |
| 2318 | -S "failed" |
| 2319 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2320 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2321 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2322 | "$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] | 2323 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2324 | 0 \ |
| 2325 | -C "client hello, adding renegotiation extension" \ |
| 2326 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2327 | -S "found renegotiation extension" \ |
| 2328 | -s "server hello, secure renegotiation extension" \ |
| 2329 | -c "found renegotiation extension" \ |
| 2330 | -S "record counter limit reached: renegotiate" \ |
| 2331 | -C "=> renegotiate" \ |
| 2332 | -S "=> renegotiate" \ |
| 2333 | -S "write hello request" \ |
| 2334 | -S "SSL - An unexpected message was received from our peer" \ |
| 2335 | -S "failed" |
| 2336 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 2337 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2339 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2340 | "$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] | 2341 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2342 | 0 \ |
| 2343 | -c "client hello, adding renegotiation extension" \ |
| 2344 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2345 | -s "found renegotiation extension" \ |
| 2346 | -s "server hello, secure renegotiation extension" \ |
| 2347 | -c "found renegotiation extension" \ |
| 2348 | -s "record counter limit reached: renegotiate" \ |
| 2349 | -c "=> renegotiate" \ |
| 2350 | -s "=> renegotiate" \ |
| 2351 | -s "write hello request" \ |
| 2352 | -S "SSL - An unexpected message was received from our peer" \ |
| 2353 | -S "failed" |
| 2354 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2355 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2356 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2357 | "$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] | 2358 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2359 | 0 \ |
| 2360 | -c "client hello, adding renegotiation extension" \ |
| 2361 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2362 | -s "found renegotiation extension" \ |
| 2363 | -s "server hello, secure renegotiation extension" \ |
| 2364 | -c "found renegotiation extension" \ |
| 2365 | -s "record counter limit reached: renegotiate" \ |
| 2366 | -c "=> renegotiate" \ |
| 2367 | -s "=> renegotiate" \ |
| 2368 | -s "write hello request" \ |
| 2369 | -S "SSL - An unexpected message was received from our peer" \ |
| 2370 | -S "failed" |
| 2371 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2372 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2373 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2374 | "$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] | 2375 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 2376 | 0 \ |
| 2377 | -C "client hello, adding renegotiation extension" \ |
| 2378 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2379 | -S "found renegotiation extension" \ |
| 2380 | -s "server hello, secure renegotiation extension" \ |
| 2381 | -c "found renegotiation extension" \ |
| 2382 | -S "record counter limit reached: renegotiate" \ |
| 2383 | -C "=> renegotiate" \ |
| 2384 | -S "=> renegotiate" \ |
| 2385 | -S "write hello request" \ |
| 2386 | -S "SSL - An unexpected message was received from our peer" \ |
| 2387 | -S "failed" |
| 2388 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2390 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2391 | "$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] | 2392 | "$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] | 2393 | 0 \ |
| 2394 | -c "client hello, adding renegotiation extension" \ |
| 2395 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2396 | -s "found renegotiation extension" \ |
| 2397 | -s "server hello, secure renegotiation extension" \ |
| 2398 | -c "found renegotiation extension" \ |
| 2399 | -c "=> renegotiate" \ |
| 2400 | -s "=> renegotiate" \ |
| 2401 | -S "write hello request" |
| 2402 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2403 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2404 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2405 | "$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] | 2406 | "$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] | 2407 | 0 \ |
| 2408 | -c "client hello, adding renegotiation extension" \ |
| 2409 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2410 | -s "found renegotiation extension" \ |
| 2411 | -s "server hello, secure renegotiation extension" \ |
| 2412 | -c "found renegotiation extension" \ |
| 2413 | -c "=> renegotiate" \ |
| 2414 | -s "=> renegotiate" \ |
| 2415 | -s "write hello request" |
| 2416 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2417 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2418 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2419 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2420 | "$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] | 2421 | 0 \ |
| 2422 | -c "client hello, adding renegotiation extension" \ |
| 2423 | -c "found renegotiation extension" \ |
| 2424 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2425 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2426 | -C "error" \ |
| 2427 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2428 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2429 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2430 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2431 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2432 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2433 | "$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] | 2434 | 0 \ |
| 2435 | -c "client hello, adding renegotiation extension" \ |
| 2436 | -c "found renegotiation extension" \ |
| 2437 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2438 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2439 | -C "error" \ |
| 2440 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2441 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2442 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2443 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2444 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2445 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2446 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2447 | 1 \ |
| 2448 | -c "client hello, adding renegotiation extension" \ |
| 2449 | -C "found renegotiation extension" \ |
| 2450 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2451 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2452 | -c "error" \ |
| 2453 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2454 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2455 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2456 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2457 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2458 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2459 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2460 | allow_legacy=0" \ |
| 2461 | 1 \ |
| 2462 | -c "client hello, adding renegotiation extension" \ |
| 2463 | -C "found renegotiation extension" \ |
| 2464 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2465 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2466 | -c "error" \ |
| 2467 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2468 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2469 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2471 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 2472 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2473 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2474 | allow_legacy=1" \ |
| 2475 | 0 \ |
| 2476 | -c "client hello, adding renegotiation extension" \ |
| 2477 | -C "found renegotiation extension" \ |
| 2478 | -c "=> renegotiate" \ |
| 2479 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2480 | -C "error" \ |
| 2481 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2482 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2483 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2484 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2485 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2486 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2487 | 0 \ |
| 2488 | -c "client hello, adding renegotiation extension" \ |
| 2489 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2490 | -s "found renegotiation extension" \ |
| 2491 | -s "server hello, secure renegotiation extension" \ |
| 2492 | -c "found renegotiation extension" \ |
| 2493 | -c "=> renegotiate" \ |
| 2494 | -s "=> renegotiate" \ |
| 2495 | -S "write hello request" |
| 2496 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2497 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2498 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2499 | "$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] | 2500 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2501 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2502 | 0 \ |
| 2503 | -c "client hello, adding renegotiation extension" \ |
| 2504 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2505 | -s "found renegotiation extension" \ |
| 2506 | -s "server hello, secure renegotiation extension" \ |
| 2507 | -c "found renegotiation extension" \ |
| 2508 | -c "=> renegotiate" \ |
| 2509 | -s "=> renegotiate" \ |
| 2510 | -s "write hello request" |
| 2511 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2512 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2513 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2514 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2515 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2516 | 0 \ |
| 2517 | -c "client hello, adding renegotiation extension" \ |
| 2518 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2519 | -s "found renegotiation extension" \ |
| 2520 | -s "server hello, secure renegotiation extension" \ |
| 2521 | -s "record counter limit reached: renegotiate" \ |
| 2522 | -c "=> renegotiate" \ |
| 2523 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2524 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2525 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2526 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2527 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2528 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2529 | "$G_SRV -u --mtu 4096" \ |
| 2530 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2531 | 0 \ |
| 2532 | -c "client hello, adding renegotiation extension" \ |
| 2533 | -c "found renegotiation extension" \ |
| 2534 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2535 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2536 | -C "error" \ |
| 2537 | -s "Extra-header:" |
| 2538 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2539 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2540 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2541 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2542 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2543 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2544 | "$P_CLI debug_level=3" \ |
| 2545 | 0 \ |
| 2546 | -c "found renegotiation extension" \ |
| 2547 | -C "error" \ |
| 2548 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2549 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2550 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2551 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2552 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2553 | "$P_CLI debug_level=3" \ |
| 2554 | 0 \ |
| 2555 | -C "found renegotiation extension" \ |
| 2556 | -C "error" \ |
| 2557 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2558 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2559 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2560 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2561 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2562 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2563 | 1 \ |
| 2564 | -C "found renegotiation extension" \ |
| 2565 | -c "error" \ |
| 2566 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2567 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2568 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2569 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2570 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2571 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2572 | 0 \ |
| 2573 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2574 | -s "server hello, secure renegotiation extension" |
| 2575 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2576 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2577 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2578 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2579 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2580 | 0 \ |
| 2581 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2582 | -S "server hello, secure renegotiation extension" |
| 2583 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2584 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2585 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2586 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2587 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2588 | 1 \ |
| 2589 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2590 | -S "server hello, secure renegotiation extension" |
| 2591 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2592 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2593 | |
| 2594 | requires_gnutls |
| 2595 | run_test "DER format: no trailing bytes" \ |
| 2596 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2597 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2598 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2599 | 0 \ |
| 2600 | -c "Handshake was completed" \ |
| 2601 | |
| 2602 | requires_gnutls |
| 2603 | run_test "DER format: with a trailing zero byte" \ |
| 2604 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2605 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2606 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2607 | 0 \ |
| 2608 | -c "Handshake was completed" \ |
| 2609 | |
| 2610 | requires_gnutls |
| 2611 | run_test "DER format: with a trailing random byte" \ |
| 2612 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2613 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2614 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2615 | 0 \ |
| 2616 | -c "Handshake was completed" \ |
| 2617 | |
| 2618 | requires_gnutls |
| 2619 | run_test "DER format: with 2 trailing random bytes" \ |
| 2620 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2621 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2622 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2623 | 0 \ |
| 2624 | -c "Handshake was completed" \ |
| 2625 | |
| 2626 | requires_gnutls |
| 2627 | run_test "DER format: with 4 trailing random bytes" \ |
| 2628 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2629 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2630 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2631 | 0 \ |
| 2632 | -c "Handshake was completed" \ |
| 2633 | |
| 2634 | requires_gnutls |
| 2635 | run_test "DER format: with 8 trailing random bytes" \ |
| 2636 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2637 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2638 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2639 | 0 \ |
| 2640 | -c "Handshake was completed" \ |
| 2641 | |
| 2642 | requires_gnutls |
| 2643 | run_test "DER format: with 9 trailing random bytes" \ |
| 2644 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2645 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2646 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2647 | 0 \ |
| 2648 | -c "Handshake was completed" \ |
| 2649 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2650 | # Tests for auth_mode |
| 2651 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2652 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2653 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2654 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2655 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2656 | 1 \ |
| 2657 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2658 | -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] | 2659 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2660 | -c "X509 - Certificate verification failed" |
| 2661 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2662 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2663 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2664 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2665 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2666 | 0 \ |
| 2667 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2668 | -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] | 2669 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2670 | -C "X509 - Certificate verification failed" |
| 2671 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2672 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2673 | "$P_SRV" \ |
| 2674 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2675 | 0 \ |
| 2676 | -c "x509_verify_cert() returned" \ |
| 2677 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2678 | -c "! Certificate verification flags"\ |
| 2679 | -C "! mbedtls_ssl_handshake returned" \ |
| 2680 | -C "X509 - Certificate verification failed" \ |
| 2681 | -C "SSL - No CA Chain is set, but required to operate" |
| 2682 | |
| 2683 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2684 | "$P_SRV" \ |
| 2685 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2686 | 1 \ |
| 2687 | -c "x509_verify_cert() returned" \ |
| 2688 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2689 | -c "! Certificate verification flags"\ |
| 2690 | -c "! mbedtls_ssl_handshake returned" \ |
| 2691 | -c "SSL - No CA Chain is set, but required to operate" |
| 2692 | |
| 2693 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2694 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2695 | # the client informs the server about the supported curves - it does, though, in the |
| 2696 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2697 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2698 | # different means to have the server ignoring the client's supported curve list. |
| 2699 | |
| 2700 | requires_config_enabled MBEDTLS_ECP_C |
| 2701 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2702 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2703 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2704 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2705 | 1 \ |
| 2706 | -c "bad certificate (EC key curve)"\ |
| 2707 | -c "! Certificate verification flags"\ |
| 2708 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2709 | |
| 2710 | requires_config_enabled MBEDTLS_ECP_C |
| 2711 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2712 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2713 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2714 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2715 | 1 \ |
| 2716 | -c "bad certificate (EC key curve)"\ |
| 2717 | -c "! Certificate verification flags"\ |
| 2718 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2719 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2720 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2721 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2722 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2723 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2724 | 0 \ |
| 2725 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2726 | -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] | 2727 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2728 | -C "X509 - Certificate verification failed" |
| 2729 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2730 | run_test "Authentication: client SHA256, server required" \ |
| 2731 | "$P_SRV auth_mode=required" \ |
| 2732 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2733 | key_file=data_files/server6.key \ |
| 2734 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2735 | 0 \ |
| 2736 | -c "Supported Signature Algorithm found: 4," \ |
| 2737 | -c "Supported Signature Algorithm found: 5," |
| 2738 | |
| 2739 | run_test "Authentication: client SHA384, server required" \ |
| 2740 | "$P_SRV auth_mode=required" \ |
| 2741 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2742 | key_file=data_files/server6.key \ |
| 2743 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2744 | 0 \ |
| 2745 | -c "Supported Signature Algorithm found: 4," \ |
| 2746 | -c "Supported Signature Algorithm found: 5," |
| 2747 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2748 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2749 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2750 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2751 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2752 | key_file=data_files/server5.key" \ |
| 2753 | 1 \ |
| 2754 | -S "skip write certificate request" \ |
| 2755 | -C "skip parse certificate request" \ |
| 2756 | -c "got a certificate request" \ |
| 2757 | -c "got no certificate to send" \ |
| 2758 | -S "x509_verify_cert() returned" \ |
| 2759 | -s "client has no certificate" \ |
| 2760 | -s "! mbedtls_ssl_handshake returned" \ |
| 2761 | -c "! mbedtls_ssl_handshake returned" \ |
| 2762 | -s "No client certification received from the client, but required by the authentication mode" |
| 2763 | |
| 2764 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2765 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2766 | "$P_CLI debug_level=3 crt_file=none \ |
| 2767 | key_file=data_files/server5.key" \ |
| 2768 | 1 \ |
| 2769 | -S "skip write certificate request" \ |
| 2770 | -C "skip parse certificate request" \ |
| 2771 | -c "got a certificate request" \ |
| 2772 | -c "= write certificate$" \ |
| 2773 | -C "skip write certificate$" \ |
| 2774 | -S "x509_verify_cert() returned" \ |
| 2775 | -s "client has no certificate" \ |
| 2776 | -s "! mbedtls_ssl_handshake returned" \ |
| 2777 | -c "! mbedtls_ssl_handshake returned" \ |
| 2778 | -s "No client certification received from the client, but required by the authentication mode" |
| 2779 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2780 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2781 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2782 | "$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] | 2783 | key_file=data_files/server5.key" \ |
| 2784 | 1 \ |
| 2785 | -S "skip write certificate request" \ |
| 2786 | -C "skip parse certificate request" \ |
| 2787 | -c "got a certificate request" \ |
| 2788 | -C "skip write certificate" \ |
| 2789 | -C "skip write certificate verify" \ |
| 2790 | -S "skip parse certificate verify" \ |
| 2791 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2792 | -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] | 2793 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2794 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2795 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2796 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2797 | # We don't check that the client receives the alert because it might |
| 2798 | # detect that its write end of the connection is closed and abort |
| 2799 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2800 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2801 | run_test "Authentication: client cert not trusted, server required" \ |
| 2802 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2803 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2804 | key_file=data_files/server5.key" \ |
| 2805 | 1 \ |
| 2806 | -S "skip write certificate request" \ |
| 2807 | -C "skip parse certificate request" \ |
| 2808 | -c "got a certificate request" \ |
| 2809 | -C "skip write certificate" \ |
| 2810 | -C "skip write certificate verify" \ |
| 2811 | -S "skip parse certificate verify" \ |
| 2812 | -s "x509_verify_cert() returned" \ |
| 2813 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2814 | -s "! mbedtls_ssl_handshake returned" \ |
| 2815 | -c "! mbedtls_ssl_handshake returned" \ |
| 2816 | -s "X509 - Certificate verification failed" |
| 2817 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2818 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2819 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2820 | "$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] | 2821 | key_file=data_files/server5.key" \ |
| 2822 | 0 \ |
| 2823 | -S "skip write certificate request" \ |
| 2824 | -C "skip parse certificate request" \ |
| 2825 | -c "got a certificate request" \ |
| 2826 | -C "skip write certificate" \ |
| 2827 | -C "skip write certificate verify" \ |
| 2828 | -S "skip parse certificate verify" \ |
| 2829 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2830 | -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] | 2831 | -S "! mbedtls_ssl_handshake returned" \ |
| 2832 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2833 | -S "X509 - Certificate verification failed" |
| 2834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2835 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2836 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2837 | "$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] | 2838 | key_file=data_files/server5.key" \ |
| 2839 | 0 \ |
| 2840 | -s "skip write certificate request" \ |
| 2841 | -C "skip parse certificate request" \ |
| 2842 | -c "got no certificate request" \ |
| 2843 | -c "skip write certificate" \ |
| 2844 | -c "skip write certificate verify" \ |
| 2845 | -s "skip parse certificate verify" \ |
| 2846 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2847 | -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] | 2848 | -S "! mbedtls_ssl_handshake returned" \ |
| 2849 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2850 | -S "X509 - Certificate verification failed" |
| 2851 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2852 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2853 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2854 | "$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] | 2855 | 0 \ |
| 2856 | -S "skip write certificate request" \ |
| 2857 | -C "skip parse certificate request" \ |
| 2858 | -c "got a certificate request" \ |
| 2859 | -C "skip write certificate$" \ |
| 2860 | -C "got no certificate to send" \ |
| 2861 | -S "SSLv3 client has no certificate" \ |
| 2862 | -c "skip write certificate verify" \ |
| 2863 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2864 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2865 | -S "! mbedtls_ssl_handshake returned" \ |
| 2866 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2867 | -S "X509 - Certificate verification failed" |
| 2868 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2869 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2870 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2871 | "$O_CLI" \ |
| 2872 | 0 \ |
| 2873 | -S "skip write certificate request" \ |
| 2874 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2875 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2876 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2877 | -S "X509 - Certificate verification failed" |
| 2878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2879 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2880 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2881 | "$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] | 2882 | 0 \ |
| 2883 | -C "skip parse certificate request" \ |
| 2884 | -c "got a certificate request" \ |
| 2885 | -C "skip write certificate$" \ |
| 2886 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2887 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2888 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2889 | run_test "Authentication: client no cert, openssl server required" \ |
| 2890 | "$O_SRV -Verify 10" \ |
| 2891 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2892 | 1 \ |
| 2893 | -C "skip parse certificate request" \ |
| 2894 | -c "got a certificate request" \ |
| 2895 | -C "skip write certificate$" \ |
| 2896 | -c "skip write certificate verify" \ |
| 2897 | -c "! mbedtls_ssl_handshake returned" |
| 2898 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2899 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2900 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2901 | "$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] | 2902 | "$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] | 2903 | 0 \ |
| 2904 | -S "skip write certificate request" \ |
| 2905 | -C "skip parse certificate request" \ |
| 2906 | -c "got a certificate request" \ |
| 2907 | -C "skip write certificate$" \ |
| 2908 | -c "skip write certificate verify" \ |
| 2909 | -c "got no certificate to send" \ |
| 2910 | -s "SSLv3 client has no certificate" \ |
| 2911 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2912 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2913 | -S "! mbedtls_ssl_handshake returned" \ |
| 2914 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2915 | -S "X509 - Certificate verification failed" |
| 2916 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2917 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 2918 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2919 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2920 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2921 | 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] | 2922 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2923 | 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] | 2924 | 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] | 2925 | 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] | 2926 | printf "test value of ${MAX_IM_CA}. \n" |
| 2927 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2928 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 2929 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2930 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2931 | |
| 2932 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2933 | fi |
| 2934 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2935 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2936 | run_test "Authentication: server max_int chain, client default" \ |
| 2937 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2938 | key_file=data_files/dir-maxpath/09.key" \ |
| 2939 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2940 | 0 \ |
| 2941 | -C "X509 - A fatal error occured" |
| 2942 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2943 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2944 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2945 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2946 | key_file=data_files/dir-maxpath/10.key" \ |
| 2947 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2948 | 1 \ |
| 2949 | -c "X509 - A fatal error occured" |
| 2950 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2951 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2952 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2953 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2954 | key_file=data_files/dir-maxpath/10.key" \ |
| 2955 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2956 | auth_mode=optional" \ |
| 2957 | 1 \ |
| 2958 | -c "X509 - A fatal error occured" |
| 2959 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2960 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2961 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2962 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2963 | key_file=data_files/dir-maxpath/10.key" \ |
| 2964 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2965 | auth_mode=none" \ |
| 2966 | 0 \ |
| 2967 | -C "X509 - A fatal error occured" |
| 2968 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2969 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2970 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2971 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2972 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2973 | key_file=data_files/dir-maxpath/10.key" \ |
| 2974 | 0 \ |
| 2975 | -S "X509 - A fatal error occured" |
| 2976 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2977 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2978 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2979 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2980 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2981 | key_file=data_files/dir-maxpath/10.key" \ |
| 2982 | 1 \ |
| 2983 | -s "X509 - A fatal error occured" |
| 2984 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2985 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2986 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2987 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2988 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2989 | key_file=data_files/dir-maxpath/10.key" \ |
| 2990 | 1 \ |
| 2991 | -s "X509 - A fatal error occured" |
| 2992 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2993 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2994 | run_test "Authentication: client max_int chain, server required" \ |
| 2995 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2996 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2997 | key_file=data_files/dir-maxpath/09.key" \ |
| 2998 | 0 \ |
| 2999 | -S "X509 - A fatal error occured" |
| 3000 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3001 | # Tests for CA list in CertificateRequest messages |
| 3002 | |
| 3003 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3004 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3005 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3006 | key_file=data_files/server6.key" \ |
| 3007 | 0 \ |
| 3008 | -s "requested DN" |
| 3009 | |
| 3010 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3011 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3012 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3013 | key_file=data_files/server6.key" \ |
| 3014 | 0 \ |
| 3015 | -S "requested DN" |
| 3016 | |
| 3017 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 3018 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3019 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3020 | key_file=data_files/server5.key" \ |
| 3021 | 1 \ |
| 3022 | -S "requested DN" \ |
| 3023 | -s "x509_verify_cert() returned" \ |
| 3024 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3025 | -s "! mbedtls_ssl_handshake returned" \ |
| 3026 | -c "! mbedtls_ssl_handshake returned" \ |
| 3027 | -s "X509 - Certificate verification failed" |
| 3028 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3029 | # Tests for certificate selection based on SHA verson |
| 3030 | |
| 3031 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 3032 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3033 | key_file=data_files/server5.key \ |
| 3034 | crt_file2=data_files/server5-sha1.crt \ |
| 3035 | key_file2=data_files/server5.key" \ |
| 3036 | "$P_CLI force_version=tls1_2" \ |
| 3037 | 0 \ |
| 3038 | -c "signed using.*ECDSA with SHA256" \ |
| 3039 | -C "signed using.*ECDSA with SHA1" |
| 3040 | |
| 3041 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 3042 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3043 | key_file=data_files/server5.key \ |
| 3044 | crt_file2=data_files/server5-sha1.crt \ |
| 3045 | key_file2=data_files/server5.key" \ |
| 3046 | "$P_CLI force_version=tls1_1" \ |
| 3047 | 0 \ |
| 3048 | -C "signed using.*ECDSA with SHA256" \ |
| 3049 | -c "signed using.*ECDSA with SHA1" |
| 3050 | |
| 3051 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 3052 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3053 | key_file=data_files/server5.key \ |
| 3054 | crt_file2=data_files/server5-sha1.crt \ |
| 3055 | key_file2=data_files/server5.key" \ |
| 3056 | "$P_CLI force_version=tls1" \ |
| 3057 | 0 \ |
| 3058 | -C "signed using.*ECDSA with SHA256" \ |
| 3059 | -c "signed using.*ECDSA with SHA1" |
| 3060 | |
| 3061 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 3062 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3063 | key_file=data_files/server5.key \ |
| 3064 | crt_file2=data_files/server6.crt \ |
| 3065 | key_file2=data_files/server6.key" \ |
| 3066 | "$P_CLI force_version=tls1_1" \ |
| 3067 | 0 \ |
| 3068 | -c "serial number.*09" \ |
| 3069 | -c "signed using.*ECDSA with SHA256" \ |
| 3070 | -C "signed using.*ECDSA with SHA1" |
| 3071 | |
| 3072 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 3073 | "$P_SRV crt_file=data_files/server6.crt \ |
| 3074 | key_file=data_files/server6.key \ |
| 3075 | crt_file2=data_files/server5.crt \ |
| 3076 | key_file2=data_files/server5.key" \ |
| 3077 | "$P_CLI force_version=tls1_1" \ |
| 3078 | 0 \ |
| 3079 | -c "serial number.*0A" \ |
| 3080 | -c "signed using.*ECDSA with SHA256" \ |
| 3081 | -C "signed using.*ECDSA with SHA1" |
| 3082 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3083 | # tests for SNI |
| 3084 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3085 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3086 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3087 | 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] | 3088 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3089 | 0 \ |
| 3090 | -S "parse ServerName extension" \ |
| 3091 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3092 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3093 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3094 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3095 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3096 | 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] | 3097 | 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] | 3098 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3099 | 0 \ |
| 3100 | -s "parse ServerName extension" \ |
| 3101 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3102 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3103 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3104 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3105 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3106 | 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] | 3107 | 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] | 3108 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3109 | 0 \ |
| 3110 | -s "parse ServerName extension" \ |
| 3111 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3112 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3113 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3114 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3115 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3116 | 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] | 3117 | 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] | 3118 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3119 | 1 \ |
| 3120 | -s "parse ServerName extension" \ |
| 3121 | -s "ssl_sni_wrapper() returned" \ |
| 3122 | -s "mbedtls_ssl_handshake returned" \ |
| 3123 | -c "mbedtls_ssl_handshake returned" \ |
| 3124 | -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] | 3125 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3126 | run_test "SNI: client auth no override: optional" \ |
| 3127 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3128 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3129 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3130 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3131 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3132 | -S "skip write certificate request" \ |
| 3133 | -C "skip parse certificate request" \ |
| 3134 | -c "got a certificate request" \ |
| 3135 | -C "skip write certificate" \ |
| 3136 | -C "skip write certificate verify" \ |
| 3137 | -S "skip parse certificate verify" |
| 3138 | |
| 3139 | run_test "SNI: client auth override: none -> optional" \ |
| 3140 | "$P_SRV debug_level=3 auth_mode=none \ |
| 3141 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3142 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3143 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3144 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3145 | -S "skip write certificate request" \ |
| 3146 | -C "skip parse certificate request" \ |
| 3147 | -c "got a certificate request" \ |
| 3148 | -C "skip write certificate" \ |
| 3149 | -C "skip write certificate verify" \ |
| 3150 | -S "skip parse certificate verify" |
| 3151 | |
| 3152 | run_test "SNI: client auth override: optional -> none" \ |
| 3153 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3154 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3155 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3156 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3157 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3158 | -s "skip write certificate request" \ |
| 3159 | -C "skip parse certificate request" \ |
| 3160 | -c "got no certificate request" \ |
| 3161 | -c "skip write certificate" \ |
| 3162 | -c "skip write certificate verify" \ |
| 3163 | -s "skip parse certificate verify" |
| 3164 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3165 | run_test "SNI: CA no override" \ |
| 3166 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3167 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3168 | ca_file=data_files/test-ca.crt \ |
| 3169 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3170 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3171 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3172 | 1 \ |
| 3173 | -S "skip write certificate request" \ |
| 3174 | -C "skip parse certificate request" \ |
| 3175 | -c "got a certificate request" \ |
| 3176 | -C "skip write certificate" \ |
| 3177 | -C "skip write certificate verify" \ |
| 3178 | -S "skip parse certificate verify" \ |
| 3179 | -s "x509_verify_cert() returned" \ |
| 3180 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3181 | -S "The certificate has been revoked (is on a CRL)" |
| 3182 | |
| 3183 | run_test "SNI: CA override" \ |
| 3184 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3185 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3186 | ca_file=data_files/test-ca.crt \ |
| 3187 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3188 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3189 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3190 | 0 \ |
| 3191 | -S "skip write certificate request" \ |
| 3192 | -C "skip parse certificate request" \ |
| 3193 | -c "got a certificate request" \ |
| 3194 | -C "skip write certificate" \ |
| 3195 | -C "skip write certificate verify" \ |
| 3196 | -S "skip parse certificate verify" \ |
| 3197 | -S "x509_verify_cert() returned" \ |
| 3198 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3199 | -S "The certificate has been revoked (is on a CRL)" |
| 3200 | |
| 3201 | run_test "SNI: CA override with CRL" \ |
| 3202 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3203 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3204 | ca_file=data_files/test-ca.crt \ |
| 3205 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3206 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3207 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3208 | 1 \ |
| 3209 | -S "skip write certificate request" \ |
| 3210 | -C "skip parse certificate request" \ |
| 3211 | -c "got a certificate request" \ |
| 3212 | -C "skip write certificate" \ |
| 3213 | -C "skip write certificate verify" \ |
| 3214 | -S "skip parse certificate verify" \ |
| 3215 | -s "x509_verify_cert() returned" \ |
| 3216 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3217 | -s "The certificate has been revoked (is on a CRL)" |
| 3218 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3219 | # Tests for SNI and DTLS |
| 3220 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3221 | run_test "SNI: DTLS, no SNI callback" \ |
| 3222 | "$P_SRV debug_level=3 dtls=1 \ |
| 3223 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 3224 | "$P_CLI server_name=localhost dtls=1" \ |
| 3225 | 0 \ |
| 3226 | -S "parse ServerName extension" \ |
| 3227 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3228 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3229 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3230 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3231 | "$P_SRV debug_level=3 dtls=1 \ |
| 3232 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3233 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3234 | "$P_CLI server_name=localhost dtls=1" \ |
| 3235 | 0 \ |
| 3236 | -s "parse ServerName extension" \ |
| 3237 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3238 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3239 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3240 | run_test "SNI: DTLS, matching cert 2" \ |
| 3241 | "$P_SRV debug_level=3 dtls=1 \ |
| 3242 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3243 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3244 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 3245 | 0 \ |
| 3246 | -s "parse ServerName extension" \ |
| 3247 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3248 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 3249 | |
| 3250 | run_test "SNI: DTLS, no matching cert" \ |
| 3251 | "$P_SRV debug_level=3 dtls=1 \ |
| 3252 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3253 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3254 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 3255 | 1 \ |
| 3256 | -s "parse ServerName extension" \ |
| 3257 | -s "ssl_sni_wrapper() returned" \ |
| 3258 | -s "mbedtls_ssl_handshake returned" \ |
| 3259 | -c "mbedtls_ssl_handshake returned" \ |
| 3260 | -c "SSL - A fatal alert message was received from our peer" |
| 3261 | |
| 3262 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 3263 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3264 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3265 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3266 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3267 | 0 \ |
| 3268 | -S "skip write certificate request" \ |
| 3269 | -C "skip parse certificate request" \ |
| 3270 | -c "got a certificate request" \ |
| 3271 | -C "skip write certificate" \ |
| 3272 | -C "skip write certificate verify" \ |
| 3273 | -S "skip parse certificate verify" |
| 3274 | |
| 3275 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 3276 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 3277 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3278 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3279 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3280 | 0 \ |
| 3281 | -S "skip write certificate request" \ |
| 3282 | -C "skip parse certificate request" \ |
| 3283 | -c "got a certificate request" \ |
| 3284 | -C "skip write certificate" \ |
| 3285 | -C "skip write certificate verify" \ |
| 3286 | -S "skip parse certificate verify" |
| 3287 | |
| 3288 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 3289 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3290 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3291 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3292 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3293 | 0 \ |
| 3294 | -s "skip write certificate request" \ |
| 3295 | -C "skip parse certificate request" \ |
| 3296 | -c "got no certificate request" \ |
| 3297 | -c "skip write certificate" \ |
| 3298 | -c "skip write certificate verify" \ |
| 3299 | -s "skip parse certificate verify" |
| 3300 | |
| 3301 | run_test "SNI: DTLS, CA no override" \ |
| 3302 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3303 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3304 | ca_file=data_files/test-ca.crt \ |
| 3305 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3306 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3307 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3308 | 1 \ |
| 3309 | -S "skip write certificate request" \ |
| 3310 | -C "skip parse certificate request" \ |
| 3311 | -c "got a certificate request" \ |
| 3312 | -C "skip write certificate" \ |
| 3313 | -C "skip write certificate verify" \ |
| 3314 | -S "skip parse certificate verify" \ |
| 3315 | -s "x509_verify_cert() returned" \ |
| 3316 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3317 | -S "The certificate has been revoked (is on a CRL)" |
| 3318 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3319 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3320 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3321 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3322 | ca_file=data_files/test-ca.crt \ |
| 3323 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3324 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3325 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3326 | 0 \ |
| 3327 | -S "skip write certificate request" \ |
| 3328 | -C "skip parse certificate request" \ |
| 3329 | -c "got a certificate request" \ |
| 3330 | -C "skip write certificate" \ |
| 3331 | -C "skip write certificate verify" \ |
| 3332 | -S "skip parse certificate verify" \ |
| 3333 | -S "x509_verify_cert() returned" \ |
| 3334 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3335 | -S "The certificate has been revoked (is on a CRL)" |
| 3336 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3337 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3338 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3339 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 3340 | ca_file=data_files/test-ca.crt \ |
| 3341 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3342 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3343 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3344 | 1 \ |
| 3345 | -S "skip write certificate request" \ |
| 3346 | -C "skip parse certificate request" \ |
| 3347 | -c "got a certificate request" \ |
| 3348 | -C "skip write certificate" \ |
| 3349 | -C "skip write certificate verify" \ |
| 3350 | -S "skip parse certificate verify" \ |
| 3351 | -s "x509_verify_cert() returned" \ |
| 3352 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3353 | -s "The certificate has been revoked (is on a CRL)" |
| 3354 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3355 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 3356 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3357 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3358 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3359 | "$P_CLI nbio=2 tickets=0" \ |
| 3360 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3361 | -S "mbedtls_ssl_handshake returned" \ |
| 3362 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3363 | -c "Read from server: .* bytes read" |
| 3364 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3365 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3366 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 3367 | "$P_CLI nbio=2 tickets=0" \ |
| 3368 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3369 | -S "mbedtls_ssl_handshake returned" \ |
| 3370 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3371 | -c "Read from server: .* bytes read" |
| 3372 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3373 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3374 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3375 | "$P_CLI nbio=2 tickets=1" \ |
| 3376 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3377 | -S "mbedtls_ssl_handshake returned" \ |
| 3378 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3379 | -c "Read from server: .* bytes read" |
| 3380 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3381 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3382 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3383 | "$P_CLI nbio=2 tickets=1" \ |
| 3384 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3385 | -S "mbedtls_ssl_handshake returned" \ |
| 3386 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3387 | -c "Read from server: .* bytes read" |
| 3388 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3389 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3390 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3391 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3392 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3393 | -S "mbedtls_ssl_handshake returned" \ |
| 3394 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3395 | -c "Read from server: .* bytes read" |
| 3396 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3397 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3398 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3399 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3400 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3401 | -S "mbedtls_ssl_handshake returned" \ |
| 3402 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3403 | -c "Read from server: .* bytes read" |
| 3404 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3405 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3406 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3407 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 3408 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3409 | -S "mbedtls_ssl_handshake returned" \ |
| 3410 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3411 | -c "Read from server: .* bytes read" |
| 3412 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3413 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 3414 | |
| 3415 | run_test "Event-driven I/O: basic handshake" \ |
| 3416 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3417 | "$P_CLI event=1 tickets=0" \ |
| 3418 | 0 \ |
| 3419 | -S "mbedtls_ssl_handshake returned" \ |
| 3420 | -C "mbedtls_ssl_handshake returned" \ |
| 3421 | -c "Read from server: .* bytes read" |
| 3422 | |
| 3423 | run_test "Event-driven I/O: client auth" \ |
| 3424 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 3425 | "$P_CLI event=1 tickets=0" \ |
| 3426 | 0 \ |
| 3427 | -S "mbedtls_ssl_handshake returned" \ |
| 3428 | -C "mbedtls_ssl_handshake returned" \ |
| 3429 | -c "Read from server: .* bytes read" |
| 3430 | |
| 3431 | run_test "Event-driven I/O: ticket" \ |
| 3432 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3433 | "$P_CLI event=1 tickets=1" \ |
| 3434 | 0 \ |
| 3435 | -S "mbedtls_ssl_handshake returned" \ |
| 3436 | -C "mbedtls_ssl_handshake returned" \ |
| 3437 | -c "Read from server: .* bytes read" |
| 3438 | |
| 3439 | run_test "Event-driven I/O: ticket + client auth" \ |
| 3440 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3441 | "$P_CLI event=1 tickets=1" \ |
| 3442 | 0 \ |
| 3443 | -S "mbedtls_ssl_handshake returned" \ |
| 3444 | -C "mbedtls_ssl_handshake returned" \ |
| 3445 | -c "Read from server: .* bytes read" |
| 3446 | |
| 3447 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 3448 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3449 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3450 | 0 \ |
| 3451 | -S "mbedtls_ssl_handshake returned" \ |
| 3452 | -C "mbedtls_ssl_handshake returned" \ |
| 3453 | -c "Read from server: .* bytes read" |
| 3454 | |
| 3455 | run_test "Event-driven I/O: ticket + resume" \ |
| 3456 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3457 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3458 | 0 \ |
| 3459 | -S "mbedtls_ssl_handshake returned" \ |
| 3460 | -C "mbedtls_ssl_handshake returned" \ |
| 3461 | -c "Read from server: .* bytes read" |
| 3462 | |
| 3463 | run_test "Event-driven I/O: session-id resume" \ |
| 3464 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3465 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 3466 | 0 \ |
| 3467 | -S "mbedtls_ssl_handshake returned" \ |
| 3468 | -C "mbedtls_ssl_handshake returned" \ |
| 3469 | -c "Read from server: .* bytes read" |
| 3470 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3471 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 3472 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3473 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3474 | 0 \ |
| 3475 | -c "Read from server: .* bytes read" |
| 3476 | |
| 3477 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 3478 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3479 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3480 | 0 \ |
| 3481 | -c "Read from server: .* bytes read" |
| 3482 | |
| 3483 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 3484 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3485 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3486 | 0 \ |
| 3487 | -c "Read from server: .* bytes read" |
| 3488 | |
| 3489 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 3490 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3491 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3492 | 0 \ |
| 3493 | -c "Read from server: .* bytes read" |
| 3494 | |
| 3495 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 3496 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3497 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3498 | 0 \ |
| 3499 | -c "Read from server: .* bytes read" |
| 3500 | |
| 3501 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 3502 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3503 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3504 | 0 \ |
| 3505 | -c "Read from server: .* bytes read" |
| 3506 | |
| 3507 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 3508 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3509 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3510 | 0 \ |
| 3511 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3512 | |
| 3513 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3514 | # During session resumption, the client will send its ApplicationData record |
| 3515 | # within the same datagram as the Finished messages. In this situation, the |
| 3516 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3517 | # because the ApplicationData request has already been queued internally. |
| 3518 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3519 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3520 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3521 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3522 | 0 \ |
| 3523 | -c "Read from server: .* bytes read" |
| 3524 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3525 | # Tests for version negotiation |
| 3526 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3527 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3528 | "$P_SRV" \ |
| 3529 | "$P_CLI" \ |
| 3530 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3531 | -S "mbedtls_ssl_handshake returned" \ |
| 3532 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3533 | -s "Protocol is TLSv1.2" \ |
| 3534 | -c "Protocol is TLSv1.2" |
| 3535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3536 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3537 | "$P_SRV" \ |
| 3538 | "$P_CLI max_version=tls1_1" \ |
| 3539 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3540 | -S "mbedtls_ssl_handshake returned" \ |
| 3541 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3542 | -s "Protocol is TLSv1.1" \ |
| 3543 | -c "Protocol is TLSv1.1" |
| 3544 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3545 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3546 | "$P_SRV max_version=tls1_1" \ |
| 3547 | "$P_CLI" \ |
| 3548 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3549 | -S "mbedtls_ssl_handshake returned" \ |
| 3550 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3551 | -s "Protocol is TLSv1.1" \ |
| 3552 | -c "Protocol is TLSv1.1" |
| 3553 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3554 | 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] | 3555 | "$P_SRV max_version=tls1_1" \ |
| 3556 | "$P_CLI max_version=tls1_1" \ |
| 3557 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3558 | -S "mbedtls_ssl_handshake returned" \ |
| 3559 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3560 | -s "Protocol is TLSv1.1" \ |
| 3561 | -c "Protocol is TLSv1.1" |
| 3562 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3563 | 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] | 3564 | "$P_SRV min_version=tls1_1" \ |
| 3565 | "$P_CLI max_version=tls1_1" \ |
| 3566 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3567 | -S "mbedtls_ssl_handshake returned" \ |
| 3568 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3569 | -s "Protocol is TLSv1.1" \ |
| 3570 | -c "Protocol is TLSv1.1" |
| 3571 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3572 | 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] | 3573 | "$P_SRV max_version=tls1_1" \ |
| 3574 | "$P_CLI min_version=tls1_1" \ |
| 3575 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3576 | -S "mbedtls_ssl_handshake returned" \ |
| 3577 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3578 | -s "Protocol is TLSv1.1" \ |
| 3579 | -c "Protocol is TLSv1.1" |
| 3580 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3581 | 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] | 3582 | "$P_SRV max_version=tls1_1" \ |
| 3583 | "$P_CLI min_version=tls1_2" \ |
| 3584 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3585 | -s "mbedtls_ssl_handshake returned" \ |
| 3586 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3587 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3588 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3589 | 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] | 3590 | "$P_SRV min_version=tls1_2" \ |
| 3591 | "$P_CLI max_version=tls1_1" \ |
| 3592 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3593 | -s "mbedtls_ssl_handshake returned" \ |
| 3594 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3595 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3596 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3597 | # Tests for ALPN extension |
| 3598 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3599 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3600 | "$P_SRV debug_level=3" \ |
| 3601 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3602 | 0 \ |
| 3603 | -C "client hello, adding alpn extension" \ |
| 3604 | -S "found alpn extension" \ |
| 3605 | -C "got an alert message, type: \\[2:120]" \ |
| 3606 | -S "server hello, adding alpn extension" \ |
| 3607 | -C "found alpn extension " \ |
| 3608 | -C "Application Layer Protocol is" \ |
| 3609 | -S "Application Layer Protocol is" |
| 3610 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3611 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3612 | "$P_SRV debug_level=3" \ |
| 3613 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3614 | 0 \ |
| 3615 | -c "client hello, adding alpn extension" \ |
| 3616 | -s "found alpn extension" \ |
| 3617 | -C "got an alert message, type: \\[2:120]" \ |
| 3618 | -S "server hello, adding alpn extension" \ |
| 3619 | -C "found alpn extension " \ |
| 3620 | -c "Application Layer Protocol is (none)" \ |
| 3621 | -S "Application Layer Protocol is" |
| 3622 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3623 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3624 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3625 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3626 | 0 \ |
| 3627 | -C "client hello, adding alpn extension" \ |
| 3628 | -S "found alpn extension" \ |
| 3629 | -C "got an alert message, type: \\[2:120]" \ |
| 3630 | -S "server hello, adding alpn extension" \ |
| 3631 | -C "found alpn extension " \ |
| 3632 | -C "Application Layer Protocol is" \ |
| 3633 | -s "Application Layer Protocol is (none)" |
| 3634 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3635 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3636 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3637 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3638 | 0 \ |
| 3639 | -c "client hello, adding alpn extension" \ |
| 3640 | -s "found alpn extension" \ |
| 3641 | -C "got an alert message, type: \\[2:120]" \ |
| 3642 | -s "server hello, adding alpn extension" \ |
| 3643 | -c "found alpn extension" \ |
| 3644 | -c "Application Layer Protocol is abc" \ |
| 3645 | -s "Application Layer Protocol is abc" |
| 3646 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3647 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3648 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3649 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3650 | 0 \ |
| 3651 | -c "client hello, adding alpn extension" \ |
| 3652 | -s "found alpn extension" \ |
| 3653 | -C "got an alert message, type: \\[2:120]" \ |
| 3654 | -s "server hello, adding alpn extension" \ |
| 3655 | -c "found alpn extension" \ |
| 3656 | -c "Application Layer Protocol is abc" \ |
| 3657 | -s "Application Layer Protocol is abc" |
| 3658 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3659 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3660 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3661 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3662 | 0 \ |
| 3663 | -c "client hello, adding alpn extension" \ |
| 3664 | -s "found alpn extension" \ |
| 3665 | -C "got an alert message, type: \\[2:120]" \ |
| 3666 | -s "server hello, adding alpn extension" \ |
| 3667 | -c "found alpn extension" \ |
| 3668 | -c "Application Layer Protocol is 1234" \ |
| 3669 | -s "Application Layer Protocol is 1234" |
| 3670 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3671 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3672 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3673 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3674 | 1 \ |
| 3675 | -c "client hello, adding alpn extension" \ |
| 3676 | -s "found alpn extension" \ |
| 3677 | -c "got an alert message, type: \\[2:120]" \ |
| 3678 | -S "server hello, adding alpn extension" \ |
| 3679 | -C "found alpn extension" \ |
| 3680 | -C "Application Layer Protocol is 1234" \ |
| 3681 | -S "Application Layer Protocol is 1234" |
| 3682 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3683 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3684 | # Tests for keyUsage in leaf certificates, part 1: |
| 3685 | # server-side certificate/suite selection |
| 3686 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3687 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3688 | "$P_SRV key_file=data_files/server2.key \ |
| 3689 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3690 | "$P_CLI" \ |
| 3691 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3692 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3693 | |
| 3694 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3695 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3696 | "$P_SRV key_file=data_files/server2.key \ |
| 3697 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3698 | "$P_CLI" \ |
| 3699 | 0 \ |
| 3700 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3701 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3702 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3703 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3704 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3705 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3706 | 1 \ |
| 3707 | -C "Ciphersuite is " |
| 3708 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3709 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3710 | "$P_SRV key_file=data_files/server5.key \ |
| 3711 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3712 | "$P_CLI" \ |
| 3713 | 0 \ |
| 3714 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3715 | |
| 3716 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3717 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3718 | "$P_SRV key_file=data_files/server5.key \ |
| 3719 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3720 | "$P_CLI" \ |
| 3721 | 0 \ |
| 3722 | -c "Ciphersuite is TLS-ECDH-" |
| 3723 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3724 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3725 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3726 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3727 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3728 | 1 \ |
| 3729 | -C "Ciphersuite is " |
| 3730 | |
| 3731 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3732 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3733 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3734 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3735 | "$O_SRV -key data_files/server2.key \ |
| 3736 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3737 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3738 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3739 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3740 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3741 | -C "Processing of the Certificate handshake message failed" \ |
| 3742 | -c "Ciphersuite is TLS-" |
| 3743 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3744 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3745 | "$O_SRV -key data_files/server2.key \ |
| 3746 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3747 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3748 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3749 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3750 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3751 | -C "Processing of the Certificate handshake message failed" \ |
| 3752 | -c "Ciphersuite is TLS-" |
| 3753 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3754 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3755 | "$O_SRV -key data_files/server2.key \ |
| 3756 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3757 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3758 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3759 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3760 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3761 | -C "Processing of the Certificate handshake message failed" \ |
| 3762 | -c "Ciphersuite is TLS-" |
| 3763 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3764 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3765 | "$O_SRV -key data_files/server2.key \ |
| 3766 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3767 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3768 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3769 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3770 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3771 | -c "Processing of the Certificate handshake message failed" \ |
| 3772 | -C "Ciphersuite is TLS-" |
| 3773 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3774 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3775 | "$O_SRV -key data_files/server2.key \ |
| 3776 | -cert data_files/server2.ku-ke.crt" \ |
| 3777 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3778 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3779 | 0 \ |
| 3780 | -c "bad certificate (usage extensions)" \ |
| 3781 | -C "Processing of the Certificate handshake message failed" \ |
| 3782 | -c "Ciphersuite is TLS-" \ |
| 3783 | -c "! Usage does not match the keyUsage extension" |
| 3784 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3785 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3786 | "$O_SRV -key data_files/server2.key \ |
| 3787 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3788 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3789 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3790 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3791 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3792 | -C "Processing of the Certificate handshake message failed" \ |
| 3793 | -c "Ciphersuite is TLS-" |
| 3794 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3795 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3796 | "$O_SRV -key data_files/server2.key \ |
| 3797 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3798 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3799 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3800 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3801 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3802 | -c "Processing of the Certificate handshake message failed" \ |
| 3803 | -C "Ciphersuite is TLS-" |
| 3804 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3805 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3806 | "$O_SRV -key data_files/server2.key \ |
| 3807 | -cert data_files/server2.ku-ds.crt" \ |
| 3808 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3809 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3810 | 0 \ |
| 3811 | -c "bad certificate (usage extensions)" \ |
| 3812 | -C "Processing of the Certificate handshake message failed" \ |
| 3813 | -c "Ciphersuite is TLS-" \ |
| 3814 | -c "! Usage does not match the keyUsage extension" |
| 3815 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3816 | # Tests for keyUsage in leaf certificates, part 3: |
| 3817 | # server-side checking of client cert |
| 3818 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3819 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3820 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3821 | "$O_CLI -key data_files/server2.key \ |
| 3822 | -cert data_files/server2.ku-ds.crt" \ |
| 3823 | 0 \ |
| 3824 | -S "bad certificate (usage extensions)" \ |
| 3825 | -S "Processing of the Certificate handshake message failed" |
| 3826 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3827 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3828 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3829 | "$O_CLI -key data_files/server2.key \ |
| 3830 | -cert data_files/server2.ku-ke.crt" \ |
| 3831 | 0 \ |
| 3832 | -s "bad certificate (usage extensions)" \ |
| 3833 | -S "Processing of the Certificate handshake message failed" |
| 3834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3835 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3836 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3837 | "$O_CLI -key data_files/server2.key \ |
| 3838 | -cert data_files/server2.ku-ke.crt" \ |
| 3839 | 1 \ |
| 3840 | -s "bad certificate (usage extensions)" \ |
| 3841 | -s "Processing of the Certificate handshake message failed" |
| 3842 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3843 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3844 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3845 | "$O_CLI -key data_files/server5.key \ |
| 3846 | -cert data_files/server5.ku-ds.crt" \ |
| 3847 | 0 \ |
| 3848 | -S "bad certificate (usage extensions)" \ |
| 3849 | -S "Processing of the Certificate handshake message failed" |
| 3850 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3851 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3852 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3853 | "$O_CLI -key data_files/server5.key \ |
| 3854 | -cert data_files/server5.ku-ka.crt" \ |
| 3855 | 0 \ |
| 3856 | -s "bad certificate (usage extensions)" \ |
| 3857 | -S "Processing of the Certificate handshake message failed" |
| 3858 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3859 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3860 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3861 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3862 | "$P_SRV key_file=data_files/server5.key \ |
| 3863 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3864 | "$P_CLI" \ |
| 3865 | 0 |
| 3866 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3867 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3868 | "$P_SRV key_file=data_files/server5.key \ |
| 3869 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3870 | "$P_CLI" \ |
| 3871 | 0 |
| 3872 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3873 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3874 | "$P_SRV key_file=data_files/server5.key \ |
| 3875 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3876 | "$P_CLI" \ |
| 3877 | 0 |
| 3878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3879 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3880 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3881 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3882 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3883 | 1 |
| 3884 | |
| 3885 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3886 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3887 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3888 | "$O_SRV -key data_files/server5.key \ |
| 3889 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3890 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3891 | 0 \ |
| 3892 | -C "bad certificate (usage extensions)" \ |
| 3893 | -C "Processing of the Certificate handshake message failed" \ |
| 3894 | -c "Ciphersuite is TLS-" |
| 3895 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3896 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3897 | "$O_SRV -key data_files/server5.key \ |
| 3898 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3899 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3900 | 0 \ |
| 3901 | -C "bad certificate (usage extensions)" \ |
| 3902 | -C "Processing of the Certificate handshake message failed" \ |
| 3903 | -c "Ciphersuite is TLS-" |
| 3904 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3905 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3906 | "$O_SRV -key data_files/server5.key \ |
| 3907 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3908 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3909 | 0 \ |
| 3910 | -C "bad certificate (usage extensions)" \ |
| 3911 | -C "Processing of the Certificate handshake message failed" \ |
| 3912 | -c "Ciphersuite is TLS-" |
| 3913 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3914 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3915 | "$O_SRV -key data_files/server5.key \ |
| 3916 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3917 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3918 | 1 \ |
| 3919 | -c "bad certificate (usage extensions)" \ |
| 3920 | -c "Processing of the Certificate handshake message failed" \ |
| 3921 | -C "Ciphersuite is TLS-" |
| 3922 | |
| 3923 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3925 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3926 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3927 | "$O_CLI -key data_files/server5.key \ |
| 3928 | -cert data_files/server5.eku-cli.crt" \ |
| 3929 | 0 \ |
| 3930 | -S "bad certificate (usage extensions)" \ |
| 3931 | -S "Processing of the Certificate handshake message failed" |
| 3932 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3933 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3934 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3935 | "$O_CLI -key data_files/server5.key \ |
| 3936 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3937 | 0 \ |
| 3938 | -S "bad certificate (usage extensions)" \ |
| 3939 | -S "Processing of the Certificate handshake message failed" |
| 3940 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3941 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3942 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3943 | "$O_CLI -key data_files/server5.key \ |
| 3944 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3945 | 0 \ |
| 3946 | -S "bad certificate (usage extensions)" \ |
| 3947 | -S "Processing of the Certificate handshake message failed" |
| 3948 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3949 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3950 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3951 | "$O_CLI -key data_files/server5.key \ |
| 3952 | -cert data_files/server5.eku-cs.crt" \ |
| 3953 | 0 \ |
| 3954 | -s "bad certificate (usage extensions)" \ |
| 3955 | -S "Processing of the Certificate handshake message failed" |
| 3956 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3957 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3958 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3959 | "$O_CLI -key data_files/server5.key \ |
| 3960 | -cert data_files/server5.eku-cs.crt" \ |
| 3961 | 1 \ |
| 3962 | -s "bad certificate (usage extensions)" \ |
| 3963 | -s "Processing of the Certificate handshake message failed" |
| 3964 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3965 | # Tests for DHM parameters loading |
| 3966 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3967 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3968 | "$P_SRV" \ |
| 3969 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3970 | debug_level=3" \ |
| 3971 | 0 \ |
| 3972 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3973 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3974 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3975 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3976 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3977 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3978 | debug_level=3" \ |
| 3979 | 0 \ |
| 3980 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3981 | -c "value of 'DHM: G ' (2 bits)" |
| 3982 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3983 | # Tests for DHM client-side size checking |
| 3984 | |
| 3985 | run_test "DHM size: server default, client default, OK" \ |
| 3986 | "$P_SRV" \ |
| 3987 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3988 | debug_level=1" \ |
| 3989 | 0 \ |
| 3990 | -C "DHM prime too short:" |
| 3991 | |
| 3992 | run_test "DHM size: server default, client 2048, OK" \ |
| 3993 | "$P_SRV" \ |
| 3994 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3995 | debug_level=1 dhmlen=2048" \ |
| 3996 | 0 \ |
| 3997 | -C "DHM prime too short:" |
| 3998 | |
| 3999 | run_test "DHM size: server 1024, client default, OK" \ |
| 4000 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4001 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4002 | debug_level=1" \ |
| 4003 | 0 \ |
| 4004 | -C "DHM prime too short:" |
| 4005 | |
| 4006 | run_test "DHM size: server 1000, client default, rejected" \ |
| 4007 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 4008 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4009 | debug_level=1" \ |
| 4010 | 1 \ |
| 4011 | -c "DHM prime too short:" |
| 4012 | |
| 4013 | run_test "DHM size: server default, client 2049, rejected" \ |
| 4014 | "$P_SRV" \ |
| 4015 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4016 | debug_level=1 dhmlen=2049" \ |
| 4017 | 1 \ |
| 4018 | -c "DHM prime too short:" |
| 4019 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4020 | # Tests for PSK callback |
| 4021 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4022 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4023 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 4024 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4025 | psk_identity=foo psk=abc123" \ |
| 4026 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4027 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4028 | -S "SSL - Unknown identity received" \ |
| 4029 | -S "SSL - Verification of the message MAC failed" |
| 4030 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4031 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4032 | "$P_SRV" \ |
| 4033 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4034 | psk_identity=foo psk=abc123" \ |
| 4035 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4036 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4037 | -S "SSL - Unknown identity received" \ |
| 4038 | -S "SSL - Verification of the message MAC failed" |
| 4039 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4040 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4041 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 4042 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4043 | psk_identity=foo psk=abc123" \ |
| 4044 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4045 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4046 | -s "SSL - Unknown identity received" \ |
| 4047 | -S "SSL - Verification of the message MAC failed" |
| 4048 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4049 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4050 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4051 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4052 | psk_identity=abc psk=dead" \ |
| 4053 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4054 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4055 | -S "SSL - Unknown identity received" \ |
| 4056 | -S "SSL - Verification of the message MAC failed" |
| 4057 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4058 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4059 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4060 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4061 | psk_identity=def psk=beef" \ |
| 4062 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4063 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4064 | -S "SSL - Unknown identity received" \ |
| 4065 | -S "SSL - Verification of the message MAC failed" |
| 4066 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4067 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4068 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4069 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4070 | psk_identity=ghi psk=beef" \ |
| 4071 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4072 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4073 | -s "SSL - Unknown identity received" \ |
| 4074 | -S "SSL - Verification of the message MAC failed" |
| 4075 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4076 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4077 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4078 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4079 | psk_identity=abc psk=beef" \ |
| 4080 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4081 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4082 | -S "SSL - Unknown identity received" \ |
| 4083 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4084 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4085 | # Tests for EC J-PAKE |
| 4086 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4087 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4088 | run_test "ECJPAKE: client not configured" \ |
| 4089 | "$P_SRV debug_level=3" \ |
| 4090 | "$P_CLI debug_level=3" \ |
| 4091 | 0 \ |
| 4092 | -C "add ciphersuite: c0ff" \ |
| 4093 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4094 | -S "found ecjpake kkpp extension" \ |
| 4095 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4096 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4097 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4098 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4099 | -S "None of the common ciphersuites is usable" |
| 4100 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4101 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4102 | run_test "ECJPAKE: server not configured" \ |
| 4103 | "$P_SRV debug_level=3" \ |
| 4104 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4105 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4106 | 1 \ |
| 4107 | -c "add ciphersuite: c0ff" \ |
| 4108 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4109 | -s "found ecjpake kkpp extension" \ |
| 4110 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4111 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4112 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4113 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4114 | -s "None of the common ciphersuites is usable" |
| 4115 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4116 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4117 | run_test "ECJPAKE: working, TLS" \ |
| 4118 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4119 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4120 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 4121 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4122 | -c "add ciphersuite: c0ff" \ |
| 4123 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4124 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4125 | -s "found ecjpake kkpp extension" \ |
| 4126 | -S "skip ecjpake kkpp extension" \ |
| 4127 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4128 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4129 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4130 | -S "None of the common ciphersuites is usable" \ |
| 4131 | -S "SSL - Verification of the message MAC failed" |
| 4132 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4133 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4134 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4135 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 4136 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4137 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 4138 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4139 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4140 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4141 | -s "SSL - Verification of the message MAC failed" |
| 4142 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4143 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4144 | run_test "ECJPAKE: working, DTLS" \ |
| 4145 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4146 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4147 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4148 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4149 | -c "re-using cached ecjpake parameters" \ |
| 4150 | -S "SSL - Verification of the message MAC failed" |
| 4151 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4152 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4153 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 4154 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 4155 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4156 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4157 | 0 \ |
| 4158 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4159 | -S "SSL - Verification of the message MAC failed" |
| 4160 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4161 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4162 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4163 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 4164 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4165 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 4166 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4167 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4168 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4169 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4170 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4171 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4172 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4173 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 4174 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 4175 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 4176 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4177 | 0 |
| 4178 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4179 | # Tests for ciphersuites per version |
| 4180 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4181 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4182 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4183 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4184 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4185 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4186 | "$P_CLI force_version=ssl3" \ |
| 4187 | 0 \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4188 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4189 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 4191 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4192 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4193 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4194 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 4195 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4196 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4197 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4198 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4200 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4201 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4202 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4203 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4204 | "$P_CLI force_version=tls1_1" \ |
| 4205 | 0 \ |
| 4206 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 4207 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4209 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4210 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4211 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4212 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4213 | "$P_CLI force_version=tls1_2" \ |
| 4214 | 0 \ |
| 4215 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 4216 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4217 | # Test for ClientHello without extensions |
| 4218 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 4219 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4220 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Ron Eldor | b76e765 | 2019-01-16 23:14:41 +0200 | [diff] [blame] | 4221 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4222 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4223 | 0 \ |
| 4224 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4225 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4226 | requires_gnutls |
| 4227 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 4228 | "$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] | 4229 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4230 | 0 \ |
| 4231 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4232 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4233 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4234 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4235 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4236 | "$P_SRV" \ |
| 4237 | "$P_CLI request_size=100" \ |
| 4238 | 0 \ |
| 4239 | -s "Read from client: 100 bytes read$" |
| 4240 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4241 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4242 | "$P_SRV" \ |
| 4243 | "$P_CLI request_size=500" \ |
| 4244 | 0 \ |
| 4245 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4246 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4247 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4248 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4249 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4250 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4251 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4252 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4253 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4254 | 0 \ |
| 4255 | -s "Read from client: 1 bytes read" |
| 4256 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4257 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4258 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4259 | "$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] | 4260 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4261 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4262 | 0 \ |
| 4263 | -s "Read from client: 1 bytes read" |
| 4264 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4265 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4266 | "$P_SRV" \ |
| 4267 | "$P_CLI request_size=1 force_version=tls1 \ |
| 4268 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4269 | 0 \ |
| 4270 | -s "Read from client: 1 bytes read" |
| 4271 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4272 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 4273 | "$P_SRV" \ |
| 4274 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 4275 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4276 | 0 \ |
| 4277 | -s "Read from client: 1 bytes read" |
| 4278 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4279 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4280 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4281 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4282 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4283 | 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] | 4284 | 0 \ |
| 4285 | -s "Read from client: 1 bytes read" |
| 4286 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4287 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4288 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4289 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4290 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4291 | 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] | 4292 | 0 \ |
| 4293 | -s "Read from client: 1 bytes read" |
| 4294 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4295 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4296 | "$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] | 4297 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4298 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4299 | 0 \ |
| 4300 | -s "Read from client: 1 bytes read" |
| 4301 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4302 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4303 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4304 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4305 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4306 | 0 \ |
| 4307 | -s "Read from client: 1 bytes read" |
| 4308 | |
| 4309 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4310 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4311 | "$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] | 4312 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4313 | 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] | 4314 | 0 \ |
| 4315 | -s "Read from client: 1 bytes read" |
| 4316 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4317 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4318 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4319 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4320 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4321 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4322 | 0 \ |
| 4323 | -s "Read from client: 1 bytes read" |
| 4324 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4325 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4326 | "$P_SRV" \ |
| 4327 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4328 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4329 | 0 \ |
| 4330 | -s "Read from client: 1 bytes read" |
| 4331 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4332 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 4333 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4334 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4335 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4336 | 0 \ |
| 4337 | -s "Read from client: 1 bytes read" |
| 4338 | |
| 4339 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4340 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4341 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4342 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4343 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4344 | 0 \ |
| 4345 | -s "Read from client: 1 bytes read" |
| 4346 | |
| 4347 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4348 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4349 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4350 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4351 | 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] | 4352 | 0 \ |
| 4353 | -s "Read from client: 1 bytes read" |
| 4354 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4355 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4356 | "$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] | 4357 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4358 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4359 | 0 \ |
| 4360 | -s "Read from client: 1 bytes read" |
| 4361 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4362 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4363 | "$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] | 4364 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4365 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4366 | 0 \ |
| 4367 | -s "Read from client: 1 bytes read" |
| 4368 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4369 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4370 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4371 | "$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] | 4372 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4373 | 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] | 4374 | 0 \ |
| 4375 | -s "Read from client: 1 bytes read" |
| 4376 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4377 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4378 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4379 | "$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] | 4380 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4381 | 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] | 4382 | 0 \ |
| 4383 | -s "Read from client: 1 bytes read" |
| 4384 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4385 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4386 | "$P_SRV" \ |
| 4387 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4388 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4389 | 0 \ |
| 4390 | -s "Read from client: 1 bytes read" |
| 4391 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4392 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 4393 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4394 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4395 | 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] | 4396 | 0 \ |
| 4397 | -s "Read from client: 1 bytes read" |
| 4398 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4399 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4400 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4401 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4402 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4403 | 0 \ |
| 4404 | -s "Read from client: 1 bytes read" |
| 4405 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4406 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4407 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4408 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4409 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4410 | 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] | 4411 | 0 \ |
| 4412 | -s "Read from client: 1 bytes read" |
| 4413 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4414 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4415 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4416 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4417 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4418 | 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] | 4419 | 0 \ |
| 4420 | -s "Read from client: 1 bytes read" |
| 4421 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4422 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4423 | "$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] | 4424 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4425 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4426 | 0 \ |
| 4427 | -s "Read from client: 1 bytes read" |
| 4428 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4429 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4430 | "$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] | 4431 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4432 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4433 | 0 \ |
| 4434 | -s "Read from client: 1 bytes read" |
| 4435 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4436 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4437 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4438 | "$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] | 4439 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4440 | 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] | 4441 | 0 \ |
| 4442 | -s "Read from client: 1 bytes read" |
| 4443 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4444 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4445 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4446 | "$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] | 4447 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4448 | 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] | 4449 | 0 \ |
| 4450 | -s "Read from client: 1 bytes read" |
| 4451 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4452 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4453 | "$P_SRV" \ |
| 4454 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4455 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4456 | 0 \ |
| 4457 | -s "Read from client: 1 bytes read" |
| 4458 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4459 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4460 | "$P_SRV" \ |
| 4461 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4462 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4463 | 0 \ |
| 4464 | -s "Read from client: 1 bytes read" |
| 4465 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4466 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4467 | |
| 4468 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4469 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4470 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 4471 | "$P_CLI dtls=1 request_size=1 \ |
| 4472 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4473 | 0 \ |
| 4474 | -s "Read from client: 1 bytes read" |
| 4475 | |
| 4476 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4477 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4478 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 4479 | "$P_CLI dtls=1 request_size=1 \ |
| 4480 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4481 | 0 \ |
| 4482 | -s "Read from client: 1 bytes read" |
| 4483 | |
| 4484 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4485 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4486 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4487 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 4488 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4489 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4490 | 0 \ |
| 4491 | -s "Read from client: 1 bytes read" |
| 4492 | |
| 4493 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4494 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4495 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4496 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4497 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4498 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4499 | 0 \ |
| 4500 | -s "Read from client: 1 bytes read" |
| 4501 | |
| 4502 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4503 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4504 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 4505 | "$P_CLI dtls=1 request_size=1 \ |
| 4506 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4507 | 0 \ |
| 4508 | -s "Read from client: 1 bytes read" |
| 4509 | |
| 4510 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4511 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4512 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4513 | "$P_CLI dtls=1 request_size=1 \ |
| 4514 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4515 | 0 \ |
| 4516 | -s "Read from client: 1 bytes read" |
| 4517 | |
| 4518 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4519 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4520 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4521 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4522 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4523 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4524 | 0 \ |
| 4525 | -s "Read from client: 1 bytes read" |
| 4526 | |
| 4527 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4528 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4529 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4530 | "$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] | 4531 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4532 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4533 | 0 \ |
| 4534 | -s "Read from client: 1 bytes read" |
| 4535 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4536 | # Tests for small server packets |
| 4537 | |
| 4538 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4539 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 4540 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 4541 | "$P_CLI force_version=ssl3 \ |
| 4542 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4543 | 0 \ |
| 4544 | -c "Read from server: 1 bytes read" |
| 4545 | |
| 4546 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4547 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 4548 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4549 | "$P_CLI force_version=ssl3 \ |
| 4550 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4551 | 0 \ |
| 4552 | -c "Read from server: 1 bytes read" |
| 4553 | |
| 4554 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 4555 | "$P_SRV response_size=1" \ |
| 4556 | "$P_CLI force_version=tls1 \ |
| 4557 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4558 | 0 \ |
| 4559 | -c "Read from server: 1 bytes read" |
| 4560 | |
| 4561 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 4562 | "$P_SRV response_size=1" \ |
| 4563 | "$P_CLI force_version=tls1 etm=0 \ |
| 4564 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4565 | 0 \ |
| 4566 | -c "Read from server: 1 bytes read" |
| 4567 | |
| 4568 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4569 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 4570 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4571 | "$P_CLI force_version=tls1 \ |
| 4572 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4573 | 0 \ |
| 4574 | -c "Read from server: 1 bytes read" |
| 4575 | |
| 4576 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4577 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 4578 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4579 | "$P_CLI force_version=tls1 \ |
| 4580 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4581 | 0 \ |
| 4582 | -c "Read from server: 1 bytes read" |
| 4583 | |
| 4584 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 4585 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4586 | "$P_CLI force_version=tls1 \ |
| 4587 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4588 | 0 \ |
| 4589 | -c "Read from server: 1 bytes read" |
| 4590 | |
| 4591 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 4592 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4593 | "$P_CLI force_version=tls1 \ |
| 4594 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4595 | 0 \ |
| 4596 | -c "Read from server: 1 bytes read" |
| 4597 | |
| 4598 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4599 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 4600 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4601 | "$P_CLI force_version=tls1 \ |
| 4602 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4603 | 0 \ |
| 4604 | -c "Read from server: 1 bytes read" |
| 4605 | |
| 4606 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4607 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 4608 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4609 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4610 | trunc_hmac=1 etm=0" \ |
| 4611 | 0 \ |
| 4612 | -c "Read from server: 1 bytes read" |
| 4613 | |
| 4614 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 4615 | "$P_SRV response_size=1" \ |
| 4616 | "$P_CLI force_version=tls1_1 \ |
| 4617 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4618 | 0 \ |
| 4619 | -c "Read from server: 1 bytes read" |
| 4620 | |
| 4621 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 4622 | "$P_SRV response_size=1" \ |
| 4623 | "$P_CLI force_version=tls1_1 \ |
| 4624 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4625 | 0 \ |
| 4626 | -c "Read from server: 1 bytes read" |
| 4627 | |
| 4628 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4629 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 4630 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4631 | "$P_CLI force_version=tls1_1 \ |
| 4632 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4633 | 0 \ |
| 4634 | -c "Read from server: 1 bytes read" |
| 4635 | |
| 4636 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4637 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 4638 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4639 | "$P_CLI force_version=tls1_1 \ |
| 4640 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4641 | 0 \ |
| 4642 | -c "Read from server: 1 bytes read" |
| 4643 | |
| 4644 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 4645 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4646 | "$P_CLI force_version=tls1_1 \ |
| 4647 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4648 | 0 \ |
| 4649 | -c "Read from server: 1 bytes read" |
| 4650 | |
| 4651 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 4652 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4653 | "$P_CLI force_version=tls1_1 \ |
| 4654 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4655 | 0 \ |
| 4656 | -c "Read from server: 1 bytes read" |
| 4657 | |
| 4658 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4659 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 4660 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4661 | "$P_CLI force_version=tls1_1 \ |
| 4662 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4663 | 0 \ |
| 4664 | -c "Read from server: 1 bytes read" |
| 4665 | |
| 4666 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4667 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 4668 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4669 | "$P_CLI force_version=tls1_1 \ |
| 4670 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4671 | 0 \ |
| 4672 | -c "Read from server: 1 bytes read" |
| 4673 | |
| 4674 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 4675 | "$P_SRV response_size=1" \ |
| 4676 | "$P_CLI force_version=tls1_2 \ |
| 4677 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4678 | 0 \ |
| 4679 | -c "Read from server: 1 bytes read" |
| 4680 | |
| 4681 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 4682 | "$P_SRV response_size=1" \ |
| 4683 | "$P_CLI force_version=tls1_2 \ |
| 4684 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4685 | 0 \ |
| 4686 | -c "Read from server: 1 bytes read" |
| 4687 | |
| 4688 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 4689 | "$P_SRV response_size=1" \ |
| 4690 | "$P_CLI force_version=tls1_2 \ |
| 4691 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 4692 | 0 \ |
| 4693 | -c "Read from server: 1 bytes read" |
| 4694 | |
| 4695 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4696 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 4697 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4698 | "$P_CLI force_version=tls1_2 \ |
| 4699 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4700 | 0 \ |
| 4701 | -c "Read from server: 1 bytes read" |
| 4702 | |
| 4703 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4704 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 4705 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4706 | "$P_CLI force_version=tls1_2 \ |
| 4707 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4708 | 0 \ |
| 4709 | -c "Read from server: 1 bytes read" |
| 4710 | |
| 4711 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 4712 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4713 | "$P_CLI force_version=tls1_2 \ |
| 4714 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4715 | 0 \ |
| 4716 | -c "Read from server: 1 bytes read" |
| 4717 | |
| 4718 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 4719 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4720 | "$P_CLI force_version=tls1_2 \ |
| 4721 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4722 | 0 \ |
| 4723 | -c "Read from server: 1 bytes read" |
| 4724 | |
| 4725 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4726 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 4727 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4728 | "$P_CLI force_version=tls1_2 \ |
| 4729 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4730 | 0 \ |
| 4731 | -c "Read from server: 1 bytes read" |
| 4732 | |
| 4733 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4734 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 4735 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4736 | "$P_CLI force_version=tls1_2 \ |
| 4737 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4738 | 0 \ |
| 4739 | -c "Read from server: 1 bytes read" |
| 4740 | |
| 4741 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 4742 | "$P_SRV response_size=1" \ |
| 4743 | "$P_CLI force_version=tls1_2 \ |
| 4744 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4745 | 0 \ |
| 4746 | -c "Read from server: 1 bytes read" |
| 4747 | |
| 4748 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 4749 | "$P_SRV response_size=1" \ |
| 4750 | "$P_CLI force_version=tls1_2 \ |
| 4751 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4752 | 0 \ |
| 4753 | -c "Read from server: 1 bytes read" |
| 4754 | |
| 4755 | # Tests for small server packets in DTLS |
| 4756 | |
| 4757 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4758 | run_test "Small server packet DTLS 1.0" \ |
| 4759 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 4760 | "$P_CLI dtls=1 \ |
| 4761 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4762 | 0 \ |
| 4763 | -c "Read from server: 1 bytes read" |
| 4764 | |
| 4765 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4766 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 4767 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 4768 | "$P_CLI dtls=1 \ |
| 4769 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4770 | 0 \ |
| 4771 | -c "Read from server: 1 bytes read" |
| 4772 | |
| 4773 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4774 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4775 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 4776 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 4777 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 4778 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4779 | 0 \ |
| 4780 | -c "Read from server: 1 bytes read" |
| 4781 | |
| 4782 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4783 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4784 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 4785 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 4786 | "$P_CLI dtls=1 \ |
| 4787 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4788 | 0 \ |
| 4789 | -c "Read from server: 1 bytes read" |
| 4790 | |
| 4791 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4792 | run_test "Small server packet DTLS 1.2" \ |
| 4793 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 4794 | "$P_CLI dtls=1 \ |
| 4795 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4796 | 0 \ |
| 4797 | -c "Read from server: 1 bytes read" |
| 4798 | |
| 4799 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4800 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 4801 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 4802 | "$P_CLI dtls=1 \ |
| 4803 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4804 | 0 \ |
| 4805 | -c "Read from server: 1 bytes read" |
| 4806 | |
| 4807 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4808 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4809 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 4810 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 4811 | "$P_CLI dtls=1 \ |
| 4812 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4813 | 0 \ |
| 4814 | -c "Read from server: 1 bytes read" |
| 4815 | |
| 4816 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4817 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4818 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 4819 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 4820 | "$P_CLI dtls=1 \ |
| 4821 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4822 | 0 \ |
| 4823 | -c "Read from server: 1 bytes read" |
| 4824 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4825 | # A test for extensions in SSLv3 |
| 4826 | |
| 4827 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4828 | run_test "SSLv3 with extensions, server side" \ |
| 4829 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 4830 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4831 | 0 \ |
| 4832 | -S "dumping 'client hello extensions'" \ |
| 4833 | -S "server hello, total extension length:" |
| 4834 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4835 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4836 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4837 | # How many fragments do we expect to write $1 bytes? |
| 4838 | fragments_for_write() { |
| 4839 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4840 | } |
| 4841 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4842 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4843 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4844 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4845 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4846 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4847 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4848 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4849 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4850 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4851 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4852 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4853 | "$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] | 4854 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4855 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4856 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4857 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4858 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4859 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4860 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4861 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4862 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4863 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4864 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4865 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4866 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4867 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4868 | run_test "Large client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4869 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4870 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4871 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4872 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4873 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4874 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4875 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4876 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4877 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4878 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4879 | 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] | 4880 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4881 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4882 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4883 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4884 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4885 | run_test "Large client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4886 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4887 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4888 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4889 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4890 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4891 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4892 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4893 | "$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] | 4894 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4895 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4896 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4897 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4898 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4899 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4900 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4901 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4902 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4903 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4904 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4905 | |
| 4906 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4907 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4908 | "$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] | 4909 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4910 | 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] | 4911 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4912 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4913 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4914 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4915 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4916 | "$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] | 4917 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4918 | 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] | 4919 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4920 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4921 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4922 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4923 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4924 | "$P_SRV" \ |
| 4925 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4926 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4927 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4928 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4929 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4930 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4931 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4932 | "$P_SRV" \ |
| 4933 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4934 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4935 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4936 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4937 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4938 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4939 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4940 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4941 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4942 | 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] | 4943 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4944 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4945 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4946 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4947 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4948 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4949 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4950 | 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] | 4951 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4952 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4953 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4954 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4955 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4956 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4957 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4958 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4959 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4960 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4961 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4962 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4963 | "$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] | 4964 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4965 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4966 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4967 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4968 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4969 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4970 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4971 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4972 | "$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] | 4973 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4974 | 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] | 4975 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4976 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4977 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4978 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4979 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4980 | "$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] | 4981 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4982 | 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] | 4983 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4984 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4985 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4986 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4987 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4988 | "$P_SRV" \ |
| 4989 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4990 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4991 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4992 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4993 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4994 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4995 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4996 | "$P_SRV" \ |
| 4997 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 4998 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4999 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5000 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5001 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5002 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5003 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5004 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5005 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5006 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5007 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5008 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5009 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5010 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5011 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5012 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5013 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5014 | 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] | 5015 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5016 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5017 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5018 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5019 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5020 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5021 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5022 | 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] | 5023 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5024 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5025 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5026 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5027 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5028 | "$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] | 5029 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5030 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5031 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5032 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5033 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5034 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5035 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5036 | "$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] | 5037 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5038 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5039 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5040 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5041 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5042 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5043 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5044 | "$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] | 5045 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5046 | 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] | 5047 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5048 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5049 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5050 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5051 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5052 | "$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] | 5053 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5054 | 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] | 5055 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5056 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5057 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5058 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5059 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5060 | "$P_SRV" \ |
| 5061 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5062 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5063 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5064 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5065 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5066 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5067 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5068 | "$P_SRV" \ |
| 5069 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5070 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5071 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5072 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5073 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5074 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5075 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5076 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5077 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 5078 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5079 | "$P_CLI force_version=ssl3 \ |
| 5080 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5081 | 0 \ |
| 5082 | -c "Read from server: 16384 bytes read" |
| 5083 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 5084 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 5085 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5086 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 5087 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 5088 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 5089 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5090 | 0 \ |
| 5091 | -c "Read from server: 1 bytes read"\ |
| 5092 | -c "16383 bytes read"\ |
| 5093 | -C "Read from server: 16384 bytes read" |
| 5094 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5095 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 5096 | "$P_SRV response_size=16384" \ |
| 5097 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5098 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5099 | 0 \ |
| 5100 | -c "Read from server: 1 bytes read"\ |
| 5101 | -c "16383 bytes read"\ |
| 5102 | -C "Read from server: 16384 bytes read" |
| 5103 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5104 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5105 | "$P_SRV response_size=16384" \ |
| 5106 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 5107 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5108 | 0 \ |
| 5109 | -c "Read from server: 1 bytes read"\ |
| 5110 | -c "16383 bytes read"\ |
| 5111 | -C "Read from server: 16384 bytes read" |
| 5112 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5113 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5114 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 5115 | "$P_SRV response_size=16384" \ |
| 5116 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5117 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5118 | trunc_hmac=1" \ |
| 5119 | 0 \ |
| 5120 | -c "Read from server: 1 bytes read"\ |
| 5121 | -c "16383 bytes read"\ |
| 5122 | -C "Read from server: 16384 bytes read" |
| 5123 | |
| 5124 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5125 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 5126 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5127 | "$P_CLI force_version=tls1 \ |
| 5128 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5129 | trunc_hmac=1" \ |
| 5130 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5131 | -s "16384 bytes written in 1 fragments" \ |
| 5132 | -c "Read from server: 16384 bytes read" |
| 5133 | |
| 5134 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 5135 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5136 | "$P_CLI force_version=tls1 \ |
| 5137 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5138 | 0 \ |
| 5139 | -s "16384 bytes written in 1 fragments" \ |
| 5140 | -c "Read from server: 16384 bytes read" |
| 5141 | |
| 5142 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5143 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5144 | "$P_CLI force_version=tls1 \ |
| 5145 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5146 | 0 \ |
| 5147 | -s "16384 bytes written in 1 fragments" \ |
| 5148 | -c "Read from server: 16384 bytes read" |
| 5149 | |
| 5150 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5151 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5152 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5153 | "$P_CLI force_version=tls1 \ |
| 5154 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5155 | 0 \ |
| 5156 | -s "16384 bytes written in 1 fragments" \ |
| 5157 | -c "Read from server: 16384 bytes read" |
| 5158 | |
| 5159 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5160 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5161 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5162 | "$P_CLI force_version=tls1 \ |
| 5163 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5164 | 0 \ |
| 5165 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5166 | -c "Read from server: 16384 bytes read" |
| 5167 | |
| 5168 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 5169 | "$P_SRV response_size=16384" \ |
| 5170 | "$P_CLI force_version=tls1_1 \ |
| 5171 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5172 | 0 \ |
| 5173 | -c "Read from server: 16384 bytes read" |
| 5174 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5175 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5176 | "$P_SRV response_size=16384" \ |
| 5177 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 5178 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5179 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5180 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5181 | -c "Read from server: 16384 bytes read" |
| 5182 | |
| 5183 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5184 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 5185 | "$P_SRV response_size=16384" \ |
| 5186 | "$P_CLI force_version=tls1_1 \ |
| 5187 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5188 | trunc_hmac=1" \ |
| 5189 | 0 \ |
| 5190 | -c "Read from server: 16384 bytes read" |
| 5191 | |
| 5192 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5193 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5194 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5195 | "$P_CLI force_version=tls1_1 \ |
| 5196 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5197 | 0 \ |
| 5198 | -s "16384 bytes written in 1 fragments" \ |
| 5199 | -c "Read from server: 16384 bytes read" |
| 5200 | |
| 5201 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 5202 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5203 | "$P_CLI force_version=tls1_1 \ |
| 5204 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5205 | 0 \ |
| 5206 | -c "Read from server: 16384 bytes read" |
| 5207 | |
| 5208 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5209 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5210 | "$P_CLI force_version=tls1_1 \ |
| 5211 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5212 | 0 \ |
| 5213 | -s "16384 bytes written in 1 fragments" \ |
| 5214 | -c "Read from server: 16384 bytes read" |
| 5215 | |
| 5216 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5217 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 5218 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5219 | "$P_CLI force_version=tls1_1 \ |
| 5220 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5221 | trunc_hmac=1" \ |
| 5222 | 0 \ |
| 5223 | -c "Read from server: 16384 bytes read" |
| 5224 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5225 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5226 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5227 | "$P_CLI force_version=tls1_1 \ |
| 5228 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5229 | 0 \ |
| 5230 | -s "16384 bytes written in 1 fragments" \ |
| 5231 | -c "Read from server: 16384 bytes read" |
| 5232 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5233 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5234 | "$P_SRV response_size=16384" \ |
| 5235 | "$P_CLI force_version=tls1_2 \ |
| 5236 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5237 | 0 \ |
| 5238 | -c "Read from server: 16384 bytes read" |
| 5239 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5240 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5241 | "$P_SRV response_size=16384" \ |
| 5242 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5243 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5244 | 0 \ |
| 5245 | -s "16384 bytes written in 1 fragments" \ |
| 5246 | -c "Read from server: 16384 bytes read" |
| 5247 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5248 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5249 | "$P_SRV response_size=16384" \ |
| 5250 | "$P_CLI force_version=tls1_2 \ |
| 5251 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5252 | 0 \ |
| 5253 | -c "Read from server: 16384 bytes read" |
| 5254 | |
| 5255 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5256 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 5257 | "$P_SRV response_size=16384" \ |
| 5258 | "$P_CLI force_version=tls1_2 \ |
| 5259 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5260 | trunc_hmac=1" \ |
| 5261 | 0 \ |
| 5262 | -c "Read from server: 16384 bytes read" |
| 5263 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5264 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5265 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5266 | "$P_CLI force_version=tls1_2 \ |
| 5267 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5268 | 0 \ |
| 5269 | -s "16384 bytes written in 1 fragments" \ |
| 5270 | -c "Read from server: 16384 bytes read" |
| 5271 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5272 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 5273 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5274 | "$P_CLI force_version=tls1_2 \ |
| 5275 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5276 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5277 | -s "16384 bytes written in 1 fragments" \ |
| 5278 | -c "Read from server: 16384 bytes read" |
| 5279 | |
| 5280 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5281 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5282 | "$P_CLI force_version=tls1_2 \ |
| 5283 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5284 | 0 \ |
| 5285 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5286 | -c "Read from server: 16384 bytes read" |
| 5287 | |
| 5288 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5289 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 5290 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5291 | "$P_CLI force_version=tls1_2 \ |
| 5292 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5293 | trunc_hmac=1" \ |
| 5294 | 0 \ |
| 5295 | -c "Read from server: 16384 bytes read" |
| 5296 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5297 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5298 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5299 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5300 | "$P_CLI force_version=tls1_2 \ |
| 5301 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5302 | 0 \ |
| 5303 | -s "16384 bytes written in 1 fragments" \ |
| 5304 | -c "Read from server: 16384 bytes read" |
| 5305 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5306 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5307 | "$P_SRV response_size=16384" \ |
| 5308 | "$P_CLI force_version=tls1_2 \ |
| 5309 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5310 | 0 \ |
| 5311 | -c "Read from server: 16384 bytes read" |
| 5312 | |
| 5313 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5314 | "$P_SRV response_size=16384" \ |
| 5315 | "$P_CLI force_version=tls1_2 \ |
| 5316 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5317 | 0 \ |
| 5318 | -c "Read from server: 16384 bytes read" |
| 5319 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5320 | # Tests for restartable ECC |
| 5321 | |
| 5322 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5323 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5324 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5325 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5326 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5327 | debug_level=1" \ |
| 5328 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5329 | -C "x509_verify_cert.*4b00" \ |
| 5330 | -C "mbedtls_pk_verify.*4b00" \ |
| 5331 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5332 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5333 | |
| 5334 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5335 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5336 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5337 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5338 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5339 | debug_level=1 ec_max_ops=0" \ |
| 5340 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5341 | -C "x509_verify_cert.*4b00" \ |
| 5342 | -C "mbedtls_pk_verify.*4b00" \ |
| 5343 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5344 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5345 | |
| 5346 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5347 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5348 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5349 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5350 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5351 | debug_level=1 ec_max_ops=65535" \ |
| 5352 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5353 | -C "x509_verify_cert.*4b00" \ |
| 5354 | -C "mbedtls_pk_verify.*4b00" \ |
| 5355 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5356 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5357 | |
| 5358 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5359 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5360 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5361 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5362 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5363 | debug_level=1 ec_max_ops=1000" \ |
| 5364 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5365 | -c "x509_verify_cert.*4b00" \ |
| 5366 | -c "mbedtls_pk_verify.*4b00" \ |
| 5367 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5368 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5369 | |
| 5370 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5371 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 5372 | "$P_SRV auth_mode=required \ |
| 5373 | crt_file=data_files/server5-badsign.crt \ |
| 5374 | key_file=data_files/server5.key" \ |
| 5375 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5376 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5377 | debug_level=1 ec_max_ops=1000" \ |
| 5378 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5379 | -c "x509_verify_cert.*4b00" \ |
| 5380 | -C "mbedtls_pk_verify.*4b00" \ |
| 5381 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5382 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5383 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5384 | -c "! mbedtls_ssl_handshake returned" \ |
| 5385 | -c "X509 - Certificate verification failed" |
| 5386 | |
| 5387 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5388 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 5389 | "$P_SRV auth_mode=required \ |
| 5390 | crt_file=data_files/server5-badsign.crt \ |
| 5391 | key_file=data_files/server5.key" \ |
| 5392 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5393 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5394 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5395 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5396 | -c "x509_verify_cert.*4b00" \ |
| 5397 | -c "mbedtls_pk_verify.*4b00" \ |
| 5398 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5399 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5400 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5401 | -C "! mbedtls_ssl_handshake returned" \ |
| 5402 | -C "X509 - Certificate verification failed" |
| 5403 | |
| 5404 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5405 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 5406 | "$P_SRV auth_mode=required \ |
| 5407 | crt_file=data_files/server5-badsign.crt \ |
| 5408 | key_file=data_files/server5.key" \ |
| 5409 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5410 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5411 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 5412 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5413 | -C "x509_verify_cert.*4b00" \ |
| 5414 | -c "mbedtls_pk_verify.*4b00" \ |
| 5415 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5416 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5417 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5418 | -C "! mbedtls_ssl_handshake returned" \ |
| 5419 | -C "X509 - Certificate verification failed" |
| 5420 | |
| 5421 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5422 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5423 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5424 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5425 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5426 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 5427 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5428 | -c "x509_verify_cert.*4b00" \ |
| 5429 | -c "mbedtls_pk_verify.*4b00" \ |
| 5430 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5431 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5432 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5433 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5434 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 5435 | "$P_SRV" \ |
| 5436 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5437 | debug_level=1 ec_max_ops=1000" \ |
| 5438 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5439 | -c "x509_verify_cert.*4b00" \ |
| 5440 | -c "mbedtls_pk_verify.*4b00" \ |
| 5441 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5442 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5443 | |
| 5444 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5445 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 5446 | "$P_SRV psk=abc123" \ |
| 5447 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 5448 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 5449 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5450 | -C "x509_verify_cert.*4b00" \ |
| 5451 | -C "mbedtls_pk_verify.*4b00" \ |
| 5452 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5453 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5454 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5455 | # Tests of asynchronous private key support in SSL |
| 5456 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5457 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5458 | run_test "SSL async private: sign, delay=0" \ |
| 5459 | "$P_SRV \ |
| 5460 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5461 | "$P_CLI" \ |
| 5462 | 0 \ |
| 5463 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5464 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5465 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5466 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5467 | run_test "SSL async private: sign, delay=1" \ |
| 5468 | "$P_SRV \ |
| 5469 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5470 | "$P_CLI" \ |
| 5471 | 0 \ |
| 5472 | -s "Async sign callback: using key slot " \ |
| 5473 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5474 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5475 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 5476 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5477 | run_test "SSL async private: sign, delay=2" \ |
| 5478 | "$P_SRV \ |
| 5479 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 5480 | "$P_CLI" \ |
| 5481 | 0 \ |
| 5482 | -s "Async sign callback: using key slot " \ |
| 5483 | -U "Async sign callback: using key slot " \ |
| 5484 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 5485 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5486 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5487 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 5488 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 5489 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 5490 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5492 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 5493 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 5494 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 5495 | "$P_CLI force_version=tls1_1" \ |
| 5496 | 0 \ |
| 5497 | -s "Async sign callback: using key slot " \ |
| 5498 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5499 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5500 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 5501 | run_test "SSL async private: sign, SNI" \ |
| 5502 | "$P_SRV debug_level=3 \ |
| 5503 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 5504 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5505 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5506 | "$P_CLI server_name=polarssl.example" \ |
| 5507 | 0 \ |
| 5508 | -s "Async sign callback: using key slot " \ |
| 5509 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5510 | -s "parse ServerName extension" \ |
| 5511 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5512 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5513 | |
| 5514 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5515 | run_test "SSL async private: decrypt, delay=0" \ |
| 5516 | "$P_SRV \ |
| 5517 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5518 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5519 | 0 \ |
| 5520 | -s "Async decrypt callback: using key slot " \ |
| 5521 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5522 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5523 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5524 | run_test "SSL async private: decrypt, delay=1" \ |
| 5525 | "$P_SRV \ |
| 5526 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5527 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5528 | 0 \ |
| 5529 | -s "Async decrypt callback: using key slot " \ |
| 5530 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5531 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5532 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5533 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5534 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 5535 | "$P_SRV psk=abc123 \ |
| 5536 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5537 | "$P_CLI psk=abc123 \ |
| 5538 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5539 | 0 \ |
| 5540 | -s "Async decrypt callback: using key slot " \ |
| 5541 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5542 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5543 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5544 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 5545 | "$P_SRV psk=abc123 \ |
| 5546 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5547 | "$P_CLI psk=abc123 \ |
| 5548 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5549 | 0 \ |
| 5550 | -s "Async decrypt callback: using key slot " \ |
| 5551 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5552 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5553 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5554 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5555 | run_test "SSL async private: sign callback not present" \ |
| 5556 | "$P_SRV \ |
| 5557 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5558 | "$P_CLI; [ \$? -eq 1 ] && |
| 5559 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5560 | 0 \ |
| 5561 | -S "Async sign callback" \ |
| 5562 | -s "! mbedtls_ssl_handshake returned" \ |
| 5563 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 5564 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 5565 | -s "Successful connection" |
| 5566 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5567 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5568 | run_test "SSL async private: decrypt callback not present" \ |
| 5569 | "$P_SRV debug_level=1 \ |
| 5570 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 5571 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 5572 | [ \$? -eq 1 ] && $P_CLI" \ |
| 5573 | 0 \ |
| 5574 | -S "Async decrypt callback" \ |
| 5575 | -s "! mbedtls_ssl_handshake returned" \ |
| 5576 | -s "got no RSA private key" \ |
| 5577 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5578 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5579 | |
| 5580 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5581 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5582 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5583 | "$P_SRV \ |
| 5584 | async_operations=s async_private_delay1=1 \ |
| 5585 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5586 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5587 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5588 | 0 \ |
| 5589 | -s "Async sign callback: using key slot 0," \ |
| 5590 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5591 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5592 | |
| 5593 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5594 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5595 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5596 | "$P_SRV \ |
| 5597 | async_operations=s async_private_delay2=1 \ |
| 5598 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5599 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5600 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5601 | 0 \ |
| 5602 | -s "Async sign callback: using key slot 0," \ |
| 5603 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5604 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5605 | |
| 5606 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5607 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 5608 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5609 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 5610 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5611 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5612 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5613 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5614 | 0 \ |
| 5615 | -s "Async sign callback: using key slot 1," \ |
| 5616 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5617 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5618 | |
| 5619 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5620 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5621 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5622 | "$P_SRV \ |
| 5623 | async_operations=s async_private_delay1=1 \ |
| 5624 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5625 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5626 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5627 | 0 \ |
| 5628 | -s "Async sign callback: no key matches this certificate." |
| 5629 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5630 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5631 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5632 | "$P_SRV \ |
| 5633 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5634 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5635 | "$P_CLI" \ |
| 5636 | 1 \ |
| 5637 | -s "Async sign callback: injected error" \ |
| 5638 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5639 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5640 | -s "! mbedtls_ssl_handshake returned" |
| 5641 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5642 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5643 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5644 | "$P_SRV \ |
| 5645 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5646 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5647 | "$P_CLI" \ |
| 5648 | 1 \ |
| 5649 | -s "Async sign callback: using key slot " \ |
| 5650 | -S "Async resume" \ |
| 5651 | -s "Async cancel" |
| 5652 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5653 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5654 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5655 | "$P_SRV \ |
| 5656 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5657 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5658 | "$P_CLI" \ |
| 5659 | 1 \ |
| 5660 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5661 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5662 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5663 | -s "! mbedtls_ssl_handshake returned" |
| 5664 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5665 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5666 | run_test "SSL async private: decrypt, error in start" \ |
| 5667 | "$P_SRV \ |
| 5668 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5669 | async_private_error=1" \ |
| 5670 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5671 | 1 \ |
| 5672 | -s "Async decrypt callback: injected error" \ |
| 5673 | -S "Async resume" \ |
| 5674 | -S "Async cancel" \ |
| 5675 | -s "! mbedtls_ssl_handshake returned" |
| 5676 | |
| 5677 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5678 | run_test "SSL async private: decrypt, cancel after start" \ |
| 5679 | "$P_SRV \ |
| 5680 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5681 | async_private_error=2" \ |
| 5682 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5683 | 1 \ |
| 5684 | -s "Async decrypt callback: using key slot " \ |
| 5685 | -S "Async resume" \ |
| 5686 | -s "Async cancel" |
| 5687 | |
| 5688 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5689 | run_test "SSL async private: decrypt, error in resume" \ |
| 5690 | "$P_SRV \ |
| 5691 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5692 | async_private_error=3" \ |
| 5693 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5694 | 1 \ |
| 5695 | -s "Async decrypt callback: using key slot " \ |
| 5696 | -s "Async resume callback: decrypt done but injected error" \ |
| 5697 | -S "Async cancel" \ |
| 5698 | -s "! mbedtls_ssl_handshake returned" |
| 5699 | |
| 5700 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5701 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5702 | "$P_SRV \ |
| 5703 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5704 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5705 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5706 | 0 \ |
| 5707 | -s "Async cancel" \ |
| 5708 | -s "! mbedtls_ssl_handshake returned" \ |
| 5709 | -s "Async resume" \ |
| 5710 | -s "Successful connection" |
| 5711 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5712 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5713 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5714 | "$P_SRV \ |
| 5715 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5716 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5717 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5718 | 0 \ |
| 5719 | -s "! mbedtls_ssl_handshake returned" \ |
| 5720 | -s "Async resume" \ |
| 5721 | -s "Successful connection" |
| 5722 | |
| 5723 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5724 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5725 | 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] | 5726 | "$P_SRV \ |
| 5727 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 5728 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5729 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5730 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5731 | [ \$? -eq 1 ] && |
| 5732 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5733 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 5734 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5735 | -S "Async resume" \ |
| 5736 | -s "Async cancel" \ |
| 5737 | -s "! mbedtls_ssl_handshake returned" \ |
| 5738 | -s "Async sign callback: no key matches this certificate." \ |
| 5739 | -s "Successful connection" |
| 5740 | |
| 5741 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5742 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5743 | 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] | 5744 | "$P_SRV \ |
| 5745 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 5746 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5747 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5748 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5749 | [ \$? -eq 1 ] && |
| 5750 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5751 | 0 \ |
| 5752 | -s "Async resume" \ |
| 5753 | -s "! mbedtls_ssl_handshake returned" \ |
| 5754 | -s "Async sign callback: no key matches this certificate." \ |
| 5755 | -s "Successful connection" |
| 5756 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5757 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5758 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5759 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 5760 | "$P_SRV \ |
| 5761 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5762 | exchanges=2 renegotiation=1" \ |
| 5763 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5764 | 0 \ |
| 5765 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5766 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5767 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5768 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5770 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 5771 | "$P_SRV \ |
| 5772 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5773 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5774 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 5775 | 0 \ |
| 5776 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5777 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5778 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5779 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5780 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5781 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 5782 | "$P_SRV \ |
| 5783 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5784 | exchanges=2 renegotiation=1" \ |
| 5785 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5786 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5787 | 0 \ |
| 5788 | -s "Async decrypt callback: using key slot " \ |
| 5789 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5790 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5791 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5792 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5793 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 5794 | "$P_SRV \ |
| 5795 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5796 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5797 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 5798 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5799 | 0 \ |
| 5800 | -s "Async decrypt callback: using key slot " \ |
| 5801 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5802 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5803 | # Tests for ECC extensions (rfc 4492) |
| 5804 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5805 | requires_config_enabled MBEDTLS_AES_C |
| 5806 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5807 | requires_config_enabled MBEDTLS_SHA256_C |
| 5808 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5809 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 5810 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5811 | "$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] | 5812 | 0 \ |
| 5813 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 5814 | -C "client hello, adding supported_point_formats extension" \ |
| 5815 | -S "found supported elliptic curves extension" \ |
| 5816 | -S "found supported point formats extension" |
| 5817 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5818 | requires_config_enabled MBEDTLS_AES_C |
| 5819 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5820 | requires_config_enabled MBEDTLS_SHA256_C |
| 5821 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5822 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5823 | "$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] | 5824 | "$P_CLI debug_level=3" \ |
| 5825 | 0 \ |
| 5826 | -C "found supported_point_formats extension" \ |
| 5827 | -S "server hello, supported_point_formats extension" |
| 5828 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5829 | requires_config_enabled MBEDTLS_AES_C |
| 5830 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5831 | requires_config_enabled MBEDTLS_SHA256_C |
| 5832 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5833 | run_test "Force an ECC ciphersuite in the client side" \ |
| 5834 | "$P_SRV debug_level=3" \ |
| 5835 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5836 | 0 \ |
| 5837 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 5838 | -c "client hello, adding supported_point_formats extension" \ |
| 5839 | -s "found supported elliptic curves extension" \ |
| 5840 | -s "found supported point formats extension" |
| 5841 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5842 | requires_config_enabled MBEDTLS_AES_C |
| 5843 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5844 | requires_config_enabled MBEDTLS_SHA256_C |
| 5845 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5846 | run_test "Force an ECC ciphersuite in the server side" \ |
| 5847 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5848 | "$P_CLI debug_level=3" \ |
| 5849 | 0 \ |
| 5850 | -c "found supported_point_formats extension" \ |
| 5851 | -s "server hello, supported_point_formats extension" |
| 5852 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5853 | # Tests for DTLS HelloVerifyRequest |
| 5854 | |
| 5855 | run_test "DTLS cookie: enabled" \ |
| 5856 | "$P_SRV dtls=1 debug_level=2" \ |
| 5857 | "$P_CLI dtls=1 debug_level=2" \ |
| 5858 | 0 \ |
| 5859 | -s "cookie verification failed" \ |
| 5860 | -s "cookie verification passed" \ |
| 5861 | -S "cookie verification skipped" \ |
| 5862 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5863 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5864 | -S "SSL - The requested feature is not available" |
| 5865 | |
| 5866 | run_test "DTLS cookie: disabled" \ |
| 5867 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 5868 | "$P_CLI dtls=1 debug_level=2" \ |
| 5869 | 0 \ |
| 5870 | -S "cookie verification failed" \ |
| 5871 | -S "cookie verification passed" \ |
| 5872 | -s "cookie verification skipped" \ |
| 5873 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5874 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5875 | -S "SSL - The requested feature is not available" |
| 5876 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5877 | run_test "DTLS cookie: default (failing)" \ |
| 5878 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 5879 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 5880 | 1 \ |
| 5881 | -s "cookie verification failed" \ |
| 5882 | -S "cookie verification passed" \ |
| 5883 | -S "cookie verification skipped" \ |
| 5884 | -C "received hello verify request" \ |
| 5885 | -S "hello verification requested" \ |
| 5886 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5887 | |
| 5888 | requires_ipv6 |
| 5889 | run_test "DTLS cookie: enabled, IPv6" \ |
| 5890 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 5891 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 5892 | 0 \ |
| 5893 | -s "cookie verification failed" \ |
| 5894 | -s "cookie verification passed" \ |
| 5895 | -S "cookie verification skipped" \ |
| 5896 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5897 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5898 | -S "SSL - The requested feature is not available" |
| 5899 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5900 | run_test "DTLS cookie: enabled, nbio" \ |
| 5901 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 5902 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5903 | 0 \ |
| 5904 | -s "cookie verification failed" \ |
| 5905 | -s "cookie verification passed" \ |
| 5906 | -S "cookie verification skipped" \ |
| 5907 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5908 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5909 | -S "SSL - The requested feature is not available" |
| 5910 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5911 | # Tests for client reconnecting from the same port with DTLS |
| 5912 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5913 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5914 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5915 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 5916 | "$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] | 5917 | 0 \ |
| 5918 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5919 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5920 | -S "Client initiated reconnection from same port" |
| 5921 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5922 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5923 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5924 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 5925 | "$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] | 5926 | 0 \ |
| 5927 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5928 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5929 | -s "Client initiated reconnection from same port" |
| 5930 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 5931 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 5932 | 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] | 5933 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 5934 | "$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] | 5935 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5936 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5937 | -s "Client initiated reconnection from same port" |
| 5938 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 5939 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 5940 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 5941 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 5942 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 5943 | 0 \ |
| 5944 | -S "The operation timed out" \ |
| 5945 | -s "Client initiated reconnection from same port" |
| 5946 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5947 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 5948 | "$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] | 5949 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 5950 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5951 | -s "The operation timed out" \ |
| 5952 | -S "Client initiated reconnection from same port" |
| 5953 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5954 | # Tests for various cases of client authentication with DTLS |
| 5955 | # (focused on handshake flows and message parsing) |
| 5956 | |
| 5957 | run_test "DTLS client auth: required" \ |
| 5958 | "$P_SRV dtls=1 auth_mode=required" \ |
| 5959 | "$P_CLI dtls=1" \ |
| 5960 | 0 \ |
| 5961 | -s "Verifying peer X.509 certificate... ok" |
| 5962 | |
| 5963 | run_test "DTLS client auth: optional, client has no cert" \ |
| 5964 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 5965 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 5966 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5967 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5968 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5969 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5970 | "$P_SRV dtls=1 auth_mode=none" \ |
| 5971 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 5972 | 0 \ |
| 5973 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5974 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5975 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 5976 | run_test "DTLS wrong PSK: badmac alert" \ |
| 5977 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 5978 | "$P_CLI dtls=1 psk=abc124" \ |
| 5979 | 1 \ |
| 5980 | -s "SSL - Verification of the message MAC failed" \ |
| 5981 | -c "SSL - A fatal alert message was received from our peer" |
| 5982 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 5983 | # Tests for receiving fragmented handshake messages with DTLS |
| 5984 | |
| 5985 | requires_gnutls |
| 5986 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 5987 | "$G_SRV -u --mtu 2048 -a" \ |
| 5988 | "$P_CLI dtls=1 debug_level=2" \ |
| 5989 | 0 \ |
| 5990 | -C "found fragmented DTLS handshake message" \ |
| 5991 | -C "error" |
| 5992 | |
| 5993 | requires_gnutls |
| 5994 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 5995 | "$G_SRV -u --mtu 512" \ |
| 5996 | "$P_CLI dtls=1 debug_level=2" \ |
| 5997 | 0 \ |
| 5998 | -c "found fragmented DTLS handshake message" \ |
| 5999 | -C "error" |
| 6000 | |
| 6001 | requires_gnutls |
| 6002 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6003 | "$G_SRV -u --mtu 128" \ |
| 6004 | "$P_CLI dtls=1 debug_level=2" \ |
| 6005 | 0 \ |
| 6006 | -c "found fragmented DTLS handshake message" \ |
| 6007 | -C "error" |
| 6008 | |
| 6009 | requires_gnutls |
| 6010 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6011 | "$G_SRV -u --mtu 128" \ |
| 6012 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6013 | 0 \ |
| 6014 | -c "found fragmented DTLS handshake message" \ |
| 6015 | -C "error" |
| 6016 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6017 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6018 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6019 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6020 | "$G_SRV -u --mtu 256" \ |
| 6021 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6022 | 0 \ |
| 6023 | -c "found fragmented DTLS handshake message" \ |
| 6024 | -c "client hello, adding renegotiation extension" \ |
| 6025 | -c "found renegotiation extension" \ |
| 6026 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6027 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6028 | -C "error" \ |
| 6029 | -s "Extra-header:" |
| 6030 | |
| 6031 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6032 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6033 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6034 | "$G_SRV -u --mtu 256" \ |
| 6035 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6036 | 0 \ |
| 6037 | -c "found fragmented DTLS handshake message" \ |
| 6038 | -c "client hello, adding renegotiation extension" \ |
| 6039 | -c "found renegotiation extension" \ |
| 6040 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6041 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6042 | -C "error" \ |
| 6043 | -s "Extra-header:" |
| 6044 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6045 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6046 | "$O_SRV -dtls1 -mtu 2048" \ |
| 6047 | "$P_CLI dtls=1 debug_level=2" \ |
| 6048 | 0 \ |
| 6049 | -C "found fragmented DTLS handshake message" \ |
| 6050 | -C "error" |
| 6051 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6052 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6053 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6054 | "$P_CLI dtls=1 debug_level=2" \ |
| 6055 | 0 \ |
| 6056 | -c "found fragmented DTLS handshake message" \ |
| 6057 | -C "error" |
| 6058 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6059 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6060 | "$O_SRV -dtls1 -mtu 256" \ |
| 6061 | "$P_CLI dtls=1 debug_level=2" \ |
| 6062 | 0 \ |
| 6063 | -c "found fragmented DTLS handshake message" \ |
| 6064 | -C "error" |
| 6065 | |
| 6066 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6067 | "$O_SRV -dtls1 -mtu 256" \ |
| 6068 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6069 | 0 \ |
| 6070 | -c "found fragmented DTLS handshake message" \ |
| 6071 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6072 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6073 | # Tests for sending fragmented handshake messages with DTLS |
| 6074 | # |
| 6075 | # Use client auth when we need the client to send large messages, |
| 6076 | # and use large cert chains on both sides too (the long chains we have all use |
| 6077 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6078 | # Sizes reached (UDP payload): |
| 6079 | # - 2037B for server certificate |
| 6080 | # - 1542B for client certificate |
| 6081 | # - 1013B for newsessionticket |
| 6082 | # - all others below 512B |
| 6083 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6084 | |
| 6085 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6086 | requires_config_enabled MBEDTLS_RSA_C |
| 6087 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6088 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6089 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6090 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6091 | crt_file=data_files/server7_int-ca.crt \ |
| 6092 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6093 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6094 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6095 | "$P_CLI dtls=1 debug_level=2 \ |
| 6096 | crt_file=data_files/server8_int-ca2.crt \ |
| 6097 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6098 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6099 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6100 | 0 \ |
| 6101 | -S "found fragmented DTLS handshake message" \ |
| 6102 | -C "found fragmented DTLS handshake message" \ |
| 6103 | -C "error" |
| 6104 | |
| 6105 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6106 | requires_config_enabled MBEDTLS_RSA_C |
| 6107 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6108 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6109 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6110 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6111 | crt_file=data_files/server7_int-ca.crt \ |
| 6112 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6113 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6114 | max_frag_len=1024" \ |
| 6115 | "$P_CLI dtls=1 debug_level=2 \ |
| 6116 | crt_file=data_files/server8_int-ca2.crt \ |
| 6117 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6118 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6119 | max_frag_len=2048" \ |
| 6120 | 0 \ |
| 6121 | -S "found fragmented DTLS handshake message" \ |
| 6122 | -c "found fragmented DTLS handshake message" \ |
| 6123 | -C "error" |
| 6124 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6125 | # With the MFL extension, the server has no way of forcing |
| 6126 | # the client to not exceed a certain MTU; hence, the following |
| 6127 | # test can't be replicated with an MTU proxy such as the one |
| 6128 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6129 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6130 | requires_config_enabled MBEDTLS_RSA_C |
| 6131 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6132 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6133 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6134 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6135 | crt_file=data_files/server7_int-ca.crt \ |
| 6136 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6137 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6138 | max_frag_len=512" \ |
| 6139 | "$P_CLI dtls=1 debug_level=2 \ |
| 6140 | crt_file=data_files/server8_int-ca2.crt \ |
| 6141 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6142 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6143 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6144 | 0 \ |
| 6145 | -S "found fragmented DTLS handshake message" \ |
| 6146 | -c "found fragmented DTLS handshake message" \ |
| 6147 | -C "error" |
| 6148 | |
| 6149 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6150 | requires_config_enabled MBEDTLS_RSA_C |
| 6151 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6152 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6153 | 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] | 6154 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6155 | crt_file=data_files/server7_int-ca.crt \ |
| 6156 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6157 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6158 | max_frag_len=2048" \ |
| 6159 | "$P_CLI dtls=1 debug_level=2 \ |
| 6160 | crt_file=data_files/server8_int-ca2.crt \ |
| 6161 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6162 | hs_timeout=2500-60000 \ |
| 6163 | max_frag_len=1024" \ |
| 6164 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6165 | -S "found fragmented DTLS handshake message" \ |
| 6166 | -c "found fragmented DTLS handshake message" \ |
| 6167 | -C "error" |
| 6168 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6169 | # While not required by the standard defining the MFL extension |
| 6170 | # (according to which it only applies to records, not to datagrams), |
| 6171 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6172 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6173 | # to the peer. |
| 6174 | # The next test checks that no datagrams significantly larger than the |
| 6175 | # negotiated MFL are sent. |
| 6176 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6177 | requires_config_enabled MBEDTLS_RSA_C |
| 6178 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6179 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6180 | run_test "DTLS fragmenting: client-initiated, server only (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6181 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6182 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6183 | crt_file=data_files/server7_int-ca.crt \ |
| 6184 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6185 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6186 | max_frag_len=2048" \ |
| 6187 | "$P_CLI dtls=1 debug_level=2 \ |
| 6188 | crt_file=data_files/server8_int-ca2.crt \ |
| 6189 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6190 | hs_timeout=2500-60000 \ |
| 6191 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6192 | 0 \ |
| 6193 | -S "found fragmented DTLS handshake message" \ |
| 6194 | -c "found fragmented DTLS handshake message" \ |
| 6195 | -C "error" |
| 6196 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6197 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6198 | requires_config_enabled MBEDTLS_RSA_C |
| 6199 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6200 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6201 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6202 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6203 | crt_file=data_files/server7_int-ca.crt \ |
| 6204 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6205 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6206 | max_frag_len=2048" \ |
| 6207 | "$P_CLI dtls=1 debug_level=2 \ |
| 6208 | crt_file=data_files/server8_int-ca2.crt \ |
| 6209 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6210 | hs_timeout=2500-60000 \ |
| 6211 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6212 | 0 \ |
| 6213 | -s "found fragmented DTLS handshake message" \ |
| 6214 | -c "found fragmented DTLS handshake message" \ |
| 6215 | -C "error" |
| 6216 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6217 | # While not required by the standard defining the MFL extension |
| 6218 | # (according to which it only applies to records, not to datagrams), |
| 6219 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6220 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6221 | # to the peer. |
| 6222 | # The next test checks that no datagrams significantly larger than the |
| 6223 | # negotiated MFL are sent. |
| 6224 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6225 | requires_config_enabled MBEDTLS_RSA_C |
| 6226 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6227 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6228 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6229 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6230 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6231 | crt_file=data_files/server7_int-ca.crt \ |
| 6232 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6233 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6234 | max_frag_len=2048" \ |
| 6235 | "$P_CLI dtls=1 debug_level=2 \ |
| 6236 | crt_file=data_files/server8_int-ca2.crt \ |
| 6237 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6238 | hs_timeout=2500-60000 \ |
| 6239 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6240 | 0 \ |
| 6241 | -s "found fragmented DTLS handshake message" \ |
| 6242 | -c "found fragmented DTLS handshake message" \ |
| 6243 | -C "error" |
| 6244 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6245 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6246 | requires_config_enabled MBEDTLS_RSA_C |
| 6247 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6248 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6249 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6250 | crt_file=data_files/server7_int-ca.crt \ |
| 6251 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6252 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6253 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6254 | "$P_CLI dtls=1 debug_level=2 \ |
| 6255 | crt_file=data_files/server8_int-ca2.crt \ |
| 6256 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6257 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6258 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6259 | 0 \ |
| 6260 | -S "found fragmented DTLS handshake message" \ |
| 6261 | -C "found fragmented DTLS handshake message" \ |
| 6262 | -C "error" |
| 6263 | |
| 6264 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6265 | requires_config_enabled MBEDTLS_RSA_C |
| 6266 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6267 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6268 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6269 | crt_file=data_files/server7_int-ca.crt \ |
| 6270 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6271 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6272 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6273 | "$P_CLI dtls=1 debug_level=2 \ |
| 6274 | crt_file=data_files/server8_int-ca2.crt \ |
| 6275 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6276 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6277 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6278 | 0 \ |
| 6279 | -s "found fragmented DTLS handshake message" \ |
| 6280 | -C "found fragmented DTLS handshake message" \ |
| 6281 | -C "error" |
| 6282 | |
| 6283 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6284 | requires_config_enabled MBEDTLS_RSA_C |
| 6285 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6286 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6287 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6288 | crt_file=data_files/server7_int-ca.crt \ |
| 6289 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6290 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6291 | mtu=512" \ |
| 6292 | "$P_CLI dtls=1 debug_level=2 \ |
| 6293 | crt_file=data_files/server8_int-ca2.crt \ |
| 6294 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6295 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6296 | mtu=2048" \ |
| 6297 | 0 \ |
| 6298 | -S "found fragmented DTLS handshake message" \ |
| 6299 | -c "found fragmented DTLS handshake message" \ |
| 6300 | -C "error" |
| 6301 | |
| 6302 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6303 | requires_config_enabled MBEDTLS_RSA_C |
| 6304 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6305 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6306 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6307 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6308 | crt_file=data_files/server7_int-ca.crt \ |
| 6309 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6310 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6311 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6312 | "$P_CLI dtls=1 debug_level=2 \ |
| 6313 | crt_file=data_files/server8_int-ca2.crt \ |
| 6314 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6315 | hs_timeout=2500-60000 \ |
| 6316 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6317 | 0 \ |
| 6318 | -s "found fragmented DTLS handshake message" \ |
| 6319 | -c "found fragmented DTLS handshake message" \ |
| 6320 | -C "error" |
| 6321 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6322 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6323 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6324 | requires_config_enabled MBEDTLS_RSA_C |
| 6325 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6326 | requires_config_enabled MBEDTLS_SHA256_C |
| 6327 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6328 | requires_config_enabled MBEDTLS_AES_C |
| 6329 | requires_config_enabled MBEDTLS_GCM_C |
| 6330 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6331 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6332 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6333 | crt_file=data_files/server7_int-ca.crt \ |
| 6334 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6335 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6336 | mtu=512" \ |
| 6337 | "$P_CLI dtls=1 debug_level=2 \ |
| 6338 | crt_file=data_files/server8_int-ca2.crt \ |
| 6339 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6340 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6341 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6342 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6343 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6344 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6345 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6346 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6347 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6348 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6349 | # Forcing ciphersuite for this test to fit the MTU of 508 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6350 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6351 | # retransmissions, but in some cases (like both the server and client using |
| 6352 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6353 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6354 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6355 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6356 | requires_config_enabled MBEDTLS_RSA_C |
| 6357 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6358 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6359 | requires_config_enabled MBEDTLS_AES_C |
| 6360 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6361 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6362 | -p "$P_PXY mtu=508" \ |
| 6363 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6364 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6365 | key_file=data_files/server7.key \ |
| 6366 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6367 | "$P_CLI dtls=1 debug_level=2 \ |
| 6368 | crt_file=data_files/server8_int-ca2.crt \ |
| 6369 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6370 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6371 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6372 | 0 \ |
| 6373 | -s "found fragmented DTLS handshake message" \ |
| 6374 | -c "found fragmented DTLS handshake message" \ |
| 6375 | -C "error" |
| 6376 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6377 | # Forcing ciphersuite for this test to fit the MTU of 508 with full config. |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6378 | only_with_valgrind |
| 6379 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6380 | requires_config_enabled MBEDTLS_RSA_C |
| 6381 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6382 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6383 | requires_config_enabled MBEDTLS_AES_C |
| 6384 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6385 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6386 | -p "$P_PXY mtu=508" \ |
| 6387 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6388 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6389 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6390 | hs_timeout=250-10000" \ |
| 6391 | "$P_CLI dtls=1 debug_level=2 \ |
| 6392 | crt_file=data_files/server8_int-ca2.crt \ |
| 6393 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6394 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6395 | hs_timeout=250-10000" \ |
| 6396 | 0 \ |
| 6397 | -s "found fragmented DTLS handshake message" \ |
| 6398 | -c "found fragmented DTLS handshake message" \ |
| 6399 | -C "error" |
| 6400 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6401 | # 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] | 6402 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6403 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6404 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6405 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6406 | requires_config_enabled MBEDTLS_RSA_C |
| 6407 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6408 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6409 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6410 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6411 | crt_file=data_files/server7_int-ca.crt \ |
| 6412 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6413 | hs_timeout=10000-60000 \ |
| 6414 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6415 | "$P_CLI dtls=1 debug_level=2 \ |
| 6416 | crt_file=data_files/server8_int-ca2.crt \ |
| 6417 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6418 | hs_timeout=10000-60000 \ |
| 6419 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6420 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6421 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6422 | -s "found fragmented DTLS handshake message" \ |
| 6423 | -c "found fragmented DTLS handshake message" \ |
| 6424 | -C "error" |
| 6425 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6426 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6427 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 6428 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6429 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6430 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6431 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6432 | requires_config_enabled MBEDTLS_RSA_C |
| 6433 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6434 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6435 | requires_config_enabled MBEDTLS_AES_C |
| 6436 | requires_config_enabled MBEDTLS_GCM_C |
| 6437 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6438 | -p "$P_PXY mtu=512" \ |
| 6439 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6440 | crt_file=data_files/server7_int-ca.crt \ |
| 6441 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6442 | hs_timeout=10000-60000 \ |
| 6443 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6444 | "$P_CLI dtls=1 debug_level=2 \ |
| 6445 | crt_file=data_files/server8_int-ca2.crt \ |
| 6446 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6447 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6448 | hs_timeout=10000-60000 \ |
| 6449 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6450 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6451 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6452 | -s "found fragmented DTLS handshake message" \ |
| 6453 | -c "found fragmented DTLS handshake message" \ |
| 6454 | -C "error" |
| 6455 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6456 | not_with_valgrind # spurious autoreduction due to timeout |
| 6457 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6458 | requires_config_enabled MBEDTLS_RSA_C |
| 6459 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6460 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6461 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6462 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6463 | crt_file=data_files/server7_int-ca.crt \ |
| 6464 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6465 | hs_timeout=10000-60000 \ |
| 6466 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6467 | "$P_CLI dtls=1 debug_level=2 \ |
| 6468 | crt_file=data_files/server8_int-ca2.crt \ |
| 6469 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6470 | hs_timeout=10000-60000 \ |
| 6471 | mtu=1024 nbio=2" \ |
| 6472 | 0 \ |
| 6473 | -S "autoreduction" \ |
| 6474 | -s "found fragmented DTLS handshake message" \ |
| 6475 | -c "found fragmented DTLS handshake message" \ |
| 6476 | -C "error" |
| 6477 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6478 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6479 | not_with_valgrind # spurious autoreduction due to timeout |
| 6480 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6481 | requires_config_enabled MBEDTLS_RSA_C |
| 6482 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6483 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6484 | requires_config_enabled MBEDTLS_AES_C |
| 6485 | requires_config_enabled MBEDTLS_GCM_C |
| 6486 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 6487 | -p "$P_PXY mtu=512" \ |
| 6488 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6489 | crt_file=data_files/server7_int-ca.crt \ |
| 6490 | key_file=data_files/server7.key \ |
| 6491 | hs_timeout=10000-60000 \ |
| 6492 | mtu=512 nbio=2" \ |
| 6493 | "$P_CLI dtls=1 debug_level=2 \ |
| 6494 | crt_file=data_files/server8_int-ca2.crt \ |
| 6495 | key_file=data_files/server8.key \ |
| 6496 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6497 | hs_timeout=10000-60000 \ |
| 6498 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6499 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6500 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6501 | -s "found fragmented DTLS handshake message" \ |
| 6502 | -c "found fragmented DTLS handshake message" \ |
| 6503 | -C "error" |
| 6504 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6505 | # Forcing ciphersuite for this test to fit the MTU of 1450 with full config. |
Hanno Becker | b841b4f | 2018-08-28 10:25:51 +0100 | [diff] [blame] | 6506 | # This ensures things still work after session_reset(). |
| 6507 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6508 | # Since we don't support reading fragmented ClientHello yet, |
| 6509 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 6510 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6511 | # An autoreduction on the client-side might happen if the server is |
| 6512 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6513 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6514 | # resumed listening, which would result in a spurious autoreduction. |
| 6515 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6516 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6517 | requires_config_enabled MBEDTLS_RSA_C |
| 6518 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6519 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6520 | requires_config_enabled MBEDTLS_AES_C |
| 6521 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6522 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 6523 | -p "$P_PXY mtu=1450" \ |
| 6524 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6525 | crt_file=data_files/server7_int-ca.crt \ |
| 6526 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6527 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6528 | mtu=1450" \ |
| 6529 | "$P_CLI dtls=1 debug_level=2 \ |
| 6530 | crt_file=data_files/server8_int-ca2.crt \ |
| 6531 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6532 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6533 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6534 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6535 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6536 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6537 | -s "found fragmented DTLS handshake message" \ |
| 6538 | -c "found fragmented DTLS handshake message" \ |
| 6539 | -C "error" |
| 6540 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6541 | # An autoreduction on the client-side might happen if the server is |
| 6542 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6543 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6544 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6545 | requires_config_enabled MBEDTLS_RSA_C |
| 6546 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6547 | requires_config_enabled MBEDTLS_SHA256_C |
| 6548 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6549 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6550 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 6551 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 6552 | -p "$P_PXY mtu=512" \ |
| 6553 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6554 | crt_file=data_files/server7_int-ca.crt \ |
| 6555 | key_file=data_files/server7.key \ |
| 6556 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6557 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6558 | mtu=512" \ |
| 6559 | "$P_CLI dtls=1 debug_level=2 \ |
| 6560 | crt_file=data_files/server8_int-ca2.crt \ |
| 6561 | key_file=data_files/server8.key \ |
| 6562 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6563 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6564 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6565 | mtu=512" \ |
| 6566 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6567 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6568 | -s "found fragmented DTLS handshake message" \ |
| 6569 | -c "found fragmented DTLS handshake message" \ |
| 6570 | -C "error" |
| 6571 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6572 | # An autoreduction on the client-side might happen if the server is |
| 6573 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6574 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6575 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6576 | requires_config_enabled MBEDTLS_RSA_C |
| 6577 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6578 | requires_config_enabled MBEDTLS_SHA256_C |
| 6579 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6580 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6581 | requires_config_enabled MBEDTLS_AES_C |
| 6582 | requires_config_enabled MBEDTLS_GCM_C |
| 6583 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 6584 | -p "$P_PXY mtu=512" \ |
| 6585 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6586 | crt_file=data_files/server7_int-ca.crt \ |
| 6587 | key_file=data_files/server7.key \ |
| 6588 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6589 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6590 | mtu=512" \ |
| 6591 | "$P_CLI dtls=1 debug_level=2 \ |
| 6592 | crt_file=data_files/server8_int-ca2.crt \ |
| 6593 | key_file=data_files/server8.key \ |
| 6594 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6595 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6596 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6597 | mtu=512" \ |
| 6598 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6599 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6600 | -s "found fragmented DTLS handshake message" \ |
| 6601 | -c "found fragmented DTLS handshake message" \ |
| 6602 | -C "error" |
| 6603 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6604 | # An autoreduction on the client-side might happen if the server is |
| 6605 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6606 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6607 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6608 | requires_config_enabled MBEDTLS_RSA_C |
| 6609 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6610 | requires_config_enabled MBEDTLS_SHA256_C |
| 6611 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6612 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6613 | requires_config_enabled MBEDTLS_AES_C |
| 6614 | requires_config_enabled MBEDTLS_CCM_C |
| 6615 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6616 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6617 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6618 | crt_file=data_files/server7_int-ca.crt \ |
| 6619 | key_file=data_files/server7.key \ |
| 6620 | exchanges=2 renegotiation=1 \ |
| 6621 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6622 | hs_timeout=10000-60000 \ |
| 6623 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6624 | "$P_CLI dtls=1 debug_level=2 \ |
| 6625 | crt_file=data_files/server8_int-ca2.crt \ |
| 6626 | key_file=data_files/server8.key \ |
| 6627 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6628 | hs_timeout=10000-60000 \ |
| 6629 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6630 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6631 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6632 | -s "found fragmented DTLS handshake message" \ |
| 6633 | -c "found fragmented DTLS handshake message" \ |
| 6634 | -C "error" |
| 6635 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6636 | # An autoreduction on the client-side might happen if the server is |
| 6637 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6638 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6639 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6640 | requires_config_enabled MBEDTLS_RSA_C |
| 6641 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6642 | requires_config_enabled MBEDTLS_SHA256_C |
| 6643 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6644 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6645 | requires_config_enabled MBEDTLS_AES_C |
| 6646 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6647 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 6648 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6649 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6650 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6651 | crt_file=data_files/server7_int-ca.crt \ |
| 6652 | key_file=data_files/server7.key \ |
| 6653 | exchanges=2 renegotiation=1 \ |
| 6654 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6655 | hs_timeout=10000-60000 \ |
| 6656 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6657 | "$P_CLI dtls=1 debug_level=2 \ |
| 6658 | crt_file=data_files/server8_int-ca2.crt \ |
| 6659 | key_file=data_files/server8.key \ |
| 6660 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6661 | hs_timeout=10000-60000 \ |
| 6662 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6663 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6664 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6665 | -s "found fragmented DTLS handshake message" \ |
| 6666 | -c "found fragmented DTLS handshake message" \ |
| 6667 | -C "error" |
| 6668 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6669 | # An autoreduction on the client-side might happen if the server is |
| 6670 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6671 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6672 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6673 | requires_config_enabled MBEDTLS_RSA_C |
| 6674 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6675 | requires_config_enabled MBEDTLS_SHA256_C |
| 6676 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6677 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6678 | requires_config_enabled MBEDTLS_AES_C |
| 6679 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6680 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6681 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6682 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6683 | crt_file=data_files/server7_int-ca.crt \ |
| 6684 | key_file=data_files/server7.key \ |
| 6685 | exchanges=2 renegotiation=1 \ |
| 6686 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6687 | hs_timeout=10000-60000 \ |
| 6688 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6689 | "$P_CLI dtls=1 debug_level=2 \ |
| 6690 | crt_file=data_files/server8_int-ca2.crt \ |
| 6691 | key_file=data_files/server8.key \ |
| 6692 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6693 | hs_timeout=10000-60000 \ |
| 6694 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6695 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6696 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6697 | -s "found fragmented DTLS handshake message" \ |
| 6698 | -c "found fragmented DTLS handshake message" \ |
| 6699 | -C "error" |
| 6700 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6701 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6702 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6703 | requires_config_enabled MBEDTLS_RSA_C |
| 6704 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6705 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6706 | requires_config_enabled MBEDTLS_AES_C |
| 6707 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6708 | client_needs_more_time 2 |
| 6709 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 6710 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6711 | "$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] | 6712 | crt_file=data_files/server7_int-ca.crt \ |
| 6713 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6714 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6715 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6716 | crt_file=data_files/server8_int-ca2.crt \ |
| 6717 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6718 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6719 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6720 | 0 \ |
| 6721 | -s "found fragmented DTLS handshake message" \ |
| 6722 | -c "found fragmented DTLS handshake message" \ |
| 6723 | -C "error" |
| 6724 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6725 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6726 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6727 | requires_config_enabled MBEDTLS_RSA_C |
| 6728 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6729 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6730 | requires_config_enabled MBEDTLS_AES_C |
| 6731 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6732 | client_needs_more_time 2 |
| 6733 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 6734 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 6735 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6736 | crt_file=data_files/server7_int-ca.crt \ |
| 6737 | key_file=data_files/server7.key \ |
| 6738 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6739 | "$P_CLI dtls=1 debug_level=2 \ |
| 6740 | crt_file=data_files/server8_int-ca2.crt \ |
| 6741 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6742 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6743 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6744 | 0 \ |
| 6745 | -s "found fragmented DTLS handshake message" \ |
| 6746 | -c "found fragmented DTLS handshake message" \ |
| 6747 | -C "error" |
| 6748 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6749 | # interop tests for DTLS fragmentating with reliable connection |
| 6750 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6751 | # here and below we just want to test that the we fragment in a way that |
| 6752 | # pleases other implementations, so we don't need the peer to fragment |
| 6753 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6754 | requires_config_enabled MBEDTLS_RSA_C |
| 6755 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6757 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6758 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 6759 | "$G_SRV -u" \ |
| 6760 | "$P_CLI dtls=1 debug_level=2 \ |
| 6761 | crt_file=data_files/server8_int-ca2.crt \ |
| 6762 | key_file=data_files/server8.key \ |
| 6763 | mtu=512 force_version=dtls1_2" \ |
| 6764 | 0 \ |
| 6765 | -c "fragmenting handshake message" \ |
| 6766 | -C "error" |
| 6767 | |
| 6768 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6769 | requires_config_enabled MBEDTLS_RSA_C |
| 6770 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6771 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6772 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6773 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 6774 | "$G_SRV -u" \ |
| 6775 | "$P_CLI dtls=1 debug_level=2 \ |
| 6776 | crt_file=data_files/server8_int-ca2.crt \ |
| 6777 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6778 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6779 | 0 \ |
| 6780 | -c "fragmenting handshake message" \ |
| 6781 | -C "error" |
| 6782 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6783 | # We use --insecure for the GnuTLS client because it expects |
| 6784 | # the hostname / IP it connects to to be the name used in the |
| 6785 | # certificate obtained from the server. Here, however, it |
| 6786 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 6787 | # as the server name in the certificate. This will make the |
| 6788 | # certifiate validation fail, but passing --insecure makes |
| 6789 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6790 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6791 | requires_config_enabled MBEDTLS_RSA_C |
| 6792 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6794 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6795 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6796 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6797 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6798 | crt_file=data_files/server7_int-ca.crt \ |
| 6799 | key_file=data_files/server7.key \ |
| 6800 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6801 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6802 | 0 \ |
| 6803 | -s "fragmenting handshake message" |
| 6804 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6805 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6806 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6807 | requires_config_enabled MBEDTLS_RSA_C |
| 6808 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6810 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6811 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6812 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6813 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6814 | crt_file=data_files/server7_int-ca.crt \ |
| 6815 | key_file=data_files/server7.key \ |
| 6816 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6817 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6818 | 0 \ |
| 6819 | -s "fragmenting handshake message" |
| 6820 | |
| 6821 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6822 | requires_config_enabled MBEDTLS_RSA_C |
| 6823 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6825 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 6826 | "$O_SRV -dtls1_2 -verify 10" \ |
| 6827 | "$P_CLI dtls=1 debug_level=2 \ |
| 6828 | crt_file=data_files/server8_int-ca2.crt \ |
| 6829 | key_file=data_files/server8.key \ |
| 6830 | mtu=512 force_version=dtls1_2" \ |
| 6831 | 0 \ |
| 6832 | -c "fragmenting handshake message" \ |
| 6833 | -C "error" |
| 6834 | |
| 6835 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6836 | requires_config_enabled MBEDTLS_RSA_C |
| 6837 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6839 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 6840 | "$O_SRV -dtls1 -verify 10" \ |
| 6841 | "$P_CLI dtls=1 debug_level=2 \ |
| 6842 | crt_file=data_files/server8_int-ca2.crt \ |
| 6843 | key_file=data_files/server8.key \ |
| 6844 | mtu=512 force_version=dtls1" \ |
| 6845 | 0 \ |
| 6846 | -c "fragmenting handshake message" \ |
| 6847 | -C "error" |
| 6848 | |
| 6849 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6850 | requires_config_enabled MBEDTLS_RSA_C |
| 6851 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6853 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 6854 | "$P_SRV dtls=1 debug_level=2 \ |
| 6855 | crt_file=data_files/server7_int-ca.crt \ |
| 6856 | key_file=data_files/server7.key \ |
| 6857 | mtu=512 force_version=dtls1_2" \ |
| 6858 | "$O_CLI -dtls1_2" \ |
| 6859 | 0 \ |
| 6860 | -s "fragmenting handshake message" |
| 6861 | |
| 6862 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6863 | requires_config_enabled MBEDTLS_RSA_C |
| 6864 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6866 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 6867 | "$P_SRV dtls=1 debug_level=2 \ |
| 6868 | crt_file=data_files/server7_int-ca.crt \ |
| 6869 | key_file=data_files/server7.key \ |
| 6870 | mtu=512 force_version=dtls1" \ |
| 6871 | "$O_CLI -dtls1" \ |
| 6872 | 0 \ |
| 6873 | -s "fragmenting handshake message" |
| 6874 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6875 | # interop tests for DTLS fragmentating with unreliable connection |
| 6876 | # |
| 6877 | # again we just want to test that the we fragment in a way that |
| 6878 | # pleases other implementations, so we don't need the peer to fragment |
| 6879 | requires_gnutls_next |
| 6880 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6881 | requires_config_enabled MBEDTLS_RSA_C |
| 6882 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6884 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6885 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 6886 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6887 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6888 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6889 | crt_file=data_files/server8_int-ca2.crt \ |
| 6890 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6891 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6892 | 0 \ |
| 6893 | -c "fragmenting handshake message" \ |
| 6894 | -C "error" |
| 6895 | |
| 6896 | requires_gnutls_next |
| 6897 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6898 | requires_config_enabled MBEDTLS_RSA_C |
| 6899 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6901 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6902 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 6903 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6904 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6905 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6906 | crt_file=data_files/server8_int-ca2.crt \ |
| 6907 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6908 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6909 | 0 \ |
| 6910 | -c "fragmenting handshake message" \ |
| 6911 | -C "error" |
| 6912 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6913 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6914 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6915 | requires_config_enabled MBEDTLS_RSA_C |
| 6916 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6918 | client_needs_more_time 4 |
| 6919 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 6920 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6921 | "$P_SRV dtls=1 debug_level=2 \ |
| 6922 | crt_file=data_files/server7_int-ca.crt \ |
| 6923 | key_file=data_files/server7.key \ |
| 6924 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6925 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6926 | 0 \ |
| 6927 | -s "fragmenting handshake message" |
| 6928 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6929 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6930 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6931 | requires_config_enabled MBEDTLS_RSA_C |
| 6932 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6934 | client_needs_more_time 4 |
| 6935 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 6936 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6937 | "$P_SRV dtls=1 debug_level=2 \ |
| 6938 | crt_file=data_files/server7_int-ca.crt \ |
| 6939 | key_file=data_files/server7.key \ |
| 6940 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6941 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6942 | 0 \ |
| 6943 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6944 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6945 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 6946 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6947 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6948 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 6949 | ## (this should happen in some 1.1.1_ release according to the ticket). |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6950 | skip_next_test |
| 6951 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6952 | requires_config_enabled MBEDTLS_RSA_C |
| 6953 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6955 | client_needs_more_time 4 |
| 6956 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 6957 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6958 | "$O_SRV -dtls1_2 -verify 10" \ |
| 6959 | "$P_CLI dtls=1 debug_level=2 \ |
| 6960 | crt_file=data_files/server8_int-ca2.crt \ |
| 6961 | key_file=data_files/server8.key \ |
| 6962 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 6963 | 0 \ |
| 6964 | -c "fragmenting handshake message" \ |
| 6965 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6966 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6967 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6968 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6969 | requires_config_enabled MBEDTLS_RSA_C |
| 6970 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6971 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6972 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6973 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 6974 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6975 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6976 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6977 | crt_file=data_files/server8_int-ca2.crt \ |
| 6978 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6979 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6980 | 0 \ |
| 6981 | -c "fragmenting handshake message" \ |
| 6982 | -C "error" |
| 6983 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6984 | skip_next_test |
| 6985 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6986 | requires_config_enabled MBEDTLS_RSA_C |
| 6987 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6989 | client_needs_more_time 4 |
| 6990 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 6991 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6992 | "$P_SRV dtls=1 debug_level=2 \ |
| 6993 | crt_file=data_files/server7_int-ca.crt \ |
| 6994 | key_file=data_files/server7.key \ |
| 6995 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 6996 | "$O_CLI -dtls1_2" \ |
| 6997 | 0 \ |
| 6998 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6999 | |
| 7000 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 7001 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7002 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7003 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7004 | requires_config_enabled MBEDTLS_RSA_C |
| 7005 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7007 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7008 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 7009 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7010 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7011 | crt_file=data_files/server7_int-ca.crt \ |
| 7012 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7013 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7014 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7015 | 0 \ |
| 7016 | -s "fragmenting handshake message" |
| 7017 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7018 | # Tests for specific things with "unreliable" UDP connection |
| 7019 | |
| 7020 | not_with_valgrind # spurious resend due to timeout |
| 7021 | run_test "DTLS proxy: reference" \ |
| 7022 | -p "$P_PXY" \ |
| 7023 | "$P_SRV dtls=1 debug_level=2" \ |
| 7024 | "$P_CLI dtls=1 debug_level=2" \ |
| 7025 | 0 \ |
| 7026 | -C "replayed record" \ |
| 7027 | -S "replayed record" \ |
| 7028 | -C "record from another epoch" \ |
| 7029 | -S "record from another epoch" \ |
| 7030 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7031 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7032 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7033 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7034 | -c "HTTP/1.0 200 OK" |
| 7035 | |
| 7036 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7037 | run_test "DTLS proxy: duplicate every packet" \ |
| 7038 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7039 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7040 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7041 | 0 \ |
| 7042 | -c "replayed record" \ |
| 7043 | -s "replayed record" \ |
| 7044 | -c "record from another epoch" \ |
| 7045 | -s "record from another epoch" \ |
| 7046 | -S "resend" \ |
| 7047 | -s "Extra-header:" \ |
| 7048 | -c "HTTP/1.0 200 OK" |
| 7049 | |
| 7050 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 7051 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7052 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 7053 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7054 | 0 \ |
| 7055 | -c "replayed record" \ |
| 7056 | -S "replayed record" \ |
| 7057 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7058 | -s "record from another epoch" \ |
| 7059 | -c "resend" \ |
| 7060 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7061 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7062 | -c "HTTP/1.0 200 OK" |
| 7063 | |
| 7064 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 7065 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7066 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7067 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7068 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7069 | -c "next record in same datagram" \ |
| 7070 | -s "next record in same datagram" |
| 7071 | |
| 7072 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 7073 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7074 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7075 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7076 | 0 \ |
| 7077 | -c "next record in same datagram" \ |
| 7078 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7079 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7080 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 7081 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7082 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 7083 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7084 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7085 | -c "discarding invalid record (mac)" \ |
| 7086 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7087 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7088 | -c "HTTP/1.0 200 OK" \ |
| 7089 | -S "too many records with bad MAC" \ |
| 7090 | -S "Verification of the message MAC failed" |
| 7091 | |
| 7092 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 7093 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7094 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 7095 | "$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] | 7096 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7097 | -C "discarding invalid record (mac)" \ |
| 7098 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7099 | -S "Extra-header:" \ |
| 7100 | -C "HTTP/1.0 200 OK" \ |
| 7101 | -s "too many records with bad MAC" \ |
| 7102 | -s "Verification of the message MAC failed" |
| 7103 | |
| 7104 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 7105 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7106 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 7107 | "$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] | 7108 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7109 | -c "discarding invalid record (mac)" \ |
| 7110 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7111 | -s "Extra-header:" \ |
| 7112 | -c "HTTP/1.0 200 OK" \ |
| 7113 | -S "too many records with bad MAC" \ |
| 7114 | -S "Verification of the message MAC failed" |
| 7115 | |
| 7116 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 7117 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7118 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 7119 | "$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] | 7120 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7121 | -c "discarding invalid record (mac)" \ |
| 7122 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7123 | -s "Extra-header:" \ |
| 7124 | -c "HTTP/1.0 200 OK" \ |
| 7125 | -s "too many records with bad MAC" \ |
| 7126 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7127 | |
| 7128 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 7129 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 7130 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 7131 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7132 | 0 \ |
| 7133 | -c "record from another epoch" \ |
| 7134 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7135 | -s "Extra-header:" \ |
| 7136 | -c "HTTP/1.0 200 OK" |
| 7137 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7138 | # Tests for reordering support with DTLS |
| 7139 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7140 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 7141 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7142 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7143 | hs_timeout=2500-60000" \ |
| 7144 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7145 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7146 | 0 \ |
| 7147 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7148 | -c "Next handshake message has been buffered - load"\ |
| 7149 | -S "Buffering HS message" \ |
| 7150 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7151 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7152 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7153 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7154 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7155 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7156 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 7157 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7158 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7159 | hs_timeout=2500-60000" \ |
| 7160 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7161 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7162 | 0 \ |
| 7163 | -c "Buffering HS message" \ |
| 7164 | -c "found fragmented DTLS handshake message"\ |
| 7165 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 7166 | -c "Next handshake message has been buffered - load"\ |
| 7167 | -S "Buffering HS message" \ |
| 7168 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7169 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7170 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7171 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7172 | -S "Remember CCS message" |
| 7173 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7174 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 7175 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 7176 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 7177 | # while keeping the ServerKeyExchange. |
| 7178 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 7179 | 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] | 7180 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7181 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7182 | hs_timeout=2500-60000" \ |
| 7183 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7184 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7185 | 0 \ |
| 7186 | -c "Buffering HS message" \ |
| 7187 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7188 | -C "attempt to make space by freeing buffered messages" \ |
| 7189 | -S "Buffering HS message" \ |
| 7190 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7191 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7192 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7193 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7194 | -S "Remember CCS message" |
| 7195 | |
| 7196 | # The size constraints ensure that the delayed certificate message can't |
| 7197 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 7198 | # when dropping it first. |
| 7199 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 7200 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 7201 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 7202 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7203 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7204 | hs_timeout=2500-60000" \ |
| 7205 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7206 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7207 | 0 \ |
| 7208 | -c "Buffering HS message" \ |
| 7209 | -c "attempt to make space by freeing buffered future messages" \ |
| 7210 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7211 | -S "Buffering HS message" \ |
| 7212 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7213 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7214 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7215 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7216 | -S "Remember CCS message" |
| 7217 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7218 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 7219 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7220 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 7221 | hs_timeout=2500-60000" \ |
| 7222 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7223 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7224 | 0 \ |
| 7225 | -C "Buffering HS message" \ |
| 7226 | -C "Next handshake message has been buffered - load"\ |
| 7227 | -s "Buffering HS message" \ |
| 7228 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7229 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7230 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7231 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7232 | -S "Remember CCS message" |
| 7233 | |
| 7234 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 7235 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7236 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7237 | hs_timeout=2500-60000" \ |
| 7238 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7239 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7240 | 0 \ |
| 7241 | -C "Buffering HS message" \ |
| 7242 | -C "Next handshake message has been buffered - load"\ |
| 7243 | -S "Buffering HS message" \ |
| 7244 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7245 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7246 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7247 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7248 | -S "Remember CCS message" |
| 7249 | |
| 7250 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 7251 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7252 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7253 | hs_timeout=2500-60000" \ |
| 7254 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7255 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7256 | 0 \ |
| 7257 | -C "Buffering HS message" \ |
| 7258 | -C "Next handshake message has been buffered - load"\ |
| 7259 | -S "Buffering HS message" \ |
| 7260 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7261 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7262 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7263 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7264 | -s "Remember CCS message" |
| 7265 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7266 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7267 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7268 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7269 | hs_timeout=2500-60000" \ |
| 7270 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7271 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 7272 | 0 \ |
| 7273 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7274 | -s "Found buffered record from current epoch - load" \ |
| 7275 | -c "Buffer record from epoch 1" \ |
| 7276 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7277 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7278 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 7279 | # from the server are delayed, so that the encrypted Finished message |
| 7280 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 7281 | # in afterwards, the encrypted Finished message must be freed in order |
| 7282 | # to make space for the NewSessionTicket to be reassembled. |
| 7283 | # This works only in very particular circumstances: |
| 7284 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 7285 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 7286 | # the encrypted Finished message. |
| 7287 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 7288 | # needs to be fragmented. |
| 7289 | # - All messages sent by the server must be small enough to be either sent |
| 7290 | # without fragmentation or be reassembled within the bounds of |
| 7291 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 7292 | # handshake, omitting CRTs. |
| 7293 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 7294 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 7295 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 7296 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 7297 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 7298 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 7299 | 0 \ |
| 7300 | -s "Buffer record from epoch 1" \ |
| 7301 | -s "Found buffered record from current epoch - load" \ |
| 7302 | -c "Buffer record from epoch 1" \ |
| 7303 | -C "Found buffered record from current epoch - load" \ |
| 7304 | -c "Enough space available after freeing future epoch record" |
| 7305 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 7306 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 7307 | |
| 7308 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7309 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 7310 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7311 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7312 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7313 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7314 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7315 | 0 \ |
| 7316 | -s "Extra-header:" \ |
| 7317 | -c "HTTP/1.0 200 OK" |
| 7318 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7319 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7320 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 7321 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7322 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7323 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7324 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7325 | 0 \ |
| 7326 | -s "Extra-header:" \ |
| 7327 | -c "HTTP/1.0 200 OK" |
| 7328 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7329 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7330 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 7331 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7332 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7333 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7334 | 0 \ |
| 7335 | -s "Extra-header:" \ |
| 7336 | -c "HTTP/1.0 200 OK" |
| 7337 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7338 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7339 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 7340 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7341 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 7342 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7343 | 0 \ |
| 7344 | -s "Extra-header:" \ |
| 7345 | -c "HTTP/1.0 200 OK" |
| 7346 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7347 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7348 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 7349 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7350 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 7351 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7352 | 0 \ |
| 7353 | -s "Extra-header:" \ |
| 7354 | -c "HTTP/1.0 200 OK" |
| 7355 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7356 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7357 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 7358 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7359 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 7360 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7361 | 0 \ |
| 7362 | -s "Extra-header:" \ |
| 7363 | -c "HTTP/1.0 200 OK" |
| 7364 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7365 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7366 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 7367 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7368 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 7369 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7370 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7371 | 0 \ |
| 7372 | -s "Extra-header:" \ |
| 7373 | -c "HTTP/1.0 200 OK" |
| 7374 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7375 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7376 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 7377 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7378 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7379 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7380 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7381 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 7382 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7383 | 0 \ |
| 7384 | -s "a session has been resumed" \ |
| 7385 | -c "a session has been resumed" \ |
| 7386 | -s "Extra-header:" \ |
| 7387 | -c "HTTP/1.0 200 OK" |
| 7388 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7389 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7390 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 7391 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7392 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7393 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7394 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7395 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 7396 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 7397 | 0 \ |
| 7398 | -s "a session has been resumed" \ |
| 7399 | -c "a session has been resumed" \ |
| 7400 | -s "Extra-header:" \ |
| 7401 | -c "HTTP/1.0 200 OK" |
| 7402 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7403 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7404 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7405 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7406 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7407 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 7408 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7409 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 7410 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7411 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7412 | 0 \ |
| 7413 | -c "=> renegotiate" \ |
| 7414 | -s "=> renegotiate" \ |
| 7415 | -s "Extra-header:" \ |
| 7416 | -c "HTTP/1.0 200 OK" |
| 7417 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7418 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7419 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7420 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 7421 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7422 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 7423 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7424 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 7425 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7426 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7427 | 0 \ |
| 7428 | -c "=> renegotiate" \ |
| 7429 | -s "=> renegotiate" \ |
| 7430 | -s "Extra-header:" \ |
| 7431 | -c "HTTP/1.0 200 OK" |
| 7432 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7433 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7435 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 7436 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7437 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 7438 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7439 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7440 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 7441 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7442 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7443 | 0 \ |
| 7444 | -c "=> renegotiate" \ |
| 7445 | -s "=> renegotiate" \ |
| 7446 | -s "Extra-header:" \ |
| 7447 | -c "HTTP/1.0 200 OK" |
| 7448 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7449 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7450 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7451 | 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] | 7452 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7453 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 7454 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7455 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7456 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 7457 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7458 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7459 | 0 \ |
| 7460 | -c "=> renegotiate" \ |
| 7461 | -s "=> renegotiate" \ |
| 7462 | -s "Extra-header:" \ |
| 7463 | -c "HTTP/1.0 200 OK" |
| 7464 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7465 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 7466 | ## all versions installed on the CI machines), reported here: |
| 7467 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 7468 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7469 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 7470 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7471 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7472 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7473 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7474 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7475 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7476 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7477 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7478 | -c "HTTP/1.0 200 OK" |
| 7479 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7480 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7481 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7482 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7483 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 7484 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7485 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7486 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7487 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7488 | -c "HTTP/1.0 200 OK" |
| 7489 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7490 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7491 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7492 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7493 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 7494 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7495 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7496 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2 tickets=0" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7497 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7498 | -c "HTTP/1.0 200 OK" |
| 7499 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 7500 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7501 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7502 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7503 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 7504 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 7505 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7506 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7507 | 0 \ |
| 7508 | -s "Extra-header:" \ |
| 7509 | -c "Extra-header:" |
| 7510 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7511 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7512 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7513 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7514 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 7515 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7516 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7517 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7518 | 0 \ |
| 7519 | -s "Extra-header:" \ |
| 7520 | -c "Extra-header:" |
| 7521 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7522 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7523 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7524 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7525 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 7526 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7527 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7528 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7529 | 0 \ |
| 7530 | -s "Extra-header:" \ |
| 7531 | -c "Extra-header:" |
| 7532 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 7533 | # Final report |
| 7534 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7535 | echo "------------------------------------------------------------------------" |
| 7536 | |
| 7537 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7538 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7539 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7540 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7541 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 7542 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 7543 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7544 | |
| 7545 | exit $FAILS |